Changeset 30738 in osm for applications/editors/josm/plugins/smed/src/panels/PanelHaz.java
- Timestamp:
- 2014-10-19T01:27:04+02:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed/src/panels/PanelHaz.java
r30737 r30738 24 24 private ActionListener alCat = new ActionListener() { 25 25 public void actionPerformed(java.awt.event.ActionEvent e) { 26 dlg.panelMain.mark.setObjPattern(Pat.HSTRP);26 SmedAction.panelMain.mark.setObjPattern(Pat.HSTRP); 27 27 if (northButton.isSelected()) { 28 dlg.panelMain.mark.setCategory(Cat.CAM_NORTH);29 dlg.panelMain.mark.setObjColour(Col.BLACK);30 dlg.panelMain.mark.addObjColour(Col.YELLOW);28 SmedAction.panelMain.mark.setCategory(Cat.CAM_NORTH); 29 SmedAction.panelMain.mark.setObjColour(Col.BLACK); 30 SmedAction.panelMain.mark.addObjColour(Col.YELLOW); 31 31 northButton.setBorderPainted(true); 32 32 } else { … … 34 34 } 35 35 if (southButton.isSelected()) { 36 dlg.panelMain.mark.setCategory(Cat.CAM_SOUTH);37 dlg.panelMain.mark.setObjColour(Col.YELLOW);38 dlg.panelMain.mark.addObjColour(Col.BLACK);36 SmedAction.panelMain.mark.setCategory(Cat.CAM_SOUTH); 37 SmedAction.panelMain.mark.setObjColour(Col.YELLOW); 38 SmedAction.panelMain.mark.addObjColour(Col.BLACK); 39 39 southButton.setBorderPainted(true); 40 40 } else { … … 42 42 } 43 43 if (eastButton.isSelected()) { 44 dlg.panelMain.mark.setCategory(Cat.CAM_EAST);45 dlg.panelMain.mark.setObjColour(Col.BLACK);46 dlg.panelMain.mark.addObjColour(Col.YELLOW);47 dlg.panelMain.mark.addObjColour(Col.BLACK);44 SmedAction.panelMain.mark.setCategory(Cat.CAM_EAST); 45 SmedAction.panelMain.mark.setObjColour(Col.BLACK); 46 SmedAction.panelMain.mark.addObjColour(Col.YELLOW); 47 SmedAction.panelMain.mark.addObjColour(Col.BLACK); 48 48 eastButton.setBorderPainted(true); 49 49 } else { … … 51 51 } 52 52 if (westButton.isSelected()) { 53 dlg.panelMain.mark.setCategory(Cat.CAM_WEST);54 dlg.panelMain.mark.setObjColour(Col.YELLOW);55 dlg.panelMain.mark.addObjColour(Col.BLACK);56 dlg.panelMain.mark.addObjColour(Col.YELLOW);53 SmedAction.panelMain.mark.setCategory(Cat.CAM_WEST); 54 SmedAction.panelMain.mark.setObjColour(Col.YELLOW); 55 SmedAction.panelMain.mark.addObjColour(Col.BLACK); 56 SmedAction.panelMain.mark.addObjColour(Col.YELLOW); 57 57 westButton.setBorderPainted(true); 58 58 } else { … … 60 60 } 61 61 if (isolButton.isSelected()) { 62 dlg.panelMain.mark.setCategory(Cat.NOCAT);63 dlg.panelMain.mark.setObjColour(Col.BLACK);64 dlg.panelMain.mark.addObjColour(Col.RED);65 dlg.panelMain.mark.addObjColour(Col.BLACK);62 SmedAction.panelMain.mark.setCategory(Cat.NOCAT); 63 SmedAction.panelMain.mark.setObjColour(Col.BLACK); 64 SmedAction.panelMain.mark.addObjColour(Col.RED); 65 SmedAction.panelMain.mark.addObjColour(Col.BLACK); 66 66 isolButton.setBorderPainted(true); 67 67 } else { 68 68 isolButton.setBorderPainted(false); 69 69 } 70 topmarkButton.setVisible( dlg.panelMain.mark.testValid());71 lightButton.setVisible( dlg.panelMain.mark.testValid());72 dlg.panelMain.panelMore.syncPanel();70 topmarkButton.setVisible(SmedAction.panelMain.mark.testValid()); 71 lightButton.setVisible(SmedAction.panelMain.mark.testValid()); 72 SmedAction.panelMain.panelMore.syncPanel(); 73 73 } 74 74 }; … … 90 90 JRadioButton button = shapes.get(shp); 91 91 if (button.isSelected()) { 92 dlg.panelMain.mark.setShape(shp);92 SmedAction.panelMain.mark.setShape(shp); 93 93 if (isolButton.isSelected()) 94 dlg.panelMain.mark.setObject(isdObjects.get(shp));94 SmedAction.panelMain.mark.setObject(isdObjects.get(shp)); 95 95 else 96 dlg.panelMain.mark.setObject(carObjects.get(shp));96 SmedAction.panelMain.mark.setObject(carObjects.get(shp)); 97 97 button.setBorderPainted(true); 98 98 } else 99 99 button.setBorderPainted(false); 100 100 } 101 topmarkButton.setVisible( dlg.panelMain.mark.testValid());102 lightButton.setVisible( dlg.panelMain.mark.testValid());101 topmarkButton.setVisible(SmedAction.panelMain.mark.testValid()); 102 lightButton.setVisible(SmedAction.panelMain.mark.testValid()); 103 103 } 104 104 }; … … 107 107 public void actionPerformed(java.awt.event.ActionEvent e) { 108 108 if (topmarkButton.isSelected()) { 109 dlg.panelMain.mark.setTopPattern(Pat.NOPAT);110 dlg.panelMain.mark.setTopColour(Col.BLACK);111 switch ( dlg.panelMain.mark.getCategory()) {109 SmedAction.panelMain.mark.setTopPattern(Pat.NOPAT); 110 SmedAction.panelMain.mark.setTopColour(Col.BLACK); 111 switch (SmedAction.panelMain.mark.getCategory()) { 112 112 case CAM_NORTH: 113 dlg.panelMain.mark.setTopmark(Top.NORTH);113 SmedAction.panelMain.mark.setTopmark(Top.NORTH); 114 114 break; 115 115 case CAM_SOUTH: 116 dlg.panelMain.mark.setTopmark(Top.SOUTH);116 SmedAction.panelMain.mark.setTopmark(Top.SOUTH); 117 117 break; 118 118 case CAM_EAST: 119 dlg.panelMain.mark.setTopmark(Top.EAST);119 SmedAction.panelMain.mark.setTopmark(Top.EAST); 120 120 break; 121 121 case CAM_WEST: 122 dlg.panelMain.mark.setTopmark(Top.WEST);122 SmedAction.panelMain.mark.setTopmark(Top.WEST); 123 123 break; 124 124 default: 125 dlg.panelMain.mark.setTopmark(Top.SPHERES2);125 SmedAction.panelMain.mark.setTopmark(Top.SPHERES2); 126 126 break; 127 127 } 128 128 topmarkButton.setBorderPainted(true); 129 129 } else { 130 dlg.panelMain.mark.setTopmark(Top.NOTOP);131 dlg.panelMain.mark.setTopPattern(Pat.NOPAT);132 dlg.panelMain.mark.setTopColour(Col.UNKCOL);130 SmedAction.panelMain.mark.setTopmark(Top.NOTOP); 131 SmedAction.panelMain.mark.setTopPattern(Pat.NOPAT); 132 SmedAction.panelMain.mark.setTopColour(Col.UNKCOL); 133 133 topmarkButton.setBorderPainted(false); 134 134 } 135 dlg.panelMain.panelTop.syncPanel();135 SmedAction.panelMain.panelTop.syncPanel(); 136 136 } 137 137 }; … … 140 140 public void actionPerformed(java.awt.event.ActionEvent e) { 141 141 if (lightButton.isSelected()) { 142 dlg.panelMain.mark.setLightAtt(Att.COL, 0, Col.WHITE);143 switch ( dlg.panelMain.mark.getCategory()) {142 SmedAction.panelMain.mark.setLightAtt(Att.COL, 0, Col.WHITE); 143 switch (SmedAction.panelMain.mark.getCategory()) { 144 144 case CAM_NORTH: 145 dlg.panelMain.mark.setLightAtt(Att.CHR, 0, "Q");146 dlg.panelMain.mark.setLightAtt(Att.GRP, 0, "");145 SmedAction.panelMain.mark.setLightAtt(Att.CHR, 0, "Q"); 146 SmedAction.panelMain.mark.setLightAtt(Att.GRP, 0, ""); 147 147 break; 148 148 case CAM_SOUTH: 149 dlg.panelMain.mark.setLightAtt(Att.CHR, 0, "Q+LFl");150 dlg.panelMain.mark.setLightAtt(Att.GRP, 0, "6");149 SmedAction.panelMain.mark.setLightAtt(Att.CHR, 0, "Q+LFl"); 150 SmedAction.panelMain.mark.setLightAtt(Att.GRP, 0, "6"); 151 151 break; 152 152 case CAM_EAST: 153 dlg.panelMain.mark.setLightAtt(Att.CHR, 0, "Q");154 dlg.panelMain.mark.setLightAtt(Att.GRP, 0, "3");153 SmedAction.panelMain.mark.setLightAtt(Att.CHR, 0, "Q"); 154 SmedAction.panelMain.mark.setLightAtt(Att.GRP, 0, "3"); 155 155 break; 156 156 case CAM_WEST: 157 dlg.panelMain.mark.setLightAtt(Att.CHR, 0, "Q");158 dlg.panelMain.mark.setLightAtt(Att.GRP, 0, "9");157 SmedAction.panelMain.mark.setLightAtt(Att.CHR, 0, "Q"); 158 SmedAction.panelMain.mark.setLightAtt(Att.GRP, 0, "9"); 159 159 break; 160 160 default: 161 dlg.panelMain.mark.setLightAtt(Att.CHR, 0, "Fl");162 dlg.panelMain.mark.setLightAtt(Att.GRP, 0, "2");161 SmedAction.panelMain.mark.setLightAtt(Att.CHR, 0, "Fl"); 162 SmedAction.panelMain.mark.setLightAtt(Att.GRP, 0, "2"); 163 163 break; 164 164 } 165 165 lightButton.setBorderPainted(true); 166 166 } else { 167 dlg.panelMain.mark.clrLight();167 SmedAction.panelMain.mark.clrLight(); 168 168 lightButton.setBorderPainted(false); 169 169 } 170 dlg.panelMain.panelLit.syncPanel();170 SmedAction.panelMain.panelLit.syncPanel(); 171 171 } 172 172 }; … … 205 205 206 206 public void syncPanel() { 207 northButton.setBorderPainted( dlg.panelMain.mark.getCategory() == Cat.CAM_NORTH);208 southButton.setBorderPainted( dlg.panelMain.mark.getCategory() == Cat.CAM_SOUTH);209 eastButton.setBorderPainted( dlg.panelMain.mark.getCategory() == Cat.CAM_EAST);210 westButton.setBorderPainted( dlg.panelMain.mark.getCategory() == Cat.CAM_WEST);211 isolButton.setBorderPainted(SeaMark.GrpMAP.get( dlg.panelMain.mark.getObject()) == Grp.ISD);207 northButton.setBorderPainted(SmedAction.panelMain.mark.getCategory() == Cat.CAM_NORTH); 208 southButton.setBorderPainted(SmedAction.panelMain.mark.getCategory() == Cat.CAM_SOUTH); 209 eastButton.setBorderPainted(SmedAction.panelMain.mark.getCategory() == Cat.CAM_EAST); 210 westButton.setBorderPainted(SmedAction.panelMain.mark.getCategory() == Cat.CAM_WEST); 211 isolButton.setBorderPainted(SeaMark.GrpMAP.get(SmedAction.panelMain.mark.getObject()) == Grp.ISD); 212 212 for (Shp shp : shapes.keySet()) { 213 213 JRadioButton button = shapes.get(shp); 214 button.setBorderPainted( dlg.panelMain.mark.getShape() == shp);215 } 216 topmarkButton.setBorderPainted( dlg.panelMain.mark.getTopmark() != Top.NOTOP);217 topmarkButton.setSelected( dlg.panelMain.mark.getTopmark() != Top.NOTOP);218 topmarkButton.setVisible( dlg.panelMain.mark.testValid());219 Boolean lit = ( dlg.panelMain.mark.getLightAtt(Att.COL, 0) != Col.UNKCOL) && !((String)dlg.panelMain.mark.getLightAtt(Att.CHR, 0)).isEmpty();214 button.setBorderPainted(SmedAction.panelMain.mark.getShape() == shp); 215 } 216 topmarkButton.setBorderPainted(SmedAction.panelMain.mark.getTopmark() != Top.NOTOP); 217 topmarkButton.setSelected(SmedAction.panelMain.mark.getTopmark() != Top.NOTOP); 218 topmarkButton.setVisible(SmedAction.panelMain.mark.testValid()); 219 Boolean lit = (SmedAction.panelMain.mark.getLightAtt(Att.COL, 0) != Col.UNKCOL) && !((String)SmedAction.panelMain.mark.getLightAtt(Att.CHR, 0)).isEmpty(); 220 220 lightButton.setBorderPainted(lit); 221 221 lightButton.setSelected(lit); 222 lightButton.setVisible( dlg.panelMain.mark.testValid());222 lightButton.setVisible(SmedAction.panelMain.mark.testValid()); 223 223 } 224 224
Note:
See TracChangeset
for help on using the changeset viewer.
