Changeset 33054 in osm for applications/editors/josm/plugins/smed/src/panels
- Timestamp:
- 2016-11-12T04:42:33+01:00 (8 years ago)
- Location:
- applications/editors/josm/plugins/smed/src/panels
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed/src/panels/PanelChan.java
r32767 r33054 1 // License: GPL. For details, see LICENSE file. 1 2 package panels; 2 3 … … 311 312 topmarkButton.setSelected(dlg.panelMain.mark.getTopmark() != Top.NOTOP); 312 313 topmarkButton.setVisible(dlg.panelMain.mark.testValid()); 313 Boolean lit = (dlg.panelMain.mark.getLightAtt(Att.COL, 0) != Col.UNKCOL) && !((String)dlg.panelMain.mark.getLightAtt(Att.CHR, 0)).isEmpty(); 314 Boolean lit = (dlg.panelMain.mark.getLightAtt(Att.COL, 0) != Col.UNKCOL) 315 && !((String) dlg.panelMain.mark.getLightAtt(Att.CHR, 0)).isEmpty(); 314 316 lightButton.setBorderPainted(lit); 315 317 lightButton.setSelected(lit); -
applications/editors/josm/plugins/smed/src/panels/PanelChr.java
r32767 r33054 1 // License: GPL. For details, see LICENSE file. 1 2 package panels; 2 3 … … 33 34 public JLabel charLabel = new JLabel(); 34 35 public JTextField charBox = new JTextField(); 35 public JToggleButton noneButton = new (new ImageIcon(getClass().getResource("/images/NoCharButton.png")));36 public JToggleButton fixedButton = new (new ImageIcon(getClass().getResource("/images/FixedButton.png")));37 public JToggleButton flashButton = new (new ImageIcon(getClass().getResource("/images/FlashButton.png")));38 public JToggleButton longFlashButton = new (new ImageIcon(getClass().getResource("/images/LongFlashButton.png")));39 public JToggleButton quickButton = new (new ImageIcon(getClass().getResource("/images/QuickButton.png")));40 public JToggleButton veryQuickButton = new (new ImageIcon(getClass().getResource("/images/VeryQuickButton.png")));41 public JToggleButton ultraQuickButton = new (new ImageIcon(getClass().getResource("/images/UltraQuickButton.png")));42 public JToggleButton interruptedQuickButton = new (new ImageIcon(getClass().getResource("/images/InterruptedQuickButton.png")));43 public JToggleButton interruptedVeryQuickButton = new (new ImageIcon(getClass().getResource("/images/InterruptedVeryQuickButton.png")));44 public JToggleButton interruptedUltraQuickButton = new (new ImageIcon(getClass().getResource("/images/InterruptedUltraQuickButton.png")));45 public JToggleButton isophasedButton = new (new ImageIcon(getClass().getResource("/images/IsophasedButton.png")));46 public JToggleButton occultingButton = new (new ImageIcon(getClass().getResource("/images/OccultingButton.png")));47 public JToggleButton morseButton = new (new ImageIcon(getClass().getResource("/images/MorseButton.png")));48 public JToggleButton alternatingButton = new (new ImageIcon(getClass().getResource("/images/AlternatingButton.png")));36 public JToggleButton noneButton = newJToggleButton("/images/NoCharButton.png"); 37 public JToggleButton fixedButton = newJToggleButton("/images/FixedButton.png"); 38 public JToggleButton flashButton = newJToggleButton("/images/FlashButton.png"); 39 public JToggleButton longFlashButton = newJToggleButton("/images/LongFlashButton.png"); 40 public JToggleButton quickButton = newJToggleButton("/images/QuickButton.png"); 41 public JToggleButton veryQuickButton = newJToggleButton("/images/VeryQuickButton.png"); 42 public JToggleButton ultraQuickButton = newJToggleButton("/images/UltraQuickButton.png"); 43 public JToggleButton interruptedQuickButton = newJToggleButton("/images/InterruptedQuickButton.png"); 44 public JToggleButton interruptedVeryQuickButton = newJToggleButton("/images/InterruptedVeryQuickButton.png"); 45 public JToggleButton interruptedUltraQuickButton = newJToggleButton("/images/InterruptedUltraQuickButton.png"); 46 public JToggleButton isophasedButton = newJToggleButton("/images/IsophasedButton.png"); 47 public JToggleButton occultingButton = newJToggleButton("/images/OccultingButton.png"); 48 public JToggleButton morseButton = newJToggleButton("/images/MorseButton.png"); 49 public JToggleButton alternatingButton = newJToggleButton("/images/AlternatingButton.png"); 49 50 private EnumMap<Chr, JToggleButton> buttons = new EnumMap<>(Chr.class); 50 51 private ActionListener alCharButton = new ActionListener() { … … 88 89 } 89 90 }; 91 90 92 private FocusListener flCharBox = new FocusListener() { 91 93 @Override 92 94 public void focusGained(FocusEvent e) {} 95 93 96 @Override 94 97 public void focusLost(FocusEvent e) { … … 154 157 } 155 158 159 private static JToggleButton newJToggleButton(String buttonIcon) { 160 return new JToggleButton(new ImageIcon(PanelChr.class.getResource(buttonIcon))); 161 } 162 156 163 public void syncPanel() { 157 String str = (String)SmedAction.panelMain.mark.getLightAtt(Att.CHR, 0); 164 String str = (String) SmedAction.panelMain.mark.getLightAtt(Att.CHR, 0); 158 165 charBox.setText(str); 159 166 EnumSet<Chr> set = EnumSet.noneOf(Chr.class); -
applications/editors/josm/plugins/smed/src/panels/PanelCol.java
r32767 r33054 1 // License: GPL. For details, see LICENSE file. 1 2 package panels; 2 3 -
applications/editors/josm/plugins/smed/src/panels/PanelFog.java
r32767 r33054 1 // License: GPL. For details, see LICENSE file. 1 2 package panels; 2 3 -
applications/editors/josm/plugins/smed/src/panels/PanelHaz.java
r32767 r33054 1 // License: GPL. For details, see LICENSE file. 1 2 package panels; 2 3 … … 235 236 topmarkButton.setSelected(SmedAction.panelMain.mark.getTopmark() != Top.NOTOP); 236 237 topmarkButton.setVisible(SmedAction.panelMain.mark.testValid()); 237 Boolean lit = (SmedAction.panelMain.mark.getLightAtt(Att.COL, 0) != Col.UNKCOL) && !((String)SmedAction.panelMain.mark.getLightAtt(Att.CHR, 0)).isEmpty(); 238 Boolean lit = (SmedAction.panelMain.mark.getLightAtt(Att.COL, 0) != Col.UNKCOL) 239 && !((String) SmedAction.panelMain.mark.getLightAtt(Att.CHR, 0)).isEmpty(); 238 240 lightButton.setBorderPainted(lit); 239 241 lightButton.setSelected(lit); -
applications/editors/josm/plugins/smed/src/panels/PanelLights.java
r32767 r33054 1 // License: GPL. For details, see LICENSE file. 1 2 package panels; 2 3 … … 491 492 chBox.setVisible(false); 492 493 chBox.setText(SmedAction.panelMain.mark.getChannel()); 493 if ((SmedAction.panelMain.mark.getObject() == Obj.LNDMRK) && ((SmedAction.panelMain.mark.getCategory() != Cat.NOCAT) || (SmedAction.panelMain.mark.getFunc() != Fnc.UNKFNC))) { 494 if ((SmedAction.panelMain.mark.getObject() == Obj.LNDMRK) 495 && ((SmedAction.panelMain.mark.getCategory() != Cat.NOCAT) || (SmedAction.panelMain.mark.getFunc() != Fnc.UNKFNC))) { 494 496 functionLabel.setVisible(true); 495 497 categoryLabel.setVisible(true); -
applications/editors/josm/plugins/smed/src/panels/PanelLit.java
r32767 r33054 1 // License: GPL. For details, see LICENSE file. 1 2 package panels; 2 3 … … 122 123 multipleLabel.setVisible(false); 123 124 multipleBox.setVisible(false); 124 } else if ((SmedAction.panelMain.mark.getLightAtt(Att.LIT, 0) == Lit.VERT) || (SmedAction.panelMain.mark.getLightAtt(Att.LIT, 0) == Lit.HORIZ)) { 125 } else if ((SmedAction.panelMain.mark.getLightAtt(Att.LIT, 0) == Lit.VERT) 126 || (SmedAction.panelMain.mark.getLightAtt(Att.LIT, 0) == Lit.HORIZ)) { 125 127 SmedAction.panelMain.mark.setLightAtt(Att.ORT, 0, ""); 126 128 orientationBox.setText(""); … … 316 318 multipleLabel.setVisible(false); 317 319 multipleBox.setVisible(false); 318 groupBox.setText((String)SmedAction.panelMain.mark.getLightAtt(Att.GRP, 0)); 319 periodBox.setText((String)SmedAction.panelMain.mark.getLightAtt(Att.PER, 0)); 320 sequenceBox.setText((String)SmedAction.panelMain.mark.getLightAtt(Att.SEQ, 0)); 321 heightBox.setText((String)SmedAction.panelMain.mark.getLightAtt(Att.HGT, 0)); 322 rangeBox.setText((String)SmedAction.panelMain.mark.getLightAtt(Att.RNG, 0)); 323 orientationBox.setText((String)SmedAction.panelMain.mark.getLightAtt(Att.ORT, 0)); 320 groupBox.setText((String) SmedAction.panelMain.mark.getLightAtt(Att.GRP, 0)); 321 periodBox.setText((String) SmedAction.panelMain.mark.getLightAtt(Att.PER, 0)); 322 sequenceBox.setText((String) SmedAction.panelMain.mark.getLightAtt(Att.SEQ, 0)); 323 heightBox.setText((String) SmedAction.panelMain.mark.getLightAtt(Att.HGT, 0)); 324 rangeBox.setText((String) SmedAction.panelMain.mark.getLightAtt(Att.RNG, 0)); 325 orientationBox.setText((String) SmedAction.panelMain.mark.getLightAtt(Att.ORT, 0)); 324 326 orientationBox.setVisible(SmedAction.panelMain.mark.getLightAtt(Att.LIT, 0) == Lit.DIR); 325 multipleBox.setText((String)SmedAction.panelMain.mark.getLightAtt(Att.MLT, 0)); 326 multipleBox.setVisible((SmedAction.panelMain.mark.getLightAtt(Att.LIT, 0) == Lit.VERT) || (SmedAction.panelMain.mark.getLightAtt(Att.LIT, 0) == Lit.HORIZ)); 327 multipleBox.setText((String) SmedAction.panelMain.mark.getLightAtt(Att.MLT, 0)); 328 multipleBox.setVisible((SmedAction.panelMain.mark.getLightAtt(Att.LIT, 0) == Lit.VERT) 329 || (SmedAction.panelMain.mark.getLightAtt(Att.LIT, 0) == Lit.HORIZ)); 327 330 for (Vis vis : visibilities.keySet()) { 328 331 int item = visibilities.get(vis); -
applications/editors/josm/plugins/smed/src/panels/PanelMain.java
r32767 r33054 1 // License: GPL. For details, see LICENSE file. 1 2 package panels; 2 3 … … 46 47 mark.setName(nameBox.getText()); 47 48 } 49 48 50 @Override 49 51 public void focusGained(FocusEvent e) { -
applications/editors/josm/plugins/smed/src/panels/PanelMore.java
r32767 r33054 1 // License: GPL. For details, see LICENSE file. 1 2 package panels; 2 3 -
applications/editors/josm/plugins/smed/src/panels/PanelPat.java
r32767 r33054 1 // License: GPL. For details, see LICENSE file. 1 2 package panels; 2 3 -
applications/editors/josm/plugins/smed/src/panels/PanelPort.java
r32767 r33054 1 // License: GPL. For details, see LICENSE file. 1 2 package panels; 2 3 -
applications/editors/josm/plugins/smed/src/panels/PanelRadar.java
r32767 r33054 1 // License: GPL. For details, see LICENSE file. 1 2 package panels; 2 3 -
applications/editors/josm/plugins/smed/src/panels/PanelSaw.java
r32767 r33054 1 // License: GPL. For details, see LICENSE file. 1 2 package panels; 2 3 -
applications/editors/josm/plugins/smed/src/panels/PanelSectors.java
r32911 r33054 1 // License: GPL. For details, see LICENSE file. 1 2 package panels; 2 3 … … 130 131 private class SectorTable extends AbstractTableModel { 131 132 132 private String[] headings = { 133 private String[] headings = {Messages.getString("Sector"), Messages.getString("Colour"), Messages.getString("Character"), 133 134 Messages.getString("Group"), Messages.getString("Sequence"), Messages.getString("Period"), Messages.getString("Directional"), 134 135 Messages.getString("Start"), Messages.getString("End"), Messages.getString("Radius"), Messages.getString("Height"), 135 136 Messages.getString("Range"), Messages.getString("Visibility"), Messages.getString("Exhibition") }; 136 137 137 publicSectorTable() {138 SectorTable() { 138 139 } 139 140 … … 182 183 return row; 183 184 case 1: 184 if (((String)SmedAction.panelMain.mark.getLightAtt(Att.CHR, row)).contains("Al")) { 185 if (((String) SmedAction.panelMain.mark.getLightAtt(Att.CHR, row)).contains("Al")) { 185 186 if (SmedAction.panelMain.mark.getLightAtt(Att.COL, row) == Col.UNKCOL) 186 187 return Col.UNKCOL; … … 213 214 ImageIcon img = colours.get(colour); 214 215 if (img == value) 215 if (((String)SmedAction.panelMain.mark.getLightAtt(Att.CHR, row)).contains("Al")) { 216 if (((String) SmedAction.panelMain.mark.getLightAtt(Att.CHR, row)).contains("Al")) { 216 217 if (((colour == Col.UNKCOL) && (SmedAction.panelMain.mark.getLightAtt(Att.ALT, row) == Col.UNKCOL)) 217 218 || (SmedAction.panelMain.mark.getLightAtt(Att.COL, row) == Col.UNKCOL)) { … … 272 273 273 274 static class CentreRenderer extends DefaultTableCellRenderer { 274 publicCentreRenderer() {275 CentreRenderer() { 275 276 super(); 276 277 setHorizontalAlignment(SwingConstants.CENTER); … … 291 292 add(col2Label); 292 293 } 293 @Override 294 public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int rowIndex, int vColIndex) { 295 if (!((String)SmedAction.panelMain.mark.getLightAtt(Att.CHR, rowIndex)).contains("Al")) { 294 295 @Override 296 public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, 297 int rowIndex, int vColIndex) { 298 if (!((String) SmedAction.panelMain.mark.getLightAtt(Att.CHR, rowIndex)).contains("Al")) { 296 299 col2Label.setBackground(SeaMark.ColMAP.get(SmedAction.panelMain.mark.getLightAtt(Att.COL, rowIndex))); 297 300 } else { -
applications/editors/josm/plugins/smed/src/panels/PanelSpec.java
r32767 r33054 1 // License: GPL. For details, see LICENSE file. 1 2 package panels; 2 3 -
applications/editors/josm/plugins/smed/src/panels/PanelStbd.java
r32767 r33054 1 // License: GPL. For details, see LICENSE file. 1 2 package panels; 2 3 -
applications/editors/josm/plugins/smed/src/panels/PanelTop.java
r32767 r33054 1 // License: GPL. For details, see LICENSE file. 1 2 package panels; 2 3
Note:
See TracChangeset
for help on using the changeset viewer.