Changeset 26297 in osm
- Timestamp:
- 2011-07-10T16:45:16+02:00 (13 years ago)
- Location:
- applications/editors/josm/plugins/smed/plugs/oseam/src
- Files:
-
- 339 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelChan.java
r26173 r26297 42 42 shp = dlg.mark.getShape(); 43 43 if (portButton.isSelected() || prefPortButton.isSelected()) { 44 dlg.panelMain.topButton.setEnabled(true);45 dlg.panelMain.fogButton.setEnabled(true);46 dlg.panelMain.radButton.setEnabled(true);47 dlg.panelMain.litButton.setEnabled(true);48 44 dlg.panelMain.panelTop.enableAll(false); 49 45 dlg.panelMain.panelTop.noTopButton.setEnabled(true); 50 46 dlg.panelMain.panelTop.canTopButton.setEnabled(true); 51 47 dlg.panelMain.panelTop.panelCol.enableAll(false); 52 if (dlg.mark.getRegion() == Reg.A) { 48 dlg.panelMain.panelLit.panelCol.enableAll(false); 49 dlg.panelMain.panelLit.panelCol.offButton.setEnabled(true); 50 if (dlg.mark.getRegion() == Reg.B) { 51 dlg.panelMain.panelTop.panelCol.greenButton.setEnabled(true); 52 dlg.panelMain.panelTop.panelCol.greenButton.doClick(); 53 dlg.panelMain.panelLit.panelCol.greenButton.setEnabled(true); 54 dlg.panelMain.panelLit.panelCol.greenButton.doClick(); 55 } else { 53 56 dlg.panelMain.panelTop.panelCol.redButton.setEnabled(true); 54 57 dlg.panelMain.panelTop.panelCol.redButton.doClick(); 55 } else { 56 dlg.panelMain.panelTop.panelCol.greenButton.setEnabled(true); 57 dlg.panelMain.panelTop.panelCol.greenButton.doClick(); 58 dlg.panelMain.panelLit.panelCol.redButton.setEnabled(true); 59 dlg.panelMain.panelLit.panelCol.redButton.doClick(); 58 60 } 59 61 } … … 66 68 dlg.mark.setShape(Shp.UNKNOWN); 67 69 } 68 if (dlg.mark.getRegion() == Reg.A) { 70 if (dlg.mark.getRegion() == Reg.B) { 71 dlg.mark.setColour(Ent.BODY, Col.GREEN); 72 panelPort.regionBButton.doClick(); 73 } else { 69 74 dlg.mark.setColour(Ent.BODY, Col.RED); 70 75 panelPort.regionAButton.doClick(); 71 } else {72 dlg.mark.setColour(Ent.BODY, Col.GREEN);73 panelPort.regionBButton.doClick();74 76 } 75 77 portButton.setBorderPainted(true); … … 88 90 dlg.mark.setShape(Shp.UNKNOWN); 89 91 } 90 if (dlg.mark.getRegion() == Reg.A) { 92 if (dlg.mark.getRegion() == Reg.B) { 93 dlg.mark.setColour(Ent.BODY, Col.GREEN_RED_GREEN); 94 panelPort.regionBButton.doClick(); 95 } else { 91 96 dlg.mark.setColour(Ent.BODY, Col.RED_GREEN_RED); 92 97 panelPort.regionAButton.doClick(); 93 } else {94 dlg.mark.setColour(Ent.BODY, Col.GREEN_RED_GREEN);95 panelPort.regionBButton.doClick();96 98 } 97 99 prefPortButton.setBorderPainted(true); … … 104 106 } 105 107 if (stbdButton.isSelected() || prefStbdButton.isSelected()) { 106 dlg.panelMain.topButton.setEnabled(true);107 dlg.panelMain.fogButton.setEnabled(true);108 dlg.panelMain.radButton.setEnabled(true);109 dlg.panelMain.litButton.setEnabled(true);110 108 dlg.panelMain.panelTop.enableAll(false); 111 109 dlg.panelMain.panelTop.noTopButton.setEnabled(true); 112 110 dlg.panelMain.panelTop.coneTopButton.setEnabled(true); 113 111 dlg.panelMain.panelTop.panelCol.enableAll(false); 114 if (dlg.mark.getRegion() == Reg.A) { 112 dlg.panelMain.panelLit.panelCol.enableAll(false); 113 dlg.panelMain.panelLit.panelCol.offButton.setEnabled(true); 114 if (dlg.mark.getRegion() == Reg.B) { 115 dlg.panelMain.panelTop.panelCol.redButton.setEnabled(true); 116 dlg.panelMain.panelTop.panelCol.redButton.doClick(); 117 dlg.panelMain.panelLit.panelCol.redButton.setEnabled(true); 118 dlg.panelMain.panelLit.panelCol.redButton.doClick(); 119 } else { 115 120 dlg.panelMain.panelTop.panelCol.greenButton.setEnabled(true); 116 121 dlg.panelMain.panelTop.panelCol.greenButton.doClick(); 117 } else { 118 dlg.panelMain.panelTop.panelCol.redButton.setEnabled(true); 119 dlg.panelMain.panelTop.panelCol.redButton.doClick(); 122 dlg.panelMain.panelLit.panelCol.greenButton.setEnabled(true); 123 dlg.panelMain.panelLit.panelCol.greenButton.doClick(); 120 124 } 121 125 } … … 128 132 dlg.mark.setShape(Shp.UNKNOWN); 129 133 } 130 if (dlg.mark.getRegion() == Reg.A) { 134 if (dlg.mark.getRegion() == Reg.B) { 135 dlg.mark.setColour(Ent.BODY, Col.RED); 136 panelStbd.regionBButton.doClick(); 137 } else { 131 138 dlg.mark.setColour(Ent.BODY, Col.GREEN); 132 139 panelStbd.regionAButton.doClick(); 133 } else {134 dlg.mark.setColour(Ent.BODY, Col.RED);135 panelStbd.regionBButton.doClick();136 140 } 137 141 stbdButton.setBorderPainted(true); … … 150 154 dlg.mark.setShape(Shp.UNKNOWN); 151 155 } 152 if (dlg.mark.getRegion() == Reg.A) { 156 if (dlg.mark.getRegion() == Reg.B) { 157 dlg.mark.setColour(Ent.BODY, Col.RED_GREEN_RED); 158 panelStbd.regionBButton.doClick(); 159 } else { 153 160 dlg.mark.setColour(Ent.BODY, Col.GREEN_RED_GREEN); 154 161 panelStbd.regionAButton.doClick(); 155 } else {156 dlg.mark.setColour(Ent.BODY, Col.RED_GREEN_RED);157 panelStbd.regionBButton.doClick();158 162 } 159 163 prefStbdButton.setBorderPainted(true); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelChr.java
r26173 r26297 50 50 private ActionListener alCharButton = new ActionListener() { 51 51 public void actionPerformed(java.awt.event.ActionEvent e) { 52 if (noneButton.isSelected()) { 53 if (dlg.panelMain.panelLit.panelCol.offButton.isSelected()) { 54 dlg.panelMain.lightIcon.setIcon(null); 55 } 56 } else { 57 dlg.panelMain.lightIcon.setIcon(new ImageIcon(getClass().getResource("/images/Light_Green_120.png"))); 58 } 52 59 JToggleButton source = (JToggleButton) e.getSource(); 53 60 EnumSet<Chr> combo = EnumSet.noneOf(Chr.class); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelLit.java
r26173 r26297 106 106 groupBox = new JTextField(); 107 107 groupBox.setBounds(new Rectangle(135, 20, 40, 20)); 108 groupBox.setHorizontalAlignment(SwingConstants.CENTER); 108 109 this.add(groupBox, null); 109 110 groupBox.addActionListener(alGroupBox); … … 206 207 this.add(exhibitionBox, null); 207 208 exhibitionBox.addActionListener(alExhibitionBox); 209 exhibitionBox.addItem("-"); 208 210 exhibitionBox.addItem(Messages.getString("24h")); 209 211 exhibitionBox.addItem(Messages.getString("Day")); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelMain.java
r26173 r26297 91 91 radarIcon = new JLabel(); 92 92 radarIcon.setBounds(new Rectangle(250, 0, 150, 185)); 93 radarIcon.setIcon(new ImageIcon(getClass().getResource("/images/Radar_Station.png")));94 93 this.add(radarIcon, null); 95 94 fogIcon = new JLabel(); … … 268 267 lightIcon.setIcon(null); 269 268 topIcon.setIcon(null); 270 // radarIcon.setIcon(null); 271 radarIcon.setIcon(new ImageIcon(getClass().getResource("/images/Radar_Station.png"))); 269 radarIcon.setIcon(null); 272 270 fogIcon.setIcon(null); 273 271 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelPort.java
r26173 r26297 15 15 import oseam.Messages; 16 16 import oseam.dialogs.OSeaMAction; 17 import oseam.seamarks.SeaMark.Reg; 17 18 import oseam.seamarks.SeaMark.Shp; 18 19 import oseam.seamarks.SeaMark.Obj; … … 27 28 private ActionListener alRegion = new ActionListener() { 28 29 public void actionPerformed(java.awt.event.ActionEvent e) { 29 regionAButton.setBorderPainted(regionAButton.isSelected()); 30 regionBButton.setBorderPainted(regionBButton.isSelected()); 31 regionCButton.setBorderPainted(regionCButton.isSelected()); 30 if (regionAButton.isSelected()) { 31 dlg.mark.setRegion(Reg.A); 32 regionAButton.setBorderPainted(true); 33 } else { 34 regionAButton.setBorderPainted(false); 35 } 36 if (regionBButton.isSelected()) { 37 dlg.mark.setRegion(Reg.B); 38 regionBButton.setBorderPainted(true); 39 } else { 40 regionBButton.setBorderPainted(false); 41 } 42 if (regionCButton.isSelected()) { 43 dlg.mark.setRegion(Reg.C); 44 regionCButton.setBorderPainted(true); 45 } else { 46 regionCButton.setBorderPainted(false); 47 } 32 48 dlg.mark.paintSign(); 33 49 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelStbd.java
r26173 r26297 17 17 import oseam.seamarks.SeaMark.Shp; 18 18 import oseam.seamarks.SeaMark.Obj; 19 import oseam.seamarks.SeaMark.Reg; 19 20 20 21 public class PanelStbd extends JPanel { … … 27 28 private ActionListener alRegion = new ActionListener() { 28 29 public void actionPerformed(java.awt.event.ActionEvent e) { 29 regionAButton.setBorderPainted(regionAButton.isSelected()); 30 regionBButton.setBorderPainted(regionBButton.isSelected()); 31 regionCButton.setBorderPainted(regionCButton.isSelected()); 30 if (regionAButton.isSelected()) { 31 dlg.mark.setRegion(Reg.A); 32 regionAButton.setBorderPainted(true); 33 } else { 34 regionAButton.setBorderPainted(false); 35 } 36 if (regionBButton.isSelected()) { 37 dlg.mark.setRegion(Reg.B); 38 regionBButton.setBorderPainted(true); 39 } else { 40 regionBButton.setBorderPainted(false); 41 } 42 if (regionCButton.isSelected()) { 43 dlg.mark.setRegion(Reg.C); 44 regionCButton.setBorderPainted(true); 45 } else { 46 regionCButton.setBorderPainted(false); 47 } 32 48 dlg.mark.paintSign(); 33 49 } … … 51 67 dlg.mark.setShape(shp); 52 68 dlg.mark.setObject(objects.get(shp)); 69 switch (shp) { 70 case UNKNOWN: 71 dlg.panelMain.shapeIcon.setIcon(null); 72 case PILLAR: 73 // ************* 74 dlg.panelMain.topButton.setEnabled(true); 75 dlg.panelMain.fogButton.setEnabled(true); 76 dlg.panelMain.radButton.setEnabled(true); 77 dlg.panelMain.litButton.setEnabled(true); 78 // ************* 79 switch (dlg.mark.getRegion()) { 80 case A: 81 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource("/images/pillar_green.png"))); 82 break; 83 case B: 84 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource("/images/pillar_red.png"))); 85 break; 86 case C: 87 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource("/images/pillar_green;white;green;white.png"))); 88 break; 89 } 90 break; 91 case SPAR: 92 switch (dlg.mark.getRegion()) { 93 case A: 94 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource("/images/spar_green.png"))); 95 break; 96 case B: 97 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource("/images/spar_red.png"))); 98 break; 99 case C: 100 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource("/images/spar_green;white;green;white.png"))); 101 break; 102 } 103 break; 104 } 53 105 button.setBorderPainted(true); 54 106 } else -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelTop.java
r26173 r26297 36 36 public JRadioButton diamondDayButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/DiamondDayButton.png"))); 37 37 public JRadioButton triangleDayButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TriangleDayButton.png"))); 38 public JRadioButton triangleInvDayButton = new JRadioButton(new ImageIcon(getClass().getResource( 39 "/images/TriangleInvDayButton.png"))); 38 public JRadioButton triangleInvDayButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TriangleInvDayButton.png"))); 40 39 public JRadioButton squareDayButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SquareDayButton.png"))); 41 40 public JRadioButton circleDayButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CircleDayButton.png"))); … … 50 49 dlg.mark.setTopmark(top); 51 50 dlg.mark.setDaymark(Day.NONE); 51 switch (top) { 52 case NONE: 53 dlg.panelMain.topIcon.setIcon(null); 54 case CAN: 55 switch (dlg.mark.getRegion()) { 56 case A: 57 case C: 58 dlg.panelMain.topIcon.setIcon(new ImageIcon(getClass().getResource("/images/top_ih_cylinder_red.png"))); 59 break; 60 case B: 61 dlg.panelMain.topIcon.setIcon(new ImageIcon(getClass().getResource("/images/top_ih_cylinder_green.png"))); 62 break; 63 } 64 break; 65 case CONE: 66 switch (dlg.mark.getRegion()) { 67 case A: 68 case C: 69 dlg.panelMain.topIcon.setIcon(new ImageIcon(getClass().getResource("/images/top_ih_cone, point up_green.png"))); 70 break; 71 case B: 72 dlg.panelMain.topIcon.setIcon(new ImageIcon(getClass().getResource("/images/top_ih_cone, point up_red.png"))); 73 break; 74 } 75 break; 76 } 52 77 button.setBorderPainted(true); 53 78 } else … … 102 127 button.setEnabled(state); 103 128 } 129 for (JRadioButton button : days.values()) { 130 button.setEnabled(state); 131 } 132 mooringTopButton.setEnabled(state); 104 133 } 105 134 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/SeaMark.java
r26124 r26297 27 27 28 28 public enum Reg { 29 A, B 29 A, B, C 30 30 } 31 31
Note:
See TracChangeset
for help on using the changeset viewer.