Changeset 24885 in osm for applications/editors/josm/plugins/smed
- Timestamp:
- 2010-12-27T11:37:15+01:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/smed/plugs/oseam/src/oseam
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelChan.java
r24881 r24885 19 19 import oseam.seamarks.SeaMark.Cat; 20 20 import oseam.seamarks.SeaMark.Col; 21 import oseam.seamarks.SeaMark. Obj;21 import oseam.seamarks.SeaMark.Ent; 22 22 import oseam.seamarks.MarkLat; 23 23 import oseam.seamarks.MarkSaw; … … 44 44 dlg.mark.setCategory(Cat.LAT_PORT); 45 45 if (dlg.mark.getRegion() == SeaMark.IALA_A) { 46 dlg.mark.setColour( Obj.BODY, Col.RED);46 dlg.mark.setColour(Ent.BODY, Col.RED); 47 47 panelPort.regionAButton.doClick(); 48 48 } else { 49 dlg.mark.setColour( Obj.BODY, Col.GREEN);49 dlg.mark.setColour(Ent.BODY, Col.GREEN); 50 50 panelPort.regionBButton.doClick(); 51 51 } … … 62 62 dlg.mark.setCategory(Cat.LAT_STBD); 63 63 if (dlg.mark.getRegion() == SeaMark.IALA_A) { 64 dlg.mark.setColour( Obj.BODY, Col.GREEN);64 dlg.mark.setColour(Ent.BODY, Col.GREEN); 65 65 panelStbd.regionAButton.doClick(); 66 66 } else { 67 dlg.mark.setColour( Obj.BODY, Col.RED);67 dlg.mark.setColour(Ent.BODY, Col.RED); 68 68 panelStbd.regionBButton.doClick(); 69 69 } … … 80 80 dlg.mark.setCategory(Cat.LAT_PREF_PORT); 81 81 if (dlg.mark.getRegion() == SeaMark.IALA_A) { 82 dlg.mark.setColour( Obj.BODY, Col.RED_GREEN_RED);82 dlg.mark.setColour(Ent.BODY, Col.RED_GREEN_RED); 83 83 panelPort.regionAButton.doClick(); 84 84 } else { 85 dlg.mark.setColour( Obj.BODY, Col.GREEN_RED_GREEN);85 dlg.mark.setColour(Ent.BODY, Col.GREEN_RED_GREEN); 86 86 panelPort.regionBButton.doClick(); 87 87 } … … 98 98 dlg.mark.setCategory(Cat.LAT_PREF_STBD); 99 99 if (dlg.mark.getRegion() == SeaMark.IALA_A) { 100 dlg.mark.setColour( Obj.BODY, Col.GREEN_RED_GREEN);100 dlg.mark.setColour(Ent.BODY, Col.GREEN_RED_GREEN); 101 101 panelStbd.regionAButton.doClick(); 102 102 } else { 103 dlg.mark.setColour( Obj.BODY, Col.RED_GREEN_RED);103 dlg.mark.setColour(Ent.BODY, Col.RED_GREEN_RED); 104 104 panelStbd.regionBButton.doClick(); 105 105 } … … 114 114 if (!(dlg.mark instanceof MarkSaw)) 115 115 dlg.mark = new MarkSaw(dlg); 116 dlg.mark.setColour( Obj.BODY, Col.RED_WHITE);116 dlg.mark.setColour(Ent.BODY, Col.RED_WHITE); 117 117 safeWaterButton.setBorderPainted(true); 118 118 panelSaw.setVisible(true); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelCol.java
r24875 r24885 18 18 import oseam.dialogs.OSeaMAction; 19 19 import oseam.seamarks.SeaMark.Col; 20 import oseam.seamarks.SeaMark. Obj;20 import oseam.seamarks.SeaMark.Ent; 21 21 22 22 public class PanelCol extends JPanel { 23 23 24 24 private OSeaMAction dlg; 25 private Obj obj;25 private Ent ent; 26 26 private ButtonGroup colourButtons = new ButtonGroup(); 27 27 public JRadioButton offButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/OffButton.png"))); … … 43 43 JRadioButton button = colours.get(col); 44 44 if (button.isSelected()) { 45 if (dlg.mark != null) dlg.mark.setColour( obj, col);45 if (dlg.mark != null) dlg.mark.setColour(ent, col); 46 46 button.setBorderPainted(true); 47 47 } else … … 51 51 }; 52 52 53 public PanelCol(OSeaMAction dia, Obj object) {53 public PanelCol(OSeaMAction dia, Ent entity) { 54 54 dlg = dia; 55 obj = object;55 ent = entity; 56 56 this.setLayout(null); 57 57 this.add(getColButton(offButton, 0, 0, 34, 16, "No colour", Col.UNKNOWN), null); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelHaz.java
r24875 r24885 1 1 package oseam.panels; 2 3 import java.awt.event.ActionListener; 4 import java.awt.Color; 5 import java.awt.Rectangle; 2 6 3 7 import javax.swing.BorderFactory; 4 8 import javax.swing.JPanel; 5 6 import java.awt.Color;7 import java.awt.Rectangle;8 9 9 import javax.swing.ButtonGroup; 10 10 import javax.swing.ImageIcon; 11 11 import javax.swing.JRadioButton; 12 13 import java.util.EnumMap; 14 import java.util.Iterator; 12 15 13 16 import oseam.Messages; … … 17 20 import oseam.seamarks.SeaMark.Cat; 18 21 import oseam.seamarks.SeaMark.Col; 22 import oseam.seamarks.SeaMark.Ent; 23 import oseam.seamarks.SeaMark.Shp; 19 24 import oseam.seamarks.SeaMark.Obj; 20 import oseam.seamarks.SeaMark.Shp;21 22 import java.awt.event.ActionListener;23 import java.util.EnumMap;24 import java.util.Iterator;25 25 26 26 public class PanelHaz extends JPanel { … … 41 41 } 42 42 dlg.mark.setCategory(Cat.CARD_NORTH); 43 dlg.mark.setColour( Obj.BODY, Col.BLACK_YELLOW);43 dlg.mark.setColour(Ent.BODY, Col.BLACK_YELLOW); 44 44 dlg.panelMain.panelTop.northTopButton.doClick(); 45 45 dlg.panelMain.panelTop.panelCol.blackButton.doClick(); … … 54 54 } 55 55 dlg.mark.setCategory(Cat.CARD_SOUTH); 56 dlg.mark.setColour( Obj.BODY, Col.YELLOW_BLACK);56 dlg.mark.setColour(Ent.BODY, Col.YELLOW_BLACK); 57 57 dlg.panelMain.panelTop.southTopButton.doClick(); 58 58 dlg.panelMain.panelTop.panelCol.blackButton.doClick(); … … 67 67 } 68 68 dlg.mark.setCategory(Cat.CARD_EAST); 69 dlg.mark.setColour( Obj.BODY, Col.BLACK_YELLOW_BLACK);69 dlg.mark.setColour(Ent.BODY, Col.BLACK_YELLOW_BLACK); 70 70 dlg.panelMain.panelTop.eastTopButton.doClick(); 71 71 dlg.panelMain.panelTop.panelCol.blackButton.doClick(); … … 80 80 } 81 81 dlg.mark.setCategory(Cat.CARD_WEST); 82 dlg.mark.setColour( Obj.BODY, Col.YELLOW_BLACK_YELLOW);82 dlg.mark.setColour(Ent.BODY, Col.YELLOW_BLACK_YELLOW); 83 83 dlg.panelMain.panelTop.westTopButton.doClick(); 84 84 dlg.panelMain.panelTop.panelCol.blackButton.doClick(); … … 92 92 alShape.actionPerformed(null); 93 93 } 94 dlg.mark.setColour( Obj.BODY, Col.BLACK_RED_BLACK);94 dlg.mark.setColour(Ent.BODY, Col.BLACK_RED_BLACK); 95 95 dlg.panelMain.panelTop.spheres2TopButton.doClick(); 96 96 dlg.panelMain.panelTop.panelCol.blackButton.doClick(); … … 111 111 public JRadioButton towerButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TowerButton.png"))); 112 112 private EnumMap<Shp, JRadioButton> shapes = new EnumMap<Shp, JRadioButton>(Shp.class); 113 private EnumMap<Shp, Obj> carObjects = new EnumMap<Shp, Obj>(Shp.class); 114 private EnumMap<Shp, Obj> isdObjects = new EnumMap<Shp, Obj>(Shp.class); 113 115 private ActionListener alShape = new ActionListener() { 114 116 public void actionPerformed(java.awt.event.ActionEvent e) { … … 119 121 if (button.isSelected()) { 120 122 dlg.mark.setShape(shp); 123 if (isolButton.isSelected()) 124 dlg.mark.setObject(isdObjects.get(shp)); 125 else 126 dlg.mark.setObject(carObjects.get(shp)); 121 127 button.setBorderPainted(true); 122 128 } else … … 137 143 this.add(getCatButton(isolButton, 0, 128, 52, 32, "IsolTip"), null); 138 144 139 this.add(getShapeButton(pillarButton, 55, 0, 34, 32, "PillarTip", Shp.PILLAR ), null);140 this.add(getShapeButton(sparButton, 55, 32, 34, 32, "SparTip", Shp.SPAR ), null);141 this.add(getShapeButton(floatButton, 55, 64, 34, 32, "FloatTip", Shp.FLOAT ), null);142 this.add(getShapeButton(beaconButton, 55, 96, 34, 32, "BeaconTip", Shp.BEACON ), null);143 this.add(getShapeButton(towerButton, 55, 128, 34, 32, "TowerTip", Shp.TOWER ), null);145 this.add(getShapeButton(pillarButton, 55, 0, 34, 32, "PillarTip", Shp.PILLAR, Obj.BOYCAR, Obj.BOYISD), null); 146 this.add(getShapeButton(sparButton, 55, 32, 34, 32, "SparTip", Shp.SPAR, Obj.BOYCAR, Obj.BOYISD), null); 147 this.add(getShapeButton(floatButton, 55, 64, 34, 32, "FloatTip", Shp.FLOAT, Obj.LITFLT, Obj.LITFLT), null); 148 this.add(getShapeButton(beaconButton, 55, 96, 34, 32, "BeaconTip", Shp.BEACON, Obj.BCNCAR, Obj.BCNISD), null); 149 this.add(getShapeButton(towerButton, 55, 128, 34, 32, "TowerTip", Shp.TOWER, Obj.BCNCAR, Obj.BCNISD), null); 144 150 } 145 151 … … 160 166 } 161 167 162 private JRadioButton getShapeButton(JRadioButton button, int x, int y, int w, int h, String tip, Shp shp ) {168 private JRadioButton getShapeButton(JRadioButton button, int x, int y, int w, int h, String tip, Shp shp, Obj car, Obj isd) { 163 169 button.setBounds(new Rectangle(x, y, w, h)); 164 170 button.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); … … 167 173 shapeButtons.add(button); 168 174 shapes.put(shp, button); 175 carObjects.put(shp, car); 176 isdObjects.put(shp, isd); 169 177 return button; 170 178 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelLights.java
r24870 r24885 1 1 package oseam.panels; 2 2 3 import java.awt.event.ActionListener; 3 4 import java.awt.Color; 4 5 import java.awt.Rectangle; 5 import java.awt.event.ActionListener;6 6 7 7 import javax.swing.BorderFactory; … … 17 17 import oseam.dialogs.OSeaMAction; 18 18 import oseam.seamarks.SeaMark.Cat; 19 import oseam.seamarks.SeaMark.Obj; 19 20 20 21 public class PanelLights extends JPanel { … … 28 29 private JRadioButton floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LightFloatButton.png"))); 29 30 private EnumMap<Cat, JRadioButton> categories = new EnumMap<Cat, JRadioButton>(Cat.class); 31 private EnumMap<Cat, Obj> objects = new EnumMap<Cat, Obj>(Cat.class); 30 32 private ActionListener alCat = new ActionListener() { 31 33 public void actionPerformed(java.awt.event.ActionEvent e) { … … 36 38 if (button.isSelected()) { 37 39 dlg.mark.setCategory(cat); 40 dlg.mark.setObject(objects.get(cat)); 38 41 button.setBorderPainted(true); 39 42 } else … … 48 51 dlg = dia; 49 52 this.setLayout(null); 50 this.add(getCatButton(houseButton, 0, 0, 34, 32, "LighthouseTip", Cat.LIGHT_HOUSE ), null);51 this.add(getCatButton(majorButton, 0, 32, 34, 32, "MajorLightTip", Cat.LIGHT_MAJOR ), null);52 this.add(getCatButton(minorButton, 0, 64, 34, 32, "MinorLightTip", Cat.LIGHT_MINOR ), null);53 this.add(getCatButton(vesselButton, 0, 96, 34, 32, "LightVesselTip", Cat.LIGHT_VESSEL ), null);54 this.add(getCatButton(floatButton, 0, 128, 34, 32, "LightFloatTip", Cat.LIGHT_FLOAT ), null);53 this.add(getCatButton(houseButton, 0, 0, 34, 32, "LighthouseTip", Cat.LIGHT_HOUSE, Obj.LNDMRK), null); 54 this.add(getCatButton(majorButton, 0, 32, 34, 32, "MajorLightTip", Cat.LIGHT_MAJOR, Obj.LIGHTS), null); 55 this.add(getCatButton(minorButton, 0, 64, 34, 32, "MinorLightTip", Cat.LIGHT_MINOR, Obj.LIGHTS), null); 56 this.add(getCatButton(vesselButton, 0, 96, 34, 32, "LightVesselTip", Cat.LIGHT_VESSEL, Obj.LITVES), null); 57 this.add(getCatButton(floatButton, 0, 128, 34, 32, "LightFloatTip", Cat.LIGHT_FLOAT, Obj.LITFLT), null); 55 58 } 56 59 … … 59 62 } 60 63 61 private JRadioButton getCatButton(JRadioButton button, int x, int y, int w, int h, String tip, Cat cat ) {64 private JRadioButton getCatButton(JRadioButton button, int x, int y, int w, int h, String tip, Cat cat, Obj obj) { 62 65 button.setBounds(new Rectangle(x, y, w, h)); 63 66 button.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 64 67 button.setToolTipText(Messages.getString(tip)); 65 68 button.addActionListener(alCat); 69 catButtons.add(button); 66 70 categories.put(cat, button); 67 catButtons.add(button);71 objects.put(cat, obj); 68 72 return button; 69 73 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelLit.java
r24875 r24885 7 7 import oseam.Messages; 8 8 import oseam.dialogs.OSeaMAction; 9 import oseam.seamarks.SeaMark. Obj;9 import oseam.seamarks.SeaMark.Ent; 10 10 11 11 public class PanelLit extends JPanel { … … 16 16 public PanelLit(OSeaMAction dia) { 17 17 dlg = dia; 18 panelCol = new PanelCol(dlg, Obj.LIGHT);18 panelCol = new PanelCol(dlg, Ent.LIGHT); 19 19 panelCol.setBounds(new Rectangle(0, 0, 34, 160)); 20 20 this.setLayout(null); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelPort.java
r24872 r24885 1 1 package oseam.panels; 2 2 3 import java.awt.event.ActionListener; 4 import java.awt.Color; 5 import java.awt.Rectangle; 6 7 import javax.swing.ButtonGroup; 8 import javax.swing.ImageIcon; 9 import javax.swing.JRadioButton; 3 10 import javax.swing.BorderFactory; 4 11 import javax.swing.JPanel; 5 12 6 import java.awt.Color; 7 import java.awt.Dimension; 8 import java.awt.Rectangle; 9 import java.awt.Font; 10 11 import javax.swing.ButtonGroup; 12 import javax.swing.ImageIcon; 13 import javax.swing.JLabel; 14 import javax.swing.JTextField; 15 import javax.swing.JComboBox; 16 import javax.swing.JCheckBox; 17 import javax.swing.JRadioButton; 13 import java.util.EnumMap; 14 import java.util.Iterator; 18 15 19 16 import oseam.Messages; 20 17 import oseam.dialogs.OSeaMAction; 21 import oseam.seamarks.SeaMark;22 18 import oseam.seamarks.SeaMark.Shp; 23 24 import java.awt.Cursor; 25 import java.awt.event.ActionListener; 26 import java.util.EnumMap; 27 import java.util.Iterator; 19 import oseam.seamarks.SeaMark.Obj; 28 20 29 21 public class PanelPort extends JPanel { … … 49 41 public JRadioButton perchButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PerchPButton.png"))); 50 42 private EnumMap<Shp, JRadioButton> shapes = new EnumMap<Shp, JRadioButton>(Shp.class); 43 private EnumMap<Shp, Obj> objects = new EnumMap<Shp, Obj>(Shp.class); 51 44 private ActionListener alShape = new ActionListener() { 52 45 public void actionPerformed(java.awt.event.ActionEvent e) { … … 57 50 if (button.isSelected()) { 58 51 dlg.mark.setShape(shp); 52 dlg.mark.setObject(objects.get(shp)); 59 53 button.setBorderPainted(true); 60 54 } else … … 71 65 this.add(getRegionButton(regionAButton, 0, 2, 34, 30, "RegionATip"), null); 72 66 this.add(getRegionButton(regionBButton, 0, 32, 34, 30, "RegionBTip"), null); 73 this.add(getShapeButton(pillarButton, 0, 64, 34, 32, "PillarTip", Shp.PILLAR ), null);74 this.add(getShapeButton(sparButton, 0, 96, 34, 32, "SparTip", Shp.SPAR ), null);75 this.add(getShapeButton(canButton, 0, 128, 34, 32, "CanTip", Shp.CAN ), null);76 this.add(getShapeButton(floatButton, 35, 0, 34, 32, "FloatTip", Shp.FLOAT ), null);77 this.add(getShapeButton(beaconButton, 35, 32, 34, 32, "BeaconTip", Shp.BEACON ), null);78 this.add(getShapeButton(towerButton, 35, 64, 34, 32, "TowerTip", Shp.TOWER ), null);79 this.add(getShapeButton(perchButton, 35, 96, 34, 32, "PerchTip", Shp.PERCH ), null);67 this.add(getShapeButton(pillarButton, 0, 64, 34, 32, "PillarTip", Shp.PILLAR, Obj.BOYLAT), null); 68 this.add(getShapeButton(sparButton, 0, 96, 34, 32, "SparTip", Shp.SPAR, Obj.BOYLAT), null); 69 this.add(getShapeButton(canButton, 0, 128, 34, 32, "CanTip", Shp.CAN, Obj.BOYLAT), null); 70 this.add(getShapeButton(floatButton, 35, 0, 34, 32, "FloatTip", Shp.FLOAT, Obj.LITFLT), null); 71 this.add(getShapeButton(beaconButton, 35, 32, 34, 32, "BeaconTip", Shp.BEACON, Obj.BCNLAT), null); 72 this.add(getShapeButton(towerButton, 35, 64, 34, 32, "TowerTip", Shp.TOWER, Obj.BCNLAT), null); 73 this.add(getShapeButton(perchButton, 35, 96, 34, 32, "PerchTip", Shp.PERCH, Obj.BCNLAT), null); 80 74 } 81 75 … … 94 88 } 95 89 96 private JRadioButton getShapeButton(JRadioButton button, int x, int y, int w, int h, String tip, Shp shp ) {90 private JRadioButton getShapeButton(JRadioButton button, int x, int y, int w, int h, String tip, Shp shp, Obj obj) { 97 91 button.setBounds(new Rectangle(x, y, w, h)); 98 92 button.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); … … 101 95 shapeButtons.add(button); 102 96 shapes.put(shp, button); 97 objects.put(shp, obj); 103 98 return button; 104 99 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelSaw.java
r24879 r24885 1 1 package oseam.panels; 2 2 3 import java.awt.event.ActionListener; 4 import java.awt.Color; 5 import java.awt.Rectangle; 6 7 import javax.swing.ButtonGroup; 8 import javax.swing.ImageIcon; 9 import javax.swing.JRadioButton; 3 10 import javax.swing.BorderFactory; 4 11 import javax.swing.JPanel; 5 12 6 import java.awt.Color; 7 import java.awt.Dimension; 8 import java.awt.Rectangle; 9 import java.awt.Font; 10 11 import javax.swing.ButtonGroup; 12 import javax.swing.ImageIcon; 13 import javax.swing.JLabel; 14 import javax.swing.JTextField; 15 import javax.swing.JComboBox; 16 import javax.swing.JCheckBox; 17 import javax.swing.JRadioButton; 13 import java.util.EnumMap; 14 import java.util.Iterator; 18 15 19 16 import oseam.Messages; 20 17 import oseam.dialogs.OSeaMAction; 21 18 import oseam.seamarks.SeaMark.Shp; 22 23 import java.awt.Cursor; 24 import java.awt.event.ActionListener; 25 import java.util.EnumMap; 26 import java.util.Iterator; 19 import oseam.seamarks.SeaMark.Obj; 27 20 28 21 public class PanelSaw extends JPanel { … … 36 29 private JRadioButton floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FloatButton.png"))); 37 30 private EnumMap<Shp, JRadioButton> shapes = new EnumMap<Shp, JRadioButton>(Shp.class); 31 private EnumMap<Shp, Obj> objects = new EnumMap<Shp, Obj>(Shp.class); 38 32 private ActionListener alShape = new ActionListener() { 39 33 public void actionPerformed(java.awt.event.ActionEvent e) { … … 44 38 if (button.isSelected()) { 45 39 dlg.mark.setShape(shp); 40 dlg.mark.setObject(objects.get(shp)); 46 41 button.setBorderPainted(true); 47 42 } else … … 56 51 dlg = dia; 57 52 this.setLayout(null); 58 this.add(getShapeButton(pillarButton, 0, 0, 34, 32, "PillarTip", Shp.PILLAR ), null);59 this.add(getShapeButton(sparButton, 0, 32, 34, 32, "SparTip", Shp.SPAR ), null);60 this.add(getShapeButton(sphereButton, 0, 64, 34, 32, "SphereTip", Shp.SPHERE ), null);61 this.add(getShapeButton(barrelButton, 0, 96, 34, 32, "BarrelTip", Shp.BARREL ), null);62 this.add(getShapeButton(floatButton, 0, 128, 34, 32, "FloatTip", Shp.FLOAT ), null);53 this.add(getShapeButton(pillarButton, 0, 0, 34, 32, "PillarTip", Shp.PILLAR, Obj.BOYSAW), null); 54 this.add(getShapeButton(sparButton, 0, 32, 34, 32, "SparTip", Shp.SPAR, Obj.BOYSAW), null); 55 this.add(getShapeButton(sphereButton, 0, 64, 34, 32, "SphereTip", Shp.SPHERE, Obj.BOYSAW), null); 56 this.add(getShapeButton(barrelButton, 0, 96, 34, 32, "BarrelTip", Shp.BARREL, Obj.BOYSAW), null); 57 this.add(getShapeButton(floatButton, 0, 128, 34, 32, "FloatTip", Shp.FLOAT, Obj.LITFLT), null); 63 58 } 64 59 … … 68 63 } 69 64 70 private JRadioButton getShapeButton(JRadioButton button, int x, int y, int w, int h, String tip, Shp shp ) {65 private JRadioButton getShapeButton(JRadioButton button, int x, int y, int w, int h, String tip, Shp shp, Obj obj) { 71 66 button.setBounds(new Rectangle(x, y, w, h)); 72 67 button.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); … … 75 70 shapeButtons.add(button); 76 71 shapes.put(shp, button); 72 objects.put(shp, obj); 77 73 return button; 78 74 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelSpec.java
r24875 r24885 1 1 package oseam.panels; 2 2 3 import static org.openstreetmap.josm.tools.I18n.tr; 3 import java.awt.event.ActionListener; 4 import java.awt.Color; 5 import java.awt.Rectangle; 4 6 5 7 import javax.swing.BorderFactory; 6 8 import javax.swing.JPanel; 7 8 import java.awt.Color;9 import java.awt.Rectangle;10 import java.awt.event.ActionListener;11 12 9 import javax.swing.ButtonGroup; 13 10 import javax.swing.ImageIcon; … … 21 18 import oseam.seamarks.SeaMark.Shp; 22 19 import oseam.seamarks.SeaMark.Obj; 20 import oseam.seamarks.SeaMark.Ent; 23 21 24 22 public class PanelSpec extends JPanel { … … 37 35 private JRadioButton towerButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TowerButton.png"))); 38 36 private EnumMap<Shp, JRadioButton> shapes = new EnumMap<Shp, JRadioButton>(Shp.class); 37 private EnumMap<Shp, Obj> objects = new EnumMap<Shp, Obj>(Shp.class); 39 38 private PanelCol panelCol = null; 40 39 private ActionListener alShape = new ActionListener() { … … 46 45 if (button.isSelected()) { 47 46 dlg.mark.setShape(shp); 47 dlg.mark.setObject(objects.get(shp)); 48 48 button.setBorderPainted(true); 49 49 } else … … 57 57 public PanelSpec(OSeaMAction dia) { 58 58 dlg = dia; 59 panelCol = new PanelCol(dlg, Obj.BODY);59 panelCol = new PanelCol(dlg, Ent.BODY); 60 60 panelCol.setBounds(new Rectangle(9, 0, 34, 160)); 61 61 62 62 this.setLayout(null); 63 63 this.add(panelCol, null); 64 this.add(getShapeButton(pillarButton, 55, 0, 34, 32, "PillarTip", Shp.PILLAR ), null);65 this.add(getShapeButton(sparButton, 55, 32, 34, 32, "SparTip", Shp.SPAR ), null);66 this.add(getShapeButton(canButton, 55, 64, 34, 32, "CanTip", Shp.CAN ), null);67 this.add(getShapeButton(coneButton, 55, 96, 34, 32, "ConeTip", Shp.CONE ), null);68 this.add(getShapeButton(sphereButton, 55, 128, 34, 32, "SphereTip", Shp.SPHERE ), null);69 this.add(getShapeButton(barrelButton, 90, 0, 34, 32, "BarrelTip", Shp.BARREL ), null);70 this.add(getShapeButton(superButton, 90, 32, 34, 32, "SuperTip", Shp.SUPER ), null);71 this.add(getShapeButton(floatButton, 90, 64, 34, 32, "FloatTip", Shp.FLOAT ), null);72 this.add(getShapeButton(beaconButton, 90, 96, 34, 32, "BeaconTip", Shp.BEACON ), null);73 this.add(getShapeButton(towerButton, 90, 128, 34, 32, "TowerTip", Shp.TOWER ), null);64 this.add(getShapeButton(pillarButton, 55, 0, 34, 32, "PillarTip", Shp.PILLAR, Obj.BOYSPP), null); 65 this.add(getShapeButton(sparButton, 55, 32, 34, 32, "SparTip", Shp.SPAR, Obj.BOYSPP), null); 66 this.add(getShapeButton(canButton, 55, 64, 34, 32, "CanTip", Shp.CAN, Obj.BOYSPP), null); 67 this.add(getShapeButton(coneButton, 55, 96, 34, 32, "ConeTip", Shp.CONE, Obj.BOYSPP), null); 68 this.add(getShapeButton(sphereButton, 55, 128, 34, 32, "SphereTip", Shp.SPHERE, Obj.BOYSPP), null); 69 this.add(getShapeButton(barrelButton, 90, 0, 34, 32, "BarrelTip", Shp.BARREL, Obj.BOYSPP), null); 70 this.add(getShapeButton(superButton, 90, 32, 34, 32, "SuperTip", Shp.SUPER, Obj.BOYSPP), null); 71 this.add(getShapeButton(floatButton, 90, 64, 34, 32, "FloatTip", Shp.FLOAT, Obj.LITFLT), null); 72 this.add(getShapeButton(beaconButton, 90, 96, 34, 32, "BeaconTip", Shp.BEACON, Obj.BCNSPP), null); 73 this.add(getShapeButton(towerButton, 90, 128, 34, 32, "TowerTip", Shp.TOWER, Obj.BCNSPP), null); 74 74 } 75 75 … … 78 78 } 79 79 80 private JRadioButton getShapeButton(JRadioButton button, int x, int y, int w, int h, String tip, Shp shp ) {80 private JRadioButton getShapeButton(JRadioButton button, int x, int y, int w, int h, String tip, Shp shp, Obj obj) { 81 81 button.setBounds(new Rectangle(x, y, w, h)); 82 82 button.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 83 83 button.setToolTipText(Messages.getString(tip)); 84 84 button.addActionListener(alShape); 85 shapeButtons.add(button); 85 86 shapes.put(shp, button); 86 shapeButtons.add(button);87 objects.put(shp, obj); 87 88 return button; 88 89 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelStbd.java
r24872 r24885 1 1 package oseam.panels; 2 2 3 import java.awt.event.ActionListener; 4 import java.awt.Color; 5 import java.awt.Rectangle; 6 7 import javax.swing.ButtonGroup; 8 import javax.swing.ImageIcon; 9 import javax.swing.JRadioButton; 3 10 import javax.swing.BorderFactory; 4 11 import javax.swing.JPanel; 5 12 6 import java.awt.Color; 7 import java.awt.Dimension; 8 import java.awt.Rectangle; 9 import java.awt.Font; 10 11 import javax.swing.ButtonGroup; 12 import javax.swing.ImageIcon; 13 import javax.swing.JLabel; 14 import javax.swing.JTextField; 15 import javax.swing.JComboBox; 16 import javax.swing.JCheckBox; 17 import javax.swing.JRadioButton; 13 import java.util.EnumMap; 14 import java.util.Iterator; 18 15 19 16 import oseam.Messages; 20 17 import oseam.dialogs.OSeaMAction; 21 18 import oseam.seamarks.SeaMark.Shp; 22 23 import java.awt.Cursor; 24 import java.awt.event.ActionListener; 25 import java.util.EnumMap; 26 import java.util.Iterator; 19 import oseam.seamarks.SeaMark.Obj; 27 20 28 21 public class PanelStbd extends JPanel { … … 48 41 public JRadioButton perchButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PerchSButton.png"))); 49 42 private EnumMap<Shp, JRadioButton> shapes = new EnumMap<Shp, JRadioButton>(Shp.class); 43 private EnumMap<Shp, Obj> objects = new EnumMap<Shp, Obj>(Shp.class); 50 44 private ActionListener alShape = new ActionListener() { 51 45 public void actionPerformed(java.awt.event.ActionEvent e) { … … 56 50 if (button.isSelected()) { 57 51 dlg.mark.setShape(shp); 52 dlg.mark.setObject(objects.get(shp)); 58 53 button.setBorderPainted(true); 59 54 } else … … 70 65 this.add(getRegionButton(regionAButton, 0, 2, 34, 30, "RegionATip"), null); 71 66 this.add(getRegionButton(regionBButton, 0, 32, 34, 30, "RegionBTip"), null); 72 this.add(getShapeButton(pillarButton, 0, 64, 34, 32, "PillarTip", Shp.PILLAR ), null);73 this.add(getShapeButton(sparButton, 0, 96, 34, 32, "SparTip", Shp.SPAR ), null);74 this.add(getShapeButton(coneButton, 0, 128, 34, 32, "ConeTip", Shp.CONE ), null);75 this.add(getShapeButton(floatButton, 35, 0, 34, 32, "FloatTip", Shp.FLOAT ), null);76 this.add(getShapeButton(beaconButton, 35, 32, 34, 32, "BeaconTip", Shp.BEACON ), null);77 this.add(getShapeButton(towerButton, 35, 64, 34, 32, "TowerTip", Shp.TOWER ), null);78 this.add(getShapeButton(perchButton, 35, 96, 34, 32, "PerchTip", Shp.PERCH ), null);67 this.add(getShapeButton(pillarButton, 0, 64, 34, 32, "PillarTip", Shp.PILLAR, Obj.BOYLAT), null); 68 this.add(getShapeButton(sparButton, 0, 96, 34, 32, "SparTip", Shp.SPAR, Obj.BOYLAT), null); 69 this.add(getShapeButton(coneButton, 0, 128, 34, 32, "ConeTip", Shp.CONE, Obj.BOYLAT), null); 70 this.add(getShapeButton(floatButton, 35, 0, 34, 32, "FloatTip", Shp.FLOAT, Obj.LITFLT), null); 71 this.add(getShapeButton(beaconButton, 35, 32, 34, 32, "BeaconTip", Shp.BEACON, Obj.BCNLAT), null); 72 this.add(getShapeButton(towerButton, 35, 64, 34, 32, "TowerTip", Shp.TOWER, Obj.BCNLAT), null); 73 this.add(getShapeButton(perchButton, 35, 96, 34, 32, "PerchTip", Shp.PERCH, Obj.BCNLAT), null); 79 74 } 80 75 … … 93 88 } 94 89 95 private JRadioButton getShapeButton(JRadioButton button, int x, int y, int w, int h, String tip, Shp shp ) {90 private JRadioButton getShapeButton(JRadioButton button, int x, int y, int w, int h, String tip, Shp shp, Obj obj) { 96 91 button.setBounds(new Rectangle(x, y, w, h)); 97 92 button.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); … … 100 95 shapeButtons.add(button); 101 96 shapes.put(shp, button); 97 objects.put(shp, obj); 102 98 return button; 103 99 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelTop.java
r24881 r24885 16 16 import oseam.dialogs.OSeaMAction; 17 17 import oseam.seamarks.SeaMark.Top; 18 import oseam.seamarks.SeaMark. Obj;18 import oseam.seamarks.SeaMark.Ent; 19 19 20 20 public class PanelTop extends JPanel { … … 57 57 public PanelTop(OSeaMAction dia) { 58 58 dlg = dia; 59 panelCol = new PanelCol(dlg, Obj.TOPMARK);59 panelCol = new PanelCol(dlg, Ent.TOPMARK); 60 60 panelCol.setBounds(new Rectangle(0, 0, 34, 160)); 61 61 this.setLayout(null); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkCard.java
r24881 r24885 149 149 super.paintSign(); 150 150 } 151 152 public void saveSign() {153 if (dlg.node == null)154 return;155 else156 super.saveSign();157 158 String shape = "";159 160 switch (getShape()) {161 case PILLAR:162 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_cardinal"));163 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_cardinal:shape", "pillar"));164 break;165 case SPAR:166 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_cardinal"));167 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_cardinal:shape", "spar"));168 break;169 case BEACON:170 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "beacon_cardinal"));171 break;172 case TOWER:173 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "beacon_cardinal"));174 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_cardinal:shape", "tower"));175 break;176 case FLOAT:177 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "light_float"));178 break;179 default:180 }181 switch (getShape()) {182 case PILLAR:183 case SPAR:184 switch (getCategory()) {185 case CARD_NORTH:186 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_cardinal:category", "north"));187 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_cardinal:colour", "black;yellow"));188 shape = "2 cones up";189 break;190 case CARD_EAST:191 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_cardinal:category", "east"));192 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_cardinal:colour", "black;yellow;black"));193 shape = "2 cones base together";194 break;195 case CARD_SOUTH:196 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_cardinal:category", "south"));197 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_cardinal:colour", "yellow;black"));198 shape = "2 cones down";199 break;200 case CARD_WEST:201 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_cardinal:category", "west"));202 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_cardinal:colour", "yellow;black;yellow"));203 shape = "2 cones point together";204 break;205 }206 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_cardinal:colour_pattern", "horizontal stripes"));207 break;208 case BEACON:209 case TOWER:210 switch (getCategory()) {211 case CARD_NORTH:212 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_cardinal:category", "north"));213 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_cardinal:colour", "black;yellow"));214 shape = "2 cones up";215 break;216 case CARD_EAST:217 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_cardinal:category", "east"));218 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_cardinal:colour", "black;yellow;black"));219 shape = "2 cones base together";220 break;221 case CARD_SOUTH:222 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_cardinal:category", "south"));223 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_cardinal:colour", "yellow;black"));224 shape = "2 cones down";225 break;226 case CARD_WEST:227 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_cardinal:category", "west"));228 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_cardinal:colour", "yellow;black;yellow"));229 shape = "2 cones point together";230 break;231 }232 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_cardinal:colour_pattern", "horizontal stripes"));233 break;234 case FLOAT:235 switch (getCategory()) {236 case CARD_NORTH:237 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour", "black;yellow"));238 shape = "2 cones up";239 break;240 case CARD_EAST:241 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour", "black;yellow;black"));242 shape = "2 cones base together";243 break;244 case CARD_SOUTH:245 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour", "yellow;black"));246 shape = "2 cones down";247 break;248 case CARD_WEST:249 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour", "yellow;black;yellow"));250 shape = "2 cones point together";251 break;252 }253 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour_pattern", "horizontal stripes"));254 break;255 }256 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:topmark:shape", shape));257 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:topmark:colour", "black"));258 }259 260 151 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkIsol.java
r24881 r24885 102 102 super.paintSign(); 103 103 } 104 105 public void saveSign() {106 107 if (dlg.node == null)108 return;109 else110 super.saveSign();111 switch (getShape()) {112 case PILLAR:113 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_isolated_danger"));114 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_isolated_danger:shape", "pillar"));115 break;116 case SPAR:117 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_isolated_danger"));118 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_isolated_danger:shape", "spar"));119 break;120 case BEACON:121 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "beacon_isolated_danger"));122 break;123 case TOWER:124 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "beacon_isolated_danger"));125 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_isolated_danger:shape", "tower"));126 break;127 case FLOAT:128 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "light_float"));129 break;130 default:131 }132 switch (getShape()) {133 case PILLAR:134 case SPAR:135 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_isolated_danger:colour_pattern",136 "horizontal stripes"));137 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_isolated_danger:colour", "black;red;black"));138 break;139 case BEACON:140 case TOWER:141 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_isolated_danger:colour_pattern",142 "horizontal stripes"));143 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_isolated_danger:colour", "black;red;black"));144 break;145 case FLOAT:146 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour_pattern", "horizontal stripes"));147 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour", "black;red;black"));148 break;149 }150 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:topmark:shape", "2 spheres"));151 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:topmark:colour", "black"));152 }153 104 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkLat.java
r24881 r24885 470 470 super.paintSign(); 471 471 } 472 473 public void saveSign() {474 475 if (dlg.node == null)476 return;477 else478 super.saveSign();479 480 Cat cat = getCategory();481 String shape = "";482 String colour = "";483 484 switch (cat) {485 486 case LAT_PORT:487 switch (getShape()) {488 case CAN:489 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_lateral"));490 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "can"));491 break;492 case PILLAR:493 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_lateral"));494 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "pillar"));495 break;496 case SPAR:497 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_lateral"));498 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "spar"));499 break;500 case BEACON:501 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "beacon_lateral"));502 break;503 case TOWER:504 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "beacon_lateral"));505 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:shape", "tower"));506 break;507 case FLOAT:508 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "light_float"));509 break;510 case PERCH:511 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "beacon_lateral"));512 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:shape", "perch"));513 break;514 default:515 }516 switch (getShape()) {517 case CAN:518 case PILLAR:519 case SPAR:520 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:category", "port"));521 if (getRegion() == IALA_A) {522 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:colour", "red"));523 colour = "red";524 } else {525 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:colour", "green"));526 colour = "green";527 }528 break;529 case PERCH:530 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:category", "port"));531 break;532 case BEACON:533 case TOWER:534 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:category", "port"));535 if (getRegion() == IALA_A) {536 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:colour", "red"));537 colour = "red";538 } else {539 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:colour", "green"));540 colour = "green";541 }542 break;543 case FLOAT:544 if (getRegion() == IALA_A) {545 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour", "red"));546 colour = "red";547 } else {548 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour", "green"));549 colour = "green";550 }551 break;552 }553 shape = "cylinder";554 break;555 556 case LAT_PREF_PORT:557 switch (getShape()) {558 case CAN:559 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_lateral"));560 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "can"));561 break;562 case PILLAR:563 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_lateral"));564 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "pillar"));565 break;566 case SPAR:567 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_lateral"));568 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "spar"));569 break;570 case BEACON:571 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "beacon_lateral"));572 break;573 case TOWER:574 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "beacon_lateral"));575 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:shape", "tower"));576 break;577 case FLOAT:578 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "light_float"));579 break;580 default:581 }582 switch (getShape()) {583 case CAN:584 case PILLAR:585 case SPAR:586 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:category", "preferred_channel_port"));587 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:colour_pattern", "horizontal stripes"));588 if (getRegion() == IALA_A) {589 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:colour", "red;green;red"));590 colour = "red";591 } else {592 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:colour", "green;red;green"));593 colour = "green";594 }595 break;596 case BEACON:597 case TOWER:598 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:category", "preferred_channel_port"));599 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:colour_pattern", "horizontal stripes"));600 if (getRegion() == IALA_A) {601 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:colour", "red;green;red"));602 colour = "red";603 } else {604 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:colour", "green;red;green"));605 colour = "green";606 }607 break;608 case FLOAT:609 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour_pattern", "horizontal stripes"));610 if (getRegion() == IALA_A) {611 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour", "red;green;red"));612 colour = "red";613 } else {614 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour", "green;red;green"));615 colour = "green";616 }617 break;618 }619 shape = "cylinder";620 break;621 622 case LAT_STBD:623 switch (getShape()) {624 case CONE:625 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_lateral"));626 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "conical"));627 break;628 case PILLAR:629 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_lateral"));630 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "pillar"));631 break;632 case SPAR:633 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_lateral"));634 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "spar"));635 break;636 case BEACON:637 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "beacon_lateral"));638 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:shape", "stake"));639 break;640 case TOWER:641 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "beacon_lateral"));642 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:shape", "tower"));643 break;644 case FLOAT:645 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "light_float"));646 break;647 case PERCH:648 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "beacon_lateral"));649 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:shape", "perch"));650 break;651 default:652 }653 switch (getShape()) {654 case CAN:655 case PILLAR:656 case SPAR:657 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:category", "starboard"));658 if (getRegion() == IALA_A) {659 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:colour", "green"));660 colour = "green";661 } else {662 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:colour", "red"));663 colour = "red";664 }665 break;666 case BEACON:667 case TOWER:668 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:category", "starboard"));669 if (getRegion() == IALA_A) {670 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:colour", "green"));671 colour = "green";672 } else {673 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:colour", "red"));674 colour = "red";675 }676 break;677 case FLOAT:678 if (getRegion() == IALA_A) {679 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour", "green"));680 colour = "green";681 } else {682 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour", "red"));683 colour = "red";684 }685 break;686 case PERCH:687 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:category", "starboard"));688 break;689 }690 shape = "cone, point up";691 break;692 693 case LAT_PREF_STBD:694 switch (getShape()) {695 case CONE:696 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_lateral"));697 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "conical"));698 break;699 case PILLAR:700 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_lateral"));701 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "pillar"));702 break;703 case SPAR:704 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_lateral"));705 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "spar"));706 break;707 case BEACON:708 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "beacon_lateral"));709 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:shape", "stake"));710 break;711 case TOWER:712 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "beacon_lateral"));713 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:shape", "tower"));714 break;715 case FLOAT:716 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "light_float"));717 break;718 default:719 }720 switch (getShape()) {721 case CAN:722 case PILLAR:723 case SPAR:724 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:category", "preferred_channel_starboard"));725 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:colour_pattern", "horizontal stripes"));726 if (getRegion() == IALA_A) {727 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:colour", "green;red;green"));728 colour = "green";729 } else {730 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:colour", "red;green;red"));731 colour = "red";732 }733 break;734 case BEACON:735 case TOWER:736 Main.main.undoRedo737 .add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:category", "preferred_channel_starboard"));738 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:colour_pattern", "horizontal stripes"));739 if (getRegion() == IALA_A) {740 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:colour", "green;red;green"));741 colour = "green";742 } else {743 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:colour", "red;green;red"));744 colour = "red";745 }746 break;747 case FLOAT:748 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour_pattern", "horizontal stripes"));749 if (getRegion() == IALA_A) {750 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour", "green;red;green"));751 colour = "green";752 } else {753 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour", "red;green;red"));754 colour = "red";755 }756 break;757 }758 shape = "cone, point up";759 break;760 761 default:762 }763 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:topmark:shape", shape));764 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:topmark:colour", colour));765 766 Main.pref.put("tomsplugin.IALA", getRegion() ? "B" : "A");767 }768 472 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkLight.java
r24881 r24885 82 82 } 83 83 84 public void saveSign() {85 if (dlg.node == null)86 return;87 else88 super.saveSign();89 90 switch (getCategory()) {91 case LIGHT_HOUSE:92 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "landmark"));93 break;94 case LIGHT_MAJOR:95 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "light_major"));96 break;97 case LIGHT_MINOR:98 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "light_minor"));99 break;100 case LIGHT_VESSEL:101 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "light_vessel"));102 break;103 case LIGHT_FLOAT:104 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "light_float"));105 break;106 default:107 }108 }109 110 84 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkSaw.java
r24881 r24885 133 133 super.paintSign(); 134 134 } 135 136 public void saveSign() {137 if (dlg.node == null)138 return;139 else140 super.saveSign();141 142 switch (getShape()) {143 case PILLAR:144 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_safe_water"));145 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_safe_water:shape", "pillar"));146 break;147 case SPAR:148 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_safe_water"));149 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_safe_water:shape", "spar"));150 break;151 case SPHERE:152 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_safe_water"));153 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_safe_water:shape", "sphere"));154 break;155 case BEACON:156 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "beacon_safe_water"));157 break;158 case FLOAT:159 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "light_float"));160 break;161 default:162 }163 switch (getShape()) {164 case PILLAR:165 case SPAR:166 case SPHERE:167 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_safe_water:colour_pattern", "vertical stripes"));168 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_safe_water:colour", "red;white"));169 break;170 case BEACON:171 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_safe_water:colour_pattern", "vertical stripes"));172 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_safe_water:colour", "red;white"));173 break;174 case FLOAT:175 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour_pattern", "vertical stripes"));176 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour", "red;white"));177 break;178 default:179 }180 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:topmark:shape", "sphere"));181 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:topmark:colour", "red"));182 }183 135 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkSpec.java
r24881 r24885 11 11 import oseam.seamarks.SeaMark; 12 12 import oseam.seamarks.SeaMark.Col; 13 import oseam.seamarks.SeaMark.Ent; 13 14 14 15 public class MarkSpec extends SeaMark { … … 161 162 super.paintSign(); 162 163 } 163 164 public void saveSign() {165 if (dlg.node == null)166 return;167 else168 super.saveSign();169 170 switch (getShape()) {171 case PILLAR:172 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_special_purpose"));173 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:shape", "pillar"));174 saveColour(Obj.BUOY);175 break;176 case SPAR:177 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_special_purpose"));178 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:shape", "spar"));179 saveColour(Obj.BUOY);180 break;181 case CAN:182 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_special_purpose"));183 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:shape", "can"));184 saveColour(Obj.BUOY);185 break;186 case CONE:187 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_special_purpose"));188 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:shape", "conical"));189 saveColour(Obj.BUOY);190 break;191 case SPHERE:192 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_special_purpose"));193 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:shape", "sphere"));194 saveColour(Obj.BUOY);195 break;196 case BARREL:197 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_special_purpose"));198 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:shape", "barrel"));199 saveColour(Obj.BUOY);200 break;201 case SUPER:202 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_special_purpose"));203 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:shape", "super-buoy"));204 saveColour(Obj.BUOY);205 break;206 case FLOAT:207 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "light_float"));208 saveColour(Obj.FLOAT);209 break;210 case BEACON:211 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "beacon_special_purpose"));212 saveColour(Obj.BEACON);213 break;214 case TOWER:215 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "beacon_special_purpose"));216 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_special_purpose:shape", "tower"));217 saveColour(Obj.BEACON);218 break;219 default:220 }221 if (hasTopmark()) {222 switch (getTopmark()) {223 case X_SHAPE:224 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:topmark:shape", "x-shape"));225 break;226 }227 saveColour(Obj.TOPMARK);228 }229 }230 231 private void saveColour(Obj obj) {232 String str = "";233 switch (obj) {234 case BUOY:235 str = "seamark:buoy_special_purpose:colour";236 break;237 case BEACON:238 str = "seamark:beacon_special_purpose:colour";239 break;240 case FLOAT:241 str = "seamark:light_float:colour";242 break;243 case TOPMARK:244 str = "seamark:topmark:colour";245 break;246 }247 switch (getColour(obj)) {248 case WHITE:249 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, str, "white"));250 break;251 case RED:252 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, str, "red"));253 break;254 case ORANGE:255 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, str, "orange"));256 break;257 case AMBER:258 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, str, "amber"));259 break;260 case YELLOW:261 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, str, "yellow"));262 break;263 case GREEN:264 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, str, "green"));265 break;266 case BLUE:267 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, str, "blue"));268 break;269 case VIOLET:270 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, str, "violet"));271 break;272 case BLACK:273 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, str, "black"));274 break;275 }276 }277 164 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/SeaMark.java
r24881 r24885 6 6 import java.util.regex.Pattern; 7 7 8 import javax.swing.ImageIcon;9 10 8 import org.openstreetmap.josm.Main; 11 9 import org.openstreetmap.josm.command.ChangePropertyCommand; 12 import org.openstreetmap.josm.data.osm.Node;13 10 14 11 import oseam.dialogs.OSeaMAction; … … 44 41 } 45 42 43 private String name; 44 45 public String getName() { 46 return name; 47 } 48 49 public void setName(String nam) { 50 name = nam; 51 } 52 53 public enum Obj { 54 UNKNOWN, BCNCAR, BCNISD, BCNLAT, BCNSAW, BCNSPP, BOYCAR, BOYISD, BOYLAT, BOYSAW, BOYSPP, LIGHTS, LITFLT, LITVES, LNDMRK 55 } 56 57 private Obj object = Obj.UNKNOWN; 58 59 public Obj getObject() { 60 return object; 61 } 62 63 public void setObject(Obj obj) { 64 object = obj; 65 } 66 67 public enum Ent { 68 BODY, BUOY, BEACON, FLOAT, TOPMARK, LIGHT 69 } 70 46 71 public enum Col { 47 72 UNKNOWN, WHITE, RED, ORANGE, AMBER, YELLOW, GREEN, BLUE, VIOLET, BLACK, RED_GREEN_RED, GREEN_RED_GREEN, RED_WHITE, BLACK_YELLOW, BLACK_YELLOW_BLACK, YELLOW_BLACK, YELLOW_BLACK_YELLOW, BLACK_RED_BLACK 48 73 } 49 74 50 public enum Obj {51 BODY, BUOY, BEACON, FLOAT, TOPMARK, LIGHT52 }53 54 75 private Col bodyColour = Col.UNKNOWN; 55 76 56 public Col getColour( Obj obj) {57 switch ( obj) {77 public Col getColour(Ent ent) { 78 switch (ent) { 58 79 case BODY: 59 80 case BUOY: … … 69 90 } 70 91 71 public void setColour( Obj obj, Col col) {72 switch ( obj) {92 public void setColour(Ent ent, Col col) { 93 switch (ent) { 73 94 case BODY: 74 95 case BUOY: … … 84 105 break; 85 106 } 86 }87 88 private String name;89 90 public String getName() {91 return name;92 }93 94 public void setName(String nam) {95 name = nam;96 107 } 97 108 … … 636 647 String str; 637 648 649 Main.pref.put("tomsplugin.IALA", getRegion() ? "B" : "A"); 650 638 651 while (it.hasNext()) { 639 652 str = it.next(); … … 643 656 } 644 657 } 645 str = dlg.panelMain.nameBox.getText(); 646 if (!str.isEmpty()) 647 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:name", str)); 648 658 if (!name.isEmpty()) 659 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:name", name)); 660 661 String objStr = ""; 662 switch (object) { 663 case BCNCAR: 664 objStr = "beacon_cardinal"; 665 break; 666 case BCNISD: 667 objStr = "beacon_isolated_danger"; 668 break; 669 case BCNLAT: 670 objStr = "beacon_lateral"; 671 break; 672 case BCNSAW: 673 objStr = "beacon_safe_water"; 674 break; 675 case BCNSPP: 676 objStr = "beacon_special_purpose"; 677 break; 678 case BOYCAR: 679 objStr = "buoy_cardinal"; 680 break; 681 case BOYISD: 682 objStr = "buoy_isolated_danger"; 683 break; 684 case BOYLAT: 685 objStr = "buoy_lateral"; 686 break; 687 case BOYSAW: 688 objStr = "buoy_safe_water"; 689 break; 690 case BOYSPP: 691 objStr = "buoy_special_purpose"; 692 break; 693 case LIGHTS: 694 if (category == Cat.LIGHT_MAJOR) 695 objStr = "light_major"; 696 else 697 objStr = "light_minor"; 698 break; 699 case LITFLT: 700 objStr = "light_float"; 701 break; 702 case LITVES: 703 objStr = "light_vessel"; 704 break; 705 case LNDMRK: 706 objStr = "landmark"; 707 break; 708 } 709 if (!objStr.isEmpty()) { 710 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", objStr)); 711 712 switch (category) { 713 case LAT_PORT: 714 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":category", "port")); 715 break; 716 case LAT_STBD: 717 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":category", "starboard")); 718 break; 719 case LAT_PREF_PORT: 720 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":category", "preferred_channel_port")); 721 break; 722 case LAT_PREF_STBD: 723 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":category", "preferred_channel_starboard")); 724 break; 725 case CARD_NORTH: 726 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":category", "north")); 727 break; 728 case CARD_EAST: 729 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":category", "east")); 730 break; 731 case CARD_SOUTH: 732 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":category", "south")); 733 break; 734 case CARD_WEST: 735 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":category", "west")); 736 break; 737 } 738 739 switch (shape) { 740 case PILLAR: 741 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":shape", "pillar")); 742 break; 743 case SPAR: 744 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":shape", "spar")); 745 break; 746 case CAN: 747 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":shape", "can")); 748 break; 749 case CONE: 750 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":shape", "conical")); 751 break; 752 case SPHERE: 753 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":shape", "sphere")); 754 break; 755 case BARREL: 756 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":shape", "barrel")); 757 break; 758 case SUPER: 759 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":shape", "super-buoy")); 760 break; 761 case TOWER: 762 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":shape", "tower")); 763 break; 764 case STAKE: 765 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":shape", "stake")); 766 break; 767 case PERCH: 768 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":shape", "perch")); 769 break; 770 } 771 772 switch (bodyColour) { 773 case WHITE: 774 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour", "white")); 775 break; 776 case RED: 777 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour", "red")); 778 break; 779 case ORANGE: 780 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour", "orange")); 781 break; 782 case AMBER: 783 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour", "amber")); 784 break; 785 case YELLOW: 786 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour", "yellow")); 787 break; 788 case GREEN: 789 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour", "green")); 790 break; 791 case BLUE: 792 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour", "blue")); 793 break; 794 case VIOLET: 795 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour", "violet")); 796 break; 797 case BLACK: 798 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour", "black")); 799 break; 800 case RED_GREEN_RED: 801 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour", "red;green;red")); 802 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour_pattern", "horizontal stripes")); 803 break; 804 case GREEN_RED_GREEN: 805 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour", "green;red;green")); 806 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour_pattern", "horizontal stripes")); 807 break; 808 case RED_WHITE: 809 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour", "red;white")); 810 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour_pattern", "vertical stripes")); 811 break; 812 case BLACK_YELLOW: 813 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour", "black;yellow")); 814 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour_pattern", "horizontal stripes")); 815 break; 816 case BLACK_YELLOW_BLACK: 817 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour", "black;yellow;black")); 818 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour_pattern", "horizontal stripes")); 819 break; 820 case YELLOW_BLACK: 821 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour", "yellow;black")); 822 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour_pattern", "horizontal stripes")); 823 break; 824 case YELLOW_BLACK_YELLOW: 825 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour", "yellow;black;yellow")); 826 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour_pattern", "horizontal stripes")); 827 break; 828 case BLACK_RED_BLACK: 829 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour", "black;red;black")); 830 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour_pattern", "horizontal stripes")); 831 break; 832 } 833 } 834 835 String top = ""; 836 switch (topShape) { 837 case CAN: 838 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:topmark:shape", "cylinder")); 839 top = "top"; 840 break; 841 case CONE: 842 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:topmark:shape", "cone, point up")); 843 top = "top"; 844 break; 845 case SPHERE: 846 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:topmark:shape", "sphere")); 847 top = "top"; 848 break; 849 case X_SHAPE: 850 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:topmark:shape", "x-shape")); 851 top = "top"; 852 break; 853 case NORTH: 854 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:topmark:shape", "2 cones up")); 855 top = "top"; 856 break; 857 case SOUTH: 858 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:topmark:shape", "2 cones down")); 859 top = "top"; 860 break; 861 case EAST: 862 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:topmark:shape", "2 cones base together")); 863 top = "top"; 864 break; 865 case WEST: 866 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:topmark:shape", "2 cones points together")); 867 top = "top"; 868 break; 869 case SPHERES2: 870 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:topmark:shape", "2 spheres")); 871 top = "top"; 872 break; 873 case BOARD: 874 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:daymark:shape", "board")); 875 top = "day"; 876 break; 877 case DIAMOND: 878 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:daymark:shape", "diamond")); 879 top = "day"; 880 break; 881 case TRIANGLE: 882 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:daymark:shape", "triangle, point up")); 883 top = "day"; 884 break; 885 case TRIANGLE_INV: 886 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:daymark:shape", "triangle, point down")); 887 top = "day"; 888 break; 889 case SQUARE: 890 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:daymark:shape", "square")); 891 top = "day"; 892 break; 893 } 894 if (!top.isEmpty()) { 895 switch (topColour) { 896 case WHITE: 897 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + top + "mark:colour", "white")); 898 break; 899 case RED: 900 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + top + "mark:colour", "red")); 901 break; 902 case ORANGE: 903 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + top + "mark:colour", "orange")); 904 break; 905 case AMBER: 906 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + top + "mark:colour", "amber")); 907 break; 908 case YELLOW: 909 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + top + "mark:colour", "yellow")); 910 break; 911 case GREEN: 912 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + top + "mark:colour", "green")); 913 break; 914 case BLUE: 915 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + top + "mark:colour", "blue")); 916 break; 917 case VIOLET: 918 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + top + "mark:colour", "violet")); 919 break; 920 case BLACK: 921 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + top + "mark:colour", "black")); 922 break; 923 } 924 } 925 649 926 Col colour; 650 927 if (isFired()) {
Note:
See TracChangeset
for help on using the changeset viewer.