Changeset 26881 in osm for applications/editors/josm/plugins/smed
- Timestamp:
- 2011-10-13T19:45:13+02:00 (13 years ago)
- Location:
- applications/editors/josm/plugins/smed/plugs/oseam/src/oseam
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/msg/messages.properties
r26590 r26881 106 106 Fog=Fog 107 107 108 NoColour=No colour 108 RemColour=Remove colour 109 AddColour=Add colour 109 110 White=White 110 111 Red=Red … … 170 171 Military=Military Practice 171 172 173 Status=Status 174 Information=Information 175 Source=Source 176 Elevation=Elevation 177 StructureHeight=Structure Height 178 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelChan.java
r26572 r26881 34 34 dlg.mark.setShape(Shp.UNKNOWN); 35 35 } 36 if (dlg.mark.getRegion() == Reg.C) {37 panelPort.regionCButton.doClick();38 } else if (dlg.mark.getRegion() == Reg.B) {39 panelPort.regionBButton.doClick();40 } else {41 panelPort.regionAButton.doClick();42 }43 36 portButton.setBorderPainted(true); 44 37 panelPort.setVisible(true); … … 57 50 dlg.mark.setShape(Shp.UNKNOWN); 58 51 } 59 if (dlg.mark.getRegion() == Reg.C) {60 panelPort.regionCButton.doClick();61 } else if (dlg.mark.getRegion() == Reg.B) {62 panelPort.regionBButton.doClick();63 } else {64 panelPort.regionAButton.doClick();65 }66 52 prefPortButton.setBorderPainted(true); 67 53 panelPort.setVisible(true); … … 78 64 panelStbd.clearSelections(); 79 65 dlg.mark.setShape(Shp.UNKNOWN); 80 }81 if (dlg.mark.getRegion() == Reg.C) {82 panelStbd.regionCButton.doClick();83 } else if (dlg.mark.getRegion() == Reg.B) {84 panelStbd.regionBButton.doClick();85 } else {86 panelStbd.regionAButton.doClick();87 66 } 88 67 stbdButton.setBorderPainted(true); … … 101 80 panelStbd.clearSelections(); 102 81 dlg.mark.setShape(Shp.UNKNOWN); 103 }104 if (dlg.mark.getRegion() == Reg.C) {105 panelStbd.regionCButton.doClick();106 } else if (dlg.mark.getRegion() == Reg.B) {107 panelStbd.regionBButton.doClick();108 } else {109 panelStbd.regionAButton.doClick();110 82 } 111 83 prefStbdButton.setBorderPainted(true); … … 168 140 private JRadioButton getCatButton(JRadioButton button, int x, int y, int w, int h, String tip) { 169 141 button.setBounds(new Rectangle(x, y, w, h)); 170 button.setBorder(BorderFactory.createL ineBorder(Color.magenta, 2));142 button.setBorder(BorderFactory.createLoweredBevelBorder()); 171 143 button.setToolTipText(Messages.getString(tip)); 172 144 button.addActionListener(alCat); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelChr.java
r26562 r26881 142 142 private JToggleButton getChrButton(JToggleButton button, int x, int y, int w, int h, String tip, Chr chr) { 143 143 button.setBounds(new Rectangle(x, y, w, h)); 144 button.setBorder(BorderFactory.createL ineBorder(Color.magenta, 2));144 button.setBorder(BorderFactory.createLoweredBevelBorder()); 145 145 button.setBorderPainted(false); 146 146 button.setToolTipText(tr(tip)); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelCol.java
r26831 r26881 60 60 stackCol.add(stackIdx, new JRadioButton(new ImageIcon(getClass().getResource("/images/ColourButton.png")))); 61 61 JRadioButton btnI = stackCol.get(stackIdx); 62 btnI.setBorder(BorderFactory.createL ineBorder(Color.magenta, 2));62 btnI.setBorder(BorderFactory.createLoweredBevelBorder()); 63 63 stack.add(btnI); 64 64 stackColours.add(btnI); … … 111 111 ent = entity; 112 112 this.setLayout(null); 113 this.add(getColButton(offButton, 0, 0, 34, 16, Messages.getString(" NoColour"), Col.UNKNOWN), null);113 this.add(getColButton(offButton, 0, 0, 34, 16, Messages.getString("RemColour"), Col.UNKNOWN), null); 114 114 this.add(getColButton(whiteButton, 0, 16, 34, 16, Messages.getString("White"), Col.WHITE), null); 115 115 this.add(getColButton(redButton, 0, 32, 34, 16, Messages.getString("Red"), Col.RED), null); … … 129 129 130 130 stack = new JPanel(); 131 stack.setBorder(BorderFactory.createL ineBorder(Color.black));131 stack.setBorder(BorderFactory.createLoweredBevelBorder()); 132 132 stack.setBounds(38, 87, 34, 64); 133 133 stack.setLayout(null); … … 154 154 private JRadioButton getColButton(JRadioButton button, int x, int y, int w, int h, String tip, Col col) { 155 155 button.setBounds(new Rectangle(x, y, w, h)); 156 button.setBorder(BorderFactory.createL ineBorder(Color.magenta, 2));156 button.setBorder(BorderFactory.createLoweredBevelBorder()); 157 157 button.setToolTipText(tr(tip)); 158 158 button.addActionListener(alColour); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelHaz.java
r26579 r26881 149 149 private JRadioButton getCatButton(JRadioButton button, int x, int y, int w, int h, String tip) { 150 150 button.setBounds(new Rectangle(x, y, w, h)); 151 button.setBorder(BorderFactory.createL ineBorder(Color.magenta, 2));151 button.setBorder(BorderFactory.createLoweredBevelBorder()); 152 152 button.setToolTipText(Messages.getString(tip)); 153 153 button.addActionListener(alCat); … … 158 158 private JRadioButton getShapeButton(JRadioButton button, int x, int y, int w, int h, String tip, Shp shp, Obj car, Obj isd) { 159 159 button.setBounds(new Rectangle(x, y, w, h)); 160 button.setBorder(BorderFactory.createL ineBorder(Color.magenta, 2));160 button.setBorder(BorderFactory.createLoweredBevelBorder()); 161 161 button.setToolTipText(Messages.getString(tip)); 162 162 button.addActionListener(alShape); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelLights.java
r26581 r26881 190 190 private JRadioButton getObjButton(JRadioButton button, int x, int y, int w, int h, String tip, Obj obj) { 191 191 button.setBounds(new Rectangle(x, y, w, h)); 192 button.setBorder(BorderFactory.createL ineBorder(Color.magenta, 2));192 button.setBorder(BorderFactory.createLoweredBevelBorder()); 193 193 button.setToolTipText(Messages.getString(tip)); 194 194 button.addActionListener(alObj); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelLit.java
r26631 r26881 218 218 private JRadioButton getTypeButton(JRadioButton button, int x, int y, int w, int h, String tip) { 219 219 button.setBounds(new Rectangle(x, y, w, h)); 220 button.setBorder(BorderFactory.createL ineBorder(Color.magenta, 2));220 button.setBorder(BorderFactory.createLoweredBevelBorder()); 221 221 button.setToolTipText(Messages.getString(tip)); 222 222 button.addActionListener(alType); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelMain.java
r26579 r26881 316 316 private JRadioButton getButton(JRadioButton button, int x, int y, int w, int h, String tip) { 317 317 button.setBounds(new Rectangle(x, y, w, h)); 318 button.setBorder(BorderFactory.createL ineBorder(Color.magenta, 2));318 button.setBorder(BorderFactory.createLoweredBevelBorder()); 319 319 button.setToolTipText(Messages.getString(tip)); 320 320 return button; -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelMore.java
r26830 r26881 1 1 package oseam.panels; 2 3 import static org.openstreetmap.josm.tools.I18n.tr; 2 4 3 5 import java.awt.*; … … 15 17 16 18 private OSeaMAction dlg; 19 public JLabel infoLabel; 20 public JTextField infoBox; 21 private ActionListener alInfo = new ActionListener() { 22 public void actionPerformed(java.awt.event.ActionEvent e) { 23 if (dlg.mark == null) 24 return; 25 } 26 }; 27 public JLabel sourceLabel; 28 public JTextField sourceBox; 29 private ActionListener alSource = new ActionListener() { 30 public void actionPerformed(java.awt.event.ActionEvent e) { 31 if (dlg.mark == null) 32 return; 33 } 34 }; 35 public JLabel elevLabel; 36 public JTextField elevBox; 37 private ActionListener alElev = new ActionListener() { 38 public void actionPerformed(java.awt.event.ActionEvent e) { 39 if (dlg.mark == null) 40 return; 41 } 42 }; 43 public JLabel heightLabel; 44 public JTextField heightBox; 45 private ActionListener alHeight = new ActionListener() { 46 public void actionPerformed(java.awt.event.ActionEvent e) { 47 if (dlg.mark == null) 48 return; 49 } 50 }; 51 public JLabel statusLabel; 52 public JComboBox statusBox; 53 private ActionListener alStatus = new ActionListener() { 54 public void actionPerformed(java.awt.event.ActionEvent e) { 55 if (dlg.mark == null) 56 return; 57 } 58 }; 59 public JLabel constrLabel; 60 public JComboBox constrBox; 61 private ActionListener alConstr = new ActionListener() { 62 public void actionPerformed(java.awt.event.ActionEvent e) { 63 if (dlg.mark == null) 64 return; 65 } 66 }; 67 public JLabel visLabel; 68 public JComboBox visBox; 69 private ActionListener alVis = new ActionListener() { 70 public void actionPerformed(java.awt.event.ActionEvent e) { 71 if (dlg.mark == null) 72 return; 73 } 74 }; 75 public JLabel conspLabel; 76 public JComboBox conspBox; 77 private ActionListener alConsp = new ActionListener() { 78 public void actionPerformed(java.awt.event.ActionEvent e) { 79 if (dlg.mark == null) 80 return; 81 } 82 }; 17 83 public PanelPat panelPat; 84 private ButtonGroup regionButtons = new ButtonGroup(); 85 public JRadioButton regionAButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionAButton.png"))); 86 public JRadioButton regionBButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionBButton.png"))); 87 public JRadioButton regionCButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionCButton.png"))); 88 private ActionListener alRegion = new ActionListener() { 89 public void actionPerformed(java.awt.event.ActionEvent e) { 90 if (regionAButton.isSelected()) { 91 dlg.mark.setRegion(Reg.A); 92 switch (dlg.mark.getCategory()) { 93 case LAM_PORT: 94 dlg.mark.setColour(Ent.BODY, Col.RED); 95 dlg.mark.setPattern(Ent.BODY, Pat.NONE); 96 break; 97 case LAM_PPORT: 98 dlg.mark.setColour(Ent.BODY, Col.RED); 99 dlg.mark.addColour(Ent.BODY, Col.GREEN); 100 dlg.mark.addColour(Ent.BODY, Col.RED); 101 dlg.mark.setPattern(Ent.BODY, Pat.HORIZ); 102 break; 103 case LAM_STBD: 104 dlg.mark.setColour(Ent.BODY, Col.GREEN); 105 dlg.mark.setPattern(Ent.BODY, Pat.NONE); 106 break; 107 case LAM_PSTBD: 108 dlg.mark.setColour(Ent.BODY, Col.GREEN); 109 dlg.mark.addColour(Ent.BODY, Col.RED); 110 dlg.mark.addColour(Ent.BODY, Col.GREEN); 111 dlg.mark.setPattern(Ent.BODY, Pat.HORIZ); 112 break; 113 } 114 regionAButton.setBorderPainted(true); 115 } else { 116 regionAButton.setBorderPainted(false); 117 } 118 if (regionBButton.isSelected()) { 119 dlg.mark.setRegion(Reg.B); 120 switch (dlg.mark.getCategory()) { 121 case LAM_PORT: 122 dlg.mark.setColour(Ent.BODY, Col.GREEN); 123 dlg.mark.setPattern(Ent.BODY, Pat.NONE); 124 break; 125 case LAM_PPORT: 126 dlg.mark.setColour(Ent.BODY, Col.GREEN); 127 dlg.mark.addColour(Ent.BODY, Col.RED); 128 dlg.mark.addColour(Ent.BODY, Col.GREEN); 129 dlg.mark.setPattern(Ent.BODY, Pat.HORIZ); 130 break; 131 case LAM_STBD: 132 dlg.mark.setColour(Ent.BODY, Col.RED); 133 dlg.mark.setPattern(Ent.BODY, Pat.NONE); 134 break; 135 case LAM_PSTBD: 136 dlg.mark.setColour(Ent.BODY, Col.RED); 137 dlg.mark.addColour(Ent.BODY, Col.GREEN); 138 dlg.mark.addColour(Ent.BODY, Col.RED); 139 dlg.mark.setPattern(Ent.BODY, Pat.HORIZ); 140 break; 141 } 142 regionBButton.setBorderPainted(true); 143 } else { 144 regionBButton.setBorderPainted(false); 145 } 146 if (regionCButton.isSelected()) { 147 dlg.mark.setRegion(Reg.C); 148 dlg.mark.setPattern(Ent.BODY, Pat.HORIZ); 149 switch (dlg.mark.getCategory()) { 150 case LAM_PORT: 151 dlg.mark.setColour(Ent.BODY, Col.RED); 152 dlg.mark.addColour(Ent.BODY, Col.WHITE); 153 dlg.mark.addColour(Ent.BODY, Col.RED); 154 dlg.mark.addColour(Ent.BODY, Col.WHITE); 155 break; 156 case LAM_PPORT: 157 case LAM_PSTBD: 158 dlg.mark.setColour(Ent.BODY, Col.RED); 159 dlg.mark.addColour(Ent.BODY, Col.GREEN); 160 dlg.mark.addColour(Ent.BODY, Col.RED); 161 dlg.mark.addColour(Ent.BODY, Col.GREEN); 162 break; 163 case LAM_STBD: 164 dlg.mark.setColour(Ent.BODY, Col.GREEN); 165 dlg.mark.addColour(Ent.BODY, Col.WHITE); 166 dlg.mark.addColour(Ent.BODY, Col.GREEN); 167 dlg.mark.addColour(Ent.BODY, Col.WHITE); 168 break; 169 } 170 regionCButton.setBorderPainted(true); 171 } else { 172 regionCButton.setBorderPainted(false); 173 } 174 dlg.mark.paintSign(); 175 } 176 }; 18 177 19 178 public PanelMore(OSeaMAction dia) { … … 23 182 panelPat.setBounds(new Rectangle(0, 0, 110, 160)); 24 183 this.add(panelPat, null); 25 26 } 184 this.add(getRegionButton(regionAButton, 110, 0, 34, 30, "RegionA"), null); 185 this.add(getRegionButton(regionBButton, 110, 32, 34, 30, "RegionB"), null); 186 this.add(getRegionButton(regionCButton, 110, 64, 34, 30, "RegionC"), null); 187 188 elevLabel = new JLabel(Messages.getString("Elevation"), SwingConstants.CENTER); 189 elevLabel.setBounds(new Rectangle(140, 0, 90, 20)); 190 this.add(elevLabel, null); 191 elevBox = new JTextField(); 192 elevBox.setBounds(new Rectangle(160, 20, 50, 20)); 193 this.add(elevBox, null); 194 elevBox.addActionListener(alElev); 195 196 heightLabel = new JLabel(Messages.getString("StructureHeight"), SwingConstants.CENTER); 197 heightLabel.setBounds(new Rectangle(230, 0, 100, 20)); 198 this.add(heightLabel, null); 199 heightBox = new JTextField(); 200 heightBox.setBounds(new Rectangle(250, 20, 50, 20)); 201 this.add(heightBox, null); 202 heightBox.addActionListener(alHeight); 203 204 sourceLabel = new JLabel(Messages.getString("Source"), SwingConstants.CENTER); 205 sourceLabel.setBounds(new Rectangle(110, 120, 140, 20)); 206 this.add(sourceLabel, null); 207 sourceBox = new JTextField(); 208 sourceBox.setBounds(new Rectangle(110, 100, 140, 20)); 209 this.add(sourceBox, null); 210 sourceBox.addActionListener(alSource); 211 212 infoLabel = new JLabel(Messages.getString("Information"), SwingConstants.CENTER); 213 infoLabel.setBounds(new Rectangle(110, 120, 140, 20)); 214 this.add(infoLabel, null); 215 infoBox = new JTextField(); 216 infoBox.setBounds(new Rectangle(110, 140, 140, 20)); 217 this.add(infoBox, null); 218 infoBox.addActionListener(alInfo); 219 220 /* statusLabel = new JLabel(Messages.getString("Status"), SwingConstants.CENTER); 221 statusLabel.setBounds(new Rectangle(150, 0, 100, 20)); 222 this.add(statusLabel, null); 223 statusBox = new JComboBox(); 224 statusBox.setBounds(new Rectangle(150, 20, 100, 20)); 225 this.add(statusBox, null); 226 statusBox.addActionListener(alStatus); 227 */ 228 } 27 229 28 230 public void clearSelections() { … … 30 232 } 31 233 234 private JRadioButton getRegionButton(JRadioButton button, int x, int y, int w, int h, String tip) { 235 button.setBounds(new Rectangle(x, y, w, h)); 236 button.setBorder(BorderFactory.createLoweredBevelBorder()); 237 button.setToolTipText(Messages.getString(tip)); 238 button.addActionListener(alRegion); 239 regionButtons.add(button); 240 return button; 241 } 242 32 243 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelPat.java
r26830 r26881 63 63 private JRadioButton getPatButton(JRadioButton button, int x, int y, int w, int h, String tip, Pat pat) { 64 64 button.setBounds(new Rectangle(x, y, w, h)); 65 button.setBorder(BorderFactory.createL ineBorder(Color.magenta, 2));65 button.setBorder(BorderFactory.createLoweredBevelBorder()); 66 66 button.setToolTipText(Messages.getString(tip)); 67 67 button.addActionListener(alPat); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelPort.java
r26579 r26881 13 13 14 14 private OSeaMAction dlg; 15 private ButtonGroup regionButtons = new ButtonGroup();16 public JRadioButton regionAButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionAButton.png")));17 public JRadioButton regionBButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionBButton.png")));18 public JRadioButton regionCButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionCButton.png")));19 private ActionListener alRegion = new ActionListener() {20 public void actionPerformed(java.awt.event.ActionEvent e) {21 if (regionAButton.isSelected()) {22 dlg.mark.setRegion(Reg.A);23 dlg.mark.setColour(Ent.BODY, Col.RED);24 dlg.mark.setPattern(Ent.BODY, Pat.NONE);25 if (dlg.mark.getCategory() == Cat.LAM_PPORT) {26 dlg.mark.addColour(Ent.BODY, Col.GREEN);27 dlg.mark.addColour(Ent.BODY, Col.RED);28 dlg.mark.setPattern(Ent.BODY, Pat.HORIZ);29 }30 regionAButton.setBorderPainted(true);31 } else {32 regionAButton.setBorderPainted(false);33 }34 if (regionBButton.isSelected()) {35 dlg.mark.setRegion(Reg.B);36 dlg.mark.setColour(Ent.BODY, Col.GREEN);37 dlg.mark.setPattern(Ent.BODY, Pat.NONE);38 if (dlg.mark.getCategory() == Cat.LAM_PPORT) {39 dlg.mark.addColour(Ent.BODY, Col.RED);40 dlg.mark.addColour(Ent.BODY, Col.GREEN);41 dlg.mark.setPattern(Ent.BODY, Pat.HORIZ);42 }43 regionBButton.setBorderPainted(true);44 } else {45 regionBButton.setBorderPainted(false);46 }47 if (regionCButton.isSelected()) {48 dlg.mark.setRegion(Reg.C);49 if (dlg.mark.getCategory() == Cat.LAM_PPORT) {50 dlg.mark.setColour(Ent.BODY, Col.RED);51 dlg.mark.addColour(Ent.BODY, Col.GREEN);52 dlg.mark.addColour(Ent.BODY, Col.RED);53 dlg.mark.addColour(Ent.BODY, Col.GREEN);54 } else {55 dlg.mark.setColour(Ent.BODY, Col.RED);56 dlg.mark.addColour(Ent.BODY, Col.WHITE);57 dlg.mark.addColour(Ent.BODY, Col.RED);58 dlg.mark.addColour(Ent.BODY, Col.WHITE);59 }60 dlg.mark.setPattern(Ent.BODY, Pat.HORIZ);61 regionCButton.setBorderPainted(true);62 } else {63 regionCButton.setBorderPainted(false);64 }65 dlg.mark.paintSign();66 }67 };68 15 private ButtonGroup shapeButtons = new ButtonGroup(); 69 16 public JRadioButton pillarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PillarButton.png"))); … … 102 49 dlg = dia; 103 50 this.setLayout(null); 104 this.add(getRegionButton(regionAButton, 70, 0, 34, 30, "RegionA"), null);105 this.add(getRegionButton(regionBButton, 70, 32, 34, 30, "RegionB"), null);106 this.add(getRegionButton(regionCButton, 70, 64, 34, 30, "RegionC"), null);107 51 this.add(getShapeButton(pillarButton, 0, 0, 34, 32, "Pillar", Shp.PILLAR, Obj.BOYLAT), null); 108 52 this.add(getShapeButton(sparButton, 0, 32, 34, 32, "Spar", Shp.SPAR, Obj.BOYLAT), null); … … 121 65 } 122 66 123 private JRadioButton getRegionButton(JRadioButton button, int x, int y, int w, int h, String tip) {124 button.setBounds(new Rectangle(x, y, w, h));125 button.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));126 button.setToolTipText(Messages.getString(tip));127 button.addActionListener(alRegion);128 regionButtons.add(button);129 return button;130 }131 132 67 private JRadioButton getShapeButton(JRadioButton button, int x, int y, int w, int h, String tip, Shp shp, Obj obj) { 133 68 button.setBounds(new Rectangle(x, y, w, h)); 134 button.setBorder(BorderFactory.createL ineBorder(Color.magenta, 2));69 button.setBorder(BorderFactory.createLoweredBevelBorder()); 135 70 button.setToolTipText(Messages.getString(tip)); 136 71 button.addActionListener(alShape); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelSaw.java
r26579 r26881 59 59 private JRadioButton getShapeButton(JRadioButton button, int x, int y, int w, int h, String tip, Shp shp, Obj obj) { 60 60 button.setBounds(new Rectangle(x, y, w, h)); 61 button.setBorder(BorderFactory.createL ineBorder(Color.magenta, 2));61 button.setBorder(BorderFactory.createLoweredBevelBorder()); 62 62 button.setToolTipText(Messages.getString(tip)); 63 63 button.addActionListener(alShape); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelSpec.java
r26631 r26881 153 153 private JRadioButton getShapeButton(JRadioButton button, int x, int y, int w, int h, String tip, Shp shp, Obj obj) { 154 154 button.setBounds(new Rectangle(x, y, w, h)); 155 button.setBorder(BorderFactory.createL ineBorder(Color.magenta, 2));155 button.setBorder(BorderFactory.createLoweredBevelBorder()); 156 156 button.setToolTipText(Messages.getString(tip)); 157 157 button.addActionListener(alShape); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelStbd.java
r26579 r26881 13 13 14 14 private OSeaMAction dlg; 15 private ButtonGroup regionButtons = new ButtonGroup();16 public JRadioButton regionAButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionAButton.png")));17 public JRadioButton regionBButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionBButton.png")));18 public JRadioButton regionCButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionCButton.png")));19 private ActionListener alRegion = new ActionListener() {20 public void actionPerformed(java.awt.event.ActionEvent e) {21 if (regionAButton.isSelected()) {22 dlg.mark.setRegion(Reg.A);23 dlg.mark.setColour(Ent.BODY, Col.GREEN);24 dlg.mark.setPattern(Ent.BODY, Pat.NONE);25 if (dlg.mark.getCategory() == Cat.LAM_PSTBD) {26 dlg.mark.addColour(Ent.BODY, Col.RED);27 dlg.mark.addColour(Ent.BODY, Col.GREEN);28 dlg.mark.setPattern(Ent.BODY, Pat.HORIZ);29 }30 regionAButton.setBorderPainted(true);31 } else {32 regionAButton.setBorderPainted(false);33 }34 if (regionBButton.isSelected()) {35 dlg.mark.setRegion(Reg.B);36 dlg.mark.setColour(Ent.BODY, Col.RED);37 dlg.mark.setPattern(Ent.BODY, Pat.NONE);38 if (dlg.mark.getCategory() == Cat.LAM_PSTBD) {39 dlg.mark.addColour(Ent.BODY, Col.GREEN);40 dlg.mark.addColour(Ent.BODY, Col.RED);41 dlg.mark.setPattern(Ent.BODY, Pat.HORIZ);42 }43 regionBButton.setBorderPainted(true);44 } else {45 regionBButton.setBorderPainted(false);46 }47 if (regionCButton.isSelected()) {48 dlg.mark.setRegion(Reg.C);49 if (dlg.mark.getCategory() == Cat.LAM_PSTBD) {50 dlg.mark.setColour(Ent.BODY, Col.RED);51 dlg.mark.addColour(Ent.BODY, Col.GREEN);52 dlg.mark.addColour(Ent.BODY, Col.RED);53 dlg.mark.addColour(Ent.BODY, Col.GREEN);54 } else {55 dlg.mark.setColour(Ent.BODY, Col.GREEN);56 dlg.mark.addColour(Ent.BODY, Col.WHITE);57 dlg.mark.addColour(Ent.BODY, Col.GREEN);58 dlg.mark.addColour(Ent.BODY, Col.WHITE);59 }60 dlg.mark.setPattern(Ent.BODY, Pat.HORIZ);61 regionCButton.setBorderPainted(true);62 } else {63 regionCButton.setBorderPainted(false);64 }65 dlg.mark.paintSign();66 }67 };68 15 private ButtonGroup shapeButtons = new ButtonGroup(); 69 16 public JRadioButton pillarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PillarButton.png"))); … … 102 49 dlg = dia; 103 50 this.setLayout(null); 104 this.add(getRegionButton(regionAButton, 70, 0, 34, 30, "RegionA"), null);105 this.add(getRegionButton(regionBButton, 70, 32, 34, 30, "RegionB"), null);106 this.add(getRegionButton(regionCButton, 70, 64, 34, 30, "RegionC"), null);107 51 this.add(getShapeButton(pillarButton, 0, 0, 34, 32, "Pillar", Shp.PILLAR, Obj.BOYLAT), null); 108 52 this.add(getShapeButton(sparButton, 0, 32, 34, 32, "Spar", Shp.SPAR, Obj.BOYLAT), null); … … 121 65 } 122 66 123 private JRadioButton getRegionButton(JRadioButton button, int x, int y, int w, int h, String tip) {124 button.setBounds(new Rectangle(x, y, w, h));125 button.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));126 button.setToolTipText(Messages.getString(tip));127 button.addActionListener(alRegion);128 regionButtons.add(button);129 return button;130 }131 132 67 private JRadioButton getShapeButton(JRadioButton button, int x, int y, int w, int h, String tip, Shp shp, Obj obj) { 133 68 button.setBounds(new Rectangle(x, y, w, h)); 134 button.setBorder(BorderFactory.createL ineBorder(Color.magenta, 2));69 button.setBorder(BorderFactory.createLoweredBevelBorder()); 135 70 button.setToolTipText(Messages.getString(tip)); 136 71 button.addActionListener(alShape); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelTop.java
r26573 r26881 101 101 private JRadioButton getTopButton(JRadioButton button, int x, int y, int w, int h, String tip, Top top) { 102 102 button.setBounds(new Rectangle(x, y, w, h)); 103 button.setBorder(BorderFactory.createL ineBorder(Color.magenta, 2));103 button.setBorder(BorderFactory.createLoweredBevelBorder()); 104 104 button.setToolTipText(Messages.getString(tip)); 105 105 button.addActionListener(alTop); … … 111 111 private JRadioButton getDayButton(JRadioButton button, int x, int y, int w, int h, String tip, Day day) { 112 112 button.setBounds(new Rectangle(x, y, w, h)); 113 button.setBorder(BorderFactory.createL ineBorder(Color.magenta, 2));113 button.setBorder(BorderFactory.createLoweredBevelBorder()); 114 114 button.setToolTipText(Messages.getString(tip)); 115 115 button.addActionListener(alTop); … … 121 121 private JRadioButton getMoorButton(JRadioButton button, int x, int y, int w, int h, String tip) { 122 122 button.setBounds(new Rectangle(x, y, w, h)); 123 button.setBorder(BorderFactory.createL ineBorder(Color.magenta, 2));123 button.setBorder(BorderFactory.createLoweredBevelBorder()); 124 124 button.setToolTipText(Messages.getString(tip)); 125 125 button.addActionListener(alTop); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/SeaMark.java
r26830 r26881 629 629 630 630 public void parseMark(Node node) { 631 region = Main.pref.get("smedplugin.IALA").equals("C") ? Reg.C : (Main.pref.get("smedplugin.IALA").equals("B") ? Reg.B : Reg.A);632 631 dlg.panelMain.clearSelections(); 633 632 dlg.manager.showVisualMessage(""); 634 String str = ""; 633 String str = Main.pref.get("smedplugin.IALA"); 634 if (str.equals("C")) 635 dlg.panelMain.panelMore.regionCButton.doClick(); 636 else if (str.equals("B")) 637 dlg.panelMain.panelMore.regionBButton.doClick(); 638 else 639 dlg.panelMain.panelMore.regionAButton.doClick(); 635 640 636 641 Map<String, String> keys = node.getKeys(); 637 642 643 str = ""; 638 644 if (keys.containsKey("seamark:type")) 639 645 str = keys.get("seamark:type");
Note:
See TracChangeset
for help on using the changeset viewer.