Revision 728

View differences:

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
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) {
org.gvsig.topology/trunk/org.gvsig.topology/org.gvsig.topology.swing/org.gvsig.topology.swing.impl/src/main/java/org/gvsig/topology/swing/impl/TopologySwingImplLibrary.java
61 61
        String[][] iconNames = new String[][] {
62 62
            new String[] { "layertypes", "layer-type-point" },
63 63
            new String[] { "layertypes", "layer-type-line" },
64
            new String[] { "layertypes", "layer-type-polygon" }
64
            new String[] { "layertypes", "layer-type-polygon" },
65
            new String[] { "layertypes", "layer-type-multipoint" },
66
            new String[] { "layertypes", "layer-type-multiline" },
67
            new String[] { "layertypes", "layer-type-multipolygon" }
65 68
        };
66 69
        IconTheme theme = ToolsSwingLocator.getIconThemeManager().getCurrent();
67 70
        for (String[] icon : iconNames) {
68
            URL url = this.getClass().getResource("images/layertypes"+icon[1]+".png");
71
            URL url = this.getClass().getResource("images/layertypes/"+icon[1]+".png");
69 72
            theme.registerDefault("topology", icon[0], icon[1], null, url);
70 73
        }
71 74
    }
org.gvsig.topology/trunk/org.gvsig.topology/org.gvsig.topology.swing/org.gvsig.topology.swing.impl/src/main/java/org/gvsig/topology/swing/impl/SelectDataSetDialog.java
55 55
                return label;
56 56
            }
57 57
        });
58
        this.treeDataSets.addMouseListener(new MouseAdapter() {
59
            @Override
60
            public void mouseClicked(MouseEvent e) {
61
                if( e.getButton()==MouseEvent.BUTTON1 && e.getClickCount()==2 ) {
62
                    setVisible(false);
63
                }
64
            }
65
        });
58
//        this.treeDataSets.addMouseListener(new MouseAdapter() {
59
//            @Override
60
//            public void mouseClicked(MouseEvent e) {
61
//                if( e.getButton()==MouseEvent.BUTTON1 && e.getClickCount()==2 ) {
62
//                    setVisible(false);
63
//                }
64
//            }
65
//        });
66 66
        this.setPreferredSize(new Dimension(350, 400));
67 67
        this.translate();
68 68
    }

Also available in: Unified diff