Changeset 30738 in osm for applications/editors/josm/plugins/smed/src
- Timestamp:
- 2014-10-19T01:27:04+02:00 (10 years ago)
- Location:
- applications/editors/josm/plugins/smed/src
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed/src/panels/PanelChan.java
r29894 r30738 28 28 panelStbd.setVisible(false); 29 29 panelSaw.setVisible(false); 30 dlg.panelMain.moreButton.setVisible(false);31 dlg.panelMain.saveButton.setEnabled(false);30 SmedAction.panelMain.moreButton.setVisible(false); 31 SmedAction.panelMain.saveButton.setEnabled(false); 32 32 topmarkButton.setVisible(false); 33 33 lightButton.setVisible(false); 34 Shp shp = dlg.panelMain.mark.getShape();34 Shp shp = SmedAction.panelMain.mark.getShape(); 35 35 if (portButton.isSelected()) { 36 dlg.panelMain.mark.setCategory(Cat.LAM_PORT);36 SmedAction.panelMain.mark.setCategory(Cat.LAM_PORT); 37 37 if (panelPort.shapes.containsKey(shp)) { 38 38 panelPort.shapes.get(shp).setSelected(true); 39 39 } else { 40 40 panelPort.shapeButtons.clearSelection(); 41 dlg.panelMain.mark.setShape(Shp.UNKSHP);41 SmedAction.panelMain.mark.setShape(Shp.UNKSHP); 42 42 } 43 43 panelPort.alShape.actionPerformed(null); … … 48 48 } 49 49 if (stbdButton.isSelected()) { 50 dlg.panelMain.mark.setCategory(Cat.LAM_STBD);50 SmedAction.panelMain.mark.setCategory(Cat.LAM_STBD); 51 51 if (panelStbd.shapes.containsKey(shp)) { 52 52 panelStbd.shapes.get(shp).setSelected(true); 53 53 } else { 54 54 panelStbd.shapeButtons.clearSelection(); 55 dlg.panelMain.mark.setShape(Shp.UNKSHP);55 SmedAction.panelMain.mark.setShape(Shp.UNKSHP); 56 56 } 57 57 panelStbd.alShape.actionPerformed(null); … … 62 62 } 63 63 if (prefStbdButton.isSelected()) { 64 dlg.panelMain.mark.setCategory(Cat.LAM_PSTBD);64 SmedAction.panelMain.mark.setCategory(Cat.LAM_PSTBD); 65 65 if (panelPort.shapes.containsKey(shp)) { 66 66 panelPort.shapes.get(shp).setSelected(true); 67 67 } else { 68 68 panelPort.shapeButtons.clearSelection(); 69 dlg.panelMain.mark.setShape(Shp.UNKSHP);69 SmedAction.panelMain.mark.setShape(Shp.UNKSHP); 70 70 } 71 71 panelPort.alShape.actionPerformed(null); … … 76 76 } 77 77 if (prefPortButton.isSelected()) { 78 dlg.panelMain.mark.setCategory(Cat.LAM_PPORT);78 SmedAction.panelMain.mark.setCategory(Cat.LAM_PPORT); 79 79 if (panelStbd.shapes.containsKey(shp)) { 80 80 panelStbd.shapes.get(shp).setSelected(true); 81 81 } else { 82 82 panelStbd.shapeButtons.clearSelection(); 83 dlg.panelMain.mark.setShape(Shp.UNKSHP);83 SmedAction.panelMain.mark.setShape(Shp.UNKSHP); 84 84 } 85 85 panelStbd.alShape.actionPerformed(null); … … 90 90 } 91 91 if (safeWaterButton.isSelected()) { 92 dlg.panelMain.mark.setCategory(Cat.NOCAT);92 SmedAction.panelMain.mark.setCategory(Cat.NOCAT); 93 93 panelSaw.setVisible(true); 94 94 if (panelSaw.shapes.containsKey(shp)) { … … 96 96 } else { 97 97 panelSaw.shapeButtons.clearSelection(); 98 dlg.panelMain.mark.setShape(Shp.UNKSHP);98 SmedAction.panelMain.mark.setShape(Shp.UNKSHP); 99 99 } 100 100 panelSaw.alShape.actionPerformed(null); … … 104 104 safeWaterButton.setBorderPainted(false); 105 105 } 106 topmarkButton.setVisible( dlg.panelMain.mark.testValid());107 lightButton.setVisible( dlg.panelMain.mark.testValid());108 dlg.panelMain.panelMore.syncPanel();106 topmarkButton.setVisible(SmedAction.panelMain.mark.testValid()); 107 lightButton.setVisible(SmedAction.panelMain.mark.testValid()); 108 SmedAction.panelMain.panelMore.syncPanel(); 109 109 } 110 110 }; … … 113 113 public void actionPerformed(java.awt.event.ActionEvent e) { 114 114 if (topmarkButton.isSelected()) { 115 if (SeaMark.GrpMAP.get( dlg.panelMain.mark.getObject()) == Grp.SAW) {116 dlg.panelMain.mark.setTopmark(Top.SPHERE);117 dlg.panelMain.mark.setTopPattern(Pat.NOPAT);118 dlg.panelMain.mark.setTopColour(Col.RED);115 if (SeaMark.GrpMAP.get(SmedAction.panelMain.mark.getObject()) == Grp.SAW) { 116 SmedAction.panelMain.mark.setTopmark(Top.SPHERE); 117 SmedAction.panelMain.mark.setTopPattern(Pat.NOPAT); 118 SmedAction.panelMain.mark.setTopColour(Col.RED); 119 119 } else { 120 120 switch (dlg.panelMain.mark.getCategory()) { -
applications/editors/josm/plugins/smed/src/panels/PanelChr.java
r30737 r30738 67 67 } 68 68 String str = charBox.getText(); 69 dlg.panelMain.mark.setLightAtt(Att.CHR, 0, str);69 SmedAction.panelMain.mark.setLightAtt(Att.CHR, 0, str); 70 70 if (!str.contains("Al")) { 71 col2Label.setBackground(SeaMark.ColMAP.get( dlg.panelMain.mark.getLightAtt(Att.COL, 0)));72 dlg.panelMain.mark.setLightAtt(Att.ALT, 0, Col.UNKCOL);71 col2Label.setBackground(SeaMark.ColMAP.get(SmedAction.panelMain.mark.getLightAtt(Att.COL, 0))); 72 SmedAction.panelMain.mark.setLightAtt(Att.ALT, 0, Col.UNKCOL); 73 73 } else { 74 col2Label.setBackground(SeaMark.ColMAP.get( dlg.panelMain.mark.getLightAtt(Att.ALT, 0)));74 col2Label.setBackground(SeaMark.ColMAP.get(SmedAction.panelMain.mark.getLightAtt(Att.ALT, 0))); 75 75 } 76 76 } … … 80 80 public void focusLost(java.awt.event.FocusEvent e) { 81 81 String str = charBox.getText(); 82 dlg.panelMain.mark.setLightAtt(Att.CHR, 0, str);82 SmedAction.panelMain.mark.setLightAtt(Att.CHR, 0, str); 83 83 EnumSet<Chr> set = EnumSet.noneOf(Chr.class); 84 84 for (EnumSet<Chr> map : SeaMark.ChrMAP.keySet()) { … … 99 99 } 100 100 if (!str.contains("Al")) { 101 col2Label.setBackground(SeaMark.ColMAP.get( dlg.panelMain.mark.getLightAtt(Att.COL, 0)));102 dlg.panelMain.mark.setLightAtt(Att.ALT, 0, Col.UNKCOL);101 col2Label.setBackground(SeaMark.ColMAP.get(SmedAction.panelMain.mark.getLightAtt(Att.COL, 0))); 102 SmedAction.panelMain.mark.setLightAtt(Att.ALT, 0, Col.UNKCOL); 103 103 } else { 104 col2Label.setBackground(SeaMark.ColMAP.get( dlg.panelMain.mark.getLightAtt(Att.ALT, 0)));104 col2Label.setBackground(SeaMark.ColMAP.get(SmedAction.panelMain.mark.getLightAtt(Att.ALT, 0))); 105 105 } 106 106 } … … 141 141 142 142 public void syncPanel() { 143 String str = (String) dlg.panelMain.mark.getLightAtt(Att.CHR, 0);143 String str = (String)SmedAction.panelMain.mark.getLightAtt(Att.CHR, 0); 144 144 charBox.setText(str); 145 145 EnumSet<Chr> set = EnumSet.noneOf(Chr.class); … … 151 151 } 152 152 if (!str.contains("Al")) { 153 col2Label.setBackground(SeaMark.ColMAP.get( dlg.panelMain.mark.getLightAtt(Att.COL, 0)));153 col2Label.setBackground(SeaMark.ColMAP.get(SmedAction.panelMain.mark.getLightAtt(Att.COL, 0))); 154 154 } else { 155 col2Label.setBackground(SeaMark.ColMAP.get( dlg.panelMain.mark.getLightAtt(Att.ALT, 0)));155 col2Label.setBackground(SeaMark.ColMAP.get(SmedAction.panelMain.mark.getLightAtt(Att.ALT, 0))); 156 156 } 157 col1Label.setBackground(SeaMark.ColMAP.get( dlg.panelMain.mark.getLightAtt(Att.COL, 0)));157 col1Label.setBackground(SeaMark.ColMAP.get(SmedAction.panelMain.mark.getLightAtt(Att.COL, 0))); 158 158 for (Chr chr : buttons.keySet()) { 159 159 JToggleButton button = buttons.get(chr); -
applications/editors/josm/plugins/smed/src/panels/PanelCol.java
r30737 r30738 41 41 if (button.isSelected()) { 42 42 if (ent == Ent.LIGHT) { 43 if (((String) dlg.panelMain.mark.getLightAtt(Att.CHR, 0)).contains("Al")) {44 if (((button == delButton) && ( dlg.panelMain.mark.getLightAtt(Att.ALT, 0) == Col.UNKCOL))45 || ( dlg.panelMain.mark.getLightAtt(Att.COL, 0) == Col.UNKCOL)) {46 dlg.panelMain.mark.setLightAtt(Att.COL, 0, col);47 dlg.panelMain.panelLit.panelChr.col1Label.setBackground(SeaMark.ColMAP.get(col));43 if (((String) SmedAction.panelMain.mark.getLightAtt(Att.CHR, 0)).contains("Al")) { 44 if (((button == delButton) && (SmedAction.panelMain.mark.getLightAtt(Att.ALT, 0) == Col.UNKCOL)) 45 || (SmedAction.panelMain.mark.getLightAtt(Att.COL, 0) == Col.UNKCOL)) { 46 SmedAction.panelMain.mark.setLightAtt(Att.COL, 0, col); 47 SmedAction.panelMain.panelLit.panelChr.col1Label.setBackground(SeaMark.ColMAP.get(col)); 48 48 } else { 49 dlg.panelMain.mark.setLightAtt(Att.ALT, 0, col);50 dlg.panelMain.panelLit.panelChr.col2Label.setBackground(SeaMark.ColMAP.get(col));49 SmedAction.panelMain.mark.setLightAtt(Att.ALT, 0, col); 50 SmedAction.panelMain.panelLit.panelChr.col2Label.setBackground(SeaMark.ColMAP.get(col)); 51 51 } 52 52 } else { 53 dlg.panelMain.mark.setLightAtt(Att.COL, 0, col);54 dlg.panelMain.panelLit.panelChr.col1Label.setBackground(SeaMark.ColMAP.get(col));55 dlg.panelMain.panelLit.panelChr.col2Label.setBackground(SeaMark.ColMAP.get(col));53 SmedAction.panelMain.mark.setLightAtt(Att.COL, 0, col); 54 SmedAction.panelMain.panelLit.panelChr.col1Label.setBackground(SeaMark.ColMAP.get(col)); 55 SmedAction.panelMain.panelLit.panelChr.col2Label.setBackground(SeaMark.ColMAP.get(col)); 56 56 } 57 57 button.setBorderPainted(true); 58 58 } else { 59 59 if (button == delButton) { 60 dlg.panelMain.mark.subColour(ent, stackIdx);60 SmedAction.panelMain.mark.subColour(ent, stackIdx); 61 61 } else if (button == addButton) { 62 62 if (stackCol.size() != 0) 63 63 stackIdx++; 64 64 if (stackCol.size() == 0) 65 dlg.panelMain.mark.setColour(ent, col);65 SmedAction.panelMain.mark.setColour(ent, col); 66 66 else 67 switch ( dlg.panelMain.mark.getPattern(ent)) {67 switch (SmedAction.panelMain.mark.getPattern(ent)) { 68 68 case NOPAT: 69 69 break; … … 71 71 case CROSS: 72 72 if (stackCol.size() < 2) 73 dlg.panelMain.mark.addColour(ent, stackIdx, col);73 SmedAction.panelMain.mark.addColour(ent, stackIdx, col); 74 74 break; 75 75 case SQUARED: 76 76 if (stackCol.size() < 4) 77 dlg.panelMain.mark.addColour(ent, stackIdx, col);77 SmedAction.panelMain.mark.addColour(ent, stackIdx, col); 78 78 break; 79 79 default: 80 dlg.panelMain.mark.addColour(ent, stackIdx, col);80 SmedAction.panelMain.mark.addColour(ent, stackIdx, col); 81 81 break; 82 82 } 83 83 } else { 84 dlg.panelMain.mark.setColour(ent, stackIdx, col);84 SmedAction.panelMain.mark.setColour(ent, stackIdx, col); 85 85 } 86 86 syncPanel(); … … 150 150 for (Col col : colours.keySet()) { 151 151 JRadioButton button = colours.get(col); 152 if ( dlg.panelMain.mark.getLightAtt(Att.COL, 0) == col) {152 if (SmedAction.panelMain.mark.getLightAtt(Att.COL, 0) == col) { 153 153 button.setBorderPainted(true); 154 154 } else … … 157 157 } else { 158 158 int idx; 159 for (idx = 0; dlg.panelMain.mark.getColour(ent, idx) != Col.UNKCOL; idx++) {159 for (idx = 0; SmedAction.panelMain.mark.getColour(ent, idx) != Col.UNKCOL; idx++) { 160 160 if (stackCol.size() <= idx) { 161 161 stackCol.add(idx, new JRadioButton(new ImageIcon(getClass().getResource("/images/ColourButton.png")))); … … 185 185 JRadioButton btnI = stackCol.get(idx); 186 186 btnI.setBounds(2, (2 + (idx * height)), 30, height); 187 btnI.setBackground(SeaMark.ColMAP.get( dlg.panelMain.mark.getColour(ent, idx)));187 btnI.setBackground(SeaMark.ColMAP.get(SmedAction.panelMain.mark.getColour(ent, idx))); 188 188 if (stackIdx == idx) { 189 189 btnI.setBorderPainted(true); -
applications/editors/josm/plugins/smed/src/panels/PanelFog.java
r30737 r30738 30 30 JRadioButton button = fogs.get(fog); 31 31 if (button.isSelected()) { 32 dlg.panelMain.mark.setFogSound(fog);32 SmedAction.panelMain.mark.setFogSound(fog); 33 33 button.setBorderPainted(true); 34 34 } else … … 41 41 private FocusListener flGroup = new FocusAdapter() { 42 42 public void focusLost(java.awt.event.FocusEvent e) { 43 dlg.panelMain.mark.setFogGroup(groupBox.getText());43 SmedAction.panelMain.mark.setFogGroup(groupBox.getText()); 44 44 } 45 45 }; … … 48 48 private FocusListener flPeriod = new FocusAdapter() { 49 49 public void focusLost(java.awt.event.FocusEvent e) { 50 dlg.panelMain.mark.setFogPeriod(periodBox.getText());50 SmedAction.panelMain.mark.setFogPeriod(periodBox.getText()); 51 51 } 52 52 }; … … 55 55 private FocusListener flSeq = new FocusAdapter() { 56 56 public void focusLost(java.awt.event.FocusEvent e) { 57 dlg.panelMain.mark.setFogSequence(seqBox.getText());57 SmedAction.panelMain.mark.setFogSequence(seqBox.getText()); 58 58 } 59 59 }; … … 62 62 private FocusListener flRange = new FocusAdapter() { 63 63 public void focusLost(java.awt.event.FocusEvent e) { 64 dlg.panelMain.mark.setFogRange(rangeBox.getText());64 SmedAction.panelMain.mark.setFogRange(rangeBox.getText()); 65 65 } 66 66 }; … … 120 120 for (Fog fog : fogs.keySet()) { 121 121 JRadioButton button = fogs.get(fog); 122 button.setBorderPainted( dlg.panelMain.mark.getFogSound() == fog);122 button.setBorderPainted(SmedAction.panelMain.mark.getFogSound() == fog); 123 123 } 124 groupBox.setText( dlg.panelMain.mark.getFogGroup());125 seqBox.setText( dlg.panelMain.mark.getFogSequence());126 periodBox.setText( dlg.panelMain.mark.getFogPeriod());127 rangeBox.setText( dlg.panelMain.mark.getFogRange());124 groupBox.setText(SmedAction.panelMain.mark.getFogGroup()); 125 seqBox.setText(SmedAction.panelMain.mark.getFogSequence()); 126 periodBox.setText(SmedAction.panelMain.mark.getFogPeriod()); 127 rangeBox.setText(SmedAction.panelMain.mark.getFogRange()); 128 128 } 129 129 -
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 -
applications/editors/josm/plugins/smed/src/panels/PanelLights.java
r30737 r30738 25 25 int idx = landCats.get(cat); 26 26 if (dlg.node != null && (idx == landCatBox.getSelectedIndex())) { 27 dlg.panelMain.mark.setCategory(cat);28 dlg.panelMain.mark.testValid();27 SmedAction.panelMain.mark.setCategory(cat); 28 SmedAction.panelMain.mark.testValid(); 29 29 } 30 30 } … … 38 38 int idx = trafficCats.get(cat); 39 39 if (dlg.node != null && (idx == trafficCatBox.getSelectedIndex())) { 40 dlg.panelMain.mark.setCategory(cat);41 dlg.panelMain.mark.testValid();40 SmedAction.panelMain.mark.setCategory(cat); 41 SmedAction.panelMain.mark.testValid(); 42 42 } 43 43 } … … 51 51 int idx = warningCats.get(cat); 52 52 if (dlg.node != null && (idx == warningCatBox.getSelectedIndex())) { 53 dlg.panelMain.mark.setCategory(cat);54 dlg.panelMain.mark.testValid();53 SmedAction.panelMain.mark.setCategory(cat); 54 SmedAction.panelMain.mark.testValid(); 55 55 } 56 56 } … … 64 64 int idx = platformCats.get(cat); 65 65 if (dlg.node != null && (idx == platformCatBox.getSelectedIndex())) { 66 dlg.panelMain.mark.setCategory(cat);67 dlg.panelMain.mark.testValid();66 SmedAction.panelMain.mark.setCategory(cat); 67 SmedAction.panelMain.mark.testValid(); 68 68 } 69 69 } … … 77 77 int idx = pilotCats.get(cat); 78 78 if (dlg.node != null && (idx == pilotCatBox.getSelectedIndex())) { 79 dlg.panelMain.mark.setCategory(cat);80 dlg.panelMain.mark.testValid();79 SmedAction.panelMain.mark.setCategory(cat); 80 SmedAction.panelMain.mark.testValid(); 81 81 } 82 82 } … … 90 90 int idx = rescueCats.get(cat); 91 91 if (dlg.node != null && (idx == rescueCatBox.getSelectedIndex())) { 92 dlg.panelMain.mark.setCategory(cat);93 dlg.panelMain.mark.testValid();92 SmedAction.panelMain.mark.setCategory(cat); 93 SmedAction.panelMain.mark.testValid(); 94 94 } 95 95 } … … 103 103 int idx = radioCats.get(cat); 104 104 if (dlg.node != null && (idx == radioCatBox.getSelectedIndex())) { 105 dlg.panelMain.mark.setCategory(cat);106 dlg.panelMain.mark.testValid();105 SmedAction.panelMain.mark.setCategory(cat); 106 SmedAction.panelMain.mark.testValid(); 107 107 } 108 108 } … … 116 116 int idx = radarCats.get(cat); 117 117 if (dlg.node != null && (idx == radarCatBox.getSelectedIndex())) { 118 dlg.panelMain.mark.setCategory(cat);119 dlg.panelMain.mark.testValid();118 SmedAction.panelMain.mark.setCategory(cat); 119 SmedAction.panelMain.mark.testValid(); 120 120 } 121 121 } … … 130 130 int idx = functions.get(fnc); 131 131 if (dlg.node != null && (idx == functionBox.getSelectedIndex())) { 132 dlg.panelMain.mark.setFunc(fnc);133 dlg.panelMain.mark.testValid();132 SmedAction.panelMain.mark.setFunc(fnc); 133 SmedAction.panelMain.mark.testValid(); 134 134 } 135 135 } … … 157 157 JRadioButton button = objects.get(obj); 158 158 if (button.isSelected()) { 159 dlg.panelMain.mark.setObject(obj);159 SmedAction.panelMain.mark.setObject(obj); 160 160 button.setBorderPainted(true); 161 161 } else 162 162 button.setBorderPainted(false); 163 163 } 164 if ( dlg.panelMain.mark.getObject() == Obj.LITVES)165 dlg.panelMain.mark.setShape(Shp.SUPER);166 else if ( dlg.panelMain.mark.getObject() == Obj.LITFLT)167 dlg.panelMain.mark.setShape(Shp.FLOAT);168 else dlg.panelMain.mark.setShape(Shp.UNKSHP);164 if (SmedAction.panelMain.mark.getObject() == Obj.LITVES) 165 SmedAction.panelMain.mark.setShape(Shp.SUPER); 166 else if (SmedAction.panelMain.mark.getObject() == Obj.LITFLT) 167 SmedAction.panelMain.mark.setShape(Shp.FLOAT); 168 else SmedAction.panelMain.mark.setShape(Shp.UNKSHP); 169 169 functionLabel.setVisible(false); 170 170 categoryLabel.setVisible(false); … … 181 181 chLabel.setVisible(false); 182 182 chBox.setVisible(false); 183 dlg.panelMain.mark.setCategory(Cat.NOCAT);183 SmedAction.panelMain.mark.setCategory(Cat.NOCAT); 184 184 if (landButton.isSelected()) { 185 185 functionLabel.setVisible(true); … … 227 227 alRadarCatBox.actionPerformed(null); 228 228 } 229 dlg.panelMain.mark.testValid();229 SmedAction.panelMain.mark.testValid(); 230 230 } 231 231 }; … … 234 234 private FocusListener flCh = new FocusAdapter() { 235 235 public void focusLost(java.awt.event.FocusEvent e) { 236 dlg.panelMain.mark.setChannel(chBox.getText());236 SmedAction.panelMain.mark.setChannel(chBox.getText()); 237 237 } 238 238 }; … … 462 462 chLabel.setVisible(false); 463 463 chBox.setVisible(false); 464 chBox.setText( dlg.panelMain.mark.getChannel());465 if (( dlg.panelMain.mark.getObject() == Obj.LNDMRK) && ((dlg.panelMain.mark.getCategory() != Cat.NOCAT) || (dlg.panelMain.mark.getFunc() != Fnc.UNKFNC))) {464 chBox.setText(SmedAction.panelMain.mark.getChannel()); 465 if ((SmedAction.panelMain.mark.getObject() == Obj.LNDMRK) && ((SmedAction.panelMain.mark.getCategory() != Cat.NOCAT) || (SmedAction.panelMain.mark.getFunc() != Fnc.UNKFNC))) { 466 466 functionLabel.setVisible(true); 467 467 categoryLabel.setVisible(true); … … 470 470 for (Fnc fnc : functions.keySet()) { 471 471 int item = functions.get(fnc); 472 if ( dlg.panelMain.mark.getFunc() == fnc)472 if (SmedAction.panelMain.mark.getFunc() == fnc) 473 473 functionBox.setSelectedIndex(item); 474 474 } 475 475 for (Cat cat : landCats.keySet()) { 476 476 int item = landCats.get(cat); 477 if ( dlg.panelMain.mark.getCategory() == cat)477 if (SmedAction.panelMain.mark.getCategory() == cat) 478 478 landCatBox.setSelectedIndex(item); 479 479 } 480 } else if ( dlg.panelMain.mark.getObject() == Obj.SISTAT) {480 } else if (SmedAction.panelMain.mark.getObject() == Obj.SISTAT) { 481 481 categoryLabel.setVisible(true); 482 482 trafficCatBox.setVisible(true); 483 483 for (Cat cat : trafficCats.keySet()) { 484 484 int item = trafficCats.get(cat); 485 if ( dlg.panelMain.mark.getCategory() == cat)485 if (SmedAction.panelMain.mark.getCategory() == cat) 486 486 trafficCatBox.setSelectedIndex(item); 487 487 } 488 488 chLabel.setVisible(true); 489 489 chBox.setVisible(true); 490 } else if ( dlg.panelMain.mark.getObject() == Obj.SISTAW) {490 } else if (SmedAction.panelMain.mark.getObject() == Obj.SISTAW) { 491 491 categoryLabel.setVisible(true); 492 492 warningCatBox.setVisible(true); 493 493 for (Cat cat : warningCats.keySet()) { 494 494 int item = warningCats.get(cat); 495 if ( dlg.panelMain.mark.getCategory() == cat)495 if (SmedAction.panelMain.mark.getCategory() == cat) 496 496 warningCatBox.setSelectedIndex(item); 497 497 } 498 498 chLabel.setVisible(true); 499 499 chBox.setVisible(true); 500 } else if ( dlg.panelMain.mark.getObject() == Obj.OFSPLF) {500 } else if (SmedAction.panelMain.mark.getObject() == Obj.OFSPLF) { 501 501 categoryLabel.setVisible(true); 502 502 platformCatBox.setVisible(true); 503 503 for (Cat cat : platformCats.keySet()) { 504 504 int item = platformCats.get(cat); 505 if ( dlg.panelMain.mark.getCategory() == cat)505 if (SmedAction.panelMain.mark.getCategory() == cat) 506 506 platformCatBox.setSelectedIndex(item); 507 507 } 508 } else if ( dlg.panelMain.mark.getObject() == Obj.PILBOP) {508 } else if (SmedAction.panelMain.mark.getObject() == Obj.PILBOP) { 509 509 categoryLabel.setVisible(true); 510 510 pilotCatBox.setVisible(true); 511 511 for (Cat cat : pilotCats.keySet()) { 512 512 int item = pilotCats.get(cat); 513 if ( dlg.panelMain.mark.getCategory() == cat)513 if (SmedAction.panelMain.mark.getCategory() == cat) 514 514 pilotCatBox.setSelectedIndex(item); 515 515 } 516 516 chLabel.setVisible(true); 517 517 chBox.setVisible(true); 518 } else if ( dlg.panelMain.mark.getObject() == Obj.RSCSTA) {518 } else if (SmedAction.panelMain.mark.getObject() == Obj.RSCSTA) { 519 519 categoryLabel.setVisible(true); 520 520 rescueCatBox.setVisible(true); 521 521 for (Cat cat : rescueCats.keySet()) { 522 522 int item = rescueCats.get(cat); 523 if ( dlg.panelMain.mark.getCategory() == cat)523 if (SmedAction.panelMain.mark.getCategory() == cat) 524 524 rescueCatBox.setSelectedIndex(item); 525 525 } 526 } else if ( dlg.panelMain.mark.getObject() == Obj.RDOSTA) {526 } else if (SmedAction.panelMain.mark.getObject() == Obj.RDOSTA) { 527 527 categoryLabel.setVisible(true); 528 528 radioCatBox.setVisible(true); 529 529 for (Cat cat : radioCats.keySet()) { 530 530 int item = radioCats.get(cat); 531 if ( dlg.panelMain.mark.getCategory() == cat)531 if (SmedAction.panelMain.mark.getCategory() == cat) 532 532 radioCatBox.setSelectedIndex(item); 533 533 } 534 534 chLabel.setVisible(true); 535 535 chBox.setVisible(true); 536 } else if ( dlg.panelMain.mark.getObject() == Obj.RADSTA) {536 } else if (SmedAction.panelMain.mark.getObject() == Obj.RADSTA) { 537 537 categoryLabel.setVisible(true); 538 538 radarCatBox.setVisible(true); 539 539 for (Cat cat : radarCats.keySet()) { 540 540 int item = radarCats.get(cat); 541 if ( dlg.panelMain.mark.getCategory() == cat)541 if (SmedAction.panelMain.mark.getCategory() == cat) 542 542 radarCatBox.setSelectedIndex(item); 543 543 } … … 547 547 for (Obj obj : objects.keySet()) { 548 548 JRadioButton button = objects.get(obj); 549 button.setBorderPainted( dlg.panelMain.mark.getObject() == obj);550 } 551 dlg.panelMain.mark.testValid();549 button.setBorderPainted(SmedAction.panelMain.mark.getObject() == obj); 550 } 551 SmedAction.panelMain.mark.testValid(); 552 552 } 553 553 -
applications/editors/josm/plugins/smed/src/panels/PanelLit.java
r30737 r30738 21 21 private FocusListener flGroup = new FocusAdapter() { 22 22 public void focusLost(java.awt.event.FocusEvent e) { 23 dlg.panelMain.mark.setLightAtt(Att.GRP, 0, groupBox.getText());23 SmedAction.panelMain.mark.setLightAtt(Att.GRP, 0, groupBox.getText()); 24 24 } 25 25 }; … … 28 28 private FocusListener flPeriod = new FocusAdapter() { 29 29 public void focusLost(java.awt.event.FocusEvent e) { 30 dlg.panelMain.mark.setLightAtt(Att.PER, 0, periodBox.getText());30 SmedAction.panelMain.mark.setLightAtt(Att.PER, 0, periodBox.getText()); 31 31 } 32 32 }; … … 35 35 private FocusListener flSequence = new FocusAdapter() { 36 36 public void focusLost(java.awt.event.FocusEvent e) { 37 dlg.panelMain.mark.setLightAtt(Att.SEQ, 0, sequenceBox.getText());37 SmedAction.panelMain.mark.setLightAtt(Att.SEQ, 0, sequenceBox.getText()); 38 38 } 39 39 }; … … 46 46 int idx = visibilities.get(vis); 47 47 if (idx == visibilityBox.getSelectedIndex()) 48 dlg.panelMain.mark.setLightAtt(Att.VIS, 0, vis);48 SmedAction.panelMain.mark.setLightAtt(Att.VIS, 0, vis); 49 49 } 50 50 } … … 54 54 private FocusListener flHeight = new FocusAdapter() { 55 55 public void focusLost(java.awt.event.FocusEvent e) { 56 dlg.panelMain.mark.setLightAtt(Att.HGT, 0, heightBox.getText());56 SmedAction.panelMain.mark.setLightAtt(Att.HGT, 0, heightBox.getText()); 57 57 } 58 58 }; … … 61 61 private FocusListener flRange = new FocusAdapter() { 62 62 public void focusLost(java.awt.event.FocusEvent e) { 63 dlg.panelMain.mark.setLightAtt(Att.RNG, 0, rangeBox.getText());63 SmedAction.panelMain.mark.setLightAtt(Att.RNG, 0, rangeBox.getText()); 64 64 } 65 65 }; … … 68 68 private FocusListener flOrientation = new FocusAdapter() { 69 69 public void focusLost(java.awt.event.FocusEvent e) { 70 dlg.panelMain.mark.setLightAtt(Att.ORT, 0, orientationBox.getText());70 SmedAction.panelMain.mark.setLightAtt(Att.ORT, 0, orientationBox.getText()); 71 71 } 72 72 }; … … 75 75 private FocusListener flMultiple = new FocusAdapter() { 76 76 public void focusLost(java.awt.event.FocusEvent e) { 77 dlg.panelMain.mark.setLightAtt(Att.MLT, 0, multipleBox.getText());77 SmedAction.panelMain.mark.setLightAtt(Att.MLT, 0, multipleBox.getText()); 78 78 } 79 79 }; … … 86 86 int idx = categories.get(lit); 87 87 if (idx == categoryBox.getSelectedIndex()) 88 dlg.panelMain.mark.setLightAtt(Att.LIT, 0, lit);89 } 90 if ( dlg.panelMain.mark.getLightAtt(Att.LIT, 0) == Lit.DIR) {91 dlg.panelMain.mark.setLightAtt(Att.MLT, 0, "");88 SmedAction.panelMain.mark.setLightAtt(Att.LIT, 0, lit); 89 } 90 if (SmedAction.panelMain.mark.getLightAtt(Att.LIT, 0) == Lit.DIR) { 91 SmedAction.panelMain.mark.setLightAtt(Att.MLT, 0, ""); 92 92 multipleBox.setText(""); 93 93 orientationLabel.setVisible(true); … … 95 95 multipleLabel.setVisible(false); 96 96 multipleBox.setVisible(false); 97 } else if (( dlg.panelMain.mark.getLightAtt(Att.LIT, 0) == Lit.VERT) || (dlg.panelMain.mark.getLightAtt(Att.LIT, 0) == Lit.HORIZ)) {98 dlg.panelMain.mark.setLightAtt(Att.ORT, 0, "");97 } else if ((SmedAction.panelMain.mark.getLightAtt(Att.LIT, 0) == Lit.VERT) || (SmedAction.panelMain.mark.getLightAtt(Att.LIT, 0) == Lit.HORIZ)) { 98 SmedAction.panelMain.mark.setLightAtt(Att.ORT, 0, ""); 99 99 orientationBox.setText(""); 100 100 orientationLabel.setVisible(false); … … 103 103 multipleBox.setVisible(true); 104 104 } else { 105 dlg.panelMain.mark.setLightAtt(Att.MLT, 0, "");105 SmedAction.panelMain.mark.setLightAtt(Att.MLT, 0, ""); 106 106 multipleBox.setText(""); 107 dlg.panelMain.mark.setLightAtt(Att.ORT, 0, "");107 SmedAction.panelMain.mark.setLightAtt(Att.ORT, 0, ""); 108 108 orientationBox.setText(""); 109 109 orientationLabel.setVisible(false); … … 122 122 int idx = exhibitions.get(exh); 123 123 if (idx == exhibitionBox.getSelectedIndex()) 124 dlg.panelMain.mark.setLightAtt(Att.EXH, 0, exh);124 SmedAction.panelMain.mark.setLightAtt(Att.EXH, 0, exh); 125 125 } 126 126 } … … 137 137 } else { 138 138 panelSector.setVisible(false); 139 while ( dlg.panelMain.mark.getSectorCount() > 1)140 dlg.panelMain.mark.delLight(1);139 while (SmedAction.panelMain.mark.getSectorCount() > 1) 140 SmedAction.panelMain.mark.delLight(1); 141 141 } 142 142 } … … 285 285 multipleLabel.setVisible(false); 286 286 multipleBox.setVisible(false); 287 groupBox.setText((String) dlg.panelMain.mark.getLightAtt(Att.GRP, 0));288 periodBox.setText((String) dlg.panelMain.mark.getLightAtt(Att.PER, 0));289 sequenceBox.setText((String) dlg.panelMain.mark.getLightAtt(Att.SEQ, 0));290 heightBox.setText((String) dlg.panelMain.mark.getLightAtt(Att.HGT, 0));291 rangeBox.setText((String) dlg.panelMain.mark.getLightAtt(Att.RNG, 0));292 orientationBox.setText((String) dlg.panelMain.mark.getLightAtt(Att.ORT, 0));293 orientationBox.setVisible( dlg.panelMain.mark.getLightAtt(Att.LIT, 0) == Lit.DIR);294 multipleBox.setText((String) dlg.panelMain.mark.getLightAtt(Att.MLT, 0));295 multipleBox.setVisible(( dlg.panelMain.mark.getLightAtt(Att.LIT, 0) == Lit.VERT) || (dlg.panelMain.mark.getLightAtt(Att.LIT, 0) == Lit.HORIZ));287 groupBox.setText((String)SmedAction.panelMain.mark.getLightAtt(Att.GRP, 0)); 288 periodBox.setText((String)SmedAction.panelMain.mark.getLightAtt(Att.PER, 0)); 289 sequenceBox.setText((String)SmedAction.panelMain.mark.getLightAtt(Att.SEQ, 0)); 290 heightBox.setText((String)SmedAction.panelMain.mark.getLightAtt(Att.HGT, 0)); 291 rangeBox.setText((String)SmedAction.panelMain.mark.getLightAtt(Att.RNG, 0)); 292 orientationBox.setText((String)SmedAction.panelMain.mark.getLightAtt(Att.ORT, 0)); 293 orientationBox.setVisible(SmedAction.panelMain.mark.getLightAtt(Att.LIT, 0) == Lit.DIR); 294 multipleBox.setText((String)SmedAction.panelMain.mark.getLightAtt(Att.MLT, 0)); 295 multipleBox.setVisible((SmedAction.panelMain.mark.getLightAtt(Att.LIT, 0) == Lit.VERT) || (SmedAction.panelMain.mark.getLightAtt(Att.LIT, 0) == Lit.HORIZ)); 296 296 for (Vis vis : visibilities.keySet()) { 297 297 int item = visibilities.get(vis); 298 if ( dlg.panelMain.mark.getLightAtt(Att.VIS, 0) == vis)298 if (SmedAction.panelMain.mark.getLightAtt(Att.VIS, 0) == vis) 299 299 visibilityBox.setSelectedIndex(item); 300 300 } 301 301 for (Lit lit : categories.keySet()) { 302 302 int item = categories.get(lit); 303 if ( dlg.panelMain.mark.getLightAtt(Att.LIT, 0) == lit)303 if (SmedAction.panelMain.mark.getLightAtt(Att.LIT, 0) == lit) 304 304 categoryBox.setSelectedIndex(item); 305 305 } 306 306 for (Exh exh : exhibitions.keySet()) { 307 307 int item = exhibitions.get(exh); 308 if ( dlg.panelMain.mark.getLightAtt(Att.EXH, 0) == exh)308 if (SmedAction.panelMain.mark.getLightAtt(Att.EXH, 0) == exh) 309 309 exhibitionBox.setSelectedIndex(item); 310 310 } 311 if ( dlg.panelMain.mark.isSectored()) {311 if (SmedAction.panelMain.mark.isSectored()) { 312 312 singleButton.setBorderPainted(false); 313 313 sectorButton.setBorderPainted(true); … … 317 317 sectorButton.setBorderPainted(false); 318 318 panelSector.setVisible(false); 319 while ( dlg.panelMain.mark.getSectorCount() > 1)320 dlg.panelMain.mark.delLight(dlg.panelMain.mark.getSectorCount() - 1);319 while (SmedAction.panelMain.mark.getSectorCount() > 1) 320 SmedAction.panelMain.mark.delLight(SmedAction.panelMain.mark.getSectorCount() - 1); 321 321 } 322 322 panelCol.syncPanel(); -
applications/editors/josm/plugins/smed/src/panels/PanelMore.java
r30737 r30738 19 19 private FocusListener flInfo = new FocusAdapter() { 20 20 public void focusLost(java.awt.event.FocusEvent e) { 21 dlg.panelMain.mark.setInfo(infoBox.getText());21 SmedAction.panelMain.mark.setInfo(infoBox.getText()); 22 22 } 23 23 }; … … 26 26 private FocusListener flSource = new FocusAdapter() { 27 27 public void focusLost(java.awt.event.FocusEvent e) { 28 dlg.panelMain.mark.setSource(sourceBox.getText());28 SmedAction.panelMain.mark.setSource(sourceBox.getText()); 29 29 } 30 30 }; … … 33 33 private FocusListener flElev = new FocusAdapter() { 34 34 public void focusLost(java.awt.event.FocusEvent e) { 35 dlg.panelMain.mark.setElevation(elevBox.getText());35 SmedAction.panelMain.mark.setElevation(elevBox.getText()); 36 36 } 37 37 }; … … 40 40 private FocusListener flHeight = new FocusAdapter() { 41 41 public void focusLost(java.awt.event.FocusEvent e) { 42 dlg.panelMain.mark.setObjectHeight(heightBox.getText());42 SmedAction.panelMain.mark.setObjectHeight(heightBox.getText()); 43 43 } 44 44 }; … … 50 50 for (Sts sts : statuses.keySet()) { 51 51 int idx = statuses.get(sts); 52 if ( dlg.panelMain.mark != null && (idx == statusBox.getSelectedIndex()))53 dlg.panelMain.mark.setStatus(sts);52 if (SmedAction.panelMain.mark != null && (idx == statusBox.getSelectedIndex())) 53 SmedAction.panelMain.mark.setStatus(sts); 54 54 } 55 55 } … … 62 62 for (Cns cns : constructions.keySet()) { 63 63 int idx = constructions.get(cns); 64 if ( dlg.panelMain.mark != null && (idx == constrBox.getSelectedIndex()))65 dlg.panelMain.mark.setConstr(cns);64 if (SmedAction.panelMain.mark != null && (idx == constrBox.getSelectedIndex())) 65 SmedAction.panelMain.mark.setConstr(cns); 66 66 } 67 67 } … … 74 74 for (Con con : conspicuities.keySet()) { 75 75 int idx = conspicuities.get(con); 76 if ( dlg.panelMain.mark != null && (idx == conBox.getSelectedIndex()))77 dlg.panelMain.mark.setConsp(con);76 if (SmedAction.panelMain.mark != null && (idx == conBox.getSelectedIndex())) 77 SmedAction.panelMain.mark.setConsp(con); 78 78 } 79 79 } … … 86 86 for (Con con : reflectivities.keySet()) { 87 87 int idx = reflectivities.get(con); 88 if ( dlg.panelMain.mark != null && (idx == reflBox.getSelectedIndex()))89 dlg.panelMain.mark.setRefl(con);88 if (SmedAction.panelMain.mark != null && (idx == reflBox.getSelectedIndex())) 89 SmedAction.panelMain.mark.setRefl(con); 90 90 } 91 91 } … … 99 99 public void actionPerformed(java.awt.event.ActionEvent e) { 100 100 if (regionAButton.isSelected()) { 101 dlg.panelMain.mark.setRegion(Reg.A);101 SmedAction.panelMain.mark.setRegion(Reg.A); 102 102 switch (dlg.panelMain.mark.getCategory()) { 103 103 case LAM_PORT: -
applications/editors/josm/plugins/smed/src/panels/PanelPat.java
r30737 r30738 31 31 JRadioButton button = patterns.get(pat); 32 32 if (button.isSelected()) { 33 dlg.panelMain.mark.setPattern(ent, pat);33 SmedAction.panelMain.mark.setPattern(ent, pat); 34 34 button.setBorderPainted(true); 35 35 } else 36 36 button.setBorderPainted(false); 37 37 } 38 switch ( dlg.panelMain.mark.getPattern(ent)) {38 switch (SmedAction.panelMain.mark.getPattern(ent)) { 39 39 case NOPAT: 40 40 panelCol.trimStack(1); … … 74 74 for (Pat pat : patterns.keySet()) { 75 75 JRadioButton button = patterns.get(pat); 76 if ( dlg.panelMain.mark.getPattern(ent) == pat) {76 if (SmedAction.panelMain.mark.getPattern(ent) == pat) { 77 77 button.setBorderPainted(true); 78 78 } else -
applications/editors/josm/plugins/smed/src/panels/PanelPort.java
r30737 r30738 31 31 JRadioButton button = shapes.get(shp); 32 32 if (button.isSelected()) { 33 dlg.panelMain.mark.setShape(shp);34 dlg.panelMain.mark.setObject(objects.get(shp));33 SmedAction.panelMain.mark.setShape(shp); 34 SmedAction.panelMain.mark.setObject(objects.get(shp)); 35 35 button.setBorderPainted(true); 36 36 } else 37 37 button.setBorderPainted(false); 38 38 } 39 if ( dlg.panelMain.mark.testValid()) {40 dlg.panelMain.panelChan.topmarkButton.setVisible(true);41 dlg.panelMain.panelChan.lightButton.setVisible(true);42 if ( dlg.panelMain.mark.getCategory() == Cat.LAM_PORT) {43 switch ( dlg.panelMain.mark.getRegion()) {39 if (SmedAction.panelMain.mark.testValid()) { 40 SmedAction.panelMain.panelChan.topmarkButton.setVisible(true); 41 SmedAction.panelMain.panelChan.lightButton.setVisible(true); 42 if (SmedAction.panelMain.mark.getCategory() == Cat.LAM_PORT) { 43 switch (SmedAction.panelMain.mark.getRegion()) { 44 44 case A: 45 dlg.panelMain.mark.setObjPattern(Pat.NOPAT);46 dlg.panelMain.mark.setObjColour(Col.RED);45 SmedAction.panelMain.mark.setObjPattern(Pat.NOPAT); 46 SmedAction.panelMain.mark.setObjColour(Col.RED); 47 47 break; 48 48 case B: 49 dlg.panelMain.mark.setObjPattern(Pat.NOPAT);50 dlg.panelMain.mark.setObjColour(Col.GREEN);49 SmedAction.panelMain.mark.setObjPattern(Pat.NOPAT); 50 SmedAction.panelMain.mark.setObjColour(Col.GREEN); 51 51 break; 52 52 case C: 53 dlg.panelMain.mark.setObjPattern(Pat.HSTRP);54 dlg.panelMain.mark.setObjColour(Col.RED);55 dlg.panelMain.mark.addObjColour(Col.WHITE);56 dlg.panelMain.mark.addObjColour(Col.RED);57 dlg.panelMain.mark.addObjColour(Col.WHITE);53 SmedAction.panelMain.mark.setObjPattern(Pat.HSTRP); 54 SmedAction.panelMain.mark.setObjColour(Col.RED); 55 SmedAction.panelMain.mark.addObjColour(Col.WHITE); 56 SmedAction.panelMain.mark.addObjColour(Col.RED); 57 SmedAction.panelMain.mark.addObjColour(Col.WHITE); 58 58 break; 59 59 } 60 60 } else { 61 dlg.panelMain.mark.setObjPattern(Pat.HSTRP);62 switch ( dlg.panelMain.mark.getRegion()) {61 SmedAction.panelMain.mark.setObjPattern(Pat.HSTRP); 62 switch (SmedAction.panelMain.mark.getRegion()) { 63 63 case A: 64 dlg.panelMain.mark.setObjColour(Col.RED);65 dlg.panelMain.mark.addObjColour(Col.GREEN);66 dlg.panelMain.mark.addObjColour(Col.RED);64 SmedAction.panelMain.mark.setObjColour(Col.RED); 65 SmedAction.panelMain.mark.addObjColour(Col.GREEN); 66 SmedAction.panelMain.mark.addObjColour(Col.RED); 67 67 break; 68 68 case B: 69 dlg.panelMain.mark.setObjColour(Col.GREEN);70 dlg.panelMain.mark.addObjColour(Col.RED);71 dlg.panelMain.mark.addObjColour(Col.GREEN);69 SmedAction.panelMain.mark.setObjColour(Col.GREEN); 70 SmedAction.panelMain.mark.addObjColour(Col.RED); 71 SmedAction.panelMain.mark.addObjColour(Col.GREEN); 72 72 break; 73 73 case C: 74 dlg.panelMain.mark.setObjColour(Col.RED);75 dlg.panelMain.mark.addObjColour(Col.GREEN);76 dlg.panelMain.mark.addObjColour(Col.RED);77 dlg.panelMain.mark.addObjColour(Col.GREEN);74 SmedAction.panelMain.mark.setObjColour(Col.RED); 75 SmedAction.panelMain.mark.addObjColour(Col.GREEN); 76 SmedAction.panelMain.mark.addObjColour(Col.RED); 77 SmedAction.panelMain.mark.addObjColour(Col.GREEN); 78 78 break; 79 79 } 80 80 } 81 dlg.panelMain.panelMore.syncPanel();81 SmedAction.panelMain.panelMore.syncPanel(); 82 82 } else { 83 dlg.panelMain.panelChan.topmarkButton.setVisible(false);84 dlg.panelMain.panelChan.lightButton.setVisible(false);83 SmedAction.panelMain.panelChan.topmarkButton.setVisible(false); 84 SmedAction.panelMain.panelChan.lightButton.setVisible(false); 85 85 } 86 86 } … … 104 104 for (Shp shp : shapes.keySet()) { 105 105 JRadioButton button = shapes.get(shp); 106 if ( dlg.panelMain.mark.getShape() == shp) {106 if (SmedAction.panelMain.mark.getShape() == shp) { 107 107 button.setBorderPainted(true); 108 108 } else -
applications/editors/josm/plugins/smed/src/panels/PanelRadar.java
r30737 r30738 35 35 int idx = radioCats.get(cat); 36 36 if (dlg.node != null && (idx == radioCatBox.getSelectedIndex())) { 37 dlg.panelMain.mark.setRadio(cat);37 SmedAction.panelMain.mark.setRadio(cat); 38 38 } 39 39 } … … 52 52 JRadioButton button = rads.get(rtb); 53 53 if (button.isSelected()) { 54 dlg.panelMain.mark.setRadar(rtb);54 SmedAction.panelMain.mark.setRadar(rtb); 55 55 } 56 56 } … … 62 62 private FocusListener flGroup = new FocusAdapter() { 63 63 public void focusLost(java.awt.event.FocusEvent e) { 64 dlg.panelMain.mark.setRaconGroup(groupBox.getText());64 SmedAction.panelMain.mark.setRaconGroup(groupBox.getText()); 65 65 } 66 66 }; … … 69 69 private FocusListener flPeriod = new FocusAdapter() { 70 70 public void focusLost(java.awt.event.FocusEvent e) { 71 dlg.panelMain.mark.setRaconPeriod(periodBox.getText());71 SmedAction.panelMain.mark.setRaconPeriod(periodBox.getText()); 72 72 } 73 73 }; … … 76 76 private FocusListener flSeq = new FocusAdapter() { 77 77 public void focusLost(java.awt.event.FocusEvent e) { 78 dlg.panelMain.mark.setRaconSequence(seqBox.getText());78 SmedAction.panelMain.mark.setRaconSequence(seqBox.getText()); 79 79 } 80 80 }; … … 83 83 private FocusListener flRange = new FocusAdapter() { 84 84 public void focusLost(java.awt.event.FocusEvent e) { 85 dlg.panelMain.mark.setRaconRange(rangeBox.getText());85 SmedAction.panelMain.mark.setRaconRange(rangeBox.getText()); 86 86 } 87 87 }; … … 90 90 private FocusListener flSector1 = new FocusAdapter() { 91 91 public void focusLost(java.awt.event.FocusEvent e) { 92 dlg.panelMain.mark.setRaconSector1(sector1Box.getText());92 SmedAction.panelMain.mark.setRaconSector1(sector1Box.getText()); 93 93 } 94 94 }; … … 97 97 private FocusListener flSector2 = new FocusAdapter() { 98 98 public void focusLost(java.awt.event.FocusEvent e) { 99 dlg.panelMain.mark.setRaconSector2(sector2Box.getText());99 SmedAction.panelMain.mark.setRaconSector2(sector2Box.getText()); 100 100 } 101 101 }; … … 204 204 205 205 public void syncPanel() { 206 boolean rad = (( dlg.panelMain.mark.getRadar() != Rtb.NORTB) && (dlg.panelMain.mark.getRadar() != Rtb.REFLECTOR));206 boolean rad = ((SmedAction.panelMain.mark.getRadar() != Rtb.NORTB) && (SmedAction.panelMain.mark.getRadar() != Rtb.REFLECTOR)); 207 207 groupLabel.setVisible(rad); 208 208 groupBox.setVisible(rad); … … 219 219 sectorsLabel.setVisible(rad); 220 220 for (Rtb rtb : rads.keySet()) { 221 rads.get(rtb).setBorderPainted( dlg.panelMain.mark.getRadar() == rtb);222 } 223 groupBox.setText( dlg.panelMain.mark.getRaconGroup());224 seqBox.setText( dlg.panelMain.mark.getRaconSequence());225 periodBox.setText( dlg.panelMain.mark.getRaconPeriod());226 rangeBox.setText( dlg.panelMain.mark.getRaconRange());227 sector1Box.setText( dlg.panelMain.mark.getRaconSector1());228 sector2Box.setText( dlg.panelMain.mark.getRaconSector2());229 aisButton.setSelected( dlg.panelMain.mark.getRadio() != Cat.NOROS);221 rads.get(rtb).setBorderPainted(SmedAction.panelMain.mark.getRadar() == rtb); 222 } 223 groupBox.setText(SmedAction.panelMain.mark.getRaconGroup()); 224 seqBox.setText(SmedAction.panelMain.mark.getRaconSequence()); 225 periodBox.setText(SmedAction.panelMain.mark.getRaconPeriod()); 226 rangeBox.setText(SmedAction.panelMain.mark.getRaconRange()); 227 sector1Box.setText(SmedAction.panelMain.mark.getRaconSector1()); 228 sector2Box.setText(SmedAction.panelMain.mark.getRaconSector2()); 229 aisButton.setSelected(SmedAction.panelMain.mark.getRadio() != Cat.NOROS); 230 230 aisButton.setBorderPainted(aisButton.isSelected()); 231 radioCatBox.setVisible( dlg.panelMain.mark.getRadio() != Cat.NOROS);231 radioCatBox.setVisible(SmedAction.panelMain.mark.getRadio() != Cat.NOROS); 232 232 } 233 233 -
applications/editors/josm/plugins/smed/src/panels/PanelSaw.java
r30737 r30738 27 27 JRadioButton button = shapes.get(shp); 28 28 if (button.isSelected()) { 29 dlg.panelMain.mark.setShape(shp);30 dlg.panelMain.mark.setObject(objects.get(shp));29 SmedAction.panelMain.mark.setShape(shp); 30 SmedAction.panelMain.mark.setObject(objects.get(shp)); 31 31 button.setBorderPainted(true); 32 32 } else 33 33 button.setBorderPainted(false); 34 34 } 35 if ( dlg.panelMain.mark.testValid()) {36 dlg.panelMain.panelChan.topmarkButton.setVisible(true);37 dlg.panelMain.mark.setObjPattern(Pat.VSTRP);38 dlg.panelMain.mark.setObjColour(Col.RED);39 dlg.panelMain.mark.addObjColour(Col.WHITE);35 if (SmedAction.panelMain.mark.testValid()) { 36 SmedAction.panelMain.panelChan.topmarkButton.setVisible(true); 37 SmedAction.panelMain.mark.setObjPattern(Pat.VSTRP); 38 SmedAction.panelMain.mark.setObjColour(Col.RED); 39 SmedAction.panelMain.mark.addObjColour(Col.WHITE); 40 40 } else { 41 dlg.panelMain.panelChan.topmarkButton.setVisible(false);41 SmedAction.panelMain.panelChan.topmarkButton.setVisible(false); 42 42 } 43 dlg.panelMain.panelMore.syncPanel();43 SmedAction.panelMain.panelMore.syncPanel(); 44 44 } 45 45 }; … … 58 58 for (Shp shp : shapes.keySet()) { 59 59 JRadioButton button = shapes.get(shp); 60 if ( dlg.panelMain.mark.getShape() == shp) {60 if (SmedAction.panelMain.mark.getShape() == shp) { 61 61 button.setBorderPainted(true); 62 62 } else 63 63 button.setBorderPainted(false); 64 64 } 65 dlg.panelMain.mark.testValid();65 SmedAction.panelMain.mark.testValid(); 66 66 } 67 67 -
applications/editors/josm/plugins/smed/src/panels/PanelSectors.java
r30737 r30738 123 123 124 124 public int getRowCount() { 125 if ( dlg.panelMain == null)125 if (SmedAction.panelMain == null) 126 126 return 1; 127 127 else 128 return dlg.panelMain.mark.getSectorCount();128 return SmedAction.panelMain.mark.getSectorCount(); 129 129 } 130 130 … … 152 152 return row; 153 153 case 1: 154 if (((String) dlg.panelMain.mark.getLightAtt(Att.CHR, row)).contains("Al")) {155 if ( dlg.panelMain.mark.getLightAtt(Att.COL, row) == Col.UNKCOL) {154 if (((String)SmedAction.panelMain.mark.getLightAtt(Att.CHR, row)).contains("Al")) { 155 if (SmedAction.panelMain.mark.getLightAtt(Att.COL, row) == Col.UNKCOL) { 156 156 return Col.UNKCOL; 157 157 } else { 158 return dlg.panelMain.mark.getLightAtt(Att.ALT, row);158 return SmedAction.panelMain.mark.getLightAtt(Att.ALT, row); 159 159 } 160 160 } else { 161 return dlg.panelMain.mark.getLightAtt(Att.COL, row);161 return SmedAction.panelMain.mark.getLightAtt(Att.COL, row); 162 162 } 163 163 case 6: 164 return ( dlg.panelMain.mark.getLightAtt(Att.LIT, row) == Lit.DIR);164 return (SmedAction.panelMain.mark.getLightAtt(Att.LIT, row) == Lit.DIR); 165 165 case 7: 166 166 case 8: 167 if ( dlg.panelMain.mark.getLightAtt(Att.LIT, row) == Lit.DIR)168 return dlg.panelMain.mark.getLightAtt(Att.ORT, row);167 if (SmedAction.panelMain.mark.getLightAtt(Att.LIT, row) == Lit.DIR) 168 return SmedAction.panelMain.mark.getLightAtt(Att.ORT, row); 169 169 else 170 return dlg.panelMain.mark.getLightAtt(col - 1, row);170 return SmedAction.panelMain.mark.getLightAtt(col - 1, row); 171 171 case 12: 172 return visibilities.get( dlg.panelMain.mark.getLightAtt(Att.VIS, row));172 return visibilities.get(SmedAction.panelMain.mark.getLightAtt(Att.VIS, row)); 173 173 case 13: 174 return exhibitions.get( dlg.panelMain.mark.getLightAtt(Att.EXH, row));174 return exhibitions.get(SmedAction.panelMain.mark.getLightAtt(Att.EXH, row)); 175 175 default: 176 return dlg.panelMain.mark.getLightAtt(col - 1, row);176 return SmedAction.panelMain.mark.getLightAtt(col - 1, row); 177 177 } 178 178 } … … 184 184 ImageIcon img = colours.get(colour); 185 185 if (img == value) 186 if (((String) dlg.panelMain.mark.getLightAtt(Att.CHR, row)).contains("Al")) {187 if (((colour == Col.UNKCOL) && ( dlg.panelMain.mark.getLightAtt(Att.ALT, row) == Col.UNKCOL))188 || ( dlg.panelMain.mark.getLightAtt(Att.COL, row) == Col.UNKCOL)) {189 dlg.panelMain.mark.setLightAtt(Att.COL, row, colour);186 if (((String)SmedAction.panelMain.mark.getLightAtt(Att.CHR, row)).contains("Al")) { 187 if (((colour == Col.UNKCOL) && (SmedAction.panelMain.mark.getLightAtt(Att.ALT, row) == Col.UNKCOL)) 188 || (SmedAction.panelMain.mark.getLightAtt(Att.COL, row) == Col.UNKCOL)) { 189 SmedAction.panelMain.mark.setLightAtt(Att.COL, row, colour); 190 190 } else { 191 dlg.panelMain.mark.setLightAtt(Att.ALT, row, colour);191 SmedAction.panelMain.mark.setLightAtt(Att.ALT, row, colour); 192 192 } 193 193 } else { 194 dlg.panelMain.mark.setLightAtt(Att.COL, row, colour);194 SmedAction.panelMain.mark.setLightAtt(Att.COL, row, colour); 195 195 } 196 196 } … … 200 200 case 10: 201 201 case 11: 202 dlg.panelMain.mark.setLightAtt(col - 1, row, value);202 SmedAction.panelMain.mark.setLightAtt(col - 1, row, value); 203 203 break; 204 204 case 6: 205 205 if ((Boolean) value == true) { 206 dlg.panelMain.mark.setLightAtt(Att.LIT, row, Lit.DIR);207 dlg.panelMain.mark.setLightAtt(Att.BEG, row, "");208 dlg.panelMain.mark.setLightAtt(Att.END, row, "");206 SmedAction.panelMain.mark.setLightAtt(Att.LIT, row, Lit.DIR); 207 SmedAction.panelMain.mark.setLightAtt(Att.BEG, row, ""); 208 SmedAction.panelMain.mark.setLightAtt(Att.END, row, ""); 209 209 } else { 210 dlg.panelMain.mark.setLightAtt(Att.LIT, row, Lit.UNKLIT);211 dlg.panelMain.mark.setLightAtt(Att.ORT, row, "");210 SmedAction.panelMain.mark.setLightAtt(Att.LIT, row, Lit.UNKLIT); 211 SmedAction.panelMain.mark.setLightAtt(Att.ORT, row, ""); 212 212 } 213 213 break; 214 214 case 7: 215 215 case 8: 216 if ( dlg.panelMain.mark.getLightAtt(Att.LIT, row) == Lit.DIR) {217 dlg.panelMain.mark.setLightAtt(Att.ORT, row, value);216 if (SmedAction.panelMain.mark.getLightAtt(Att.LIT, row) == Lit.DIR) { 217 SmedAction.panelMain.mark.setLightAtt(Att.ORT, row, value); 218 218 } else { 219 dlg.panelMain.mark.setLightAtt(col - 1, row, value);219 SmedAction.panelMain.mark.setLightAtt(col - 1, row, value); 220 220 } 221 221 break; … … 224 224 String str = visibilities.get(vis); 225 225 if (str.equals(value)) 226 dlg.panelMain.mark.setLightAtt(Att.VIS, row, vis);226 SmedAction.panelMain.mark.setLightAtt(Att.VIS, row, vis); 227 227 } 228 228 break; … … 231 231 String str = exhibitions.get(exh); 232 232 if (str.equals(value)) 233 dlg.panelMain.mark.setLightAtt(Att.EXH, row, exh);233 SmedAction.panelMain.mark.setLightAtt(Att.EXH, row, exh); 234 234 } 235 235 break; 236 236 default: 237 dlg.panelMain.mark.setLightAtt(col - 1, row, value);237 SmedAction.panelMain.mark.setLightAtt(col - 1, row, value); 238 238 } 239 239 } … … 261 261 } 262 262 public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int rowIndex, int vColIndex) { 263 if (!((String) dlg.panelMain.mark.getLightAtt(Att.CHR, rowIndex)).contains("Al")) {264 col2Label.setBackground(SeaMark.ColMAP.get( dlg.panelMain.mark.getLightAtt(Att.COL, rowIndex)));263 if (!((String)SmedAction.panelMain.mark.getLightAtt(Att.CHR, rowIndex)).contains("Al")) { 264 col2Label.setBackground(SeaMark.ColMAP.get(SmedAction.panelMain.mark.getLightAtt(Att.COL, rowIndex))); 265 265 } else { 266 col2Label.setBackground(SeaMark.ColMAP.get( dlg.panelMain.mark.getLightAtt(Att.ALT, rowIndex)));267 } 268 col1Label.setBackground(SeaMark.ColMAP.get( dlg.panelMain.mark.getLightAtt(Att.COL, rowIndex)));266 col2Label.setBackground(SeaMark.ColMAP.get(SmedAction.panelMain.mark.getLightAtt(Att.ALT, rowIndex))); 267 } 268 col1Label.setBackground(SeaMark.ColMAP.get(SmedAction.panelMain.mark.getLightAtt(Att.COL, rowIndex))); 269 269 return this; 270 270 } … … 276 276 277 277 public void addSector(int idx) { 278 dlg.panelMain.mark.addLight(idx);278 SmedAction.panelMain.mark.addLight(idx); 279 279 table.setSize(860, ((table.getRowCount() * 16) + 28)); 280 280 if (table.getRowCount() > 3) { … … 287 287 public void deleteSector(int idx) { 288 288 if (idx > 0) { 289 dlg.panelMain.mark.delLight(idx);289 SmedAction.panelMain.mark.delLight(idx); 290 290 table.setSize(860, ((table.getRowCount() * 16) + 28)); 291 291 if (table.getRowCount() > 3) { -
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 -
applications/editors/josm/plugins/smed/src/panels/PanelStbd.java
r30737 r30738 31 31 JRadioButton button = shapes.get(shp); 32 32 if (button.isSelected()) { 33 dlg.panelMain.mark.setShape(shp);34 dlg.panelMain.mark.setObject(objects.get(shp));33 SmedAction.panelMain.mark.setShape(shp); 34 SmedAction.panelMain.mark.setObject(objects.get(shp)); 35 35 button.setBorderPainted(true); 36 36 } else 37 37 button.setBorderPainted(false); 38 38 } 39 if ( dlg.panelMain.mark.testValid()) {40 dlg.panelMain.panelChan.topmarkButton.setVisible(true);41 dlg.panelMain.panelChan.lightButton.setVisible(true);42 if ( dlg.panelMain.mark.getCategory() == Cat.LAM_STBD) {43 switch ( dlg.panelMain.mark.getRegion()) {39 if (SmedAction.panelMain.mark.testValid()) { 40 SmedAction.panelMain.panelChan.topmarkButton.setVisible(true); 41 SmedAction.panelMain.panelChan.lightButton.setVisible(true); 42 if (SmedAction.panelMain.mark.getCategory() == Cat.LAM_STBD) { 43 switch (SmedAction.panelMain.mark.getRegion()) { 44 44 case A: 45 dlg.panelMain.mark.setObjPattern(Pat.NOPAT);46 dlg.panelMain.mark.setObjColour(Col.GREEN);45 SmedAction.panelMain.mark.setObjPattern(Pat.NOPAT); 46 SmedAction.panelMain.mark.setObjColour(Col.GREEN); 47 47 break; 48 48 case B: 49 dlg.panelMain.mark.setObjPattern(Pat.NOPAT);50 dlg.panelMain.mark.setObjColour(Col.RED);49 SmedAction.panelMain.mark.setObjPattern(Pat.NOPAT); 50 SmedAction.panelMain.mark.setObjColour(Col.RED); 51 51 break; 52 52 case C: 53 dlg.panelMain.mark.setObjPattern(Pat.HSTRP);54 dlg.panelMain.mark.setObjColour(Col.GREEN);55 dlg.panelMain.mark.addObjColour(Col.WHITE);56 dlg.panelMain.mark.addObjColour(Col.GREEN);57 dlg.panelMain.mark.addObjColour(Col.WHITE);53 SmedAction.panelMain.mark.setObjPattern(Pat.HSTRP); 54 SmedAction.panelMain.mark.setObjColour(Col.GREEN); 55 SmedAction.panelMain.mark.addObjColour(Col.WHITE); 56 SmedAction.panelMain.mark.addObjColour(Col.GREEN); 57 SmedAction.panelMain.mark.addObjColour(Col.WHITE); 58 58 break; 59 59 } 60 60 } else { 61 dlg.panelMain.mark.setObjPattern(Pat.HSTRP);62 switch ( dlg.panelMain.mark.getRegion()) {61 SmedAction.panelMain.mark.setObjPattern(Pat.HSTRP); 62 switch (SmedAction.panelMain.mark.getRegion()) { 63 63 case A: 64 dlg.panelMain.mark.setObjColour(Col.GREEN);65 dlg.panelMain.mark.addObjColour(Col.RED);66 dlg.panelMain.mark.addObjColour(Col.GREEN);64 SmedAction.panelMain.mark.setObjColour(Col.GREEN); 65 SmedAction.panelMain.mark.addObjColour(Col.RED); 66 SmedAction.panelMain.mark.addObjColour(Col.GREEN); 67 67 break; 68 68 case B: 69 dlg.panelMain.mark.setObjColour(Col.RED);70 dlg.panelMain.mark.addObjColour(Col.GREEN);71 dlg.panelMain.mark.addObjColour(Col.RED);69 SmedAction.panelMain.mark.setObjColour(Col.RED); 70 SmedAction.panelMain.mark.addObjColour(Col.GREEN); 71 SmedAction.panelMain.mark.addObjColour(Col.RED); 72 72 break; 73 73 case C: 74 dlg.panelMain.mark.setObjColour(Col.RED);75 dlg.panelMain.mark.addObjColour(Col.GREEN);76 dlg.panelMain.mark.addObjColour(Col.RED);77 dlg.panelMain.mark.addObjColour(Col.GREEN);74 SmedAction.panelMain.mark.setObjColour(Col.RED); 75 SmedAction.panelMain.mark.addObjColour(Col.GREEN); 76 SmedAction.panelMain.mark.addObjColour(Col.RED); 77 SmedAction.panelMain.mark.addObjColour(Col.GREEN); 78 78 break; 79 79 } 80 80 } 81 dlg.panelMain.panelMore.syncPanel();81 SmedAction.panelMain.panelMore.syncPanel(); 82 82 } else { 83 dlg.panelMain.panelChan.topmarkButton.setVisible(false);84 dlg.panelMain.panelChan.lightButton.setVisible(false);83 SmedAction.panelMain.panelChan.topmarkButton.setVisible(false); 84 SmedAction.panelMain.panelChan.lightButton.setVisible(false); 85 85 } 86 86 } … … 104 104 for (Shp shp : shapes.keySet()) { 105 105 JRadioButton button = shapes.get(shp); 106 if ( dlg.panelMain.mark.getShape() == shp) {106 if (SmedAction.panelMain.mark.getShape() == shp) { 107 107 button.setBorderPainted(true); 108 108 } else -
applications/editors/josm/plugins/smed/src/panels/PanelTop.java
r30737 r30738 38 38 JRadioButton button = tops.get(top); 39 39 if (button.isSelected()) { 40 dlg.panelMain.mark.setTopmark(top);40 SmedAction.panelMain.mark.setTopmark(top); 41 41 button.setBorderPainted(true); 42 42 } else … … 79 79 for (Top top : tops.keySet()) { 80 80 JRadioButton button = tops.get(top); 81 if ( dlg.panelMain.mark.getTopmark() == top) {81 if (SmedAction.panelMain.mark.getTopmark() == top) { 82 82 button.setBorderPainted(true); 83 83 } else -
applications/editors/josm/plugins/smed/src/seamarks/SeaMark.java
r30737 r30738 1361 1361 } 1362 1362 if (tmp) { 1363 dlg.panelMain.moreButton.setVisible(true);1364 dlg.panelMain.saveButton.setEnabled(true);1365 dlg.panelMain.topButton.setEnabled(true);1366 dlg.panelMain.fogButton.setEnabled(true);1367 dlg.panelMain.radButton.setEnabled(true);1368 dlg.panelMain.litButton.setEnabled(true);1363 SmedAction.panelMain.moreButton.setVisible(true); 1364 SmedAction.panelMain.saveButton.setEnabled(true); 1365 SmedAction.panelMain.topButton.setEnabled(true); 1366 SmedAction.panelMain.fogButton.setEnabled(true); 1367 SmedAction.panelMain.radButton.setEnabled(true); 1368 SmedAction.panelMain.litButton.setEnabled(true); 1369 1369 return true; 1370 1370 } else { 1371 dlg.panelMain.moreButton.setVisible(false);1372 dlg.panelMain.moreButton.setText(">>");1373 dlg.panelMain.topButton.setEnabled(false);1374 dlg.panelMain.fogButton.setEnabled(false);1375 dlg.panelMain.radButton.setEnabled(false);1376 dlg.panelMain.litButton.setEnabled(false);1371 SmedAction.panelMain.moreButton.setVisible(false); 1372 SmedAction.panelMain.moreButton.setText(">>"); 1373 SmedAction.panelMain.topButton.setEnabled(false); 1374 SmedAction.panelMain.fogButton.setEnabled(false); 1375 SmedAction.panelMain.radButton.setEnabled(false); 1376 SmedAction.panelMain.litButton.setEnabled(false); 1377 1377 PanelMain.messageBar.setText("Seamark not recognised"); 1378 1378 return false; … … 1398 1398 setSource(""); 1399 1399 setFixme(""); 1400 dlg.panelMain.syncPanel();1400 SmedAction.panelMain.syncPanel(); 1401 1401 repaint(); 1402 1402 }
Note:
See TracChangeset
for help on using the changeset viewer.