Changeset 30738 in osm for applications/editors/josm/plugins/smed/src/panels/PanelSpec.java
- Timestamp:
- 2014-10-19T01:27:04+02:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed/src/panels/PanelSpec.java
r30737 r30738 24 24 int idx = categories.get(cat); 25 25 if (dlg.node != null && (idx == categoryBox.getSelectedIndex())) 26 dlg.panelMain.mark.setCategory(cat);26 SmedAction.panelMain.mark.setCategory(cat); 27 27 } 28 28 } … … 35 35 int idx = moorings.get(cat); 36 36 if (dlg.node != null && (idx == mooringBox.getSelectedIndex())) { 37 dlg.panelMain.mark.setCategory(cat);37 SmedAction.panelMain.mark.setCategory(cat); 38 38 if ((cat == Cat.INB_CALM) || (cat == Cat.INB_SBM)) { 39 dlg.panelMain.mark.setObject(Obj.BOYINB);40 dlg.panelMain.mark.setShape(Shp.UNKSHP);39 SmedAction.panelMain.mark.setObject(Obj.BOYINB); 40 SmedAction.panelMain.mark.setShape(Shp.UNKSHP); 41 41 } else { 42 dlg.panelMain.mark.setObject(Obj.MORFAC);42 SmedAction.panelMain.mark.setObject(Obj.MORFAC); 43 43 if (cat != Cat.MOR_BUOY) 44 dlg.panelMain.mark.setShape(Shp.UNKSHP);44 SmedAction.panelMain.mark.setShape(Shp.UNKSHP); 45 45 } 46 46 } … … 66 66 public ActionListener alShape = new ActionListener() { 67 67 public void actionPerformed(java.awt.event.ActionEvent e) { 68 if (( dlg.panelMain.mark.getObject() != Obj.MORFAC) || (dlg.panelMain.mark.getCategory() == Cat.MOR_BUOY)) {68 if ((SmedAction.panelMain.mark.getObject() != Obj.MORFAC) || (SmedAction.panelMain.mark.getCategory() == Cat.MOR_BUOY)) { 69 69 for (Shp shp : shapes.keySet()) { 70 70 JRadioButton button = shapes.get(shp); 71 71 if (button.isSelected()) { 72 dlg.panelMain.mark.setShape(shp);73 if (SeaMark.EntMAP.get( dlg.panelMain.mark.getObject()) != Ent.MOORING) {74 dlg.panelMain.mark.setObject(objects.get(shp));75 if ( dlg.panelMain.mark.getObjColour(0) == Col.UNKCOL) {76 dlg.panelMain.mark.setObjPattern(Pat.NOPAT);77 dlg.panelMain.mark.setObjColour(Col.YELLOW);72 SmedAction.panelMain.mark.setShape(shp); 73 if (SeaMark.EntMAP.get(SmedAction.panelMain.mark.getObject()) != Ent.MOORING) { 74 SmedAction.panelMain.mark.setObject(objects.get(shp)); 75 if (SmedAction.panelMain.mark.getObjColour(0) == Col.UNKCOL) { 76 SmedAction.panelMain.mark.setObjPattern(Pat.NOPAT); 77 SmedAction.panelMain.mark.setObjColour(Col.YELLOW); 78 78 } 79 79 if (button == cairnButton) { 80 dlg.panelMain.mark.setObjPattern(Pat.NOPAT);81 dlg.panelMain.mark.setObjColour(Col.UNKCOL);80 SmedAction.panelMain.mark.setObjPattern(Pat.NOPAT); 81 SmedAction.panelMain.mark.setObjColour(Col.UNKCOL); 82 82 } 83 topmarkButton.setVisible( dlg.panelMain.mark.testValid());83 topmarkButton.setVisible(SmedAction.panelMain.mark.testValid()); 84 84 } 85 85 button.setBorderPainted(true); … … 87 87 button.setBorderPainted(false); 88 88 } 89 dlg.panelMain.panelMore.syncPanel();89 SmedAction.panelMain.panelMore.syncPanel(); 90 90 } 91 91 } … … 95 95 public void actionPerformed(java.awt.event.ActionEvent e) { 96 96 if (topmarkButton.isSelected()) { 97 dlg.panelMain.mark.setTopmark(Top.X_SHAPE);98 dlg.panelMain.mark.setTopPattern(Pat.NOPAT);99 dlg.panelMain.mark.setTopColour(Col.YELLOW);97 SmedAction.panelMain.mark.setTopmark(Top.X_SHAPE); 98 SmedAction.panelMain.mark.setTopPattern(Pat.NOPAT); 99 SmedAction.panelMain.mark.setTopColour(Col.YELLOW); 100 100 topmarkButton.setBorderPainted(true); 101 101 } else { 102 dlg.panelMain.mark.setTopmark(Top.NOTOP);103 dlg.panelMain.mark.setTopPattern(Pat.NOPAT);104 dlg.panelMain.mark.setTopColour(Col.UNKCOL);102 SmedAction.panelMain.mark.setTopmark(Top.NOTOP); 103 SmedAction.panelMain.mark.setTopPattern(Pat.NOPAT); 104 SmedAction.panelMain.mark.setTopColour(Col.UNKCOL); 105 105 topmarkButton.setBorderPainted(false); 106 106 } 107 dlg.panelMain.panelTop.syncPanel();107 SmedAction.panelMain.panelTop.syncPanel(); 108 108 } 109 109 }; … … 111 111 private ActionListener alNotice = new ActionListener() { 112 112 public void actionPerformed(java.awt.event.ActionEvent e) { 113 dlg.panelMain.mark.clrMark();113 SmedAction.panelMain.mark.clrMark(); 114 114 if (noticeButton.isSelected()) { 115 dlg.panelMain.mark.setObject(Obj.NOTMRK);115 SmedAction.panelMain.mark.setObject(Obj.NOTMRK); 116 116 noticeButton.setBorderPainted(true); 117 117 } else { 118 dlg.panelMain.mark.setObject(Obj.UNKOBJ);118 SmedAction.panelMain.mark.setObject(Obj.UNKOBJ); 119 119 noticeButton.setBorderPainted(false); 120 120 } 121 dlg.panelMain.syncPanel();121 SmedAction.panelMain.syncPanel(); 122 122 } 123 123 }; … … 125 125 private ActionListener alMooring = new ActionListener() { 126 126 public void actionPerformed(java.awt.event.ActionEvent e) { 127 dlg.panelMain.mark.setObject(Obj.UNKOBJ);128 dlg.panelMain.mark.setCategory(Cat.NOCAT);129 dlg.panelMain.mark.setTopmark(Top.NOTOP);127 SmedAction.panelMain.mark.setObject(Obj.UNKOBJ); 128 SmedAction.panelMain.mark.setCategory(Cat.NOCAT); 129 SmedAction.panelMain.mark.setTopmark(Top.NOTOP); 130 130 if (mooringButton.isSelected()) { 131 dlg.panelMain.mark.setObject(Obj.MORFAC);131 SmedAction.panelMain.mark.setObject(Obj.MORFAC); 132 132 categoryBox.setVisible(false); 133 133 mooringBox.setVisible(true); … … 234 234 235 235 public void syncPanel() { 236 if (SeaMark.EntMAP.get( dlg.panelMain.mark.getObject()) == Ent.MOORING) {236 if (SeaMark.EntMAP.get(SmedAction.panelMain.mark.getObject()) == Ent.MOORING) { 237 237 mooringButton.setBorderPainted(true); 238 238 categoryBox.setVisible(false); … … 248 248 for (Cat cat : moorings.keySet()) { 249 249 int item = moorings.get(cat); 250 if ( dlg.panelMain.mark.getCategory() == cat)250 if (SmedAction.panelMain.mark.getCategory() == cat) 251 251 mooringBox.setSelectedIndex(item); 252 252 } … … 262 262 cairnButton.setEnabled(true); 263 263 noticeButton.setEnabled(true); 264 topmarkButton.setBorderPainted( dlg.panelMain.mark.getTopmark() != Top.NOTOP);265 topmarkButton.setSelected( dlg.panelMain.mark.getTopmark() != Top.NOTOP);266 topmarkButton.setVisible( dlg.panelMain.mark.testValid());264 topmarkButton.setBorderPainted(SmedAction.panelMain.mark.getTopmark() != Top.NOTOP); 265 topmarkButton.setSelected(SmedAction.panelMain.mark.getTopmark() != Top.NOTOP); 266 topmarkButton.setVisible(SmedAction.panelMain.mark.testValid()); 267 267 for (Cat cat : categories.keySet()) { 268 268 int item = categories.get(cat); 269 if ( dlg.panelMain.mark.getCategory() == cat)269 if (SmedAction.panelMain.mark.getCategory() == cat) 270 270 categoryBox.setSelectedIndex(item); 271 271 } … … 273 273 for (Shp shp : shapes.keySet()) { 274 274 JRadioButton button = shapes.get(shp); 275 if ( dlg.panelMain.mark.getShape() == shp) {275 if (SmedAction.panelMain.mark.getShape() == shp) { 276 276 button.setBorderPainted(true); 277 277 } else … … 279 279 } 280 280 noticeButton.setBorderPainted(false); 281 dlg.panelMain.mark.testValid();281 SmedAction.panelMain.mark.testValid(); 282 282 } 283 283
Note:
See TracChangeset
for help on using the changeset viewer.
