Changeset 33054 in osm for applications/editors/josm/plugins/smed/src
- Timestamp:
- 2016-11-12T04:42:33+01:00 (8 years ago)
- Location:
- applications/editors/josm/plugins/smed/src
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed/src/messages/Messages.java
r32767 r33054 1 // License: GPL. For details, see LICENSE file. 1 2 package messages; 2 3 … … 4 5 import java.util.ResourceBundle; 5 6 6 public class Messages { 7 public final class Messages { 7 8 private static final String BUNDLE_NAME = "resources/msg.messages"; 8 9 -
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 -
applications/editors/josm/plugins/smed/src/seamarks/SeaMark.java
r32911 r33054 1 // License: GPL. For details, see LICENSE file. 1 2 package seamarks; 2 3 … … 234 235 NTC_B1a, NTC_B1b, NTC_B2a, NTC_B2b, NTC_B3a, NTC_B3b, NTC_B4a, NTC_B4b, NTC_B5, NTC_B6, NTC_B7, NTC_B8, NTC_B9a, NTC_B9b, NTC_B11, 235 236 NTC_C1, NTC_C2, NTC_C3, NTC_C4, NTC_C5a, NTC_C5b, NTC_D1a, NTC_D1b, NTC_D2a, NTC_D2b, NTC_D3a, NTC_D3b, 236 NOROS, ROS_UNKN, ROS_OMNI, ROS_DIRL, ROS_ROTP, ROS_CNSL, ROS_RDF, ROS_QTG, ROS_AERO, ROS_DECA, ROS_LORN, ROS_DGPS, ROS_TORN, ROS_OMGA, ROS_SYLD, ROS_CHKA, 237 ROS_PCOM, ROS_COMB, ROS_FACS, ROS_TIME, ROS_PAIS, ROS_SAIS, ROS_VAIS, ROS_VANC, ROS_VASC, ROS_VAEC, ROS_VAWC, ROS_VAPL, ROS_VASL, ROS_VAID, ROS_VASW, ROS_VASP, ROS_VAWK 237 NOROS, ROS_UNKN, ROS_OMNI, ROS_DIRL, ROS_ROTP, ROS_CNSL, ROS_RDF, ROS_QTG, ROS_AERO, ROS_DECA, ROS_LORN, 238 ROS_DGPS, ROS_TORN, ROS_OMGA, ROS_SYLD, ROS_CHKA, 239 ROS_PCOM, ROS_COMB, ROS_FACS, ROS_TIME, ROS_PAIS, ROS_SAIS, ROS_VAIS, ROS_VANC, ROS_VASC, ROS_VAEC, ROS_VAWC, 240 ROS_VAPL, ROS_VASL, ROS_VAID, ROS_VASW, ROS_VASP, ROS_VAWK 238 241 } 239 242 … … 322 325 CatSTR.put(Cat.LMK_MNRT, "minaret"); 323 326 CatSTR.put(Cat.OFP_OIL, "oil"); 324 CatSTR.put(Cat.OFP_PRD, 327 CatSTR.put(Cat.OFP_PRD, "production"); 325 328 CatSTR.put(Cat.OFP_OBS, "observation"); 326 329 CatSTR.put(Cat.OFP_ALP, "alp"); … … 441 444 442 445 public enum Shp { 443 UNKSHP, PILLAR, SPAR, CAN, CONI, SPHERI, BARREL, FLOAT, SUPER, BUOYANT, CAIRN, PILE, LATTICE, TOWER, STAKE, POLE, POST, PERCH, BUOY, BEACON 446 UNKSHP, PILLAR, SPAR, CAN, CONI, SPHERI, BARREL, FLOAT, SUPER, BUOYANT, 447 CAIRN, PILE, LATTICE, TOWER, STAKE, POLE, POST, PERCH, BUOY, BEACON 444 448 } 445 449 … … 729 733 } 730 734 731 public Object[] sector = { 735 public Object[] sector = {Col.UNKCOL, "", "", "", "", Lit.UNKLIT, "", "", 732 736 "", "", "", Vis.UNKVIS, Exh.UNKEXH, "", "", Col.UNKCOL }; 733 737 … … 767 771 case 9: 768 772 case 10: 769 sectors.get(i)[att] = validDecimal((String)obj); 773 sectors.get(i)[att] = validDecimal((String) obj); 770 774 break; 771 775 case 6: 772 776 case 7: 773 777 case 13: 774 sectors.get(i)[att] = validDecimal((String)obj, 360); 778 sectors.get(i)[att] = validDecimal((String) obj, 360); 775 779 break; 776 780 default: … … 1778 1782 str = keys.get("seamark:light" + secStr + ":colour"); 1779 1783 if (str.contains(";")) { 1780 String strs[]= str.split(";");1781 for (Col col : ColSTR.keySet()) 1784 String[] strs = str.split(";"); 1785 for (Col col : ColSTR.keySet()) { 1782 1786 if ((strs.length > 1) && ColSTR.get(col).equals(strs[1])) { 1783 1787 setLightAtt(Att.ALT, i, col); 1784 1788 } 1789 } 1785 1790 str = strs[0]; 1786 1791 } 1787 for (Col col : ColSTR.keySet()) 1792 for (Col col : ColSTR.keySet()) { 1788 1793 if (ColSTR.get(col).equals(str)) { 1789 1794 setLightAtt(Att.COL, i, col); 1790 1795 } 1796 } 1791 1797 } 1792 1798 if (keys.containsKey("seamark:light" + secStr + ":character")) { … … 1817 1823 str = "horizontal"; 1818 1824 } 1819 for (Lit lit : LitSTR.keySet()) 1825 for (Lit lit : LitSTR.keySet()) { 1820 1826 if (LitSTR.get(lit).equals(str)) { 1821 1827 setLightAtt(Att.LIT, i, lit); 1822 1828 } 1829 } 1823 1830 } 1824 1831 if (keys.containsKey("seamark:light" + secStr + ":sector_start")) { … … 1839 1846 if (keys.containsKey("seamark:light" + secStr + ":visibility")) { 1840 1847 str = keys.get("seamark:light" + secStr + ":visibility"); 1841 for (Vis vis : VisSTR.keySet()) 1848 for (Vis vis : VisSTR.keySet()) { 1842 1849 if (VisSTR.get(vis).equals(str)) { 1843 1850 setLightAtt(Att.VIS, i, vis); 1844 1851 } 1852 } 1845 1853 } 1846 1854 if (keys.containsKey("seamark:light" + secStr + ":exhibition")) { 1847 1855 str = keys.get("seamark:light" + secStr + ":exhibition"); 1848 for (Exh exh : ExhSTR.keySet()) 1856 for (Exh exh : ExhSTR.keySet()) { 1849 1857 if (ExhSTR.get(exh).equals(str)) { 1850 1858 setLightAtt(Att.EXH, i, exh); 1851 1859 } 1860 } 1852 1861 } 1853 1862 if (keys.containsKey("seamark:light" + secStr + ":orientation")) { … … 2450 2459 g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); 2451 2460 g2.setStroke(new BasicStroke(6.0f)); 2452 if (!((String)getLightAtt(Att.BEG, i)).isEmpty() && !((String)getLightAtt(Att.END, i)).isEmpty()) { 2461 if (!((String) getLightAtt(Att.BEG, i)).isEmpty() && !((String) getLightAtt(Att.END, i)).isEmpty()) { 2453 2462 if (getLightAtt(Att.COL, i) != Col.UNKCOL) { 2454 2463 g2.setPaint(ColMAP.get(getLightAtt(Att.COL, i))); 2455 Double a0 = 270 - Double.parseDouble((String)getLightAtt(Att.BEG, i)); 2456 Double da = 270 - Double.parseDouble((String)getLightAtt(Att.END, i)) - a0; 2464 Double a0 = 270 - Double.parseDouble((String) getLightAtt(Att.BEG, i)); 2465 Double da = 270 - Double.parseDouble((String) getLightAtt(Att.END, i)) - a0; 2457 2466 da -= da > 0 ? 360 : 0; 2458 2467 g2.draw(new Arc2D.Double(12, 15, 140, 140, a0, da, Arc2D.OPEN)); … … 2460 2469 if (getLightAtt(Att.ALT, i) != Col.UNKCOL) { 2461 2470 g2.setPaint(ColMAP.get(getLightAtt(Att.ALT, i))); 2462 Double a0 = 270 - Double.parseDouble((String)getLightAtt(Att.BEG, i)); 2463 Double da = 270 - Double.parseDouble((String)getLightAtt(Att.END, i)) - a0; 2471 Double a0 = 270 - Double.parseDouble((String) getLightAtt(Att.BEG, i)); 2472 Double da = 270 - Double.parseDouble((String) getLightAtt(Att.END, i)) - a0; 2464 2473 da -= da > 0 ? 360 : 0; 2465 2474 g2.draw(new Arc2D.Double(17, 20, 130, 130, a0, da, Arc2D.OPEN)); 2466 2475 } 2467 } else if ((getLightAtt(Att.LIT, i) == Lit.DIR) && !((String)getLightAtt(Att.ORT, i)).isEmpty()) { 2476 } else if ((getLightAtt(Att.LIT, i) == Lit.DIR) && !((String) getLightAtt(Att.ORT, i)).isEmpty()) { 2468 2477 if (getLightAtt(Att.COL, i) != Col.UNKCOL) { 2469 2478 g2.setPaint(ColMAP.get(getLightAtt(Att.COL, i))); 2470 Double a0 = 270 - Double.parseDouble((String)getLightAtt(Att.ORT, i)) + 2.0; 2479 Double a0 = 270 - Double.parseDouble((String) getLightAtt(Att.ORT, i)) + 2.0; 2471 2480 Double da = -4.0; 2472 2481 g2.draw(new Arc2D.Double(12, 15, 140, 140, a0, da, Arc2D.OPEN)); … … 2474 2483 if (getLightAtt(Att.ALT, i) != Col.UNKCOL) { 2475 2484 g2.setPaint(ColMAP.get(getLightAtt(Att.ALT, i))); 2476 Double a0 = 270 - Double.parseDouble((String)getLightAtt(Att.ORT, i)) + 2.0; 2485 Double a0 = 270 - Double.parseDouble((String) getLightAtt(Att.ORT, i)) + 2.0; 2477 2486 Double da = -4.0; 2478 2487 g2.draw(new Arc2D.Double(17, 20, 130, 130, a0, da, Arc2D.OPEN)); … … 2481 2490 } 2482 2491 g2.setPaint(Color.BLACK); 2483 if ((getLightAtt(Att.COL, 0) != Col.UNKCOL) || !(((String)getLightAtt(Att.CHR, 0)).isEmpty())) { 2492 if ((getLightAtt(Att.COL, 0) != Col.UNKCOL) || !(((String) getLightAtt(Att.CHR, 0)).isEmpty())) { 2484 2493 if (sectors.size() == 1) { 2485 2494 if (((String) getLightAtt(Att.CHR, 0)).contains("Al")) { … … 2574 2583 } 2575 2584 if (getLightAtt(Att.LIT, 0) != Lit.UNKLIT) { 2576 switch ((Lit)getLightAtt(Att.LIT, 0)) { 2585 switch ((Lit) getLightAtt(Att.LIT, 0)) { 2577 2586 case VERT: 2578 2587 c += "(Vert)"; … … 2697 2706 2698 2707 if (getObjPattern() != Pat.NOPAT) { 2699 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":colour_pattern", PatSTR.get(getObjPattern()))); 2708 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":colour_pattern", 2709 PatSTR.get(getObjPattern()))); 2700 2710 } 2701 2711 … … 2745 2755 String secStr = (i == 0) ? "" : (":" + Integer.toString(i)); 2746 2756 if (sectors.get(i)[0] != Col.UNKCOL) 2747 if ((sectors.get(i)[15] != Col.UNKCOL) && ((String)sectors.get(i)[1]).contains("Al")) { 2748 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":colour", (ColSTR.get(sectors.get(i)[0])) + ";" + ColSTR.get(sectors.get(i)[15]))); 2757 if ((sectors.get(i)[15] != Col.UNKCOL) && ((String) sectors.get(i)[1]).contains("Al")) { 2758 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":colour", 2759 (ColSTR.get(sectors.get(i)[0])) + ";" + ColSTR.get(sectors.get(i)[15]))); 2749 2760 } else { 2750 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":colour", ColSTR.get(sectors.get(i)[0]))); 2761 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":colour", 2762 ColSTR.get(sectors.get(i)[0]))); 2751 2763 } 2752 2764 if (!((String) sectors.get(i)[1]).isEmpty()) { … … 2771 2783 } 2772 2784 if (sectors.get(i)[5] != Lit.UNKLIT) { 2773 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":category", LitSTR.get(sectors.get(i)[5]))); 2785 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":category", 2786 LitSTR.get(sectors.get(i)[5]))); 2774 2787 } else if (sectors.get(0)[5] != Lit.UNKLIT) { 2775 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":category", LitSTR.get(sectors.get(0)[5]))); 2788 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":category", 2789 LitSTR.get(sectors.get(0)[5]))); 2776 2790 } 2777 2791 if (!((String) sectors.get(i)[6]).isEmpty()) { 2778 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":sector_start", (String) sectors.get(i)[6])); 2792 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":sector_start", 2793 (String) sectors.get(i)[6])); 2779 2794 } 2780 2795 if (!((String) sectors.get(i)[7]).isEmpty()) { 2781 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":sector_end", (String) sectors.get(i)[7])); 2796 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":sector_end", 2797 (String) sectors.get(i)[7])); 2782 2798 } 2783 2799 if (!((String) sectors.get(i)[8]).isEmpty()) { … … 2797 2813 } 2798 2814 if (sectors.get(i)[11] != Vis.UNKVIS) { 2799 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":visibility", VisSTR.get(sectors.get(i)[11]))); 2815 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":visibility", 2816 VisSTR.get(sectors.get(i)[11]))); 2800 2817 } else if (sectors.get(0)[11] != Vis.UNKVIS) { 2801 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":visibility", VisSTR.get(sectors.get(0)[11]))); 2818 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":visibility", 2819 VisSTR.get(sectors.get(0)[11]))); 2802 2820 } 2803 2821 if (sectors.get(i)[12] != Exh.UNKEXH) { 2804 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":exhibition", ExhSTR.get(sectors.get(i)[12]))); 2822 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":exhibition", 2823 ExhSTR.get(sectors.get(i)[12]))); 2805 2824 } else if (sectors.get(0)[12] != Exh.UNKEXH) { 2806 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":exhibition", ExhSTR.get(sectors.get(0)[12]))); 2825 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":exhibition", 2826 ExhSTR.get(sectors.get(0)[12]))); 2807 2827 } 2808 2828 if (!((String) sectors.get(i)[13]).isEmpty()) { 2809 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":orientation", (String) sectors.get(i)[13])); 2829 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":orientation", 2830 (String) sectors.get(i)[13])); 2810 2831 } 2811 2832 if (!((String) sectors.get(i)[14]).isEmpty()) { -
applications/editors/josm/plugins/smed/src/smed/Smed.java
r32911 r33054 1 // License: GPL. For details, see LICENSE file. 1 2 package smed; 2 3 -
applications/editors/josm/plugins/smed/src/smed/SmedAction.java
r32911 r33054 1 /* Copyright 2013 Malcolm Herring 2 * 3 * This is free software: you can redistribute it and/or modify 4 * it under the terms of the GNU General Public License as published by 5 * the Free Software Foundation, version 3 of the License. 6 * 7 * For a copy of the GNU General Public License, see <http://www.gnu.org/licenses/>. 8 */ 9 1 // License: GPL. For details, see LICENSE file. 10 2 package smed; 11 3
Note:
See TracChangeset
for help on using the changeset viewer.