Revision 728 org.gvsig.topology/trunk/org.gvsig.topology/org.gvsig.topology.swing/org.gvsig.topology.swing.impl/src/main/java/org/gvsig/topology/swing/impl/CreateRuleDialog.java
CreateRuleDialog.java | ||
---|---|---|
12 | 12 |
import java.util.Objects; |
13 | 13 |
import javax.swing.DefaultComboBoxModel; |
14 | 14 |
import javax.swing.DefaultListCellRenderer; |
15 |
import javax.swing.Icon; |
|
15 | 16 |
import javax.swing.ImageIcon; |
16 | 17 |
import javax.swing.JLabel; |
17 | 18 |
import javax.swing.JList; |
... | ... | |
44 | 45 |
|
45 | 46 |
private class DataSetListCellRenderer extends DefaultListCellRenderer { |
46 | 47 |
|
47 |
private ImageIcon pointIcon; |
|
48 |
private ImageIcon lineIcon; |
|
49 |
private ImageIcon polygonIcon; |
|
48 |
private Icon pointIcon; |
|
49 |
private Icon lineIcon; |
|
50 |
private Icon polygonIcon; |
|
51 |
private Icon multipolygonIcon; |
|
52 |
private Icon multilineIcon; |
|
53 |
private Icon multipointIcon; |
|
50 | 54 |
|
51 | 55 |
public DataSetListCellRenderer() { |
52 | 56 |
IconTheme iconTheme = ToolsSwingLocator.getIconThemeManager().getCurrent(); |
... | ... | |
59 | 63 |
if( iconTheme.exists("layer-type-polygon") ) { |
60 | 64 |
this.polygonIcon = iconTheme.get("layer-type-polygon"); |
61 | 65 |
} |
66 |
if( iconTheme.exists("layer-type-multipoint") ) { |
|
67 |
this.multipointIcon = iconTheme.get("layer-type-multipoint"); |
|
68 |
} |
|
69 |
if( iconTheme.exists("layer-type-multiline") ) { |
|
70 |
this.multilineIcon = iconTheme.get("layer-type-multiline"); |
|
71 |
} |
|
72 |
if( iconTheme.exists("layer-type-multipolygon") ) { |
|
73 |
this.multipolygonIcon = iconTheme.get("layer-type-multipolygon"); |
|
74 |
} |
|
62 | 75 |
} |
63 | 76 |
|
64 | 77 |
@Override |
... | ... | |
73 | 86 |
int geomtype = ((FeatureStore) store).getDefaultFeatureType().getDefaultGeometryAttribute().getGeomType().getType(); |
74 | 87 |
if( GeometryUtils.isSubtype(Geometry.TYPES.POINT, geomtype) ) { |
75 | 88 |
this.setIcon(this.pointIcon); |
89 |
} else if( GeometryUtils.isSubtype(Geometry.TYPES.CURVE, geomtype) ) { |
|
90 |
this.setIcon(this.lineIcon); |
|
76 | 91 |
} else if( GeometryUtils.isSubtype(Geometry.TYPES.SURFACE, geomtype) ) { |
77 | 92 |
this.setIcon(this.polygonIcon); |
78 |
} else if( GeometryUtils.isSubtype(Geometry.TYPES.CURVE, geomtype) ) { |
|
79 |
this.setIcon(this.lineIcon); |
|
93 |
} else if( GeometryUtils.isSubtype(Geometry.TYPES.MULTIPOINT, geomtype) ) { |
|
94 |
this.setIcon(this.multipointIcon); |
|
95 |
} else if( GeometryUtils.isSubtype(Geometry.TYPES.MULTICURVE, geomtype) ) { |
|
96 |
this.setIcon(this.multilineIcon); |
|
97 |
} else if( GeometryUtils.isSubtype(Geometry.TYPES.MULTISURFACE, geomtype) ) { |
|
98 |
this.setIcon(this.multipolygonIcon); |
|
80 | 99 |
} |
81 | 100 |
} catch (DataException ex) { |
82 | 101 |
} |
... | ... | |
113 | 132 |
performDataSet1Selected(); |
114 | 133 |
} |
115 | 134 |
}); |
116 |
// this.cboDataSet1.setRenderer(new DataSetListCellRenderer());
|
|
117 |
// this.cboDataSet2.setRenderer(new DataSetListCellRenderer());
|
|
135 |
this.cboDataSet1.setRenderer(new DataSetListCellRenderer()); |
|
136 |
this.cboDataSet2.setRenderer(new DataSetListCellRenderer()); |
|
118 | 137 |
this.cboRule.addItemListener(new ItemListener() { |
119 | 138 |
@Override |
120 | 139 |
public void itemStateChanged(ItemEvent e) { |
Also available in: Unified diff