Ignore:
Timestamp:
2010-12-27T11:37:15+01:00 (14 years ago)
Author:
malcolmh
Message:

save

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelSaw.java

    r24879 r24885  
    11package oseam.panels;
    22
     3import java.awt.event.ActionListener;
     4import java.awt.Color;
     5import java.awt.Rectangle;
     6
     7import javax.swing.ButtonGroup;
     8import javax.swing.ImageIcon;
     9import javax.swing.JRadioButton;
    310import javax.swing.BorderFactory;
    411import javax.swing.JPanel;
    512
    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;
     13import java.util.EnumMap;
     14import java.util.Iterator;
    1815
    1916import oseam.Messages;
    2017import oseam.dialogs.OSeaMAction;
    2118import 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;
     19import oseam.seamarks.SeaMark.Obj;
    2720
    2821public class PanelSaw extends JPanel {
     
    3629        private JRadioButton floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FloatButton.png")));
    3730        private EnumMap<Shp, JRadioButton> shapes = new EnumMap<Shp, JRadioButton>(Shp.class);
     31        private EnumMap<Shp, Obj> objects = new EnumMap<Shp, Obj>(Shp.class);
    3832        private ActionListener alShape = new ActionListener() {
    3933                public void actionPerformed(java.awt.event.ActionEvent e) {
     
    4438                                if (button.isSelected()) {
    4539                                        dlg.mark.setShape(shp);
     40                                        dlg.mark.setObject(objects.get(shp));
    4641                                        button.setBorderPainted(true);
    4742                                } else
     
    5651                dlg = dia;
    5752                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);
    6358        }
    6459
     
    6863        }
    6964
    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) {
    7166                button.setBounds(new Rectangle(x, y, w, h));
    7267                button.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     
    7570                shapeButtons.add(button);
    7671                shapes.put(shp, button);
     72                objects.put(shp, obj);
    7773                return button;
    7874        }
Note: See TracChangeset for help on using the changeset viewer.