Changeset 26970 in osm for applications/editors/josm/plugins/smed
- Timestamp:
- 2011-10-27T15:29:59+02:00 (13 years ago)
- Location:
- applications/editors/josm/plugins/smed/plugs/oseam/src/oseam
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/dialogs/OSeaMAction.java
r26565 r26970 41 41 } else { 42 42 manager.showVisualMessage(Messages.getString("OneNode")); 43 panelMain.clearSelections();44 43 } 45 44 } … … 49 48 mark = null; 50 49 manager.showVisualMessage(Messages.getString("SelectNode")); 51 panelMain.clearSelections();52 50 } 53 51 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelChan.java
r26949 r26970 17 17 public PanelStbd panelStbd = null; 18 18 public PanelSaw panelSaw = null; 19 p rivateButtonGroup catButtons = new ButtonGroup();19 public ButtonGroup catButtons = new ButtonGroup(); 20 20 public JRadioButton portButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PortButton.png"))); 21 21 public JRadioButton stbdButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/StbdButton.png"))); … … 33 33 panelPort.shapes.get(shp).doClick(); 34 34 } else { 35 panelPort.clearSelections(); 36 dlg.mark.setShape(Shp.UNKNOWN); 37 } 38 portButton.setBorderPainted(true); 39 panelPort.setVisible(true); 40 panelPort.perchButton.setVisible(true); 41 panelPort.stakeButton.setVisible(true); 42 } else { 43 portButton.setBorderPainted(false); 44 panelPort.setVisible(false); 35 dlg.mark.setShape(Shp.UNKNOWN); 36 } 45 37 } 46 38 if (prefPortButton.isSelected()) { … … 49 41 panelPort.shapes.get(shp).doClick(); 50 42 } else { 51 panelPort.clearSelections(); 52 dlg.mark.setShape(Shp.UNKNOWN); 53 } 54 prefPortButton.setBorderPainted(true); 55 panelPort.setVisible(true); 56 } else { 57 prefPortButton.setBorderPainted(false); 58 if (!portButton.isSelected()) 59 panelPort.setVisible(false); 43 dlg.mark.setShape(Shp.UNKNOWN); 44 } 60 45 } 61 46 if (stbdButton.isSelected()) { … … 64 49 panelStbd.shapes.get(shp).doClick(); 65 50 } else { 66 panelStbd.clearSelections(); 67 dlg.mark.setShape(Shp.UNKNOWN); 68 } 69 stbdButton.setBorderPainted(true); 70 panelStbd.setVisible(true); 71 panelStbd.perchButton.setVisible(true); 72 panelStbd.stakeButton.setVisible(true); 73 } else { 74 stbdButton.setBorderPainted(false); 75 panelStbd.setVisible(false); 51 dlg.mark.setShape(Shp.UNKNOWN); 52 } 76 53 } 77 54 if (prefStbdButton.isSelected()) { … … 80 57 panelStbd.shapes.get(shp).doClick(); 81 58 } else { 82 panelStbd.clearSelections(); 83 dlg.mark.setShape(Shp.UNKNOWN); 84 } 85 prefStbdButton.setBorderPainted(true); 86 panelStbd.setVisible(true); 87 } else { 88 prefStbdButton.setBorderPainted(false); 89 if (!stbdButton.isSelected()) 90 panelStbd.setVisible(false); 59 dlg.mark.setShape(Shp.UNKNOWN); 60 } 91 61 } 92 62 if (safeWaterButton.isSelected()) { … … 95 65 panelSaw.shapes.get(shp).doClick(); 96 66 } else { 97 panelSaw.clearSelections(); 98 dlg.mark.setShape(Shp.UNKNOWN); 99 } 100 safeWaterButton.setBorderPainted(true); 101 panelSaw.setVisible(true); 102 } else { 103 safeWaterButton.setBorderPainted(false); 104 panelSaw.setVisible(false); 105 } 67 dlg.mark.setShape(Shp.UNKNOWN); 68 } 69 } 70 syncButtons(); 106 71 } 107 72 }; … … 110 75 public void actionPerformed(java.awt.event.ActionEvent e) { 111 76 if (dlg.mark != null) { 112 dlg.panelMain.panelTop.clearSelections();113 77 if (topmarkButton.isSelected()) { 114 78 if (SeaMark.GrpMAP.get(dlg.mark.getObject()) == Grp.SAW) { … … 195 159 this.add(topmarkButton); 196 160 } 197 198 public void clearSelections() { 199 topmarkButton.setSelected(false); 200 topmarkButton.setVisible(false); 201 alTop.actionPerformed(null); 202 catButtons.clearSelection(); 203 alCat.actionPerformed(null); 204 panelPort.clearSelections(); 205 panelStbd.clearSelections(); 206 panelSaw.clearSelections(); 161 162 public void syncButtons() { 163 if (portButton.isSelected()) { 164 portButton.setBorderPainted(true); 165 panelPort.setVisible(true); 166 panelPort.perchButton.setVisible(true); 167 panelPort.stakeButton.setVisible(true); 168 } else { 169 portButton.setBorderPainted(false); 170 panelPort.setVisible(false); 171 } 172 if (prefPortButton.isSelected()) { 173 prefPortButton.setBorderPainted(true); 174 panelPort.setVisible(true); 175 } else { 176 prefPortButton.setBorderPainted(false); 177 if (!portButton.isSelected()) 178 panelPort.setVisible(false); 179 } 180 if (stbdButton.isSelected()) { 181 stbdButton.setBorderPainted(true); 182 panelStbd.setVisible(true); 183 panelStbd.perchButton.setVisible(true); 184 panelStbd.stakeButton.setVisible(true); 185 } else { 186 stbdButton.setBorderPainted(false); 187 panelStbd.setVisible(false); 188 } 189 if (prefStbdButton.isSelected()) { 190 prefStbdButton.setBorderPainted(true); 191 panelStbd.setVisible(true); 192 } else { 193 prefStbdButton.setBorderPainted(false); 194 if (!stbdButton.isSelected()) 195 panelStbd.setVisible(false); 196 } 197 if (safeWaterButton.isSelected()) { 198 safeWaterButton.setBorderPainted(true); 199 panelSaw.setVisible(true); 200 } else { 201 safeWaterButton.setBorderPainted(false); 202 panelSaw.setVisible(false); 203 } 204 207 205 } 208 206 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelChr.java
r26925 r26970 126 126 } 127 127 128 public void clearSelections() {129 for (Chr chr : buttons.keySet()) {130 JToggleButton button = buttons.get(chr);131 button.setSelected(false);132 }133 noneButton.doClick();134 }135 136 128 public void enableAll(boolean state) { 137 129 for (JToggleButton button : buttons.values()) { -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelCol.java
r26968 r26970 72 72 dlg.mark.setColour(ent, stackIdx, col); 73 73 } 74 int height = 60 / stackCol.size(); 74 int height = stackCol.size() == 0 ? 60 : 60 / stackCol.size(); 75 75 for (int i = 0; stackCol.size() > i; i++) { 76 76 JRadioButton btnI = stackCol.get(i); … … 145 145 } 146 146 147 public void clearSelections() { 148 colourButtons.clearSelection(); 149 if (stackCol.size() == 0) { 150 addButton.doClick(); 151 } 152 do { 153 delButton.doClick(); 154 } while (stackCol.size() > 1); 155 alStack.actionPerformed(null); 156 } 147 public void syncButtons() { 148 if (ent != Ent.LIGHT) { 149 for (stackIdx = 0; dlg.mark.getColour(ent, stackIdx) != Col.UNKNOWN; stackIdx++) { 157 150 158 public void enableAll(boolean state) { 159 for (JRadioButton button : colours.values()) { 160 button.setEnabled(state); 151 } 161 152 } 162 153 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelFog.java
r26561 r26970 18 18 } 19 19 20 public void clearSelections() {21 22 }23 24 20 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelHaz.java
r26968 r26970 15 15 16 16 private OSeaMAction dlg; 17 p rivateButtonGroup catButtons = new ButtonGroup();17 public ButtonGroup catButtons = new ButtonGroup(); 18 18 public JRadioButton northButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CardNButton.png"))); 19 19 public JRadioButton southButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CardSButton.png"))); … … 26 26 if (dlg.mark != null) { 27 27 shp = dlg.mark.getShape(); 28 dlg.panelMain.panelMore.panelPat.clearSelections();29 28 dlg.panelMain.panelMore.panelPat.horizButton.doClick(); 30 29 if (northButton.isSelected()) { … … 142 141 public void actionPerformed(java.awt.event.ActionEvent e) { 143 142 if (dlg.mark != null) { 144 dlg.panelMain.panelTop.clearSelections();145 143 if (topmarkButton.isSelected()) { 146 144 dlg.panelMain.panelTop.panelPat.noneButton.doClick(); … … 195 193 } 196 194 197 public void clearSelections() { 198 topmarkButton.setSelected(false); 199 topmarkButton.setVisible(false); 200 alTop.actionPerformed(null); 201 catButtons.clearSelection(); 202 alCat.actionPerformed(null); 203 shapeButtons.clearSelection(); 204 alShape.actionPerformed(null); 195 public void syncButtons() { 196 northButton.setBorderPainted(northButton.isSelected()); 197 southButton.setBorderPainted(southButton.isSelected()); 198 eastButton.setBorderPainted(eastButton.isSelected()); 199 westButton.setBorderPainted(westButton.isSelected()); 200 isolButton.setBorderPainted(isolButton.isSelected()); 205 201 } 206 202 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelLights.java
r26968 r26970 153 153 } 154 154 155 public void updateSelections() {156 if (dlg.mark != null) {157 if (dlg.mark.getObject() == Obj.UNKNOWN) {158 clearSelections();159 } else {160 objects.get(dlg.mark.getObject()).doClick();161 if (dlg.mark.getObject() == Obj.SISTAT) {162 trafficCatBox.setSelectedIndex(trafficCats.get(dlg.mark.getCategory()));163 }164 if (dlg.mark.getObject() == Obj.SISTAW) {165 warningCatBox.setSelectedIndex(warningCats.get(dlg.mark.getCategory()));166 }167 }168 checkValidity();169 }170 }171 172 public void clearSelections() {173 warningCatBox.setSelectedIndex(0);174 trafficCatBox.setSelectedIndex(0);175 objButtons.clearSelection();176 alObj.actionPerformed(null);177 }178 179 155 private void addTCItem(String str, Cat cat) { 180 156 trafficCats.put(cat, trafficCatBox.getItemCount()); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelLit.java
r26949 r26970 225 225 } 226 226 227 public void clearSelections() {228 229 }230 231 227 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelMain.java
r26969 r26970 9 9 import oseam.Messages; 10 10 import oseam.dialogs.OSeaMAction; 11 import oseam.seamarks.SeaMark.*; 11 12 12 13 public class PanelMain extends JPanel { … … 114 115 alType = new ActionListener() { 115 116 public void actionPerformed(java.awt.event.ActionEvent e) { 116 if (dlg.node == null) {117 if (dlg.node == null) 117 118 typeButtons.clearSelection(); 118 }119 119 if (chanButton.isSelected()) { 120 120 chanButton.setBorderPainted(true); … … 123 123 chanButton.setBorderPainted(false); 124 124 panelChan.setVisible(false); 125 panelChan.clearSelections();126 125 } 127 126 if (hazButton.isSelected()) { … … 131 130 hazButton.setBorderPainted(false); 132 131 panelHaz.setVisible(false); 133 panelHaz.clearSelections();134 132 } 135 133 if (specButton.isSelected()) { 136 134 specButton.setBorderPainted(true); 137 135 panelSpec.setVisible(true); 138 panelSpec.updateSelections();139 136 } else { 140 137 specButton.setBorderPainted(false); 141 138 panelSpec.setVisible(false); 142 panelSpec.clearSelections();143 139 } 144 140 if (lightsButton.isSelected()) { 145 141 lightsButton.setBorderPainted(true); 146 142 panelLights.setVisible(true); 147 panelLights.updateSelections();148 143 } else { 149 144 lightsButton.setBorderPainted(false); 150 145 panelLights.setVisible(false); 151 panelLights.clearSelections();152 146 } 153 147 } … … 277 271 moreButton.addActionListener(alMore); 278 272 279 this.clearSelections();280 281 273 } 282 274 283 public void clearSelections() { 284 // panelMore.clearSelections(); 285 panelMore.setVisible(false); 286 moreButton.setVisible(false); 287 typeButtons.clearSelection(); 275 public void syncButtons() { 276 if (dlg.mark == null) { 277 topButton.setEnabled(false); 278 fogButton.setEnabled(false); 279 radButton.setEnabled(false); 280 litButton.setEnabled(false); 281 moreButton.setVisible(false); 282 } 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()); 288 298 alType.actionPerformed(null); 289 nameBox.setText("");290 alName.actionPerformed(null);291 clearType();292 }293 294 public void clearType() {295 topButton.setEnabled(false);296 fogButton.setEnabled(false);297 radButton.setEnabled(false);298 litButton.setEnabled(false);299 miscButtons.clearSelection();300 299 alMisc.actionPerformed(null); 301 // panelChan.clearSelections();302 // panelHaz.clearSelections();303 // panelSpec.clearSelections();304 // panelLights.clearSelections();305 // panelTop.clearSelections();306 // panelFog.clearSelections();307 // panelRadar.clearSelections();308 // panelLit.clearSelections();309 panelChan = new PanelChan(dlg);310 // panelChan.setBounds(new Rectangle(65, 0, 180, 160));311 panelHaz = new PanelHaz(dlg);312 // panelHaz.setBounds(new Rectangle(65, 0, 180, 160));313 panelSpec = new PanelSpec(dlg);314 // panelSpec.setBounds(new Rectangle(65, 0, 180, 160));315 panelLights = new PanelLights(dlg);316 // panelLights.setBounds(new Rectangle(65, 0, 180, 160));317 panelMore = new PanelMore(dlg);318 // panelMore.setBounds(new Rectangle(40, 165, 360, 160));319 panelTop = new PanelTop(dlg);320 // panelTop.setBounds(new Rectangle(40, 165, 360, 160));321 panelFog = new PanelFog(dlg);322 // panelFog.setBounds(new Rectangle(40, 165, 360, 160));323 panelRadar = new PanelRadar(dlg);324 // panelRadar.setBounds(new Rectangle(40, 165, 360, 160));325 panelLit = new PanelLit(dlg);326 // panelLit.setBounds(new Rectangle(40, 165, 360, 160));327 328 shapeIcon.setIcon(null);329 lightIcon.setIcon(null);330 topIcon.setIcon(null);331 radarIcon.setIcon(null);332 fogIcon.setIcon(null);333 300 } 334 301 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelMore.java
r26968 r26970 301 301 } 302 302 303 public void clearSelections() {304 panelPat.clearSelections();305 heightBox.setText("");306 alHeight.actionPerformed(null);307 elevBox.setText("");308 alElev.actionPerformed(null);309 sourceBox.setText("");310 alSource.actionPerformed(null);311 infoBox.setText("");312 alInfo.actionPerformed(null);313 statusBox.setSelectedIndex(0);314 alStatus.actionPerformed(null);315 constrBox.setSelectedIndex(0);316 alConstr.actionPerformed(null);317 visBox.setSelectedIndex(0);318 alVis.actionPerformed(null);319 reflBox.setSelectedIndex(0);320 alRefl.actionPerformed(null);321 }322 323 303 private void addStsItem(String str, Sts sts) { 324 304 statuses.put(sts, statusBox.getItemCount()); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelPat.java
r26968 r26970 72 72 } 73 73 74 public void clearSelections() {75 panelCol.clearSelections();76 patButtons.clearSelection();77 alPat.actionPerformed(null);78 }79 80 74 private JRadioButton getPatButton(JRadioButton button, int x, int y, int w, int h, String tip, Pat pat) { 81 75 button.setBounds(new Rectangle(x, y, w, h)); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelPort.java
r26968 r26970 44 44 dlg.panelMain.radButton.setEnabled(true); 45 45 dlg.panelMain.litButton.setEnabled(true); 46 dlg.panelMain.panelMore.panelPat.panelCol.clearSelections();47 46 if (dlg.mark.getCategory() == Cat.LAM_PORT) { 48 47 switch (dlg.mark.getRegion()) { … … 122 121 } 123 122 124 public void clearSelections() {125 shapeButtons.clearSelection();126 alShape.actionPerformed(null);127 }128 129 123 private JRadioButton getShapeButton(JRadioButton button, int x, int y, int w, int h, String tip, Shp shp, Obj obj) { 130 124 button.setBounds(new Rectangle(x, y, w, h)); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelRadar.java
r26561 r26970 17 17 } 18 18 19 public void clearSelections() {20 21 }22 23 19 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelSaw.java
r26968 r26970 40 40 dlg.panelMain.radButton.setEnabled(true); 41 41 dlg.panelMain.litButton.setEnabled(true); 42 dlg.panelMain.panelMore.panelPat.panelCol.clearSelections();43 42 dlg.panelMain.panelMore.panelPat.vertButton.doClick(); 44 43 dlg.panelMain.panelMore.panelPat.panelCol.redButton.doClick(); … … 66 65 } 67 66 68 public void clearSelections() {69 shapeButtons.clearSelection();70 alShape.actionPerformed(null);71 }72 73 67 private JRadioButton getShapeButton(JRadioButton button, int x, int y, int w, int h, String tip, Shp shp, Obj obj) { 74 68 button.setBounds(new Rectangle(x, y, w, h)); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelSpec.java
r26968 r26970 121 121 } 122 122 } 123 124 public void updateSelections() {125 if (dlg.mark != null) {126 if (dlg.mark.getObject() == Obj.UNKNOWN) {127 clearSelections();128 dlg.panelMain.panelMore.panelPat.panelCol.yellowButton.doClick();129 } else {130 dlg.panelMain.panelMore.panelPat.panelCol.colours.get(dlg.mark.getColour(Ent.BODY, 0)).doClick();131 }132 if (shapes.containsKey(dlg.mark.getShape())) {133 shapes.get(dlg.mark.getShape()).doClick();134 } else {135 shapeButtons.clearSelection();136 alShape.actionPerformed(null);137 }138 } else139 clearSelections();140 }141 123 142 124 private void addCatItem(String str, Cat cat) { 143 125 categories.put(cat, categoryBox.getItemCount()); 144 126 categoryBox.addItem(str); 145 }146 147 public void clearSelections() {148 shapeButtons.clearSelection();149 alShape.actionPerformed(null);150 127 } 151 128 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelStbd.java
r26968 r26970 44 44 dlg.panelMain.radButton.setEnabled(true); 45 45 dlg.panelMain.litButton.setEnabled(true); 46 dlg.panelMain.panelMore.panelPat.panelCol.clearSelections();47 46 if (dlg.mark.getCategory() == Cat.LAM_PORT) { 48 47 switch (dlg.mark.getRegion()) { … … 122 121 } 123 122 124 public void clearSelections() {125 shapeButtons.clearSelection();126 alShape.actionPerformed(null);127 }128 129 123 private JRadioButton getShapeButton(JRadioButton button, int x, int y, int w, int h, String tip, Shp shp, Obj obj) { 130 124 button.setBounds(new Rectangle(x, y, w, h)); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelTop.java
r26949 r26970 74 74 } 75 75 76 public void clearSelections() {77 noTopButton.doClick();78 panelPat.clearSelections();79 }80 81 76 public void enableAll(boolean state) { 82 77 for (JRadioButton button : tops.values()) { -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/SeaMark.java
r26968 r26970 721 721 } 722 722 723 public boolean isValid() { 724 switch (getObject()) { 725 case BCNCAR: 726 case BCNLAT: 727 case BOYCAR: 728 case BOYLAT: 729 if ((getCategory() != Cat.UNKNOWN) && (getShape() != Shp.UNKNOWN)) 730 return true; 731 break; 732 case BCNISD: 733 case BCNSAW: 734 case BCNSPP: 735 case BOYISD: 736 case BOYSAW: 737 case BOYSPP: 738 if (getShape() != Shp.UNKNOWN) 739 return true; 740 break; 741 case FLTCAR: 742 case FLTISD: 743 case FLTLAT: 744 case FLTSAW: 745 case FLTSPP: 746 if (getColour(Ent.BODY, 0) != Col.UNKNOWN) 747 return true; 748 break; 749 case LITMAJ: 750 case LITMIN: 751 case LITFLT: 752 case LITVES: 753 case LNDMRK: 754 case MORFAC: 755 case SISTAW: 756 case SISTAT: 757 return true; 758 default: return false; 759 } 760 return false; 761 } 762 723 763 // **********************!!!!!!!!! 724 764 public Light light = new Light(dlg); … … 727 767 728 768 public void parseMark(Node node) { 729 dlg.panelMain.clearSelections();769 paintlock = true; 730 770 dlg.manager.showVisualMessage(""); 731 771 String str = Main.pref.get("smedplugin.IALA"); 732 772 if (str.equals("C")) 733 dlg.panelMain.panelMore.regionCButton.doClick();773 setRegion(Reg.C); 734 774 else if (str.equals("B")) 735 dlg.panelMain.panelMore.regionBButton.doClick();775 setRegion(Reg.B); 736 776 else 737 dlg.panelMain.panelMore.regionAButton.doClick();777 setRegion(Reg.A); 738 778 739 779 Map<String, String> keys = node.getKeys(); … … 888 928 } 889 929 930 dlg.panelMain.typeButtons.clearSelection(); 931 dlg.panelMain.panelChan.catButtons.clearSelection(); 932 dlg.panelMain.panelHaz.catButtons.clearSelection(); 890 933 switch (GrpMAP.get(getObject())) { 891 934 case LAT: 892 dlg.panelMain.chanButton. doClick();935 dlg.panelMain.chanButton.setSelected(true); 893 936 switch (getCategory()) { 894 937 case LAM_PORT: 895 dlg.panelMain.panelChan.portButton. doClick();938 dlg.panelMain.panelChan.portButton.setSelected(true); 896 939 break; 897 940 case LAM_STBD: 898 dlg.panelMain.panelChan.stbdButton. doClick();941 dlg.panelMain.panelChan.stbdButton.setSelected(true); 899 942 break; 900 943 case LAM_PPORT: 901 dlg.panelMain.panelChan.prefPortButton. doClick();944 dlg.panelMain.panelChan.prefPortButton.setSelected(true); 902 945 break; 903 946 case LAM_PSTBD: 904 dlg.panelMain.panelChan.prefStbdButton. doClick();947 dlg.panelMain.panelChan.prefStbdButton.setSelected(true); 905 948 break; 906 949 } 907 950 break; 908 951 case SAW: 909 dlg.panelMain.chanButton. doClick();910 dlg.panelMain.panelChan.safeWaterButton. doClick();952 dlg.panelMain.chanButton.setSelected(true); 953 dlg.panelMain.panelChan.safeWaterButton.setSelected(true); 911 954 break; 912 955 case CAR: 913 dlg.panelMain.hazButton. doClick();956 dlg.panelMain.hazButton.setSelected(true); 914 957 switch (getCategory()) { 915 958 case CAM_NORTH: 916 dlg.panelMain.panelHaz.northButton. doClick();959 dlg.panelMain.panelHaz.northButton.setSelected(true); 917 960 break; 918 961 case CAM_SOUTH: 919 dlg.panelMain.panelHaz.southButton. doClick();962 dlg.panelMain.panelHaz.southButton.setSelected(true); 920 963 break; 921 964 case CAM_EAST: 922 dlg.panelMain.panelHaz.eastButton. doClick();965 dlg.panelMain.panelHaz.eastButton.setSelected(true); 923 966 break; 924 967 case CAM_WEST: 925 dlg.panelMain.panelHaz.westButton. doClick();968 dlg.panelMain.panelHaz.westButton.setSelected(true); 926 969 break; 927 970 } 928 971 break; 929 972 case ISD: 930 dlg.panelMain.hazButton. doClick();931 dlg.panelMain.panelHaz.isolButton. doClick();973 dlg.panelMain.hazButton.setSelected(true); 974 dlg.panelMain.panelHaz.isolButton.setSelected(true); 932 975 break; 933 976 case SPP: 934 dlg.panelMain.specButton. doClick();977 dlg.panelMain.specButton.setSelected(true); 935 978 break; 936 979 case LIT: 937 980 case SIS: 938 dlg.panelMain.lightsButton. doClick();981 dlg.panelMain.lightsButton.setSelected(true); 939 982 break; 940 983 case FLT: 941 984 switch (getColour(Ent.FLOAT, 0)) { 942 985 case RED: 943 dlg.panelMain.chanButton. doClick();986 dlg.panelMain.chanButton.setSelected(true); 944 987 if (getColour(Ent.FLOAT, 1) == Col.WHITE) 945 988 if (getColour(Ent.FLOAT, 2) == Col.RED) { 946 989 setRegion(Reg.C); 947 dlg.panelMain.panelChan.portButton. doClick();990 dlg.panelMain.panelChan.portButton.setSelected(true); 948 991 } else { 949 dlg.panelMain.panelChan.safeWaterButton. doClick();992 dlg.panelMain.panelChan.safeWaterButton.setSelected(true); 950 993 } 951 994 else if (getColour(Ent.FLOAT, 1) == Col.GREEN) { … … 954 997 } 955 998 if (getRegion().equals("B")) { 956 dlg.panelMain.panelChan.prefStbdButton. doClick();999 dlg.panelMain.panelChan.prefStbdButton.setSelected(true); 957 1000 } else { 958 dlg.panelMain.panelChan.prefPortButton. doClick();1001 dlg.panelMain.panelChan.prefPortButton.setSelected(true); 959 1002 } 960 1003 } else { 961 1004 if (getRegion().equals("B")) 962 dlg.panelMain.panelChan.stbdButton. doClick();1005 dlg.panelMain.panelChan.stbdButton.setSelected(true); 963 1006 else 964 dlg.panelMain.panelChan.portButton. doClick();1007 dlg.panelMain.panelChan.portButton.setSelected(true); 965 1008 } 966 1009 break; 967 1010 case GREEN: 968 dlg.panelMain.chanButton. doClick();1011 dlg.panelMain.chanButton.setSelected(true); 969 1012 if (getColour(Ent.FLOAT, 1) == Col.RED) { 970 1013 if (getRegion().equals("B")) { 971 dlg.panelMain.panelChan.prefPortButton. doClick();1014 dlg.panelMain.panelChan.prefPortButton.setSelected(true); 972 1015 } else { 973 dlg.panelMain.panelChan.prefStbdButton. doClick();1016 dlg.panelMain.panelChan.prefStbdButton.setSelected(true); 974 1017 } 975 1018 } else if (getColour(Ent.FLOAT, 1) == Col.WHITE) { 976 1019 setRegion(Reg.C); 977 dlg.panelMain.panelChan.stbdButton. doClick();1020 dlg.panelMain.panelChan.stbdButton.setSelected(true); 978 1021 } else { 979 1022 if (getRegion().equals("B")) { 980 dlg.panelMain.panelChan.portButton. doClick();1023 dlg.panelMain.panelChan.portButton.setSelected(true); 981 1024 } else { 982 dlg.panelMain.panelChan.stbdButton. doClick();1025 dlg.panelMain.panelChan.stbdButton.setSelected(true); 983 1026 } 984 1027 } 985 1028 break; 986 1029 case BLACK: 987 dlg.panelMain.hazButton. doClick();1030 dlg.panelMain.hazButton.setSelected(true); 988 1031 switch (getColour(Ent.FLOAT, 1)) { 989 1032 case YELLOW: 990 1033 if (getColour(Ent.FLOAT, 2) == Col.BLACK) 991 dlg.panelMain.panelHaz.eastButton. doClick();1034 dlg.panelMain.panelHaz.eastButton.setSelected(true); 992 1035 else 993 dlg.panelMain.panelHaz.northButton. doClick();1036 dlg.panelMain.panelHaz.northButton.setSelected(true); 994 1037 break; 995 1038 case RED: 996 dlg.panelMain.panelHaz.isolButton. doClick();1039 dlg.panelMain.panelHaz.isolButton.setSelected(true); 997 1040 break; 998 1041 } … … 1000 1043 case YELLOW: 1001 1044 if (getColour(Ent.FLOAT, 1) == Col.BLACK) { 1002 dlg.panelMain.hazButton. doClick();1045 dlg.panelMain.hazButton.setSelected(true); 1003 1046 if (getColour(Ent.FLOAT, 2) == Col.YELLOW) 1004 dlg.panelMain.panelHaz.westButton. doClick();1047 dlg.panelMain.panelHaz.westButton.setSelected(true); 1005 1048 else 1006 dlg.panelMain.panelHaz.southButton. doClick();1049 dlg.panelMain.panelHaz.southButton.setSelected(true); 1007 1050 } else { 1008 dlg.panelMain.specButton. doClick();1051 dlg.panelMain.specButton.setSelected(true); 1009 1052 } 1010 1053 break; 1011 1054 default: 1012 dlg.panelMain.lightsButton.doClick(); 1013 } 1014 break; 1015 } 1016 1055 dlg.panelMain.lightsButton.setSelected(true); 1056 } 1057 break; 1058 } 1059 1060 dlg.panelMain.syncButtons(); 1061 dlg.panelMain.panelChan.syncButtons(); 1062 dlg.panelMain.panelHaz.syncButtons(); 1063 1064 paintlock = false; 1065 paintSign(); 1017 1066 } 1018 1067
Note:
See TracChangeset
for help on using the changeset viewer.