Revision 28412
trunk/extensions/extSymbology/src/org/gvsig/symbology/gui/layerproperties/GeneralLabeling.java | ||
---|---|---|
49 | 49 |
import java.awt.event.ActionListener; |
50 | 50 |
import java.beans.PropertyChangeEvent; |
51 | 51 |
import java.util.ArrayList; |
52 |
import java.util.Comparator; |
|
52 | 53 |
import java.util.Date; |
53 | 54 |
import java.util.Hashtable; |
54 | 55 |
import java.util.Iterator; |
56 |
import java.util.TreeMap; |
|
55 | 57 |
|
56 | 58 |
import javax.swing.BorderFactory; |
57 | 59 |
import javax.swing.JCheckBox; |
... | ... | |
85 | 87 |
|
86 | 88 |
public class GeneralLabeling extends JPanel implements ILabelingStrategyPanel, ActionListener { |
87 | 89 |
private static final long serialVersionUID = 8864709758980903351L; |
88 |
private static Hashtable< |
|
90 |
private static Comparator comparator=new Comparator<Class<? extends ILabelingMethod>>(){ |
|
91 |
public int compare(Class<? extends ILabelingMethod> o1, |
|
92 |
Class<? extends ILabelingMethod> o2) { |
|
93 |
return o1.getName().compareTo(o2.getName()); |
|
94 |
}}; |
|
95 |
private static TreeMap< |
|
89 | 96 |
Class<? extends ILabelingMethod>, |
90 | 97 |
Class<? extends AbstractLabelingMethodPanel> |
91 | 98 |
> methods |
92 |
= new Hashtable<
|
|
99 |
= new TreeMap<
|
|
93 | 100 |
Class<? extends ILabelingMethod>, |
94 | 101 |
Class<? extends AbstractLabelingMethodPanel> |
95 |
>(); |
|
102 |
>(comparator);
|
|
96 | 103 |
private JButton btnVisualization; |
97 | 104 |
private JButton btnPlacement; |
98 | 105 |
private JComboBox cmbMethod; |
... | ... | |
222 | 229 |
|
223 | 230 |
auxLayer.setLegend((IVectorLegend)targetLayer.getLegend()); |
224 | 231 |
|
225 |
|
|
232 |
|
|
226 | 233 |
if (auxLayer.getProjection() == null) { |
227 | 234 |
Logger.getLogger(getClass()).debug("Possible bug detected in " + |
228 | 235 |
"FLyrVect.cloneLayer() (missing projection in cloned layer)"); |
trunk/extensions/extSymbology/src/org/gvsig/symbology/gui/styling/LayerPreview.java | ||
---|---|---|
66 | 66 |
public static void main(String[] args) { |
67 | 67 |
JFrame jFrame = new JFrame("test"); |
68 | 68 |
String fwAndamiDriverPath = "../_fwAndami/gvSIG/extensiones/com.iver.cit.gvsig/drivers"; |
69 |
IProjection PROJ = CRSFactory.getCRS("EPSG:23030");
|
|
69 |
IProjection PROJ = CRSFactory.getCRS("EPSG:23030"); |
|
70 | 70 |
try { |
71 | 71 |
LayerFactory.setDriversPath(new File(fwAndamiDriverPath).getAbsolutePath()); |
72 | 72 |
LayerPreview prev = new LayerPreview(); |
... | ... | |
92 | 92 |
public void drawImage(Graphics2D g, double x1, double y1, double x2, double y2, double zoom, int width, int height) { |
93 | 93 |
Cancel c = new Cancel(); |
94 | 94 |
while (!cancels.isEmpty()) cancels.pop().setCanceled(true); |
95 |
|
|
95 |
|
|
96 | 96 |
cancels.push(c); |
97 | 97 |
if (layer == null || width <= 0 || height <= 0 || vp == null) |
98 | 98 |
return; |
99 | 99 |
vp.setExtent(new Rectangle2D.Double(x1, y2, x2-x1, y1-y2)); |
100 | 100 |
vp.setImageSize(new Dimension(width, height)); |
101 | 101 |
BufferedImage bi = new BufferedImage(width, height, BufferedImage.TYPE_4BYTE_ABGR); |
102 |
|
|
102 |
|
|
103 | 103 |
double scale = vp.getScale(); |
104 | 104 |
try { |
105 | 105 |
layer.draw(bi, g, vp, c, scale); |
... | ... | |
111 | 111 |
e.printStackTrace(); |
112 | 112 |
} |
113 | 113 |
} |
114 |
|
|
115 |
|
|
114 |
|
|
115 |
|
|
116 | 116 |
} |
Also available in: Unified diff