Changeset 24885 in osm for applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelSaw.java
- Timestamp:
- 2010-12-27T11:37:15+01:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelSaw.java
r24879 r24885 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; 3 10 import javax.swing.BorderFactory; 4 11 import javax.swing.JPanel; 5 12 6 import java.awt.Color; 7 import java.awt.Dimension; 8 import java.awt.Rectangle; 9 import java.awt.Font; 10 11 import javax.swing.ButtonGroup; 12 import javax.swing.ImageIcon; 13 import javax.swing.JLabel; 14 import javax.swing.JTextField; 15 import javax.swing.JComboBox; 16 import javax.swing.JCheckBox; 17 import javax.swing.JRadioButton; 13 import java.util.EnumMap; 14 import java.util.Iterator; 18 15 19 16 import oseam.Messages; 20 17 import oseam.dialogs.OSeaMAction; 21 18 import oseam.seamarks.SeaMark.Shp; 22 23 import java.awt.Cursor; 24 import java.awt.event.ActionListener; 25 import java.util.EnumMap; 26 import java.util.Iterator; 19 import oseam.seamarks.SeaMark.Obj; 27 20 28 21 public class PanelSaw extends JPanel { … … 36 29 private JRadioButton floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FloatButton.png"))); 37 30 private EnumMap<Shp, JRadioButton> shapes = new EnumMap<Shp, JRadioButton>(Shp.class); 31 private EnumMap<Shp, Obj> objects = new EnumMap<Shp, Obj>(Shp.class); 38 32 private ActionListener alShape = new ActionListener() { 39 33 public void actionPerformed(java.awt.event.ActionEvent e) { … … 44 38 if (button.isSelected()) { 45 39 dlg.mark.setShape(shp); 40 dlg.mark.setObject(objects.get(shp)); 46 41 button.setBorderPainted(true); 47 42 } else … … 56 51 dlg = dia; 57 52 this.setLayout(null); 58 this.add(getShapeButton(pillarButton, 0, 0, 34, 32, "PillarTip", Shp.PILLAR ), null);59 this.add(getShapeButton(sparButton, 0, 32, 34, 32, "SparTip", Shp.SPAR ), null);60 this.add(getShapeButton(sphereButton, 0, 64, 34, 32, "SphereTip", Shp.SPHERE ), null);61 this.add(getShapeButton(barrelButton, 0, 96, 34, 32, "BarrelTip", Shp.BARREL ), null);62 this.add(getShapeButton(floatButton, 0, 128, 34, 32, "FloatTip", Shp.FLOAT ), null);53 this.add(getShapeButton(pillarButton, 0, 0, 34, 32, "PillarTip", Shp.PILLAR, Obj.BOYSAW), null); 54 this.add(getShapeButton(sparButton, 0, 32, 34, 32, "SparTip", Shp.SPAR, Obj.BOYSAW), null); 55 this.add(getShapeButton(sphereButton, 0, 64, 34, 32, "SphereTip", Shp.SPHERE, Obj.BOYSAW), null); 56 this.add(getShapeButton(barrelButton, 0, 96, 34, 32, "BarrelTip", Shp.BARREL, Obj.BOYSAW), null); 57 this.add(getShapeButton(floatButton, 0, 128, 34, 32, "FloatTip", Shp.FLOAT, Obj.LITFLT), null); 63 58 } 64 59 … … 68 63 } 69 64 70 private JRadioButton getShapeButton(JRadioButton button, int x, int y, int w, int h, String tip, Shp shp ) {65 private JRadioButton getShapeButton(JRadioButton button, int x, int y, int w, int h, String tip, Shp shp, Obj obj) { 71 66 button.setBounds(new Rectangle(x, y, w, h)); 72 67 button.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); … … 75 70 shapeButtons.add(button); 76 71 shapes.put(shp, button); 72 objects.put(shp, obj); 77 73 return button; 78 74 }
Note:
See TracChangeset
for help on using the changeset viewer.