Changeset 26998 in osm for applications
- Timestamp:
- 2011-11-01T17:00:02+01:00 (13 years ago)
- Location:
- applications/editors/josm/plugins/smed/plugs/oseam/src/oseam
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/dialogs/OSeaMAction.java
r26970 r26998 40 40 } 41 41 } else { 42 node = null; 43 mark = null; 44 panelMain.syncPanel(); 42 45 manager.showVisualMessage(Messages.getString("OneNode")); 43 46 } … … 47 50 node = null; 48 51 mark = null; 52 panelMain.syncPanel(); 49 53 manager.showVisualMessage(Messages.getString("SelectNode")); 50 54 } … … 71 75 panelMain.setLayout(null); 72 76 panelMain.setSize(new Dimension(400, 360)); 77 node = null; 78 mark = null; 79 panelMain.syncPanel(); 73 80 } 74 81 return panelMain; -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelChan.java
r26989 r26998 25 25 private ActionListener alCat = new ActionListener() { 26 26 public void actionPerformed(java.awt.event.ActionEvent e) { 27 Shp shp = Shp.UNKNOWN; 28 if (dlg.mark != null) 29 shp = dlg.mark.getShape(); 27 Shp shp = dlg.mark.getShape(); 30 28 if (portButton.isSelected()) { 31 29 dlg.mark.setCategory(Cat.LAM_PORT); 32 if (panelPort.shapes.containsKey(shp)) { 33 panelPort.shapes.get(shp).doClick(); 34 } else { 30 if (!panelPort.shapes.containsKey(shp)) { 35 31 dlg.mark.setShape(Shp.UNKNOWN); 36 32 } … … 38 34 if (prefPortButton.isSelected()) { 39 35 dlg.mark.setCategory(Cat.LAM_PPORT); 40 if (panelPort.shapes.containsKey(shp)) { 41 panelPort.shapes.get(shp).doClick(); 42 } else { 36 if (!panelPort.shapes.containsKey(shp)) { 43 37 dlg.mark.setShape(Shp.UNKNOWN); 44 38 } … … 46 40 if (stbdButton.isSelected()) { 47 41 dlg.mark.setCategory(Cat.LAM_STBD); 48 if (panelStbd.shapes.containsKey(shp)) { 49 panelStbd.shapes.get(shp).doClick(); 50 } else { 42 if (!panelStbd.shapes.containsKey(shp)) { 51 43 dlg.mark.setShape(Shp.UNKNOWN); 52 44 } … … 54 46 if (prefStbdButton.isSelected()) { 55 47 dlg.mark.setCategory(Cat.LAM_PSTBD); 56 if (panelStbd.shapes.containsKey(shp)) { 57 panelStbd.shapes.get(shp).doClick(); 58 } else { 48 if (!panelStbd.shapes.containsKey(shp)) { 59 49 dlg.mark.setShape(Shp.UNKNOWN); 60 50 } … … 62 52 if (safeWaterButton.isSelected()) { 63 53 dlg.mark.setCategory(Cat.NONE); 64 if (panelSaw.shapes.containsKey(shp)) { 65 panelSaw.shapes.get(shp).doClick(); 66 } else { 54 if (!panelSaw.shapes.containsKey(shp)) { 67 55 dlg.mark.setShape(Shp.UNKNOWN); 68 56 } 69 57 } 70 58 syncPanel(); 59 dlg.mark.paintSign(); 71 60 } 72 61 }; … … 74 63 private ActionListener alTop = new ActionListener() { 75 64 public void actionPerformed(java.awt.event.ActionEvent e) { 76 if (dlg.mark != null) { 77 if (topmarkButton.isSelected()) { 78 if (SeaMark.GrpMAP.get(dlg.mark.getObject()) == Grp.SAW) { 79 dlg.mark.setTopmark(Top.SPHERE); 80 dlg.mark.setPattern(Ent.TOPMARK, Pat.NONE); 81 dlg.mark.setColour(Ent.TOPMARK, Col.RED); 82 } else { 83 switch (dlg.mark.getCategory()) { 84 case LAM_PORT: 85 case LAM_PPORT: 86 dlg.mark.setTopmark(Top.CAN); 87 switch (dlg.mark.getRegion()) { 88 case A: 89 dlg.mark.setPattern(Ent.TOPMARK, Pat.NONE); 90 dlg.mark.setColour(Ent.TOPMARK, Col.RED); 91 break; 92 case B: 93 dlg.mark.setPattern(Ent.TOPMARK, Pat.NONE); 94 dlg.mark.setColour(Ent.TOPMARK, Col.GREEN); 95 break; 96 case C: 97 dlg.mark.setPattern(Ent.TOPMARK, Pat.HORIZ); 98 dlg.mark.setColour(Ent.TOPMARK, Col.RED); 99 dlg.mark.addColour(Ent.TOPMARK, Col.WHITE); 100 break; 101 } 65 if (topmarkButton.isSelected()) { 66 if (SeaMark.GrpMAP.get(dlg.mark.getObject()) == Grp.SAW) { 67 dlg.mark.setTopmark(Top.SPHERE); 68 dlg.mark.setPattern(Ent.TOPMARK, Pat.NONE); 69 dlg.mark.setColour(Ent.TOPMARK, Col.RED); 70 } else { 71 switch (dlg.mark.getCategory()) { 72 case LAM_PORT: 73 case LAM_PPORT: 74 dlg.mark.setTopmark(Top.CAN); 75 switch (dlg.mark.getRegion()) { 76 case A: 77 dlg.mark.setPattern(Ent.TOPMARK, Pat.NONE); 78 dlg.mark.setColour(Ent.TOPMARK, Col.RED); 102 79 break; 103 case LAM_STBD: 104 case LAM_PSTBD: 105 dlg.panelMain.panelTop.coneTopButton.doClick(); 106 switch (dlg.mark.getRegion()) { 107 case A: 108 dlg.mark.setPattern(Ent.TOPMARK, Pat.NONE); 109 dlg.mark.setColour(Ent.TOPMARK, Col.GREEN); 110 break; 111 case B: 112 dlg.mark.setPattern(Ent.TOPMARK, Pat.NONE); 113 dlg.mark.setColour(Ent.TOPMARK, Col.RED); 114 break; 115 case C: 116 dlg.mark.setPattern(Ent.TOPMARK, Pat.HORIZ); 117 dlg.mark.setColour(Ent.TOPMARK, Col.GREEN); 118 dlg.mark.addColour(Ent.TOPMARK, Col.WHITE); 119 break; 120 } 80 case B: 81 dlg.mark.setPattern(Ent.TOPMARK, Pat.NONE); 82 dlg.mark.setColour(Ent.TOPMARK, Col.GREEN); 83 break; 84 case C: 85 dlg.mark.setPattern(Ent.TOPMARK, Pat.HORIZ); 86 dlg.mark.setColour(Ent.TOPMARK, Col.RED); 87 dlg.mark.addColour(Ent.TOPMARK, Col.WHITE); 121 88 break; 122 89 } 90 break; 91 case LAM_STBD: 92 case LAM_PSTBD: 93 dlg.panelMain.panelTop.coneTopButton.doClick(); 94 switch (dlg.mark.getRegion()) { 95 case A: 96 dlg.mark.setPattern(Ent.TOPMARK, Pat.NONE); 97 dlg.mark.setColour(Ent.TOPMARK, Col.GREEN); 98 break; 99 case B: 100 dlg.mark.setPattern(Ent.TOPMARK, Pat.NONE); 101 dlg.mark.setColour(Ent.TOPMARK, Col.RED); 102 break; 103 case C: 104 dlg.mark.setPattern(Ent.TOPMARK, Pat.HORIZ); 105 dlg.mark.setColour(Ent.TOPMARK, Col.GREEN); 106 dlg.mark.addColour(Ent.TOPMARK, Col.WHITE); 107 break; 108 } 109 break; 123 110 } 124 topmarkButton.setBorderPainted(true);125 } else {126 dlg.mark.setTopmark(Top.NONE);127 dlg.mark.setPattern(Ent.TOPMARK, Pat.NONE);128 dlg.mark.setColour(Ent.TOPMARK, Col.UNKNOWN);129 topmarkButton.setBorderPainted(false);130 111 } 131 dlg.panelMain.panelTop.syncPanel(); 132 dlg.mark.paintSign(); 112 topmarkButton.setBorderPainted(true); 113 } else { 114 dlg.mark.setTopmark(Top.NONE); 115 dlg.mark.setPattern(Ent.TOPMARK, Pat.NONE); 116 dlg.mark.setColour(Ent.TOPMARK, Col.UNKNOWN); 117 topmarkButton.setBorderPainted(false); 133 118 } 119 dlg.panelMain.panelTop.syncPanel(); 120 dlg.mark.paintSign(); 134 121 } 135 122 }; … … 162 149 this.add(topmarkButton); 163 150 } 164 151 165 152 public void syncPanel() { 166 if ( portButton.isSelected()) {153 if ((dlg.mark.getCategory() == Cat.LAM_PORT) || (dlg.mark.getCategory() == Cat.LAM_PPORT)) { 167 154 portButton.setBorderPainted(true); 168 155 panelPort.setVisible(true); 169 panelPort.perchButton.setVisible(true); 170 panelPort.stakeButton.setVisible(true); 156 panelPort.syncPanel(); 171 157 } else { 172 158 portButton.setBorderPainted(false); 173 159 panelPort.setVisible(false); 174 160 } 175 if (prefPortButton.isSelected()) { 176 prefPortButton.setBorderPainted(true); 177 panelPort.setVisible(true); 178 } else { 179 prefPortButton.setBorderPainted(false); 180 if (!portButton.isSelected()) 181 panelPort.setVisible(false); 182 } 183 if (stbdButton.isSelected()) { 161 if ((dlg.mark.getCategory() == Cat.LAM_STBD) || (dlg.mark.getCategory() == Cat.LAM_PSTBD)) { 184 162 stbdButton.setBorderPainted(true); 185 163 panelStbd.setVisible(true); 186 panelStbd.perchButton.setVisible(true); 187 panelStbd.stakeButton.setVisible(true); 164 panelStbd.syncPanel(); 188 165 } else { 189 166 stbdButton.setBorderPainted(false); 190 167 panelStbd.setVisible(false); 191 168 } 192 if (prefStbdButton.isSelected()) { 193 prefStbdButton.setBorderPainted(true); 194 panelStbd.setVisible(true); 195 } else { 196 prefStbdButton.setBorderPainted(false); 197 if (!stbdButton.isSelected()) 198 panelStbd.setVisible(false); 199 } 200 if (safeWaterButton.isSelected()) { 169 if (SeaMark.GrpMAP.get(dlg.mark.getObject()) == Grp.SAW) { 201 170 safeWaterButton.setBorderPainted(true); 202 171 panelSaw.setVisible(true); … … 206 175 } 207 176 if (dlg.mark.isValid()) { 177 topmarkButton.setBorderPainted(dlg.mark.hasTopmark()); 208 178 topmarkButton.setVisible(true); 209 179 dlg.panelMain.moreButton.setVisible(true); 180 panelSaw.syncPanel(); 210 181 } else { 211 182 topmarkButton.setVisible(false); 212 183 dlg.panelMain.moreButton.setVisible(false); 213 184 } 214 topmarkButton.setBorderPainted(topmarkButton.isSelected());215 topmarkButton.setVisible(dlg.mark.isValid());216 panelPort.syncPanel();217 panelStbd.syncPanel();218 panelSaw.syncPanel();219 220 185 } 221 186 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelCol.java
r26978 r26998 11 11 import oseam.Messages; 12 12 import oseam.dialogs.OSeaMAction; 13 import oseam.seamarks.SeaMark; 13 14 import oseam.seamarks.SeaMark.*; 14 15 … … 56 57 dlg.mark.setColour(ent, stackIdx, col); 57 58 } 58 sync Stack();59 syncPanel(); 59 60 } 60 61 dlg.mark.paintSign(); … … 121 122 } 122 123 123 public void sync Stack() {124 public void syncPanel() { 124 125 if (ent == Ent.LIGHT) { 125 126 } else { … … 151 152 JRadioButton btnI = stackCol.get(idx); 152 153 btnI.setBounds(2, (2 + (idx * height)), 30, height); 153 btnI.setBackground( oseam.seamarks.SeaMark.ColMAP.get(dlg.mark.getColour(ent, idx)));154 btnI.setBackground(SeaMark.ColMAP.get(dlg.mark.getColour(ent, idx))); 154 155 if (stackIdx == idx) { 155 156 btnI.setBorderPainted(true); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelFog.java
r26989 r26998 27 27 private ActionListener alFog = new ActionListener() { 28 28 public void actionPerformed(java.awt.event.ActionEvent e) { 29 if (dlg.mark != null) { 30 for (Fog fog : fogs.keySet()) { 31 JRadioButton button = fogs.get(fog); 32 if (button.isSelected()) { 33 dlg.mark.setFogSound(fog); 34 button.setBorderPainted(true); 35 } else 36 button.setBorderPainted(false); 37 } 38 dlg.mark.setFog(!noFogButton.isSelected()); 39 dlg.mark.paintSign(); 29 for (Fog fog : fogs.keySet()) { 30 JRadioButton button = fogs.get(fog); 31 if (button.isSelected()) { 32 dlg.mark.setFogSound(fog); 33 button.setBorderPainted(true); 34 } else 35 button.setBorderPainted(false); 40 36 } 37 dlg.mark.setFog(!noFogButton.isSelected()); 38 dlg.mark.paintSign(); 41 39 } 42 40 }; … … 45 43 private ActionListener alGroup = new ActionListener() { 46 44 public void actionPerformed(java.awt.event.ActionEvent e) { 47 if (dlg.mark != null) 48 dlg.mark.setFogGroup(groupBox.getText()); 45 dlg.mark.setFogGroup(groupBox.getText()); 49 46 } 50 47 }; … … 53 50 private ActionListener alPeriod = new ActionListener() { 54 51 public void actionPerformed(java.awt.event.ActionEvent e) { 55 if (dlg.mark != null) 56 dlg.mark.setFogPeriod(periodBox.getText()); 52 dlg.mark.setFogPeriod(periodBox.getText()); 57 53 } 58 54 }; … … 61 57 private ActionListener alSeq = new ActionListener() { 62 58 public void actionPerformed(java.awt.event.ActionEvent e) { 63 if (dlg.mark != null) 64 dlg.mark.setFogSequence(seqBox.getText()); 59 dlg.mark.setFogSequence(seqBox.getText()); 65 60 } 66 61 }; … … 69 64 private ActionListener alRange = new ActionListener() { 70 65 public void actionPerformed(java.awt.event.ActionEvent e) { 71 if (dlg.mark != null) 72 dlg.mark.setFogRange(rangeBox.getText()); 66 dlg.mark.setFogRange(rangeBox.getText()); 73 67 } 74 68 }; … … 119 113 120 114 } 121 115 122 116 public void syncPanel() { 123 117 for (Fog fog : fogs.keySet()) { -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelHaz.java
r26989 r26998 23 23 private ActionListener alCat = new ActionListener() { 24 24 public void actionPerformed(java.awt.event.ActionEvent e) { 25 Shp shp = Shp.UNKNOWN; 26 if (dlg.mark != null) { 27 shp = dlg.mark.getShape(); 28 dlg.panelMain.panelMore.panelPat.horizButton.doClick(); 29 if (northButton.isSelected()) { 30 dlg.mark.setCategory(Cat.CAM_NORTH); 31 dlg.mark.setColour(Ent.BODY, Col.BLACK); 32 dlg.mark.addColour(Ent.BODY, Col.YELLOW); 33 if (shapes.containsKey(shp)) 34 shapes.get(shp).doClick(); 35 northButton.setBorderPainted(true); 36 } else { 37 northButton.setBorderPainted(false); 38 } 39 if (southButton.isSelected()) { 40 dlg.mark.setCategory(Cat.CAM_SOUTH); 41 dlg.mark.setColour(Ent.BODY, Col.YELLOW); 42 dlg.mark.addColour(Ent.BODY, Col.BLACK); 43 if (shapes.containsKey(shp)) 44 shapes.get(shp).doClick(); 45 southButton.setBorderPainted(true); 46 } else { 47 southButton.setBorderPainted(false); 48 } 49 if (eastButton.isSelected()) { 50 dlg.mark.setCategory(Cat.CAM_EAST); 51 dlg.mark.setColour(Ent.BODY, Col.BLACK); 52 dlg.mark.addColour(Ent.BODY, Col.YELLOW); 53 dlg.mark.addColour(Ent.BODY, Col.BLACK); 54 if (shapes.containsKey(shp)) 55 shapes.get(shp).doClick(); 56 eastButton.setBorderPainted(true); 57 } else { 58 eastButton.setBorderPainted(false); 59 } 60 if (westButton.isSelected()) { 61 dlg.mark.setCategory(Cat.CAM_WEST); 62 dlg.mark.setColour(Ent.BODY, Col.YELLOW); 63 dlg.mark.addColour(Ent.BODY, Col.BLACK); 64 dlg.mark.addColour(Ent.BODY, Col.YELLOW); 65 if (shapes.containsKey(shp)) 66 shapes.get(shp).doClick(); 67 westButton.setBorderPainted(true); 68 } else { 69 westButton.setBorderPainted(false); 70 } 71 if (isolButton.isSelected()) { 72 dlg.mark.setCategory(Cat.NONE); 73 dlg.panelMain.panelMore.panelPat.panelCol.blackButton.doClick(); 74 dlg.mark.setColour(Ent.BODY, Col.BLACK); 75 dlg.mark.addColour(Ent.BODY, Col.RED); 76 dlg.mark.addColour(Ent.BODY, Col.BLACK); 77 if (shapes.containsKey(shp)) 78 shapes.get(shp).doClick(); 79 isolButton.setBorderPainted(true); 80 } else { 81 isolButton.setBorderPainted(false); 82 } 83 dlg.panelMain.panelMore.panelPat.panelCol.syncStack(); 84 dlg.mark.paintSign(); 85 } 25 dlg.mark.setPattern(Ent.BODY, Pat.HORIZ); 26 if (northButton.isSelected()) { 27 dlg.mark.setCategory(Cat.CAM_NORTH); 28 dlg.mark.setColour(Ent.BODY, Col.BLACK); 29 dlg.mark.addColour(Ent.BODY, Col.YELLOW); 30 northButton.setBorderPainted(true); 31 } else { 32 northButton.setBorderPainted(false); 33 } 34 if (southButton.isSelected()) { 35 dlg.mark.setCategory(Cat.CAM_SOUTH); 36 dlg.mark.setColour(Ent.BODY, Col.YELLOW); 37 dlg.mark.addColour(Ent.BODY, Col.BLACK); 38 southButton.setBorderPainted(true); 39 } else { 40 southButton.setBorderPainted(false); 41 } 42 if (eastButton.isSelected()) { 43 dlg.mark.setCategory(Cat.CAM_EAST); 44 dlg.mark.setColour(Ent.BODY, Col.BLACK); 45 dlg.mark.addColour(Ent.BODY, Col.YELLOW); 46 dlg.mark.addColour(Ent.BODY, Col.BLACK); 47 eastButton.setBorderPainted(true); 48 } else { 49 eastButton.setBorderPainted(false); 50 } 51 if (westButton.isSelected()) { 52 dlg.mark.setCategory(Cat.CAM_WEST); 53 dlg.mark.setColour(Ent.BODY, Col.YELLOW); 54 dlg.mark.addColour(Ent.BODY, Col.BLACK); 55 dlg.mark.addColour(Ent.BODY, Col.YELLOW); 56 westButton.setBorderPainted(true); 57 } else { 58 westButton.setBorderPainted(false); 59 } 60 if (isolButton.isSelected()) { 61 dlg.mark.setCategory(Cat.NONE); 62 dlg.mark.setColour(Ent.BODY, Col.BLACK); 63 dlg.mark.addColour(Ent.BODY, Col.RED); 64 dlg.mark.addColour(Ent.BODY, Col.BLACK); 65 isolButton.setBorderPainted(true); 66 } else { 67 isolButton.setBorderPainted(false); 68 } 69 syncPanel(); 70 dlg.panelMain.panelMore.syncPanel(); 71 dlg.mark.paintSign(); 86 72 } 87 73 }; … … 117 103 topmarkButton.setVisible(true); 118 104 dlg.panelMain.moreButton.setVisible(true); 105 dlg.panelMain.saveButton.setEnabled(true); 119 106 dlg.panelMain.topButton.setEnabled(true); 120 107 dlg.panelMain.fogButton.setEnabled(true); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelLights.java
r26989 r26998 27 27 dlg.mark.setCategory(cat); 28 28 } 29 checkValidity();30 29 } 31 30 }; … … 40 39 dlg.mark.setCategory(cat); 41 40 } 42 checkValidity();43 41 } 44 42 }; … … 76 74 warningCatBox.setVisible(false); 77 75 } 78 checkValidity();79 76 } 80 77 }; … … 137 134 } 138 135 139 private void checkValidity() { 140 if (dlg.mark != null) { 141 if (dlg.mark.getObject() != Obj.UNKNOWN) { 142 dlg.panelMain.fogButton.setEnabled(true); 143 dlg.panelMain.radButton.setEnabled(true); 144 dlg.panelMain.litButton.setEnabled(true); 145 dlg.panelMain.moreButton.setVisible(true); 146 } else { 147 dlg.panelMain.fogButton.setEnabled(false); 148 dlg.panelMain.radButton.setEnabled(false); 149 dlg.panelMain.litButton.setEnabled(false); 150 dlg.panelMain.moreButton.setVisible(false); 151 } 152 } 136 public void syncPanel() { 137 153 138 } 154 139 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelMain.java
r26989 r26998 9 9 import oseam.Messages; 10 10 import oseam.dialogs.OSeaMAction; 11 import oseam.seamarks.SeaMark .*;11 import oseam.seamarks.SeaMark; 12 12 13 13 public class PanelMain extends JPanel { … … 37 37 } 38 38 }; 39 p rivateJButton saveButton = null;39 public JButton saveButton = null; 40 40 private ActionListener alSave = new ActionListener() { 41 41 public void actionPerformed(java.awt.event.ActionEvent e) { … … 274 274 275 275 public void syncPanel() { 276 typeButtons.clearSelection(); 277 chanButton.setBorderPainted(false); 278 hazButton.setBorderPainted(false); 279 specButton.setBorderPainted(false); 280 lightsButton.setBorderPainted(false); 281 panelChan.setVisible(false); 282 panelHaz.setVisible(false); 283 panelSpec.setVisible(false); 284 panelLights.setVisible(false); 285 panelMore.setVisible(false); 286 colLabel.setText(""); 287 shapeIcon.setIcon(null); 288 lightIcon.setIcon(null); 289 topIcon.setIcon(null); 290 radarIcon.setIcon(null); 291 fogIcon.setIcon(null); 276 292 if (dlg.mark == null) { 277 293 topButton.setEnabled(false); … … 280 296 litButton.setEnabled(false); 281 297 moreButton.setVisible(false); 298 saveButton.setEnabled(false); 299 nameBox.setEnabled(false); 300 chanButton.setEnabled(false); 301 hazButton.setEnabled(false); 302 specButton.setEnabled(false); 303 lightsButton.setEnabled(false); 282 304 } else { 283 if (dlg.mark.isValid()) { 284 topButton.setEnabled(true); 285 fogButton.setEnabled(true); 286 radButton.setEnabled(true); 287 litButton.setEnabled(true); 288 moreButton.setVisible(true); 289 } else { 290 topButton.setEnabled(false); 291 fogButton.setEnabled(false); 292 radButton.setEnabled(false); 293 litButton.setEnabled(false); 294 moreButton.setVisible(false); 295 } 296 } 297 nameBox.setText(dlg.mark.getName()); 298 alType.actionPerformed(null); 299 alMisc.actionPerformed(null); 300 dlg.panelMain.panelChan.syncPanel(); 301 dlg.panelMain.panelHaz.syncPanel(); 302 dlg.panelMain.panelSpec.syncPanel(); 303 dlg.panelMain.panelMore.setVisible(false); 304 dlg.panelMain.panelMore.syncPanel(); 305 moreButton.setVisible(dlg.mark.isValid()); 306 dlg.panelMain.panelTop.syncPanel(); 307 dlg.panelMain.panelFog.syncPanel(); 308 dlg.panelMain.panelRadar.syncPanel(); 309 dlg.panelMain.panelLit.syncPanel(); 305 nameBox.setEnabled(true); 306 chanButton.setEnabled(true); 307 hazButton.setEnabled(true); 308 specButton.setEnabled(true); 309 lightsButton.setEnabled(true); 310 nameBox.setText(dlg.mark.getName()); 311 panelChan.setVisible(false); 312 panelHaz.setVisible(false); 313 panelSpec.setVisible(false); 314 panelLights.setVisible(false); 315 switch (SeaMark.GrpMAP.get(dlg.mark.getObject())) { 316 case LAT: 317 case SAW: 318 chanButton.setBorderPainted(true); 319 panelChan.setVisible(true); 320 panelChan.syncPanel(); 321 break; 322 case CAR: 323 case ISD: 324 hazButton.setBorderPainted(true); 325 panelHaz.setVisible(true); 326 panelHaz.syncPanel(); 327 break; 328 case SPP: 329 specButton.setBorderPainted(true); 330 panelSpec.setVisible(true); 331 panelSpec.syncPanel(); 332 break; 333 case LIT: 334 case SIS: 335 lightsButton.setBorderPainted(true); 336 panelLights.setVisible(true); 337 panelLights.syncPanel(); 338 break; 339 } 340 panelMore.syncPanel(); 341 panelTop.syncPanel(); 342 panelFog.syncPanel(); 343 panelRadar.syncPanel(); 344 panelLit.syncPanel(); 345 } 310 346 } 311 347 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelMore.java
r26988 r26998 10 10 import oseam.Messages; 11 11 import oseam.dialogs.OSeaMAction; 12 import oseam.seamarks.SeaMark.* 12 import oseam.seamarks.SeaMark.*; 13 13 14 14 public class PanelMore extends JPanel { … … 19 19 private ActionListener alInfo = new ActionListener() { 20 20 public void actionPerformed(java.awt.event.ActionEvent e) { 21 if (dlg.mark != null) 22 dlg.mark.setInfo(infoBox.getText()); 21 dlg.mark.setInfo(infoBox.getText()); 23 22 } 24 23 }; … … 27 26 private ActionListener alSource = new ActionListener() { 28 27 public void actionPerformed(java.awt.event.ActionEvent e) { 29 if (dlg.mark != null) 30 dlg.mark.setSource(sourceBox.getText()); 28 dlg.mark.setSource(sourceBox.getText()); 31 29 } 32 30 }; … … 35 33 private ActionListener alElev = new ActionListener() { 36 34 public void actionPerformed(java.awt.event.ActionEvent e) { 37 if (dlg.mark != null) 38 dlg.mark.setElevation(elevBox.getText()); 35 dlg.mark.setElevation(elevBox.getText()); 39 36 } 40 37 }; … … 43 40 private ActionListener alHeight = new ActionListener() { 44 41 public void actionPerformed(java.awt.event.ActionEvent e) { 45 if (dlg.mark != null) 46 dlg.mark.setHeight(heightBox.getText()); 42 dlg.mark.setHeight(heightBox.getText()); 47 43 } 48 44 }; … … 299 295 reflBox.addActionListener(alRefl); 300 296 301 302 297 } 298 303 299 public void syncPanel() { 304 300 panelPat.syncPanel(); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelPat.java
r26988 r26998 80 80 button.setBorderPainted(false); 81 81 } 82 panelCol.sync Stack();82 panelCol.syncPanel(); 83 83 } 84 84 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelPort.java
r26988 r26998 37 37 button.setBorderPainted(false); 38 38 } 39 if (dlg.mark != null) { 40 if ((dlg.mark.getObject() != Obj.UNKNOWN) && (dlg.mark.getShape() != Shp.UNKNOWN)) { 41 dlg.panelMain.moreButton.setVisible(true); 42 dlg.panelMain.panelChan.topmarkButton.setVisible(true); 43 dlg.panelMain.topButton.setEnabled(true); 44 dlg.panelMain.fogButton.setEnabled(true); 45 dlg.panelMain.radButton.setEnabled(true); 46 dlg.panelMain.litButton.setEnabled(true); 47 if (dlg.mark.getCategory() == Cat.LAM_PORT) { 48 switch (dlg.mark.getRegion()) { 49 case A: 50 dlg.panelMain.panelMore.panelPat.noneButton.doClick(); 51 dlg.mark.setColour(Ent.BODY, Col.RED); 52 break; 53 case B: 54 dlg.panelMain.panelMore.panelPat.noneButton.doClick(); 55 dlg.mark.setColour(Ent.BODY, Col.GREEN); 56 break; 57 case C: 58 dlg.panelMain.panelMore.panelPat.horizButton.doClick(); 59 dlg.mark.setColour(Ent.BODY, Col.RED); 60 dlg.mark.addColour(Ent.BODY, Col.WHITE); 61 dlg.mark.addColour(Ent.BODY, Col.RED); 62 dlg.mark.addColour(Ent.BODY, Col.WHITE); 63 break; 64 } 65 } else { 66 switch (dlg.mark.getRegion()) { 67 case A: 68 dlg.panelMain.panelMore.panelPat.horizButton.doClick(); 69 dlg.mark.setColour(Ent.BODY, Col.RED); 70 dlg.mark.addColour(Ent.BODY, Col.GREEN); 71 dlg.mark.addColour(Ent.BODY, Col.RED); 72 break; 73 case B: 74 dlg.panelMain.panelMore.panelPat.horizButton.doClick(); 75 dlg.mark.setColour(Ent.BODY, Col.GREEN); 76 dlg.mark.addColour(Ent.BODY, Col.RED); 77 dlg.mark.addColour(Ent.BODY, Col.GREEN); 78 break; 79 case C: 80 dlg.panelMain.panelMore.panelPat.horizButton.doClick(); 81 dlg.mark.setColour(Ent.BODY, Col.RED); 82 dlg.mark.addColour(Ent.BODY, Col.GREEN); 83 dlg.mark.addColour(Ent.BODY, Col.RED); 84 dlg.mark.addColour(Ent.BODY, Col.GREEN); 85 break; 86 } 39 if (dlg.mark.isValid()) { 40 dlg.panelMain.moreButton.setVisible(true); 41 dlg.panelMain.panelChan.topmarkButton.setVisible(true); 42 dlg.panelMain.saveButton.setEnabled(true); 43 dlg.panelMain.topButton.setEnabled(true); 44 dlg.panelMain.fogButton.setEnabled(true); 45 dlg.panelMain.radButton.setEnabled(true); 46 dlg.panelMain.litButton.setEnabled(true); 47 dlg.panelMain.saveButton.setEnabled(true); 48 if (dlg.mark.getCategory() == Cat.LAM_PORT) { 49 switch (dlg.mark.getRegion()) { 50 case A: 51 dlg.mark.setPattern(Ent.BODY, Pat.NONE); 52 dlg.mark.setColour(Ent.BODY, Col.RED); 53 break; 54 case B: 55 dlg.mark.setPattern(Ent.BODY, Pat.NONE); 56 dlg.mark.setColour(Ent.BODY, Col.GREEN); 57 break; 58 case C: 59 dlg.mark.setPattern(Ent.BODY, Pat.HORIZ); 60 dlg.mark.setColour(Ent.BODY, Col.RED); 61 dlg.mark.addColour(Ent.BODY, Col.WHITE); 62 dlg.mark.addColour(Ent.BODY, Col.RED); 63 dlg.mark.addColour(Ent.BODY, Col.WHITE); 64 break; 87 65 } 88 dlg.panelMain.panelMore.panelPat.panelCol.syncStack();89 66 } else { 90 dlg.panelMain.moreButton.setVisible(false); 91 dlg.panelMain.panelChan.topmarkButton.setVisible(false); 92 dlg.panelMain.topButton.setEnabled(false); 93 dlg.panelMain.fogButton.setEnabled(false); 94 dlg.panelMain.radButton.setEnabled(false); 95 dlg.panelMain.litButton.setEnabled(false); 67 dlg.mark.setPattern(Ent.BODY, Pat.HORIZ); 68 switch (dlg.mark.getRegion()) { 69 case A: 70 dlg.mark.setColour(Ent.BODY, Col.RED); 71 dlg.mark.addColour(Ent.BODY, Col.GREEN); 72 dlg.mark.addColour(Ent.BODY, Col.RED); 73 break; 74 case B: 75 dlg.mark.setColour(Ent.BODY, Col.GREEN); 76 dlg.mark.addColour(Ent.BODY, Col.RED); 77 dlg.mark.addColour(Ent.BODY, Col.GREEN); 78 break; 79 case C: 80 dlg.mark.setColour(Ent.BODY, Col.RED); 81 dlg.mark.addColour(Ent.BODY, Col.GREEN); 82 dlg.mark.addColour(Ent.BODY, Col.RED); 83 dlg.mark.addColour(Ent.BODY, Col.GREEN); 84 break; 85 } 96 86 } 97 dlg.mark.paintSign(); 87 dlg.panelMain.panelMore.syncPanel(); 88 } else { 89 dlg.panelMain.moreButton.setVisible(false); 90 dlg.panelMain.panelChan.topmarkButton.setVisible(false); 91 dlg.panelMain.topButton.setEnabled(false); 92 dlg.panelMain.fogButton.setEnabled(false); 93 dlg.panelMain.radButton.setEnabled(false); 94 dlg.panelMain.litButton.setEnabled(false); 98 95 } 96 dlg.mark.paintSign(); 99 97 } 100 98 }; … … 123 121 } 124 122 } 125 123 126 124 private JRadioButton getShapeButton(JRadioButton button, int x, int y, int w, int h, String tip, Shp shp, Obj obj) { 127 125 button.setBounds(new Rectangle(x, y, w, h)); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelRadar.java
r26989 r26998 24 24 private ActionListener alRad = new ActionListener() { 25 25 public void actionPerformed(java.awt.event.ActionEvent e) { 26 if (dlg.mark != null) { 27 for (Rtb rtb : rads.keySet()) { 28 JRadioButton button = rads.get(rtb); 29 if (button.isSelected()) { 30 dlg.mark.setRaType(rtb); 31 button.setBorderPainted(true); 32 } else 33 button.setBorderPainted(false); 34 } 35 dlg.mark.paintSign(); 26 for (Rtb rtb : rads.keySet()) { 27 JRadioButton button = rads.get(rtb); 28 if (button.isSelected()) { 29 dlg.mark.setRaType(rtb); 30 button.setBorderPainted(true); 31 } else 32 button.setBorderPainted(false); 36 33 } 34 dlg.mark.paintSign(); 37 35 } 38 36 }; … … 41 39 private ActionListener alGroup = new ActionListener() { 42 40 public void actionPerformed(java.awt.event.ActionEvent e) { 43 if (dlg.mark != null) 44 dlg.mark.setRaconGroup(groupBox.getText()); 41 dlg.mark.setRaconGroup(groupBox.getText()); 45 42 } 46 43 }; … … 49 46 private ActionListener alPeriod = new ActionListener() { 50 47 public void actionPerformed(java.awt.event.ActionEvent e) { 51 if (dlg.mark != null) 52 dlg.mark.setRaconPeriod(periodBox.getText()); 48 dlg.mark.setRaconPeriod(periodBox.getText()); 53 49 } 54 50 }; … … 57 53 private ActionListener alSeq = new ActionListener() { 58 54 public void actionPerformed(java.awt.event.ActionEvent e) { 59 if (dlg.mark != null) 60 dlg.mark.setRaconSequence(seqBox.getText()); 55 dlg.mark.setRaconSequence(seqBox.getText()); 61 56 } 62 57 }; … … 65 60 private ActionListener alRange = new ActionListener() { 66 61 public void actionPerformed(java.awt.event.ActionEvent e) { 67 if (dlg.mark != null) 68 dlg.mark.setRaconRange(rangeBox.getText()); 62 dlg.mark.setRaconRange(rangeBox.getText()); 69 63 } 70 64 }; … … 73 67 private ActionListener alSector1 = new ActionListener() { 74 68 public void actionPerformed(java.awt.event.ActionEvent e) { 75 if (dlg.mark != null) 76 dlg.mark.setRaconSector1(rangeBox.getText()); 69 dlg.mark.setRaconSector1(rangeBox.getText()); 77 70 } 78 71 }; … … 81 74 private ActionListener alSector2 = new ActionListener() { 82 75 public void actionPerformed(java.awt.event.ActionEvent e) { 83 if (dlg.mark != null) 84 dlg.mark.setRaconSector2(rangeBox.getText()); 76 dlg.mark.setRaconSector2(rangeBox.getText()); 85 77 } 86 78 }; -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelSaw.java
r26988 r26998 41 41 dlg.panelMain.radButton.setEnabled(true); 42 42 dlg.panelMain.litButton.setEnabled(true); 43 dlg. panelMain.panelMore.panelPat.vertButton.doClick();43 dlg.mark.setPattern(Ent.BODY, Pat.VERT); 44 44 dlg.mark.setColour(Ent.BODY, Col.RED); 45 45 dlg.mark.addColour(Ent.BODY, Col.WHITE); … … 51 51 dlg.panelMain.litButton.setEnabled(false); 52 52 } 53 dlg.panelMain.panelMore. panelPat.panelCol.syncStack();53 dlg.panelMain.panelMore.syncPanel(); 54 54 dlg.mark.paintSign(); 55 55 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelSpec.java
r26989 r26998 50 50 dlg.mark.setShape(shp); 51 51 dlg.mark.setObject(objects.get(shp)); 52 if ( (button == cairnButton) && !(dlg.panelMain.panelMore.panelPat.panelCol.delButton.isSelected())) {52 if (button == cairnButton) { 53 53 dlg.mark.setPattern(Ent.BODY, Pat.NONE); 54 54 dlg.mark.setColour(Ent.BODY, Col.UNKNOWN); 55 } 56 if (dlg.mark.getColour(Ent.BODY, 0) == Col.UNKNOWN) { 57 dlg.mark.setPattern(Ent.BODY, Pat.NONE); 58 dlg.mark.setColour(Ent.BODY, Col.YELLOW); 55 59 } 56 60 button.setBorderPainted(true); 57 61 } else 58 62 button.setBorderPainted(false); 59 }60 if ((dlg.mark.getObject() != Obj.UNKNOWN) && (dlg.mark.getShape() != Shp.UNKNOWN)) {61 dlg.panelMain.topButton.setEnabled(true);62 dlg.panelMain.fogButton.setEnabled(true);63 dlg.panelMain.radButton.setEnabled(true);64 dlg.panelMain.litButton.setEnabled(true);65 dlg.panelMain.moreButton.setVisible(true);66 } else {67 dlg.panelMain.topButton.setEnabled(false);68 dlg.panelMain.fogButton.setEnabled(false);69 dlg.panelMain.radButton.setEnabled(false);70 dlg.panelMain.litButton.setEnabled(false);71 dlg.panelMain.moreButton.setVisible(false);72 63 } 73 64 dlg.panelMain.panelMore.syncPanel(); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelStbd.java
r26988 r26998 37 37 button.setBorderPainted(false); 38 38 } 39 if (dlg.mark != null) { 40 if ((dlg.mark.getObject() != Obj.UNKNOWN) && (dlg.mark.getShape() != Shp.UNKNOWN)) { 41 dlg.panelMain.moreButton.setVisible(true); 42 dlg.panelMain.panelChan.topmarkButton.setVisible(true); 43 dlg.panelMain.topButton.setEnabled(true); 44 dlg.panelMain.fogButton.setEnabled(true); 45 dlg.panelMain.radButton.setEnabled(true); 46 dlg.panelMain.litButton.setEnabled(true); 47 if (dlg.mark.getCategory() == Cat.LAM_PORT) { 48 switch (dlg.mark.getRegion()) { 49 case A: 50 dlg.panelMain.panelMore.panelPat.noneButton.doClick(); 51 dlg.mark.setColour(Ent.BODY, Col.GREEN); 52 break; 53 case B: 54 dlg.panelMain.panelMore.panelPat.noneButton.doClick(); 55 dlg.mark.setColour(Ent.BODY, Col.RED); 56 break; 57 case C: 58 dlg.panelMain.panelMore.panelPat.horizButton.doClick(); 59 dlg.mark.setColour(Ent.BODY, Col.GREEN); 60 dlg.mark.addColour(Ent.BODY, Col.WHITE); 61 dlg.mark.addColour(Ent.BODY, Col.GREEN); 62 dlg.mark.addColour(Ent.BODY, Col.WHITE); 63 break; 64 } 65 } else { 66 switch (dlg.mark.getRegion()) { 67 case A: 68 dlg.panelMain.panelMore.panelPat.horizButton.doClick(); 69 dlg.mark.setColour(Ent.BODY, Col.GREEN); 70 dlg.mark.addColour(Ent.BODY, Col.RED); 71 dlg.mark.addColour(Ent.BODY, Col.GREEN); 72 break; 73 case B: 74 dlg.panelMain.panelMore.panelPat.horizButton.doClick(); 75 dlg.mark.setColour(Ent.BODY, Col.RED); 76 dlg.mark.addColour(Ent.BODY, Col.GREEN); 77 dlg.mark.addColour(Ent.BODY, Col.RED); 78 break; 79 case C: 80 dlg.panelMain.panelMore.panelPat.horizButton.doClick(); 81 dlg.mark.setColour(Ent.BODY, Col.RED); 82 dlg.mark.addColour(Ent.BODY, Col.GREEN); 83 dlg.mark.addColour(Ent.BODY, Col.RED); 84 dlg.mark.addColour(Ent.BODY, Col.GREEN); 85 break; 86 } 39 if (dlg.mark.isValid()) { 40 dlg.panelMain.moreButton.setVisible(true); 41 dlg.panelMain.panelChan.topmarkButton.setVisible(true); 42 dlg.panelMain.saveButton.setEnabled(true); 43 dlg.panelMain.topButton.setEnabled(true); 44 dlg.panelMain.fogButton.setEnabled(true); 45 dlg.panelMain.radButton.setEnabled(true); 46 dlg.panelMain.litButton.setEnabled(true); 47 dlg.panelMain.saveButton.setEnabled(true); 48 if (dlg.mark.getCategory() == Cat.LAM_STBD) { 49 switch (dlg.mark.getRegion()) { 50 case A: 51 dlg.mark.setPattern(Ent.BODY, Pat.NONE); 52 dlg.mark.setColour(Ent.BODY, Col.GREEN); 53 break; 54 case B: 55 dlg.mark.setPattern(Ent.BODY, Pat.NONE); 56 dlg.mark.setColour(Ent.BODY, Col.RED); 57 break; 58 case C: 59 dlg.mark.setPattern(Ent.BODY, Pat.HORIZ); 60 dlg.mark.setColour(Ent.BODY, Col.GREEN); 61 dlg.mark.addColour(Ent.BODY, Col.WHITE); 62 dlg.mark.addColour(Ent.BODY, Col.GREEN); 63 dlg.mark.addColour(Ent.BODY, Col.WHITE); 64 break; 87 65 } 88 dlg.panelMain.panelMore.panelPat.panelCol.syncStack();89 66 } else { 90 dlg.panelMain.moreButton.setVisible(false); 91 dlg.panelMain.panelChan.topmarkButton.setVisible(false); 92 dlg.panelMain.topButton.setEnabled(false); 93 dlg.panelMain.fogButton.setEnabled(false); 94 dlg.panelMain.radButton.setEnabled(false); 95 dlg.panelMain.litButton.setEnabled(false); 67 dlg.mark.setPattern(Ent.BODY, Pat.HORIZ); 68 switch (dlg.mark.getRegion()) { 69 case A: 70 dlg.mark.setColour(Ent.BODY, Col.GREEN); 71 dlg.mark.addColour(Ent.BODY, Col.RED); 72 dlg.mark.addColour(Ent.BODY, Col.GREEN); 73 break; 74 case B: 75 dlg.mark.setColour(Ent.BODY, Col.RED); 76 dlg.mark.addColour(Ent.BODY, Col.GREEN); 77 dlg.mark.addColour(Ent.BODY, Col.RED); 78 break; 79 case C: 80 dlg.mark.setColour(Ent.BODY, Col.RED); 81 dlg.mark.addColour(Ent.BODY, Col.GREEN); 82 dlg.mark.addColour(Ent.BODY, Col.RED); 83 dlg.mark.addColour(Ent.BODY, Col.GREEN); 84 break; 85 } 96 86 } 97 dlg.mark.paintSign(); 87 dlg.panelMain.panelMore.syncPanel(); 88 } else { 89 dlg.panelMain.moreButton.setVisible(false); 90 dlg.panelMain.panelChan.topmarkButton.setVisible(false); 91 dlg.panelMain.topButton.setEnabled(false); 92 dlg.panelMain.fogButton.setEnabled(false); 93 dlg.panelMain.radButton.setEnabled(false); 94 dlg.panelMain.litButton.setEnabled(false); 98 95 } 96 dlg.mark.paintSign(); 99 97 } 100 98 }; … … 123 121 } 124 122 } 125 123 126 124 private JRadioButton getShapeButton(JRadioButton button, int x, int y, int w, int h, String tip, Shp shp, Obj obj) { 127 125 button.setBounds(new Rectangle(x, y, w, h)); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelTop.java
r26988 r26998 36 36 private ActionListener alTop = new ActionListener() { 37 37 public void actionPerformed(java.awt.event.ActionEvent e) { 38 if (dlg.mark != null) { 39 for (Top top : tops.keySet()) { 40 JRadioButton button = tops.get(top); 41 if (button.isSelected()) { 42 dlg.mark.setTopmark(top); 43 button.setBorderPainted(true); 44 } else 45 button.setBorderPainted(false); 46 } 47 mooringTopButton.setBorderPainted(mooringTopButton.isSelected()); 48 dlg.mark.paintSign(); 38 for (Top top : tops.keySet()) { 39 JRadioButton button = tops.get(top); 40 if (button.isSelected()) { 41 dlg.mark.setTopmark(top); 42 button.setBorderPainted(true); 43 } else 44 button.setBorderPainted(false); 49 45 } 46 mooringTopButton.setBorderPainted(mooringTopButton.isSelected()); 47 dlg.mark.paintSign(); 50 48 } 51 49 }; … … 82 80 mooringTopButton.setEnabled(state); 83 81 } 84 82 85 83 public void syncPanel() { 86 84 for (Top top : tops.keySet()) { -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/SeaMark.java
r26989 r26998 484 484 static { 485 485 TopSTR.put(Top.CAN, "cylinder"); 486 TopSTR.put(Top.CONE, "c ylinder");486 TopSTR.put(Top.CONE, "cone, point up"); 487 487 TopSTR.put(Top.SPHERE, "sphere"); 488 488 TopSTR.put(Top.X_SHAPE, "x-shape"); … … 1111 1111 } 1112 1112 1113 dlg.panelMain.typeButtons.clearSelection(); 1114 dlg.panelMain.panelChan.catButtons.clearSelection(); 1115 dlg.panelMain.panelHaz.catButtons.clearSelection(); 1116 switch (GrpMAP.get(getObject())) { 1117 case LAT: 1118 dlg.panelMain.chanButton.setSelected(true); 1119 switch (getCategory()) { 1120 case LAM_PORT: 1121 dlg.panelMain.panelChan.portButton.setSelected(true); 1122 break; 1123 case LAM_STBD: 1124 dlg.panelMain.panelChan.stbdButton.setSelected(true); 1125 break; 1126 case LAM_PPORT: 1127 dlg.panelMain.panelChan.prefPortButton.setSelected(true); 1128 break; 1129 case LAM_PSTBD: 1130 dlg.panelMain.panelChan.prefStbdButton.setSelected(true); 1131 break; 1132 } 1133 break; 1134 case SAW: 1135 dlg.panelMain.chanButton.setSelected(true); 1136 dlg.panelMain.panelChan.safeWaterButton.setSelected(true); 1137 break; 1138 case CAR: 1139 dlg.panelMain.hazButton.setSelected(true); 1140 switch (getCategory()) { 1141 case CAM_NORTH: 1142 dlg.panelMain.panelHaz.northButton.setSelected(true); 1143 break; 1144 case CAM_SOUTH: 1145 dlg.panelMain.panelHaz.southButton.setSelected(true); 1146 break; 1147 case CAM_EAST: 1148 dlg.panelMain.panelHaz.eastButton.setSelected(true); 1149 break; 1150 case CAM_WEST: 1151 dlg.panelMain.panelHaz.westButton.setSelected(true); 1152 break; 1153 } 1154 break; 1155 case ISD: 1156 dlg.panelMain.hazButton.setSelected(true); 1157 dlg.panelMain.panelHaz.isolButton.setSelected(true); 1158 break; 1159 case SPP: 1160 dlg.panelMain.specButton.setSelected(true); 1161 break; 1162 case LIT: 1163 case SIS: 1164 dlg.panelMain.lightsButton.setSelected(true); 1165 break; 1166 case FLT: 1167 switch (getColour(Ent.FLOAT, 0)) { 1168 case RED: 1169 dlg.panelMain.chanButton.setSelected(true); 1170 if (getColour(Ent.FLOAT, 1) == Col.WHITE) 1171 if (getColour(Ent.FLOAT, 2) == Col.RED) { 1172 setRegion(Reg.C); 1173 dlg.panelMain.panelChan.portButton.setSelected(true); 1174 } else { 1175 dlg.panelMain.panelChan.safeWaterButton.setSelected(true); 1176 } 1177 else if (getColour(Ent.FLOAT, 1) == Col.GREEN) { 1178 if (getColour(Ent.FLOAT, 3) == Col.GREEN) { 1179 setRegion(Reg.C); 1180 } 1181 if (getRegion().equals("B")) { 1182 dlg.panelMain.panelChan.prefStbdButton.setSelected(true); 1183 } else { 1184 dlg.panelMain.panelChan.prefPortButton.setSelected(true); 1185 } 1186 } else { 1187 if (getRegion().equals("B")) 1188 dlg.panelMain.panelChan.stbdButton.setSelected(true); 1189 else 1190 dlg.panelMain.panelChan.portButton.setSelected(true); 1191 } 1192 break; 1193 case GREEN: 1194 dlg.panelMain.chanButton.setSelected(true); 1195 if (getColour(Ent.FLOAT, 1) == Col.RED) { 1196 if (getRegion().equals("B")) { 1197 dlg.panelMain.panelChan.prefPortButton.setSelected(true); 1198 } else { 1199 dlg.panelMain.panelChan.prefStbdButton.setSelected(true); 1200 } 1201 } else if (getColour(Ent.FLOAT, 1) == Col.WHITE) { 1202 setRegion(Reg.C); 1203 dlg.panelMain.panelChan.stbdButton.setSelected(true); 1204 } else { 1205 if (getRegion().equals("B")) { 1206 dlg.panelMain.panelChan.portButton.setSelected(true); 1207 } else { 1208 dlg.panelMain.panelChan.stbdButton.setSelected(true); 1209 } 1210 } 1211 break; 1212 case BLACK: 1213 dlg.panelMain.hazButton.setSelected(true); 1214 switch (getColour(Ent.FLOAT, 1)) { 1215 case YELLOW: 1216 if (getColour(Ent.FLOAT, 2) == Col.BLACK) 1217 dlg.panelMain.panelHaz.eastButton.setSelected(true); 1218 else 1219 dlg.panelMain.panelHaz.northButton.setSelected(true); 1220 break; 1221 case RED: 1222 dlg.panelMain.panelHaz.isolButton.setSelected(true); 1223 break; 1224 } 1225 break; 1226 case YELLOW: 1227 if (getColour(Ent.FLOAT, 1) == Col.BLACK) { 1228 dlg.panelMain.hazButton.setSelected(true); 1229 if (getColour(Ent.FLOAT, 2) == Col.YELLOW) 1230 dlg.panelMain.panelHaz.westButton.setSelected(true); 1231 else 1232 dlg.panelMain.panelHaz.southButton.setSelected(true); 1233 } else { 1234 dlg.panelMain.specButton.setSelected(true); 1235 } 1236 break; 1237 default: 1238 dlg.panelMain.lightsButton.setSelected(true); 1239 } 1240 break; 1241 } 1242 1113 if (keys.containsKey("seamark:topmark:shape")) { 1114 str = keys.get("seamark:topmark:shape"); 1115 setTopmark(Top.NONE); 1116 for (Top top : TopSTR.keySet()) { 1117 if (TopSTR.get(top).equals(str)) { 1118 setTopmark(top); 1119 } 1120 } 1121 } 1122 if (keys.containsKey("seamark:topmark:colour")) { 1123 str = keys.get("seamark:topmark:colour"); 1124 setColour(Ent.TOPMARK, Col.UNKNOWN); 1125 for (Col col : ColSTR.keySet()) { 1126 if (ColSTR.get(col).equals(str)) { 1127 setColour(Ent.TOPMARK, col); 1128 } 1129 } 1130 } 1131 if (keys.containsKey("seamark:topmark:colour_pattern")) { 1132 str = keys.get("seamark:topmark:colour_pattern"); 1133 setPattern(Ent.TOPMARK, Pat.NONE); 1134 for (Pat pat : PatSTR.keySet()) { 1135 if (PatSTR.get(pat).equals(str)) { 1136 setPattern(Ent.TOPMARK, pat); 1137 } 1138 } 1139 } 1140 1141 if (keys.containsKey("seamark:fog_signal")) { 1142 str = keys.get("seamark:fog_signal"); 1143 setFogSound(Fog.NONE); 1144 for (Fog fog : FogSTR.keySet()) { 1145 if (FogSTR.get(fog).equals(str)) { 1146 setFogSound(fog); 1147 } 1148 } 1149 } 1150 if (keys.containsKey("seamark:fog_signal:group")) { 1151 setFogGroup(keys.get("seamark:fog_signal:group")); 1152 } 1153 if (keys.containsKey("seamark:fog_signal:period")) { 1154 setFogPeriod(keys.get("seamark:fog_signal:period")); 1155 } 1156 if (keys.containsKey("seamark:fog_signal:sequence")) { 1157 setFogSequence(keys.get("seamark:fog_signal:sequence")); 1158 } 1159 if (keys.containsKey("seamark:fog_signal:range")) { 1160 setFogRange(keys.get("seamark:fog_signal:range")); 1161 } 1162 1163 if (keys.containsKey("seamark:information")) { 1164 setInfo(keys.get("seamark:information")); 1165 } 1166 if (keys.containsKey("seamark:source")) { 1167 setSource(keys.get("seamark:source")); 1168 } 1169 if (keys.containsKey("seamark:height")) { 1170 setHeight(keys.get("seamark:height")); 1171 } 1172 if (keys.containsKey("seamark:elevation")) { 1173 setElevation(keys.get("seamark:elevation")); 1174 } 1175 if (keys.containsKey("seamark:status")) { 1176 str = keys.get("seamark:status"); 1177 setStatus(Sts.UNKNOWN); 1178 for (Sts sts : StsSTR.keySet()) { 1179 if (StsSTR.get(sts).equals(str)) { 1180 setStatus(sts); 1181 } 1182 } 1183 } 1184 if (keys.containsKey("seamark:construction")) { 1185 str = keys.get("seamark:construction"); 1186 setConstr(Cns.UNKNOWN); 1187 for (Cns cns : CnsSTR.keySet()) { 1188 if (CnsSTR.get(cns).equals(str)) { 1189 setConstr(cns); 1190 } 1191 } 1192 } 1193 if (keys.containsKey("seamark:visibility")) { 1194 str = keys.get("seamark:visibility"); 1195 setVis(Vis.UNKNOWN); 1196 for (Vis vis : VisSTR.keySet()) { 1197 if (VisSTR.get(vis).equals(str)) { 1198 setVis(vis); 1199 } 1200 } 1201 } 1202 if (keys.containsKey("seamark:reflectivity")) { 1203 str = keys.get("seamark:reflectivity"); 1204 setRvis(Vis.UNKNOWN); 1205 for (Vis vis : VisSTR.keySet()) { 1206 if (VisSTR.get(vis).equals(str)) { 1207 setRvis(vis); 1208 } 1209 } 1210 } 1211 1243 1212 dlg.panelMain.syncPanel(); 1244 1213
Note:
See TracChangeset
for help on using the changeset viewer.