Revision 41400 trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/project/documents/view/legend/gui/LabelingManager.java
LabelingManager.java | ||
---|---|---|
31 | 31 |
import java.awt.event.ActionListener; |
32 | 32 |
import java.util.ArrayList; |
33 | 33 |
import java.util.Comparator; |
34 |
import java.util.Hashtable; |
|
35 | 34 |
import java.util.Iterator; |
35 |
import java.util.List; |
|
36 | 36 |
import java.util.TreeMap; |
37 | 37 |
|
38 | 38 |
import javax.swing.BorderFactory; |
... | ... | |
46 | 46 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
47 | 47 |
import org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelable; |
48 | 48 |
import org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelingStrategy; |
49 |
import org.gvsig.symbology.swing.SymbologySwingLocator; |
|
50 |
import org.gvsig.symbology.swing.SymbologySwingManager; |
|
49 | 51 |
import org.gvsig.utils.swing.JComboBox; |
50 | 52 |
|
51 | 53 |
|
... | ... | |
56 | 58 |
*/ |
57 | 59 |
public class LabelingManager extends AbstractThemeManagerPage implements ActionListener { |
58 | 60 |
private static final long serialVersionUID = 856162295985695717L; |
59 |
private static ArrayList<Class<? extends ILabelingStrategyPanel>> installedPanels = new ArrayList<Class<? extends ILabelingStrategyPanel>>(); |
|
61 |
// private static ArrayList<Class<? extends ILabelingStrategyPanel>> installedPanels = new ArrayList<Class<? extends ILabelingStrategyPanel>>();
|
|
60 | 62 |
private Comparator<Class<?>> comparator=new Comparator<Class<?>>(){ |
61 | 63 |
|
62 | 64 |
public int compare(Class<?> o1, Class<?> o2) { |
... | ... | |
103 | 105 |
|
104 | 106 |
private void initialize() { |
105 | 107 |
setLayout(new BorderLayout()); |
106 |
for (Iterator<Class<? extends ILabelingStrategyPanel>> it = installedPanels.iterator(); it.hasNext();) { |
|
107 |
try { |
|
108 |
ILabelingStrategyPanel pnl = (ILabelingStrategyPanel) it.next().newInstance(); |
|
109 |
strategyPanels.put(pnl.getLabelingStrategyClass(), pnl); |
|
110 |
} catch (Exception e) { |
|
111 |
/* |
|
112 |
* can't happen |
|
113 |
* this should never happen since instantiation and access exceptions have been |
|
114 |
* controlled in the addLabelingStrategy method |
|
115 |
*/ |
|
116 |
NotificationManager.addError(e); |
|
117 |
} |
|
118 |
|
|
108 |
SymbologySwingManager symbologySwingManager = SymbologySwingLocator.getSwingManager(); |
|
109 |
|
|
110 |
Iterator<ILabelingStrategyPanel> it = symbologySwingManager.getLabelingEditors().iterator(); |
|
111 |
while( it.hasNext() ) { |
|
112 |
ILabelingStrategyPanel pnl = it.next(); |
|
113 |
strategyPanels.put(pnl.getLabelingStrategyClass(), pnl); |
|
119 | 114 |
} |
120 | 115 |
content = new JPanel(new BorderLayout()); |
121 | 116 |
content.setBorder(BorderFactory.createEtchedBorder()); |
... | ... | |
187 | 182 |
return chkApplyLabels; |
188 | 183 |
} |
189 | 184 |
|
185 |
/** |
|
186 |
* |
|
187 |
* @deprecated use {#SymbolSwingManger. |
|
188 |
*/ |
|
190 | 189 |
public static void addLabelingStrategy(Class<? extends ILabelingStrategyPanel> iLabelingStrategyPanelClass) { |
191 |
installedPanels.add(iLabelingStrategyPanelClass); |
|
190 |
SymbologySwingManager symbologySwingManager = SymbologySwingLocator.getSwingManager(); |
|
191 |
symbologySwingManager.registerLabelingEditor(iLabelingStrategyPanelClass); |
|
192 | 192 |
} |
193 | 193 |
|
194 | 194 |
private void setComponentEnabled(Component c, boolean b) { |
Also available in: Unified diff