Changeset 26561 in osm for applications/editors/josm/plugins
- Timestamp:
- 2011-08-23T20:19:03+02:00 (13 years ago)
- Location:
- applications/editors/josm/plugins/smed/plugs/oseam/src/oseam
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/dialogs/OSeaMAction.java
r26423 r26561 3 3 import oseam.panels.*; 4 4 5 import java.awt.Dimension; 6 import java.util.Collection; 7 8 import javax.swing.JPanel; 5 import java.awt.*; 6 import java.util.*; 7 import javax.swing.*; 9 8 10 9 import org.openstreetmap.josm.Main; 11 import org.openstreetmap.josm.data.SelectionChangedListener; 12 import org.openstreetmap.josm.data.osm.DataSet; 13 import org.openstreetmap.josm.data.osm.Node; 14 import org.openstreetmap.josm.data.osm.OsmPrimitive; 10 import org.openstreetmap.josm.data.*; 11 import org.openstreetmap.josm.data.osm.*; 15 12 16 13 import oseam.Messages; -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelChan.java
r26553 r26561 1 1 package oseam.panels; 2 2 3 import javax.swing.BorderFactory; 4 import javax.swing.JPanel; 5 6 import java.awt.Color; 7 import java.awt.Rectangle; 8 9 import javax.swing.ButtonGroup; 10 import javax.swing.ImageIcon; 11 import javax.swing.JRadioButton; 3 import javax.swing.*; 4 import java.awt.*; 5 import java.awt.event.*; 12 6 13 7 import oseam.Messages; 14 8 import oseam.dialogs.OSeaMAction; 15 import oseam.panels.PanelPort; 16 import oseam.panels.PanelStbd; 17 import oseam.panels.PanelSaw; 18 import oseam.seamarks.SeaMark.Cat; 19 import oseam.seamarks.SeaMark.Col; 20 import oseam.seamarks.SeaMark.Pat; 21 import oseam.seamarks.SeaMark.Ent; 22 import oseam.seamarks.SeaMark.Shp; 23 import oseam.seamarks.SeaMark.Reg; 24 25 import java.awt.event.ActionListener; 9 import oseam.seamarks.SeaMark.*; 26 10 27 11 public class PanelChan extends JPanel { -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelChr.java
r26297 r26561 3 3 import static org.openstreetmap.josm.tools.I18n.tr; 4 4 5 import java.awt.Color; 6 import java.awt.Rectangle; 7 import java.awt.event.ActionListener; 5 import java.awt.*; 6 import java.awt.event.*; 8 7 9 import javax.swing.BorderFactory; 10 import javax.swing.JPanel; 11 import javax.swing.ImageIcon; 12 import javax.swing.JToggleButton; 13 import javax.swing.JLabel; 14 import javax.swing.JTextField; 15 import javax.swing.SwingConstants; 8 import javax.swing.*; 16 9 17 import java.util.EnumMap; 18 import java.util.EnumSet; 10 import java.util.*; 19 11 20 12 import oseam.Messages; 21 13 import oseam.dialogs.OSeaMAction; 22 import oseam.seamarks.SeaMark; 23 import oseam.seamarks.Light; 24 import oseam.seamarks.Light.Chr; 14 import oseam.seamarks.*; 15 import oseam.seamarks.Light.*; 25 16 26 17 public class PanelChr extends JPanel { -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelCol.java
r26173 r26561 3 3 import static org.openstreetmap.josm.tools.I18n.tr; 4 4 5 import java.awt.Color; 6 import java.awt.Rectangle; 7 import java.awt.event.ActionListener; 8 9 import javax.swing.BorderFactory; 10 import javax.swing.JPanel; 11 import javax.swing.ButtonGroup; 12 import javax.swing.ImageIcon; 13 import javax.swing.JRadioButton; 14 15 import java.util.EnumMap; 5 import java.awt.*; 6 import java.awt.event.*; 7 import javax.swing.*; 8 import java.util.*; 16 9 17 10 import oseam.Messages; 18 11 import oseam.dialogs.OSeaMAction; 19 import oseam.seamarks.SeaMark.Col; 20 import oseam.seamarks.SeaMark.Ent; 12 import oseam.seamarks.SeaMark.*; 21 13 22 14 public class PanelCol extends JPanel { 23 15 24 16 private OSeaMAction dlg; 17 private ActionListener act; 25 18 private Ent ent; 26 19 private ButtonGroup colourButtons = new ButtonGroup(); … … 41 34 JRadioButton button = colours.get(col); 42 35 if (button.isSelected()) { 43 if (dlg.mark != null) 36 if (dlg.mark != null) { 44 37 dlg.mark.setColour(ent, col); 38 act.actionPerformed(null); 39 } 45 40 button.setBorderPainted(true); 46 41 } else … … 50 45 }; 51 46 52 public PanelCol(OSeaMAction dia, Ent entity) {47 public PanelCol(OSeaMAction dia, ActionListener al, Ent entity) { 53 48 dlg = dia; 49 act = al; 54 50 ent = entity; 55 51 this.setLayout(null); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelFog.java
r24839 r26561 1 1 package oseam.panels; 2 2 3 import javax.swing.JPanel; 4 5 import java.awt.Color; 6 import java.awt.Dimension; 7 import java.awt.Rectangle; 8 import java.awt.Font; 9 10 import javax.swing.ButtonGroup; 11 import javax.swing.ImageIcon; 12 import javax.swing.JLabel; 13 import javax.swing.JTextField; 14 import javax.swing.JComboBox; 15 import javax.swing.JCheckBox; 16 import javax.swing.JRadioButton; 3 import javax.swing.*; 4 import java.awt.*; 5 import java.awt.event.*; 17 6 18 7 import oseam.Messages; 19 8 import oseam.dialogs.OSeaMAction; 20 9 21 import java.awt.Cursor;22 import java.awt.event.ActionListener;23 10 24 11 public class PanelFog extends JPanel { -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelHaz.java
r26556 r26561 1 1 package oseam.panels; 2 2 3 import java.awt.event.ActionListener; 4 import java.awt.Color; 5 import java.awt.Rectangle; 6 7 import javax.swing.BorderFactory; 8 import javax.swing.JPanel; 9 import javax.swing.ButtonGroup; 10 import javax.swing.ImageIcon; 11 import javax.swing.JRadioButton; 12 13 import java.util.EnumMap; 3 import java.awt.event.*; 4 import java.awt.*; 5 import javax.swing.*; 6 import java.util.*; 14 7 15 8 import oseam.Messages; 16 9 import oseam.dialogs.OSeaMAction; 17 import oseam.seamarks.SeaMark.Cat; 18 import oseam.seamarks.SeaMark.Col; 19 import oseam.seamarks.SeaMark.Ent; 20 import oseam.seamarks.SeaMark.Pat; 21 import oseam.seamarks.SeaMark.Shp; 22 import oseam.seamarks.SeaMark.Obj; 10 import oseam.seamarks.SeaMark.*; 23 11 24 12 public class PanelHaz extends JPanel { -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelLights.java
r26423 r26561 1 1 package oseam.panels; 2 2 3 import java.awt.event.ActionListener; 4 import java.awt.Color; 5 import java.awt.Rectangle; 6 7 import javax.swing.BorderFactory; 8 import javax.swing.JPanel; 9 import javax.swing.ButtonGroup; 10 import javax.swing.ImageIcon; 11 import javax.swing.JRadioButton; 12 13 import java.util.EnumMap; 3 import java.awt.event.*; 4 import java.awt.*; 5 import javax.swing.*; 6 import java.util.*; 14 7 15 8 import oseam.Messages; 16 9 import oseam.dialogs.OSeaMAction; 17 import oseam.seamarks.SeaMark.Cat; 18 import oseam.seamarks.SeaMark.Obj; 10 import oseam.seamarks.SeaMark.*; 19 11 20 12 public class PanelLights extends JPanel { -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelLit.java
r26423 r26561 1 1 package oseam.panels; 2 2 3 import javax.swing.BorderFactory; 4 import javax.swing.ButtonGroup; 5 import javax.swing.ImageIcon; 6 import javax.swing.JLabel; 7 import javax.swing.JPanel; 8 import javax.swing.JRadioButton; 9 import javax.swing.JTextField; 10 import javax.swing.JComboBox; 11 import javax.swing.SwingConstants; 12 13 import java.awt.Color; 14 import java.awt.Rectangle; 15 import java.awt.event.ActionListener; 3 import javax.swing.*; 4 import java.awt.*; 5 import java.awt.event.*; 16 6 17 7 import oseam.Messages; 18 8 import oseam.dialogs.OSeaMAction; 19 import oseam.seamarks.SeaMark. Ent;9 import oseam.seamarks.SeaMark.*; 20 10 21 11 public class PanelLit extends JPanel { … … 61 51 panelChr = new PanelChr(dlg); 62 52 panelChr.setBounds(new Rectangle(0, 0, 88, 160)); 63 panelCol = new PanelCol(dlg, Ent.LIGHT);53 panelCol = new PanelCol(dlg, alType, Ent.LIGHT); 64 54 panelCol.setBounds(new Rectangle(88, 0, 34, 160)); 65 55 panelCol.blackButton.setVisible(false); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelMain.java
r26556 r26561 3 3 import static org.openstreetmap.josm.tools.I18n.tr; 4 4 5 import java.awt.Color; 6 import java.awt.Rectangle; 7 import java.awt.event.ActionListener; 8 9 import javax.swing.BorderFactory; 10 import javax.swing.ButtonGroup; 11 import javax.swing.ImageIcon; 12 import javax.swing.JButton; 13 import javax.swing.JLabel; 14 import javax.swing.JPanel; 15 import javax.swing.JRadioButton; 16 import javax.swing.JTextField; 5 import java.awt.*; 6 import java.awt.event.*; 7 import javax.swing.*; 17 8 18 9 import oseam.Messages; 19 10 import oseam.dialogs.OSeaMAction; 11 import oseam.seamarks.SeaMark.*; 20 12 21 13 public class PanelMain extends JPanel { … … 50 42 public PanelSpec panelSpec = null; 51 43 public PanelLights panelLights = null; 44 public PanelMore panelMore = null; 52 45 public PanelTop panelTop = null; 53 46 public PanelFog panelFog = null; … … 70 63 panelLights.setBounds(new Rectangle(65, 0, 165, 160)); 71 64 panelLights.setVisible(false); 65 panelMore = new PanelMore(dlg); 66 panelMore.setBounds(new Rectangle(40, 165, 360, 160)); 67 panelMore.setVisible(false); 72 68 panelTop = new PanelTop(dlg); 73 69 panelTop.setBounds(new Rectangle(40, 165, 360, 160)); … … 138 134 } 139 135 if (specButton.isSelected()) { 140 dlg.panelMain.panelSpec.panelCol.yellowButton.doClick(); 141 if ((dlg.mark != null) && (dlg.panelMain.panelSpec.shapes.containsKey(dlg.mark.getShape()))) { 142 dlg.panelMain.panelSpec.shapes.get(dlg.mark.getShape()).doClick(); 143 } else { 144 dlg.panelMain.panelSpec.shapeButtons.clearSelection(); 145 dlg.panelMain.panelSpec.alShape.actionPerformed(null); 136 if (dlg.mark != null) { 137 if (dlg.mark.getObject() == Obj.UNKNOWN) { 138 panelSpec.clearSelections(); 139 panelSpec.panelCol.yellowButton.doClick(); 140 } 141 if (panelSpec.shapes.containsKey(dlg.mark.getShape())) { 142 panelSpec.shapes.get(dlg.mark.getShape()).doClick(); 143 } else { 144 panelSpec.shapeButtons.clearSelection(); 145 panelSpec.alShape.actionPerformed(null); 146 } 146 147 } 147 148 specButton.setBorderPainted(true); … … 184 185 } 185 186 if (topButton.isSelected()) { 187 moreButton.setText("v v v"); 188 panelMore.setVisible(false); 186 189 topButton.setBorderPainted(true); 187 190 panelTop.setVisible(true); … … 191 194 } 192 195 if (fogButton.isSelected()) { 196 moreButton.setText("v v v"); 197 panelMore.setVisible(false); 193 198 fogButton.setBorderPainted(true); 194 199 panelFog.setVisible(true); … … 198 203 } 199 204 if (radButton.isSelected()) { 205 moreButton.setText("v v v"); 206 panelMore.setVisible(false); 200 207 radButton.setBorderPainted(true); 201 208 panelRadar.setVisible(true); … … 205 212 } 206 213 if (litButton.isSelected()) { 214 moreButton.setText("v v v"); 215 panelMore.setVisible(false); 207 216 litButton.setBorderPainted(true); 208 217 panelLit.setVisible(true); … … 247 256 }; 248 257 saveButton.addActionListener(alSave); 249 258 250 259 moreButton = new JButton(); 251 moreButton.setBounds(new Rectangle(230, 145, 50, 15)); 252 moreButton.setText("more..."); 260 moreButton.setBounds(new Rectangle(357, 145, 38, 15)); 261 moreButton.setMargin(new Insets(0, 0, 0, 0)); 262 moreButton.setText("v v v"); 253 263 this.add(moreButton, null); 254 264 alMore = new ActionListener() { 255 265 public void actionPerformed(java.awt.event.ActionEvent e) { 266 if (panelMore.isVisible()) { 267 moreButton.setText("v v v"); 268 panelMore.setVisible(false); 269 if (topButton.isSelected()) 270 panelTop.setVisible(true); 271 if (radButton.isSelected()) 272 panelRadar.setVisible(true); 273 if (fogButton.isSelected()) 274 panelFog.setVisible(true); 275 if (litButton.isSelected()) 276 panelLit.setVisible(true); 277 } else { 278 panelMore.setVisible(true); 279 moreButton.setText("^ ^ ^"); 280 if (topButton.isSelected()) 281 panelTop.setVisible(false); 282 if (radButton.isSelected()) 283 panelRadar.setVisible(false); 284 if (fogButton.isSelected()) 285 panelFog.setVisible(false); 286 if (litButton.isSelected()) 287 panelLit.setVisible(false); 288 } 256 289 } 257 290 }; 258 291 moreButton.addActionListener(alMore); 259 292 260 293 this.clearSelections(); 261 294 262 295 } 263 296 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelPort.java
r26552 r26561 1 1 package oseam.panels; 2 2 3 import java.awt.event.ActionListener; 4 import java.awt.Color; 5 import java.awt.Rectangle; 6 7 import javax.swing.ButtonGroup; 8 import javax.swing.ImageIcon; 9 import javax.swing.JRadioButton; 10 import javax.swing.BorderFactory; 11 import javax.swing.JPanel; 12 13 import java.util.EnumMap; 3 import java.awt.*; 4 import java.awt.event.*; 5 import javax.swing.*; 6 import java.util.*; 14 7 15 8 import oseam.Messages; 16 9 import oseam.dialogs.OSeaMAction; 17 import oseam.seamarks.SeaMark.Cat; 18 import oseam.seamarks.SeaMark.Col; 19 import oseam.seamarks.SeaMark.Pat; 20 import oseam.seamarks.SeaMark.Ent; 21 import oseam.seamarks.SeaMark.Reg; 22 import oseam.seamarks.SeaMark.Shp; 23 import oseam.seamarks.SeaMark.Obj; 10 import oseam.seamarks.SeaMark.*; 24 11 25 12 public class PanelPort extends JPanel { -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelRadar.java
r24931 r26561 1 1 package oseam.panels; 2 2 3 import javax.swing.JPanel; 3 import java.awt.*; 4 import java.awt.event.*; 5 import javax.swing.*; 6 import java.util.*; 4 7 5 8 import oseam.dialogs.OSeaMAction; -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelSaw.java
r26552 r26561 1 1 package oseam.panels; 2 2 3 import java.awt.event.ActionListener; 4 import java.awt.Color; 5 import java.awt.Rectangle; 6 7 import javax.swing.ButtonGroup; 8 import javax.swing.ImageIcon; 9 import javax.swing.JRadioButton; 10 import javax.swing.BorderFactory; 11 import javax.swing.JPanel; 12 13 import java.util.EnumMap; 3 import java.awt.*; 4 import java.awt.event.*; 5 import javax.swing.*; 6 import java.util.*; 14 7 15 8 import oseam.Messages; 16 9 import oseam.dialogs.OSeaMAction; 17 import oseam.seamarks.SeaMark.Shp; 18 import oseam.seamarks.SeaMark.Obj; 10 import oseam.seamarks.SeaMark.*; 19 11 20 12 public class PanelSaw extends JPanel { -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelSectors.java
r26173 r26561 1 1 package oseam.panels; 2 2 3 import javax.swing.ImageIcon; 4 import javax.swing.JFrame; 5 import javax.swing.JPanel; 6 import javax.swing.JScrollPane; 7 import javax.swing.JTable; 8 import javax.swing.JButton; 9 import javax.swing.table.AbstractTableModel; 10 11 import java.awt.event.ActionListener; 3 import java.awt.*; 4 import java.awt.event.*; 5 import javax.swing.*; 6 import java.util.*; 12 7 13 8 import oseam.seamarks.Light; -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelSpec.java
r26556 r26561 1 1 package oseam.panels; 2 2 3 import java.awt.event.ActionListener; 4 import java.awt.Color; 5 import java.awt.Rectangle; 6 7 import javax.swing.BorderFactory; 8 import javax.swing.JPanel; 9 import javax.swing.ButtonGroup; 10 import javax.swing.ImageIcon; 11 import javax.swing.JRadioButton; 12 13 import java.util.EnumMap; 3 import java.awt.*; 4 import java.awt.event.*; 5 import javax.swing.*; 6 import java.util.*; 14 7 15 8 import oseam.Messages; 16 9 import oseam.dialogs.OSeaMAction; 17 import oseam.seamarks.SeaMark.Shp; 18 import oseam.seamarks.SeaMark.Obj; 19 import oseam.seamarks.SeaMark.Ent; 20 import oseam.seamarks.SeaMark.Col; 10 import oseam.seamarks.SeaMark.*; 21 11 22 12 public class PanelSpec extends JPanel { … … 46 36 dlg.mark.setShape(shp); 47 37 dlg.mark.setObject(objects.get(shp)); 48 if ( button == cairnButton)38 if ((button == cairnButton) && !(panelCol.offButton.isSelected())) 49 39 panelCol.offButton.doClick(); 50 40 button.setBorderPainted(true); … … 59 49 public PanelSpec(OSeaMAction dia) { 60 50 dlg = dia; 61 panelCol = new PanelCol(dlg, Ent.BODY);62 panelCol.setBounds(new Rectangle( 9, 0, 34, 160));51 panelCol = new PanelCol(dlg, alShape, Ent.BODY); 52 panelCol.setBounds(new Rectangle(0, 0, 34, 160)); 63 53 64 54 this.setLayout(null); 65 55 this.add(panelCol, null); 66 this.add(getShapeButton(pillarButton, 55, 0, 34, 32, "Pillar", Shp.PILLAR, Obj.BOYSPP), null);67 this.add(getShapeButton(sparButton, 55, 32, 34, 32, "Spar", Shp.SPAR, Obj.BOYSPP), null);68 this.add(getShapeButton(canButton, 55, 64, 34, 32, "Can", Shp.CAN, Obj.BOYSPP), null);69 this.add(getShapeButton(coneButton, 55, 96, 34, 32, "Cone", Shp.CONE, Obj.BOYSPP), null);70 this.add(getShapeButton(sphereButton, 55, 128, 34, 32, "Sphere", Shp.SPHERE, Obj.BOYSPP), null);71 this.add(getShapeButton(barrelButton, 90, 0, 34, 32, "Barrel", Shp.BARREL, Obj.BOYSPP), null);72 this.add(getShapeButton(superButton, 90, 32, 34, 32, "Super", Shp.SUPER, Obj.BOYSPP), null);73 this.add(getShapeButton(floatButton, 90, 64, 34, 32, "Float", Shp.FLOAT, Obj.LITFLT), null);74 this.add(getShapeButton(beaconButton, 90, 96, 34, 32, "Beacon", Shp.BEACON, Obj.BCNSPP), null);75 this.add(getShapeButton(towerButton, 90, 128, 34, 32, "Tower", Shp.TOWER, Obj.BCNSPP), null);76 this.add(getShapeButton(stakeButton, 1 25, 0, 34, 32, "Stake", Shp.STAKE, Obj.BCNSPP), null);77 this.add(getShapeButton(cairnButton, 1 25, 32, 34, 32, "Cairn", Shp.CAIRN, Obj.BCNSPP), null);56 this.add(getShapeButton(pillarButton, 35, 0, 34, 32, "Pillar", Shp.PILLAR, Obj.BOYSPP), null); 57 this.add(getShapeButton(sparButton, 35, 32, 34, 32, "Spar", Shp.SPAR, Obj.BOYSPP), null); 58 this.add(getShapeButton(canButton, 35, 64, 34, 32, "Can", Shp.CAN, Obj.BOYSPP), null); 59 this.add(getShapeButton(coneButton, 35, 96, 34, 32, "Cone", Shp.CONE, Obj.BOYSPP), null); 60 this.add(getShapeButton(sphereButton, 70, 0, 34, 32, "Sphere", Shp.SPHERE, Obj.BOYSPP), null); 61 this.add(getShapeButton(barrelButton, 70, 32, 34, 32, "Barrel", Shp.BARREL, Obj.BOYSPP), null); 62 this.add(getShapeButton(superButton, 70, 64, 34, 32, "Super", Shp.SUPER, Obj.BOYSPP), null); 63 this.add(getShapeButton(floatButton, 70, 96, 34, 32, "Float", Shp.FLOAT, Obj.LITFLT), null); 64 this.add(getShapeButton(beaconButton, 105, 0, 34, 32, "Beacon", Shp.BEACON, Obj.BCNSPP), null); 65 this.add(getShapeButton(towerButton, 105, 32, 34, 32, "Tower", Shp.TOWER, Obj.BCNSPP), null); 66 this.add(getShapeButton(stakeButton, 105, 64, 34, 32, "Stake", Shp.STAKE, Obj.BCNSPP), null); 67 this.add(getShapeButton(cairnButton, 105, 96, 34, 32, "Cairn", Shp.CAIRN, Obj.BCNSPP), null); 78 68 } 79 69 80 70 public void clearSelections() { 81 71 shapeButtons.clearSelection(); 72 alShape.actionPerformed(null); 82 73 } 83 74 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelStbd.java
r26552 r26561 1 1 package oseam.panels; 2 2 3 import java.awt.event.ActionListener; 4 import java.awt.Color; 5 import java.awt.Rectangle; 6 7 import javax.swing.ButtonGroup; 8 import javax.swing.ImageIcon; 9 import javax.swing.JRadioButton; 10 import javax.swing.BorderFactory; 11 import javax.swing.JPanel; 12 13 import java.util.EnumMap; 3 import java.awt.*; 4 import java.awt.event.*; 5 import javax.swing.*; 6 import java.util.*; 14 7 15 8 import oseam.Messages; 16 9 import oseam.dialogs.OSeaMAction; 17 import oseam.seamarks.SeaMark.Cat; 18 import oseam.seamarks.SeaMark.Col; 19 import oseam.seamarks.SeaMark.Ent; 20 import oseam.seamarks.SeaMark.Pat; 21 import oseam.seamarks.SeaMark.Shp; 22 import oseam.seamarks.SeaMark.Obj; 23 import oseam.seamarks.SeaMark.Reg; 10 import oseam.seamarks.SeaMark.*; 24 11 25 12 public class PanelStbd extends JPanel { -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelTop.java
r26464 r26561 1 1 package oseam.panels; 2 2 3 import javax.swing.JPanel; 4 import javax.swing.BorderFactory; 5 import javax.swing.ButtonGroup; 6 import javax.swing.ImageIcon; 7 import javax.swing.JRadioButton; 8 9 import java.awt.Color; 10 import java.awt.Rectangle; 11 import java.awt.event.ActionListener; 12 import java.util.EnumMap; 3 import java.awt.*; 4 import java.awt.event.*; 5 import javax.swing.*; 6 import java.util.*; 13 7 14 8 import oseam.Messages; 15 9 import oseam.dialogs.OSeaMAction; 16 import oseam.seamarks.SeaMark.Top; 17 import oseam.seamarks.SeaMark.Day; 18 import oseam.seamarks.SeaMark.Ent; 10 import oseam.seamarks.SeaMark.*; 19 11 20 12 public class PanelTop extends JPanel { … … 68 60 public PanelTop(OSeaMAction dia) { 69 61 dlg = dia; 70 panelCol = new PanelCol(dlg, Ent.TOPMARK);62 panelCol = new PanelCol(dlg, alTop, Ent.TOPMARK); 71 63 panelCol.setBounds(new Rectangle(0, 0, 34, 160)); 72 64 this.setLayout(null); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/Light.java
r26128 r26561 1 1 package oseam.seamarks; 2 2 3 import java.util.ArrayList; 4 import java.util.EnumSet; 5 import java.util.HashMap; 6 import java.util.Map; 7 import java.util.regex.Matcher; 8 import java.util.regex.Pattern; 9 10 import javax.swing.table.AbstractTableModel; 3 import java.awt.*; 4 import java.awt.event.*; 5 import javax.swing.*; 6 import java.util.*; 7 import java.util.regex.*; 8 import javax.swing.table.*; 11 9 12 10 import oseam.dialogs.OSeaMAction; 13 import oseam.seamarks.SeaMark. Col;11 import oseam.seamarks.SeaMark.*; 14 12 15 13 public class Light extends AbstractTableModel { -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/SeaMark.java
r26556 r26561 1 1 package oseam.seamarks; 2 2 3 import javax.swing.ImageIcon; 4 5 import java.util.ArrayList; 6 import java.util.EnumMap; 7 import java.util.Map; 3 import java.awt.*; 4 import java.awt.event.*; 5 import javax.swing.*; 6 import java.util.*; 8 7 9 8 import org.openstreetmap.josm.Main; … … 20 19 public SeaMark(OSeaMAction dia) { 21 20 dlg = dia; 21 dlg.panelMain.clearSelections(); 22 22 } 23 23 … … 334 334 public static final EnumMap<Pat, String> PatMAP = new EnumMap<Pat, String>(Pat.class); 335 335 static { 336 PatMAP.put(Pat.HORIZ, "horizontal stripes");337 PatMAP.put(Pat.VERT, "vertical stripes");338 PatMAP.put(Pat.DIAG, "diagonal stripes");336 PatMAP.put(Pat.HORIZ, "horizontal"); 337 PatMAP.put(Pat.VERT, "vertical"); 338 PatMAP.put(Pat.DIAG, "diagonal"); 339 339 PatMAP.put(Pat.SQUARE, "squared"); 340 PatMAP.put(Pat.BORDER, "border stripe");340 PatMAP.put(Pat.BORDER, "border"); 341 341 } 342 342 … … 822 822 dlg.panelMain.topIcon.setIcon(null); 823 823 dlg.panelMain.radarIcon.setIcon(null); 824 dlg.panelMain.radarIcon.setIcon(new ImageIcon(getClass().getResource("/images/Radar_Station.png"))); 824 825 dlg.panelMain.fogIcon.setIcon(null); 825 826 … … 869 870 break; 870 871 } 871 if (!imgStr.equals("/images/")) { 872 for (Col col : bodyColour) { 873 switch (col) { 874 case WHITE: 875 imgStr += "_White"; 876 break; 877 case RED: 878 imgStr += "_Red"; 879 break; 880 case ORANGE: 881 imgStr += "_Orange"; 882 break; 883 case AMBER: 884 imgStr += "_Amber"; 885 break; 886 case YELLOW: 887 imgStr += "_Yellow"; 888 break; 889 case GREEN: 890 imgStr += "_Green"; 891 break; 892 case BLUE: 893 imgStr += "_Blue"; 894 break; 895 case VIOLET: 896 imgStr += "_Violet"; 897 break; 898 case BLACK: 899 imgStr += "_Black"; 900 break; 901 } 872 String colStr = imgStr; 873 for (Col col : bodyColour) { 874 switch (col) { 875 case WHITE: 876 colStr += "_White"; 877 break; 878 case RED: 879 colStr += "_Red"; 880 break; 881 case ORANGE: 882 colStr += "_Orange"; 883 break; 884 case AMBER: 885 colStr += "_Amber"; 886 break; 887 case YELLOW: 888 colStr += "_Yellow"; 889 break; 890 case GREEN: 891 colStr += "_Green"; 892 break; 893 case BLUE: 894 colStr += "_Blue"; 895 break; 896 case VIOLET: 897 colStr += "_Violet"; 898 break; 899 case BLACK: 900 colStr += "_Black"; 901 break; 902 902 } 903 903 } 904 904 if (getShape() == Shp.PERCH) { 905 905 if (getCategory() == Cat.LAT_PORT) { 906 imgStr = "/images/Perch_Port";906 colStr = "/images/Perch_Port"; 907 907 } else { 908 imgStr = "/images/Perch_Starboard";908 colStr = "/images/Perch_Starboard"; 909 909 } 910 910 } 911 911 if (!imgStr.equals("/images/")) { 912 imgStr += ".png"; 913 if (getClass().getResource(imgStr) == null) { 914 System.out.println("Missing image: " + imgStr); 915 return; 912 colStr += ".png"; 913 if (getClass().getResource(colStr) == null) { 914 System.out.println("Missing image: " + colStr); 915 imgStr += ".png"; 916 if (getClass().getResource(imgStr) == null) { 917 System.out.println("Missing image: " + imgStr); 918 return; 919 } else { 920 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource(imgStr))); 921 } 916 922 } else { 917 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource(imgStr))); 918 } 923 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource(colStr))); 924 } 925 } else { 926 dlg.panelMain.shapeIcon.setIcon(null); 919 927 } 920 928 }
Note:
See TracChangeset
for help on using the changeset viewer.