Changeset 27031 in osm for applications/editors/josm/plugins/smed/plugs/oseam/src
- Timestamp:
- 2011-11-09T16:41:26+01:00 (13 years ago)
- Location:
- applications/editors/josm/plugins/smed/plugs/oseam/src
- Files:
-
- 8 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/msg/messages.properties
r26908 r27031 210 210 Painted=Painted 211 211 212 NoRadar=No radar aids 213 RadarReflector=Radar Reflector 214 Ramark=Ramark 215 Racon=Racon 216 LeadingRacon=Leading Racon 217 VisibleSector=Visible sector 218 Start=Start 219 End=End -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/msg/messages_en.properties
r27028 r27031 210 210 Painted=Painted 211 211 212 NoRadar=No radar aids 213 RadarReflector=Radar Reflector 214 Ramark=Ramark 215 Racon=Racon 216 LeadingRacon=Leading Racon 217 VisibleSector=Visible sector 218 Start=Start 219 End=End 220 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelCol.java
r27027 r27031 23 23 public JRadioButton whiteButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/WhiteButton.png"))); 24 24 public JRadioButton redButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RedButton.png"))); 25 public JRadioButton greenButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/GreenButton.png"))); 26 public JRadioButton yellowButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/YellowButton.png"))); 25 27 public JRadioButton orangeButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/OrangeButton.png"))); 26 28 public JRadioButton amberButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/AmberButton.png"))); 27 public JRadioButton yellowButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/YellowButton.png")));28 public JRadioButton greenButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/GreenButton.png")));29 29 public JRadioButton blueButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BlueButton.png"))); 30 30 public JRadioButton violetButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/VioletButton.png"))); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelLit.java
r27027 r27031 110 110 } else { 111 111 dlg.mark.setSectored(false); 112 panelSector.setVisible(false); 112 if (panelSector != null) { 113 panelSector.setVisible(false); 114 } 113 115 } 114 116 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelMain.java
r27023 r27031 27 27 public JLabel topIcon = null; 28 28 public JLabel radarIcon = null; 29 public JLabel radarLabel = null; 29 30 public JLabel fogIcon = null; 31 public JLabel fogLabel = null; 30 32 public JLabel colLabel = null; 31 33 public JLabel nameLabel = null; … … 208 210 fogIcon.setBounds(new Rectangle(235, 0, 150, 185)); 209 211 this.add(fogIcon, null); 212 radarLabel = new JLabel("", SwingConstants.RIGHT); 213 radarLabel.setBounds(new Rectangle(210, 35, 100, 20)); 214 this.add(radarLabel, null); 215 fogLabel = new JLabel("", SwingConstants.RIGHT); 216 fogLabel.setBounds(new Rectangle(210, 60, 100, 20)); 217 this.add(fogLabel, null); 210 218 colLabel = new JLabel("", SwingConstants.CENTER); 211 219 colLabel.setBounds(new Rectangle(235, 100, 150, 20)); … … 284 292 panelLights.setVisible(false); 285 293 panelMore.setVisible(false); 294 radarLabel.setText(""); 295 fogLabel.setText(""); 286 296 colLabel.setText(""); 287 297 shapeIcon.setIcon(null); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelRadar.java
r26998 r27031 17 17 private ButtonGroup radarButtons = new ButtonGroup(); 18 18 public JRadioButton noRadButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/OffButton.png"))); 19 public JRadioButton reflButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/ OffButton.png")));20 public JRadioButton ra conButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/OffButton.png")));21 public JRadioButton ra markButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/OffButton.png")));22 public JRadioButton leadingButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/ OffButton.png")));19 public JRadioButton reflButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RadarReflectorButton.png"))); 20 public JRadioButton ramarkButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RamarkButton.png"))); 21 public JRadioButton raconButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RaconButton.png"))); 22 public JRadioButton leadingButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LeadingRaconButton.png"))); 23 23 private EnumMap<Rtb, JRadioButton> rads = new EnumMap<Rtb, JRadioButton>(Rtb.class); 24 24 private ActionListener alRad = new ActionListener() { … … 27 27 JRadioButton button = rads.get(rtb); 28 28 if (button.isSelected()) { 29 dlg.mark.setRaType(rtb); 30 button.setBorderPainted(true); 31 } else 32 button.setBorderPainted(false); 29 dlg.mark.setRadar(rtb); 30 } 33 31 } 32 syncPanel(); 34 33 dlg.mark.paintSign(); 35 34 } … … 40 39 public void actionPerformed(java.awt.event.ActionEvent e) { 41 40 dlg.mark.setRaconGroup(groupBox.getText()); 41 dlg.mark.paintSign(); 42 42 } 43 43 }; … … 47 47 public void actionPerformed(java.awt.event.ActionEvent e) { 48 48 dlg.mark.setRaconPeriod(periodBox.getText()); 49 dlg.mark.paintSign(); 49 50 } 50 51 }; … … 54 55 public void actionPerformed(java.awt.event.ActionEvent e) { 55 56 dlg.mark.setRaconSequence(seqBox.getText()); 57 dlg.mark.paintSign(); 56 58 } 57 59 }; … … 61 63 public void actionPerformed(java.awt.event.ActionEvent e) { 62 64 dlg.mark.setRaconRange(rangeBox.getText()); 65 dlg.mark.paintSign(); 63 66 } 64 67 }; … … 67 70 private ActionListener alSector1 = new ActionListener() { 68 71 public void actionPerformed(java.awt.event.ActionEvent e) { 69 dlg.mark.setRaconSector1( rangeBox.getText());72 dlg.mark.setRaconSector1(sector1Box.getText()); 70 73 } 71 74 }; … … 74 77 private ActionListener alSector2 = new ActionListener() { 75 78 public void actionPerformed(java.awt.event.ActionEvent e) { 76 dlg.mark.setRaconSector2( rangeBox.getText());79 dlg.mark.setRaconSector2(sector2Box.getText()); 77 80 } 78 81 }; 82 public JLabel sectorsLabel; 79 83 80 84 public PanelRadar(OSeaMAction dia) { … … 83 87 this.add(getRadButton(noRadButton, 0, 3, 27, 27, "NoRadar", Rtb.NONE), null); 84 88 this.add(getRadButton(reflButton, 0, 33, 27, 27, "RadarReflector", Rtb.REFLECTOR), null); 85 this.add(getRadButton(ra conButton, 0, 63, 27, 27, "Racon", Rtb.RACON), null);86 this.add(getRadButton(ra markButton, 0, 93, 27, 27, "Ramark", Rtb.RAMARK), null);87 this.add(getRadButton(leadingButton, 0, 123, 27, 27, "Leading Beacon", Rtb.LEADING), null);89 this.add(getRadButton(ramarkButton, 0, 63, 27, 27, "Ramark", Rtb.RAMARK), null); 90 this.add(getRadButton(raconButton, 0, 93, 27, 27, "Racon", Rtb.RACON), null); 91 this.add(getRadButton(leadingButton, 0, 123, 27, 27, "LeadingRacon", Rtb.LEADING), null); 88 92 89 93 groupLabel = new JLabel(Messages.getString("Group"), SwingConstants.CENTER); 90 groupLabel.setBounds(new Rectangle( 75, 0, 100, 20));94 groupLabel.setBounds(new Rectangle(30, 0, 100, 20)); 91 95 this.add(groupLabel, null); 92 96 groupBox = new JTextField(); 93 groupBox.setBounds(new Rectangle( 100, 20, 50, 20));97 groupBox.setBounds(new Rectangle(55, 20, 50, 20)); 94 98 this.add(groupBox, null); 95 99 groupBox.addActionListener(alGroup); 96 100 97 101 periodLabel = new JLabel(Messages.getString("Period"), SwingConstants.CENTER); 98 periodLabel.setBounds(new Rectangle( 75, 40, 100, 20));102 periodLabel.setBounds(new Rectangle(130, 0, 100, 20)); 99 103 this.add(periodLabel, null); 100 104 periodBox = new JTextField(); 101 periodBox.setBounds(new Rectangle(1 00, 60, 50, 20));105 periodBox.setBounds(new Rectangle(155, 20, 50, 20)); 102 106 this.add(periodBox, null); 103 107 periodBox.addActionListener(alPeriod); 104 108 105 109 seqLabel = new JLabel(Messages.getString("Sequence"), SwingConstants.CENTER); 106 seqLabel.setBounds(new Rectangle( 75, 80, 100, 20));110 seqLabel.setBounds(new Rectangle(30, 40, 100, 20)); 107 111 this.add(seqLabel, null); 108 112 seqBox = new JTextField(); 109 seqBox.setBounds(new Rectangle( 100, 100, 50, 20));113 seqBox.setBounds(new Rectangle(55, 60, 50, 20)); 110 114 this.add(seqBox, null); 111 115 seqBox.addActionListener(alSeq); 112 116 113 117 rangeLabel = new JLabel(Messages.getString("Range"), SwingConstants.CENTER); 114 rangeLabel.setBounds(new Rectangle( 75, 120, 100, 20));118 rangeLabel.setBounds(new Rectangle(130, 40, 100, 20)); 115 119 this.add(rangeLabel, null); 116 120 rangeBox = new JTextField(); 117 rangeBox.setBounds(new Rectangle(1 00, 140, 50, 20));121 rangeBox.setBounds(new Rectangle(155, 60, 50, 20)); 118 122 this.add(rangeBox, null); 119 123 rangeBox.addActionListener(alRange); 124 125 sectorsLabel = new JLabel(Messages.getString("VisibleSector"), SwingConstants.CENTER); 126 sectorsLabel.setBounds(new Rectangle(75, 85, 100, 20)); 127 this.add(sectorsLabel, null); 120 128 121 sector1Label = new JLabel(Messages.getString("S ectorStart"), SwingConstants.CENTER);122 sector1Label.setBounds(new Rectangle( 175, 40, 100, 20));129 sector1Label = new JLabel(Messages.getString("Start"), SwingConstants.CENTER); 130 sector1Label.setBounds(new Rectangle(30, 100, 100, 20)); 123 131 this.add(sector1Label, null); 124 132 sector1Box = new JTextField(); 125 sector1Box.setBounds(new Rectangle( 200, 60, 50, 20));133 sector1Box.setBounds(new Rectangle(55, 120, 50, 20)); 126 134 this.add(sector1Box, null); 127 135 sector1Box.addActionListener(alSector1); 128 136 129 sector2Label = new JLabel(Messages.getString(" SectorEnd"), SwingConstants.CENTER);130 sector2Label.setBounds(new Rectangle(1 75, 80, 100, 20));137 sector2Label = new JLabel(Messages.getString("End"), SwingConstants.CENTER); 138 sector2Label.setBounds(new Rectangle(130, 100, 100, 20)); 131 139 this.add(sector2Label, null); 132 140 sector2Box = new JTextField(); 133 sector2Box.setBounds(new Rectangle( 200, 100, 50, 20));141 sector2Box.setBounds(new Rectangle(155, 120, 50, 20)); 134 142 this.add(sector2Box, null); 135 sector2Box.addActionListener(alSector 1);143 sector2Box.addActionListener(alSector2); 136 144 } 137 145 138 146 public void syncPanel() { 147 boolean rad = ((dlg.mark.getRadar() != Rtb.NONE) && (dlg.mark.getRadar() != Rtb.REFLECTOR)); 148 groupLabel.setVisible(rad); 149 groupBox.setVisible(rad); 150 periodLabel.setVisible(rad); 151 periodBox.setVisible(rad); 152 seqLabel.setVisible(rad); 153 seqBox.setVisible(rad); 154 rangeLabel.setVisible(rad); 155 rangeBox.setVisible(rad); 156 sector1Label.setVisible(rad); 157 sector1Box.setVisible(rad); 158 sector2Label.setVisible(rad); 159 sector2Box.setVisible(rad); 160 sectorsLabel.setVisible(rad); 139 161 for (Rtb rtb : rads.keySet()) { 140 JRadioButton button = rads.get(rtb); 141 if (dlg.mark.getRaType() == rtb) { 142 button.setBorderPainted(true); 143 } else 144 button.setBorderPainted(false); 162 rads.get(rtb).setBorderPainted(dlg.mark.getRadar() == rtb); 145 163 } 146 164 groupBox.setText(dlg.mark.getRaconGroup()); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelSectors.java
r27028 r27031 10 10 import oseam.Messages; 11 11 import oseam.dialogs.OSeaMAction; 12 import oseam.seamarks.SeaMark;13 12 import oseam.seamarks.SeaMark.*; 14 13 … … 68 67 this.getContentPane().add(panel); 69 68 70 TableColumn col = table.getColumnModel().getColumn(1);71 col.setCellRenderer(new ColourCellRenderer());69 table.setDefaultRenderer(String.class, new CentreRenderer()); 70 table.getColumnModel().getColumn(1).setCellRenderer(new ColourCellRenderer()); 72 71 73 72 TableColumn colColumn = table.getColumnModel().getColumn(1); … … 140 139 switch (col) { 141 140 case 0: 142 return row; 141 if (row == 0) 142 return "Common"; 143 else 144 return row; 143 145 case 1: 144 146 return dlg.mark.getLightAtt(Att.COL, row); … … 212 214 } 213 215 216 static class CentreRenderer extends DefaultTableCellRenderer { 217 public CentreRenderer() { 218 super(); 219 setHorizontalAlignment(SwingConstants.CENTER); 220 } 221 } 222 214 223 public class ColourCellRenderer extends JLabel implements TableCellRenderer { 224 public ColourCellRenderer() { 225 super(); 226 setHorizontalAlignment(SwingConstants.CENTER); 227 } 215 228 public Component getTableCellRendererComponent(JTable table, Object value, 216 229 boolean isSelected, boolean hasFocus, int rowIndex, int vColIndex) { 217 setHorizontalAlignment(SwingConstants.CENTER);218 230 setIcon(colours.get(value)); 219 231 return this; -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/SeaMark.java
r27028 r27031 671 671 } 672 672 673 private boolean Radar = false;674 675 public boolean hasRadar() {676 return Radar;677 }678 679 public void setRadar(boolean radar) {680 Radar = radar;681 }682 683 private boolean Racon = false;684 685 public boolean hasRacon() {686 return Racon;687 }688 689 public void setRacon(boolean racon) {690 Racon = racon;691 }692 693 673 public enum Rtb { 694 674 NONE, REFLECTOR, RACON, RAMARK, LEADING 695 675 } 696 676 677 public static final EnumMap<Rtb, String> RtbSTR = new EnumMap<Rtb, String>(Rtb.class); 678 static { 679 RtbSTR.put(Rtb.RACON, "racon"); 680 RtbSTR.put(Rtb.RAMARK, "ramark"); 681 RtbSTR.put(Rtb.LEADING, "leading"); 682 } 683 697 684 private Rtb RaType = Rtb.NONE; 698 685 699 public Rtb getRaType() { 686 public boolean hasRadar() { 687 return (RaType != Rtb.NONE); 688 } 689 690 public boolean hasRacon() { 691 return (RaType == Rtb.RACON); 692 } 693 694 public Rtb getRadar() { 700 695 return RaType; 701 696 } 702 697 703 public void setRa Type(Rtb type) {698 public void setRadar(Rtb type) { 704 699 RaType = type; 705 700 } … … 1394 1389 if (paintlock) 1395 1390 return; 1391 paintlock = true; 1396 1392 1397 1393 dlg.panelMain.shapeIcon.setIcon(null); 1394 dlg.panelMain.colLabel.setText(""); 1395 dlg.panelMain.radarLabel.setText(""); 1396 dlg.panelMain.fogLabel.setText(""); 1397 dlg.panelMain.topIcon.setIcon(null); 1398 dlg.panelMain.fogIcon.setIcon(null); 1399 dlg.panelMain.radarIcon.setIcon(null); 1398 1400 dlg.panelMain.lightIcon.setIcon(null); 1399 dlg.panelMain.topIcon.setIcon(null);1400 dlg.panelMain.radarIcon.setIcon(null);1401 dlg.panelMain.fogIcon.setIcon(null);1402 dlg.panelMain.colLabel.setText("");1403 1401 1404 1402 String colStr; … … 1682 1680 dlg.panelMain.fogIcon.setIcon(new ImageIcon(getClass().getResource("/images/Fog_Signal.png"))); 1683 1681 } 1682 1683 if (hasRadar()) { 1684 if (getRadar() == Rtb.REFLECTOR) { 1685 dlg.panelMain.radarIcon.setIcon(new ImageIcon(getClass().getResource("/images/Radar_Reflector_355.png"))); 1686 } else { 1687 dlg.panelMain.radarIcon.setIcon(new ImageIcon(getClass().getResource("/images/Radar_Station.png"))); 1688 String str = ""; 1689 if (getRadar() == Rtb.RAMARK) 1690 str += "Ramark"; 1691 else 1692 str += "Racon"; 1693 if (!getRaconGroup().isEmpty()) 1694 str += ("(" + getRaconGroup() + ")"); 1695 else 1696 str += " "; 1697 if (!getRaconPeriod().isEmpty()) 1698 str += getRaconPeriod() + "s"; 1699 dlg.panelMain.radarLabel.setText(str); 1700 } 1701 } 1702 1703 if (isFired()) { 1704 dlg.panelMain.lightIcon.setIcon(new ImageIcon(getClass().getResource("/images/Light_Magenta_120.png"))); 1705 } 1706 1707 paintlock = false; 1684 1708 } 1685 1709 … … 1798 1822 } 1799 1823 } 1824 1825 if (hasRadar()) { 1826 if (getRadar() == Rtb.REFLECTOR) { 1827 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_reflector", "yes")); 1828 } else { 1829 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_transponder:category", RtbSTR.get(getRadar()))); 1830 if (!getRaconGroup().isEmpty()) { 1831 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_transponder:group", getRaconGroup())); 1832 } 1833 if (!getRaconPeriod().isEmpty()) { 1834 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_transponder:period", getRaconPeriod())); 1835 } 1836 if (!getRaconSequence().isEmpty()) { 1837 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_transponder:sequence", getRaconSequence())); 1838 } 1839 if (!getRaconRange().isEmpty()) { 1840 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_transponder:range", getRaconRange())); 1841 } 1842 if ((!getRaconSector1().isEmpty()) && (!getRaconSector2().isEmpty())) { 1843 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_transponder:sector_start", getRaconSector1())); 1844 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_transponder:sector_end", getRaconSector2())); 1845 } 1846 } 1847 } 1848 1800 1849 if (!getInfo().isEmpty()) { 1801 1850 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:information", getInfo()));
Note:
See TracChangeset
for help on using the changeset viewer.