Changeset 24924 in osm for applications/editors/josm
- Timestamp:
- 2010-12-31T14:59:59+01:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/smed/plugs/oseam/src
- Files:
-
- 18 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/dialogs/OSeaMAction.java
r24917 r24924 212 212 panelMain.clearSelections(); 213 213 } else { 214 if (keys.containsKey("name")) { 215 panelMain.nameBox.setText(keys.get("name")); 216 panelMain.nameBox.postActionEvent(); 217 } 218 if (keys.containsKey("seamark:name")) { 219 panelMain.nameBox.setText(keys.get("seamark:name")); 220 panelMain.nameBox.postActionEvent(); 221 } 222 if (keys.containsKey("seamark:" + type + ":name")) { 223 panelMain.nameBox.setText(keys.get("seamark:" + type + ":name")); 224 panelMain.nameBox.postActionEvent(); 225 } 214 226 mark.parseMark(); 215 227 mark.paintSign(); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelMain.java
r24904 r24924 48 48 public JRadioButton litButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LitButton.png"))); 49 49 private ActionListener alMisc = null; 50 private ActionListener alName = null; 50 51 public PanelChan panelChan = null; 51 52 public PanelHaz panelHaz = null; … … 247 248 nameBox.setBounds(new Rectangle(60, 330, 200, 20)); 248 249 this.add(nameBox, null); 250 alName = new ActionListener() { 251 public void actionPerformed(java.awt.event.ActionEvent e) { 252 if (dlg.mark == null) 253 return; 254 else 255 dlg.mark.setName(nameBox.getText()); 256 } 257 }; 258 nameBox.addActionListener(alName); 259 249 260 saveButton = new JButton(); 250 261 saveButton.setBounds(new Rectangle(285, 330, 100, 20)); … … 256 267 typeButtons.clearSelection(); 257 268 alType.actionPerformed(null); 269 nameBox.setText(""); 258 270 clearType(); 259 271 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkCard.java
r24917 r24924 20 20 if (!dlg.panelMain.hazButton.isSelected()) 21 21 dlg.panelMain.hazButton.doClick(); 22 23 if (keys.containsKey("name"))24 setName(keys.get("name"));25 26 if (keys.containsKey("seamark:name"))27 setName(keys.get("seamark:name"));28 29 if (keys.containsKey("seamark:buoy_cardinal:name"))30 setName(keys.get("seamark:buoy_cardinal:name"));31 else if (keys.containsKey("seamark:beacon_cardinal:name"))32 setName(keys.get("seamark:beacon_cardinal:name"));33 else if (keys.containsKey("seamark:light_float:name"))34 setName(keys.get("seamark:light_float:name"));35 22 36 23 String cat = ""; -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkIsol.java
r24917 r24924 25 25 dlg.panelMain.panelHaz.isolButton.doClick(); 26 26 27 if (keys.containsKey("name"))28 setName(keys.get("name"));29 30 if (keys.containsKey("seamark:name"))31 setName(keys.get("seamark:name"));32 33 if (keys.containsKey("seamark:buoy_isolated_danger:name"))34 setName(keys.get("seamark:buoy_isolated_danger:name"));35 else if (keys.containsKey("seamark:beacon_isolated_danger:name"))36 setName(keys.get("seamark:beacon_isolated_danger:name"));37 else if (keys.containsKey("seamark:light_float:name"))38 setName(keys.get("seamark:light_float:name"));39 40 27 if (keys.containsKey("seamark:buoy_isolated_danger:shape")) { 41 28 str = keys.get("seamark:buoy_isolated_danger:shape"); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkLat.java
r24917 r24924 20 20 if (!dlg.panelMain.chanButton.isSelected()) 21 21 dlg.panelMain.chanButton.doClick(); 22 23 if (keys.containsKey("name"))24 setName(keys.get("name"));25 26 if (keys.containsKey("seamark:name"))27 setName(keys.get("seamark:name"));28 29 if (keys.containsKey("seamark:buoy_lateral:name"))30 setName(keys.get("seamark:buoy_lateral:name"));31 else if (keys.containsKey("seamark:beacon_lateral:name"))32 setName(keys.get("seamark:beacon_lateral:name"));33 else if (keys.containsKey("seamark:light_float:name"))34 setName(keys.get("seamark:light_float:name"));35 22 36 23 String cat = ""; -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkLight.java
r24917 r24924 21 21 dlg.panelMain.lightsButton.doClick(); 22 22 23 if (keys.containsKey("name"))24 setName(keys.get("name"));25 26 if (keys.containsKey("seamark:name"))27 setName(keys.get("seamark:name"));28 29 if (keys.containsKey("seamark:landmark:name"))30 setName(keys.get("seamark:landmark:name"));31 else if (keys.containsKey("seamark:light_major:name"))32 setName(keys.get("seamark:light_major:name"));33 else if (keys.containsKey("seamark:light_minor:name"))34 setName(keys.get("seamark:light_minor:name"));35 else if (keys.containsKey("seamark:light_vessel:name"))36 setName(keys.get("seamark:light_vessel:name"));37 else if (keys.containsKey("seamark:light_float:name"))38 setName(keys.get("seamark:light_float:name"));39 40 23 if (keys.containsKey("seamark:type")) { 41 24 String type = keys.get("seamark:type"); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkSaw.java
r24917 r24924 24 24 dlg.panelMain.panelChan.safeWaterButton.doClick(); 25 25 26 if (keys.containsKey("name"))27 setName(keys.get("name"));28 29 if (keys.containsKey("seamark:name"))30 setName(keys.get("seamark:name"));31 32 if (keys.containsKey("seamark:buoy_safe_water:name"))33 setName(keys.get("seamark:buoy_safe_water:name"));34 else if (keys.containsKey("seamark:beacon_safe_water:name"))35 setName(keys.get("seamark:beacon_safe_water:name"));36 else if (keys.containsKey("seamark:light_float:name"))37 setName(keys.get("seamark:light_float:name"));38 39 26 if (keys.containsKey("seamark:buoy_safe_water:shape")) { 40 27 str = keys.get("seamark:buoy_safe_water:shape"); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkSpec.java
r24917 r24924 2 2 3 3 import java.util.Map; 4 5 import javax.swing.ImageIcon;6 4 7 5 import oseam.dialogs.OSeaMAction; … … 21 19 dlg.panelMain.specButton.doClick(); 22 20 23 if (keys.containsKey("name"))24 setName(keys.get("name"));25 26 if (keys.containsKey("seamark:name"))27 setName(keys.get("seamark:name"));28 29 21 if (keys.containsKey("seamark:buoy_special_purpose:name")) 30 setName(keys.get("seamark:buoy_special_purpose:name"));22 dlg.panelMain.nameBox.setText(keys.get("seamark:buoy_special_purpose:name")); 31 23 else if (keys.containsKey("seamark:beacon_special_purpose:name")) 32 setName(keys.get("seamark:beacon_special_purpose:name"));24 dlg.panelMain.nameBox.setText(keys.get("seamark:beacon_special_purpose:name")); 33 25 else if (keys.containsKey("seamark:light_float:name")) 34 setName(keys.get("seamark:light_float:name"));26 dlg.panelMain.nameBox.setText(keys.get("seamark:light_float:name")); 35 27 36 28 dlg.panelMain.panelSpec.panelCol.yellowButton.doClick(); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/SeaMark.java
r24919 r24924 74 74 objects.put(Obj.LNDMRK, "landmark"); 75 75 objects.put(Obj.MORFAC, "mooring"); 76 77 76 } 78 77 … … 89 88 public enum Ent { 90 89 BODY, BUOY, BEACON, FLOAT, TOPMARK, DAYMARK, LIGHT 90 } 91 92 public enum Grp { 93 LAT, CAR, SAW, ISD, SPP, LIT 94 } 95 96 public static final EnumMap<Obj, Grp> groups = new EnumMap<Obj, Grp>(Obj.class); 97 static { 98 groups.put(Obj.BCNCAR, Grp.CAR); 99 groups.put(Obj.BCNISD, Grp.ISD); 100 groups.put(Obj.BCNLAT, Grp.LAT); 101 groups.put(Obj.BCNSAW, Grp.SAW); 102 groups.put(Obj.BCNSPP, Grp.SPP); 103 groups.put(Obj.BOYCAR, Grp.CAR); 104 groups.put(Obj.BOYISD, Grp.ISD); 105 groups.put(Obj.BOYLAT, Grp.LAT); 106 groups.put(Obj.BOYSAW, Grp.SAW); 107 groups.put(Obj.BOYSPP, Grp.SPP); 108 groups.put(Obj.LITMAJ, Grp.LIT); 109 groups.put(Obj.LITMIN, Grp.LIT); 110 groups.put(Obj.LITFLT, Grp.LIT); 111 groups.put(Obj.LITVES, Grp.LIT); 112 groups.put(Obj.LNDMRK, Grp.LIT); 113 groups.put(Obj.MORFAC, Grp.SPP); 114 } 115 116 public enum Cat { 117 UNKNOWN, LAT_PORT, LAT_STBD, LAT_PREF_PORT, LAT_PREF_STBD, CARD_NORTH, CARD_EAST, CARD_SOUTH, CARD_WEST, LIGHT_HOUSE, LIGHT_MAJOR, LIGHT_MINOR, LIGHT_VESSEL, LIGHT_FLOAT, MOORING_BUOY 118 } 119 120 public static final EnumMap<Cat, String> categories = new EnumMap<Cat, String>(Cat.class); 121 static { 122 categories.put(Cat.LAT_PORT, "port"); 123 categories.put(Cat.LAT_STBD, "starboard"); 124 categories.put(Cat.LAT_PREF_PORT, "preferred_channel_port"); 125 categories.put(Cat.LAT_PREF_STBD, "preferred_channel_starboard"); 126 categories.put(Cat.CARD_NORTH, "north"); 127 categories.put(Cat.CARD_EAST, "east"); 128 categories.put(Cat.CARD_SOUTH, "south"); 129 categories.put(Cat.CARD_WEST, "west"); 130 categories.put(Cat.MOORING_BUOY, "mooring_buoy"); 131 } 132 133 private Cat category = Cat.UNKNOWN; 134 135 public Cat getCategory() { 136 return category; 137 } 138 139 public void setCategory(Cat cat) { 140 category = cat; 141 } 142 143 public enum Shp { 144 UNKNOWN, PILLAR, SPAR, CAN, CONE, SPHERE, BARREL, FLOAT, SUPER, BEACON, TOWER, STAKE, PERCH 145 } 146 147 public static final EnumMap<Shp, String> shapes = new EnumMap<Shp, String>(Shp.class); 148 static { 149 shapes.put(Shp.PILLAR, "pillar"); 150 shapes.put(Shp.SPAR, "spar"); 151 shapes.put(Shp.CAN, "can"); 152 shapes.put(Shp.CONE, "conical"); 153 shapes.put(Shp.SPHERE, "sphere"); 154 shapes.put(Shp.BARREL, "barrel"); 155 shapes.put(Shp.FLOAT, "float"); 156 shapes.put(Shp.SUPER, "super-buoy"); 157 shapes.put(Shp.BEACON, "beacon"); 158 shapes.put(Shp.TOWER, "tower"); 159 shapes.put(Shp.STAKE, "stake"); 160 shapes.put(Shp.PERCH, "perch"); 161 } 162 163 private Shp shape = Shp.UNKNOWN; 164 165 public Shp getShape() { 166 return shape; 167 } 168 169 public void setShape(Shp styl) { 170 shape = styl; 91 171 } 92 172 … … 153 233 break; 154 234 } 155 }156 157 public enum Cat {158 UNKNOWN, LAT_PORT, LAT_STBD, LAT_PREF_PORT, LAT_PREF_STBD, CARD_NORTH, CARD_EAST, CARD_SOUTH, CARD_WEST, LIGHT_HOUSE, LIGHT_MAJOR, LIGHT_MINOR, LIGHT_VESSEL, LIGHT_FLOAT, MOORING_BUOY159 }160 161 public static final EnumMap<Cat, String> categories = new EnumMap<Cat, String>(Cat.class);162 static {163 categories.put(Cat.LAT_PORT, "port");164 categories.put(Cat.LAT_STBD, "starboard");165 categories.put(Cat.LAT_PREF_PORT, "preferred_channel_port");166 categories.put(Cat.LAT_PREF_STBD, "preferred_channel_starboard");167 categories.put(Cat.CARD_NORTH, "north");168 categories.put(Cat.CARD_EAST, "east");169 categories.put(Cat.CARD_SOUTH, "south");170 categories.put(Cat.CARD_WEST, "west");171 categories.put(Cat.MOORING_BUOY, "mooring_buoy");172 }173 174 private Cat category = Cat.UNKNOWN;175 176 public Cat getCategory() {177 return category;178 }179 180 public void setCategory(Cat cat) {181 category = cat;182 }183 184 public enum Shp {185 UNKNOWN, PILLAR, SPAR, CAN, CONE, SPHERE, BARREL, FLOAT, SUPER, BEACON, TOWER, STAKE, PERCH186 }187 188 public static final EnumMap<Shp, String> shapes = new EnumMap<Shp, String>(Shp.class);189 static {190 shapes.put(Shp.PILLAR, "pillar");191 shapes.put(Shp.SPAR, "spar");192 shapes.put(Shp.CAN, "can");193 shapes.put(Shp.CONE, "conical");194 shapes.put(Shp.SPHERE, "sphere");195 shapes.put(Shp.BARREL, "barrel");196 shapes.put(Shp.FLOAT, "float");197 shapes.put(Shp.SUPER, "super-buoy");198 shapes.put(Shp.BEACON, "beacon");199 shapes.put(Shp.TOWER, "tower");200 shapes.put(Shp.STAKE, "stake");201 shapes.put(Shp.PERCH, "perch");202 }203 204 private Shp shape = Shp.UNKNOWN;205 206 public Shp getShape() {207 return shape;208 }209 210 public void setShape(Shp styl) {211 shape = styl;212 235 } 213 236 … … 685 708 } 686 709 imgStr += ".png"; 710 if (getClass().getResource(imgStr) == null) 711 System.out.println(imgStr); 712 else 687 713 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource(imgStr))); 688 714 } … … 723 749 imgStr += ("_" + colStr); 724 750 imgStr += ".png"; 751 if (getClass().getResource(imgStr) == null) 725 752 System.out.println(imgStr); 726 // dlg.panelMain.topIcon.setIcon(new ImageIcon(getClass().getResource(imgStr))); 727 } 728 } 729 753 else 754 dlg.panelMain.topIcon.setIcon(new ImageIcon(getClass().getResource(imgStr))); 755 } 756 } 757 /* 730 758 if (hasRadar()) { 731 759 dlg.panelMain.radarIcon.setIcon(new ImageIcon(getClass().getResource("/images/Radar_Reflector_355.png"))); … … 768 796 } 769 797 770 /* 771 * c = getLightChar(); if (c.contains("+")) { i1 = c.indexOf("+"); tmp = 772 * c.substring(i1, c.length()); c = c.substring(0, i1); if 773 * (!getLightGroup().isEmpty()) { c = c + "(" + getLightGroup() + ")"; } 774 * if (tmp != null) c = c + tmp; } else if (!getLightGroup().isEmpty()) c 775 * = c + "(" + getLightGroup() + ")"; c = c + " " + getLightColour(); lp = 776 * getLightPeriod(); if (!lp.isEmpty()) c = c + " " + lp + "s"; 777 */} 798 c = getLightChar(); if (c.contains("+")) { i1 = c.indexOf("+"); tmp = 799 c.substring(i1, c.length()); c = c.substring(0, i1); if 800 (!getLightGroup().isEmpty()) { c = c + "(" + getLightGroup() + ")"; } 801 if (tmp != null) c = c + tmp; } else if (!getLightGroup().isEmpty()) c 802 = c + "(" + getLightGroup() + ")"; c = c + " " + getLightColour(); lp = 803 getLightPeriod(); if (!lp.isEmpty()) c = c + " " + lp + "s"; 804 }*/ 778 805 } 779 806
Note:
See TracChangeset
for help on using the changeset viewer.