Changeset 24720 in osm
- Timestamp:
- 2010-12-12T14:51:43+01:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/smed/plugs/oseam/src/oseam
- Files:
-
- 1 edited
- 4 copied
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/dialogs/OSeaMAction.java
r24665 r24720 73 73 private PanelSpec panelSpec = null; 74 74 private PanelLights panelLights = null; 75 private PanelTop panelTop = null; 76 private PanelFog panelFog = null; 77 private PanelRadar panelRadar = null; 78 private PanelLit panelLit = null; 75 79 76 80 public OSeaMAction() { … … 99 103 panelLights.setBounds(new Rectangle(65, 0, 335, 160)); 100 104 panelLights.setVisible(false); 105 panelTop = new PanelTop(); 106 panelTop.setBounds(new Rectangle(40, 165, 220, 155)); 107 panelTop.setVisible(false); 108 panelFog = new PanelFog(); 109 panelFog.setBounds(new Rectangle(40, 165, 220, 155)); 110 panelFog.setVisible(false); 111 panelRadar = new PanelRadar(); 112 panelRadar.setBounds(new Rectangle(40, 165, 220, 155)); 113 panelRadar.setVisible(false); 114 panelLit = new PanelLit(); 115 panelLit.setBounds(new Rectangle(40, 165, 220, 155)); 116 panelLit.setVisible(false); 101 117 } 102 118 … … 139 155 oseamPanel.add(panelSpec, null); 140 156 oseamPanel.add(panelLights, null); 157 oseamPanel.add(panelTop, null); 158 oseamPanel.add(panelFog, null); 159 oseamPanel.add(panelRadar, null); 160 oseamPanel.add(panelLit, null); 141 161 typeButtons = new ButtonGroup(); 142 162 typeButtons.add(chanButton); … … 192 212 ActionListener alMisc = new ActionListener() { 193 213 public void actionPerformed(java.awt.event.ActionEvent e) { 194 topButton.setEnabled(!topButton.isSelected()); 195 fogButton.setEnabled(!fogButton.isSelected()); 196 radarButton.setEnabled(!radarButton.isSelected()); 197 litButton.setEnabled(!litButton.isSelected()); 214 if (topButton.isSelected()) { 215 topButton.setEnabled(false); 216 panelTop.setVisible(true); 217 } else { 218 topButton.setEnabled(true); 219 panelTop.setVisible(false); 220 } 221 if (fogButton.isSelected()) { 222 fogButton.setEnabled(false); 223 panelFog.setVisible(true); 224 } else { 225 fogButton.setEnabled(true); 226 panelFog.setVisible(false); 227 } 228 if (radarButton.isSelected()) { 229 radarButton.setEnabled(false); 230 panelRadar.setVisible(true); 231 } else { 232 radarButton.setEnabled(true); 233 panelRadar.setVisible(false); 234 } 235 if (litButton.isSelected()) { 236 litButton.setEnabled(false); 237 panelLit.setVisible(true); 238 } else { 239 litButton.setEnabled(true); 240 panelLit.setVisible(false); 241 } 198 242 } 199 243 }; -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelFog.java
r24710 r24720 1 1 package oseam.panels; 2 2 3 import javax.swing.BorderFactory;4 3 import javax.swing.JPanel; 5 4 … … 22 21 import java.awt.event.ActionListener; 23 22 24 public class Panel Hazextends JPanel {23 public class PanelFog extends JPanel { 25 24 26 private ButtonGroup catButtons = null;27 private JRadioButton northButton = null;28 private JRadioButton southButton = null;29 private JRadioButton eastButton = null;30 private JRadioButton westButton = null;31 private JRadioButton isolButton = null;32 25 33 private ButtonGroup shapeButtons = null; 34 private JRadioButton pillarButton = null; 35 private JRadioButton sparButton = null; 36 private JRadioButton floatButton = null; 37 private JRadioButton beaconButton = null; 38 private JRadioButton towerButton = null; 39 40 public PanelHaz() { 26 public PanelFog() { 41 27 super(); 42 28 initialize(); … … 45 31 private void initialize() { 46 32 this.setLayout(null); 47 this.add(getNothButton(), null);48 this.add(getSouthButton(), null);49 this.add(getEastButton(), null);50 this.add(getWestButton(), null);51 this.add(getIsolButton(), null);52 catButtons = new ButtonGroup();53 catButtons.add(northButton);54 catButtons.add(southButton);55 catButtons.add(eastButton);56 catButtons.add(westButton);57 catButtons.add(isolButton);58 ActionListener alCat = new ActionListener() {59 public void actionPerformed(java.awt.event.ActionEvent e) {60 northButton.setEnabled(!northButton.isSelected());61 southButton.setEnabled(!southButton.isSelected());62 eastButton.setEnabled(!eastButton.isSelected());63 westButton.setEnabled(!westButton.isSelected());64 isolButton.setEnabled(!isolButton.isSelected());65 }66 };67 northButton.addActionListener(alCat);68 southButton.addActionListener(alCat);69 eastButton.addActionListener(alCat);70 westButton.addActionListener(alCat);71 isolButton.addActionListener(alCat);72 73 this.add(getPillarButton(), null);74 this.add(getSparButton(), null);75 this.add(getFloatButton(), null);76 this.add(getBeaconButton(), null);77 this.add(getTowerButton(), null);78 shapeButtons = new ButtonGroup();79 shapeButtons.add(pillarButton);80 shapeButtons.add(sparButton);81 shapeButtons.add(floatButton);82 shapeButtons.add(beaconButton);83 shapeButtons.add(towerButton);84 ActionListener alShape = new ActionListener() {85 public void actionPerformed(java.awt.event.ActionEvent e) {86 pillarButton.setEnabled(!pillarButton.isSelected());87 sparButton.setEnabled(!sparButton.isSelected());88 floatButton.setEnabled(!floatButton.isSelected());89 beaconButton.setEnabled(!beaconButton.isSelected());90 towerButton.setEnabled(!towerButton.isSelected());91 }92 };93 pillarButton.addActionListener(alShape);94 sparButton.addActionListener(alShape);95 floatButton.addActionListener(alShape);96 beaconButton.addActionListener(alShape);97 towerButton.addActionListener(alShape);98 33 } 99 100 private JRadioButton getNothButton() {101 if (northButton == null) {102 northButton = new JRadioButton(new ImageIcon(getClass()103 .getResource("/images/CardNButton.png")));104 northButton.setBounds(new Rectangle(0, 0, 55, 32));105 northButton.setToolTipText(Messages.getString("NorthTip"));106 }107 return northButton;108 }109 110 private JRadioButton getSouthButton() {111 if (southButton == null) {112 southButton = new JRadioButton(new ImageIcon(getClass()113 .getResource("/images/CardSButton.png")));114 southButton.setBounds(new Rectangle(0, 32, 55, 32));115 southButton.setToolTipText(Messages.getString("SouthTip"));116 }117 return southButton;118 }119 120 private JRadioButton getEastButton() {121 if (eastButton == null) {122 eastButton = new JRadioButton(new ImageIcon(getClass().getResource(123 "/images/CardEButton.png")));124 eastButton.setBounds(new Rectangle(0, 64, 55, 32));125 eastButton.setToolTipText(Messages.getString("EastTip"));126 }127 return eastButton;128 }129 130 private JRadioButton getWestButton() {131 if (westButton == null) {132 westButton = new JRadioButton(new ImageIcon(getClass().getResource(133 "/images/CardWButton.png")));134 westButton.setBounds(new Rectangle(0, 96, 55, 32));135 westButton.setToolTipText(Messages.getString("WestTip"));136 }137 return westButton;138 }139 140 private JRadioButton getIsolButton() {141 if (isolButton == null) {142 isolButton = new JRadioButton(new ImageIcon(getClass().getResource(143 "/images/IsolButton.png")));144 isolButton.setBounds(new Rectangle(0, 128, 55, 32));145 isolButton.setToolTipText(Messages.getString("IsolTip"));146 }147 return isolButton;148 }149 150 private JRadioButton getPillarButton() {151 if (pillarButton == null) {152 pillarButton = new JRadioButton(new ImageIcon(getClass()153 .getResource("/images/PillarButton.png")));154 pillarButton.setBounds(new Rectangle(55, 0, 90, 32));155 pillarButton.setToolTipText(Messages.getString("PillarTip"));156 }157 return pillarButton;158 }159 160 private JRadioButton getSparButton() {161 if (sparButton == null) {162 sparButton = new JRadioButton(new ImageIcon(getClass().getResource(163 "/images/SparButton.png")));164 sparButton.setBounds(new Rectangle(55, 32, 90, 32));165 sparButton.setToolTipText(Messages.getString("SparTip"));166 }167 return sparButton;168 }169 170 private JRadioButton getFloatButton() {171 if (floatButton == null) {172 floatButton = new JRadioButton(new ImageIcon(getClass()173 .getResource("/images/FloatButton.png")));174 floatButton.setBounds(new Rectangle(55, 64, 90, 32));175 floatButton.setToolTipText(Messages.getString("FloatTip"));176 }177 return floatButton;178 }179 180 private JRadioButton getBeaconButton() {181 if (beaconButton == null) {182 beaconButton = new JRadioButton(new ImageIcon(getClass()183 .getResource("/images/BeaconButton.png")));184 beaconButton.setBounds(new Rectangle(55, 96, 90, 32));185 beaconButton.setToolTipText(Messages.getString("BeaconTip"));186 }187 return beaconButton;188 }189 190 private JRadioButton getTowerButton() {191 if (towerButton == null) {192 towerButton = new JRadioButton(new ImageIcon(getClass()193 .getResource("/images/TowerButton.png")));194 towerButton.setBounds(new Rectangle(55, 128, 90, 32));195 towerButton.setToolTipText(Messages.getString("TowerTip"));196 }197 return towerButton;198 }199 200 34 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelLit.java
r24710 r24720 1 1 package oseam.panels; 2 2 3 import javax.swing.BorderFactory;4 3 import javax.swing.JPanel; 5 4 … … 22 21 import java.awt.event.ActionListener; 23 22 24 public class Panel Hazextends JPanel {23 public class PanelLit extends JPanel { 25 24 26 private ButtonGroup catButtons = null; 27 private JRadioButton northButton = null; 28 private JRadioButton southButton = null; 29 private JRadioButton eastButton = null; 30 private JRadioButton westButton = null; 31 private JRadioButton isolButton = null; 32 33 private ButtonGroup shapeButtons = null; 34 private JRadioButton pillarButton = null; 35 private JRadioButton sparButton = null; 36 private JRadioButton floatButton = null; 37 private JRadioButton beaconButton = null; 38 private JRadioButton towerButton = null; 39 40 public PanelHaz() { 25 public PanelLit() { 41 26 super(); 42 27 initialize(); … … 45 30 private void initialize() { 46 31 this.setLayout(null); 47 this.add(getNothButton(), null);48 this.add(getSouthButton(), null);49 this.add(getEastButton(), null);50 this.add(getWestButton(), null);51 this.add(getIsolButton(), null);52 catButtons = new ButtonGroup();53 catButtons.add(northButton);54 catButtons.add(southButton);55 catButtons.add(eastButton);56 catButtons.add(westButton);57 catButtons.add(isolButton);58 ActionListener alCat = new ActionListener() {59 public void actionPerformed(java.awt.event.ActionEvent e) {60 northButton.setEnabled(!northButton.isSelected());61 southButton.setEnabled(!southButton.isSelected());62 eastButton.setEnabled(!eastButton.isSelected());63 westButton.setEnabled(!westButton.isSelected());64 isolButton.setEnabled(!isolButton.isSelected());65 }66 };67 northButton.addActionListener(alCat);68 southButton.addActionListener(alCat);69 eastButton.addActionListener(alCat);70 westButton.addActionListener(alCat);71 isolButton.addActionListener(alCat);72 73 this.add(getPillarButton(), null);74 this.add(getSparButton(), null);75 this.add(getFloatButton(), null);76 this.add(getBeaconButton(), null);77 this.add(getTowerButton(), null);78 shapeButtons = new ButtonGroup();79 shapeButtons.add(pillarButton);80 shapeButtons.add(sparButton);81 shapeButtons.add(floatButton);82 shapeButtons.add(beaconButton);83 shapeButtons.add(towerButton);84 ActionListener alShape = new ActionListener() {85 public void actionPerformed(java.awt.event.ActionEvent e) {86 pillarButton.setEnabled(!pillarButton.isSelected());87 sparButton.setEnabled(!sparButton.isSelected());88 floatButton.setEnabled(!floatButton.isSelected());89 beaconButton.setEnabled(!beaconButton.isSelected());90 towerButton.setEnabled(!towerButton.isSelected());91 }92 };93 pillarButton.addActionListener(alShape);94 sparButton.addActionListener(alShape);95 floatButton.addActionListener(alShape);96 beaconButton.addActionListener(alShape);97 towerButton.addActionListener(alShape);98 32 } 99 100 private JRadioButton getNothButton() {101 if (northButton == null) {102 northButton = new JRadioButton(new ImageIcon(getClass()103 .getResource("/images/CardNButton.png")));104 northButton.setBounds(new Rectangle(0, 0, 55, 32));105 northButton.setToolTipText(Messages.getString("NorthTip"));106 }107 return northButton;108 }109 110 private JRadioButton getSouthButton() {111 if (southButton == null) {112 southButton = new JRadioButton(new ImageIcon(getClass()113 .getResource("/images/CardSButton.png")));114 southButton.setBounds(new Rectangle(0, 32, 55, 32));115 southButton.setToolTipText(Messages.getString("SouthTip"));116 }117 return southButton;118 }119 120 private JRadioButton getEastButton() {121 if (eastButton == null) {122 eastButton = new JRadioButton(new ImageIcon(getClass().getResource(123 "/images/CardEButton.png")));124 eastButton.setBounds(new Rectangle(0, 64, 55, 32));125 eastButton.setToolTipText(Messages.getString("EastTip"));126 }127 return eastButton;128 }129 130 private JRadioButton getWestButton() {131 if (westButton == null) {132 westButton = new JRadioButton(new ImageIcon(getClass().getResource(133 "/images/CardWButton.png")));134 westButton.setBounds(new Rectangle(0, 96, 55, 32));135 westButton.setToolTipText(Messages.getString("WestTip"));136 }137 return westButton;138 }139 140 private JRadioButton getIsolButton() {141 if (isolButton == null) {142 isolButton = new JRadioButton(new ImageIcon(getClass().getResource(143 "/images/IsolButton.png")));144 isolButton.setBounds(new Rectangle(0, 128, 55, 32));145 isolButton.setToolTipText(Messages.getString("IsolTip"));146 }147 return isolButton;148 }149 150 private JRadioButton getPillarButton() {151 if (pillarButton == null) {152 pillarButton = new JRadioButton(new ImageIcon(getClass()153 .getResource("/images/PillarButton.png")));154 pillarButton.setBounds(new Rectangle(55, 0, 90, 32));155 pillarButton.setToolTipText(Messages.getString("PillarTip"));156 }157 return pillarButton;158 }159 160 private JRadioButton getSparButton() {161 if (sparButton == null) {162 sparButton = new JRadioButton(new ImageIcon(getClass().getResource(163 "/images/SparButton.png")));164 sparButton.setBounds(new Rectangle(55, 32, 90, 32));165 sparButton.setToolTipText(Messages.getString("SparTip"));166 }167 return sparButton;168 }169 170 private JRadioButton getFloatButton() {171 if (floatButton == null) {172 floatButton = new JRadioButton(new ImageIcon(getClass()173 .getResource("/images/FloatButton.png")));174 floatButton.setBounds(new Rectangle(55, 64, 90, 32));175 floatButton.setToolTipText(Messages.getString("FloatTip"));176 }177 return floatButton;178 }179 180 private JRadioButton getBeaconButton() {181 if (beaconButton == null) {182 beaconButton = new JRadioButton(new ImageIcon(getClass()183 .getResource("/images/BeaconButton.png")));184 beaconButton.setBounds(new Rectangle(55, 96, 90, 32));185 beaconButton.setToolTipText(Messages.getString("BeaconTip"));186 }187 return beaconButton;188 }189 190 private JRadioButton getTowerButton() {191 if (towerButton == null) {192 towerButton = new JRadioButton(new ImageIcon(getClass()193 .getResource("/images/TowerButton.png")));194 towerButton.setBounds(new Rectangle(55, 128, 90, 32));195 towerButton.setToolTipText(Messages.getString("TowerTip"));196 }197 return towerButton;198 }199 200 33 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelRadar.java
r24710 r24720 1 1 package oseam.panels; 2 2 3 import javax.swing.BorderFactory;4 3 import javax.swing.JPanel; 5 4 … … 22 21 import java.awt.event.ActionListener; 23 22 24 public class Panel Hazextends JPanel {23 public class PanelRadar extends JPanel { 25 24 26 private ButtonGroup catButtons = null;27 private JRadioButton northButton = null;28 private JRadioButton southButton = null;29 private JRadioButton eastButton = null;30 private JRadioButton westButton = null;31 private JRadioButton isolButton = null;32 25 33 private ButtonGroup shapeButtons = null; 34 private JRadioButton pillarButton = null; 35 private JRadioButton sparButton = null; 36 private JRadioButton floatButton = null; 37 private JRadioButton beaconButton = null; 38 private JRadioButton towerButton = null; 39 40 public PanelHaz() { 26 public PanelRadar() { 41 27 super(); 42 28 initialize(); … … 45 31 private void initialize() { 46 32 this.setLayout(null); 47 this.add(getNothButton(), null);48 this.add(getSouthButton(), null);49 this.add(getEastButton(), null);50 this.add(getWestButton(), null);51 this.add(getIsolButton(), null);52 catButtons = new ButtonGroup();53 catButtons.add(northButton);54 catButtons.add(southButton);55 catButtons.add(eastButton);56 catButtons.add(westButton);57 catButtons.add(isolButton);58 ActionListener alCat = new ActionListener() {59 public void actionPerformed(java.awt.event.ActionEvent e) {60 northButton.setEnabled(!northButton.isSelected());61 southButton.setEnabled(!southButton.isSelected());62 eastButton.setEnabled(!eastButton.isSelected());63 westButton.setEnabled(!westButton.isSelected());64 isolButton.setEnabled(!isolButton.isSelected());65 }66 };67 northButton.addActionListener(alCat);68 southButton.addActionListener(alCat);69 eastButton.addActionListener(alCat);70 westButton.addActionListener(alCat);71 isolButton.addActionListener(alCat);72 73 this.add(getPillarButton(), null);74 this.add(getSparButton(), null);75 this.add(getFloatButton(), null);76 this.add(getBeaconButton(), null);77 this.add(getTowerButton(), null);78 shapeButtons = new ButtonGroup();79 shapeButtons.add(pillarButton);80 shapeButtons.add(sparButton);81 shapeButtons.add(floatButton);82 shapeButtons.add(beaconButton);83 shapeButtons.add(towerButton);84 ActionListener alShape = new ActionListener() {85 public void actionPerformed(java.awt.event.ActionEvent e) {86 pillarButton.setEnabled(!pillarButton.isSelected());87 sparButton.setEnabled(!sparButton.isSelected());88 floatButton.setEnabled(!floatButton.isSelected());89 beaconButton.setEnabled(!beaconButton.isSelected());90 towerButton.setEnabled(!towerButton.isSelected());91 }92 };93 pillarButton.addActionListener(alShape);94 sparButton.addActionListener(alShape);95 floatButton.addActionListener(alShape);96 beaconButton.addActionListener(alShape);97 towerButton.addActionListener(alShape);98 33 } 99 100 private JRadioButton getNothButton() {101 if (northButton == null) {102 northButton = new JRadioButton(new ImageIcon(getClass()103 .getResource("/images/CardNButton.png")));104 northButton.setBounds(new Rectangle(0, 0, 55, 32));105 northButton.setToolTipText(Messages.getString("NorthTip"));106 }107 return northButton;108 }109 110 private JRadioButton getSouthButton() {111 if (southButton == null) {112 southButton = new JRadioButton(new ImageIcon(getClass()113 .getResource("/images/CardSButton.png")));114 southButton.setBounds(new Rectangle(0, 32, 55, 32));115 southButton.setToolTipText(Messages.getString("SouthTip"));116 }117 return southButton;118 }119 120 private JRadioButton getEastButton() {121 if (eastButton == null) {122 eastButton = new JRadioButton(new ImageIcon(getClass().getResource(123 "/images/CardEButton.png")));124 eastButton.setBounds(new Rectangle(0, 64, 55, 32));125 eastButton.setToolTipText(Messages.getString("EastTip"));126 }127 return eastButton;128 }129 130 private JRadioButton getWestButton() {131 if (westButton == null) {132 westButton = new JRadioButton(new ImageIcon(getClass().getResource(133 "/images/CardWButton.png")));134 westButton.setBounds(new Rectangle(0, 96, 55, 32));135 westButton.setToolTipText(Messages.getString("WestTip"));136 }137 return westButton;138 }139 140 private JRadioButton getIsolButton() {141 if (isolButton == null) {142 isolButton = new JRadioButton(new ImageIcon(getClass().getResource(143 "/images/IsolButton.png")));144 isolButton.setBounds(new Rectangle(0, 128, 55, 32));145 isolButton.setToolTipText(Messages.getString("IsolTip"));146 }147 return isolButton;148 }149 150 private JRadioButton getPillarButton() {151 if (pillarButton == null) {152 pillarButton = new JRadioButton(new ImageIcon(getClass()153 .getResource("/images/PillarButton.png")));154 pillarButton.setBounds(new Rectangle(55, 0, 90, 32));155 pillarButton.setToolTipText(Messages.getString("PillarTip"));156 }157 return pillarButton;158 }159 160 private JRadioButton getSparButton() {161 if (sparButton == null) {162 sparButton = new JRadioButton(new ImageIcon(getClass().getResource(163 "/images/SparButton.png")));164 sparButton.setBounds(new Rectangle(55, 32, 90, 32));165 sparButton.setToolTipText(Messages.getString("SparTip"));166 }167 return sparButton;168 }169 170 private JRadioButton getFloatButton() {171 if (floatButton == null) {172 floatButton = new JRadioButton(new ImageIcon(getClass()173 .getResource("/images/FloatButton.png")));174 floatButton.setBounds(new Rectangle(55, 64, 90, 32));175 floatButton.setToolTipText(Messages.getString("FloatTip"));176 }177 return floatButton;178 }179 180 private JRadioButton getBeaconButton() {181 if (beaconButton == null) {182 beaconButton = new JRadioButton(new ImageIcon(getClass()183 .getResource("/images/BeaconButton.png")));184 beaconButton.setBounds(new Rectangle(55, 96, 90, 32));185 beaconButton.setToolTipText(Messages.getString("BeaconTip"));186 }187 return beaconButton;188 }189 190 private JRadioButton getTowerButton() {191 if (towerButton == null) {192 towerButton = new JRadioButton(new ImageIcon(getClass()193 .getResource("/images/TowerButton.png")));194 towerButton.setBounds(new Rectangle(55, 128, 90, 32));195 towerButton.setToolTipText(Messages.getString("TowerTip"));196 }197 return towerButton;198 }199 200 34 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelTop.java
r24710 r24720 1 1 package oseam.panels; 2 2 3 import javax.swing.BorderFactory;4 3 import javax.swing.JPanel; 5 4 … … 16 15 import javax.swing.JCheckBox; 17 16 import javax.swing.JRadioButton; 17 import javax.swing.JButton; 18 18 19 19 import oseam.Messages; … … 22 22 import java.awt.event.ActionListener; 23 23 24 public class Panel Hazextends JPanel {24 public class PanelTop extends JPanel { 25 25 26 private ButtonGroup catButtons = null; 27 private JRadioButton northButton = null; 28 private JRadioButton southButton = null; 29 private JRadioButton eastButton = null; 30 private JRadioButton westButton = null; 31 private JRadioButton isolButton = null; 26 private ButtonGroup topButtons = null; 27 private JRadioButton noTopButton = null; 32 28 33 private ButtonGroup shapeButtons = null; 34 private JRadioButton pillarButton = null; 35 private JRadioButton sparButton = null; 36 private JRadioButton floatButton = null; 37 private JRadioButton beaconButton = null; 38 private JRadioButton towerButton = null; 39 40 public PanelHaz() { 29 public PanelTop() { 41 30 super(); 42 31 initialize(); … … 45 34 private void initialize() { 46 35 this.setLayout(null); 47 this.add(getNothButton(), null); 48 this.add(getSouthButton(), null); 49 this.add(getEastButton(), null); 50 this.add(getWestButton(), null); 51 this.add(getIsolButton(), null); 52 catButtons = new ButtonGroup(); 53 catButtons.add(northButton); 54 catButtons.add(southButton); 55 catButtons.add(eastButton); 56 catButtons.add(westButton); 57 catButtons.add(isolButton); 58 ActionListener alCat = new ActionListener() { 59 public void actionPerformed(java.awt.event.ActionEvent e) { 60 northButton.setEnabled(!northButton.isSelected()); 61 southButton.setEnabled(!southButton.isSelected()); 62 eastButton.setEnabled(!eastButton.isSelected()); 63 westButton.setEnabled(!westButton.isSelected()); 64 isolButton.setEnabled(!isolButton.isSelected()); 65 } 66 }; 67 northButton.addActionListener(alCat); 68 southButton.addActionListener(alCat); 69 eastButton.addActionListener(alCat); 70 westButton.addActionListener(alCat); 71 isolButton.addActionListener(alCat); 72 73 this.add(getPillarButton(), null); 74 this.add(getSparButton(), null); 75 this.add(getFloatButton(), null); 76 this.add(getBeaconButton(), null); 77 this.add(getTowerButton(), null); 78 shapeButtons = new ButtonGroup(); 79 shapeButtons.add(pillarButton); 80 shapeButtons.add(sparButton); 81 shapeButtons.add(floatButton); 82 shapeButtons.add(beaconButton); 83 shapeButtons.add(towerButton); 84 ActionListener alShape = new ActionListener() { 85 public void actionPerformed(java.awt.event.ActionEvent e) { 86 pillarButton.setEnabled(!pillarButton.isSelected()); 87 sparButton.setEnabled(!sparButton.isSelected()); 88 floatButton.setEnabled(!floatButton.isSelected()); 89 beaconButton.setEnabled(!beaconButton.isSelected()); 90 towerButton.setEnabled(!towerButton.isSelected()); 91 } 92 }; 93 pillarButton.addActionListener(alShape); 94 sparButton.addActionListener(alShape); 95 floatButton.addActionListener(alShape); 96 beaconButton.addActionListener(alShape); 97 towerButton.addActionListener(alShape); 36 this.add(getNoTopButton(), null); 37 topButtons = new ButtonGroup(); 38 topButtons.add(noTopButton); 98 39 } 99 40 100 private JRadioButton getNo thButton() {101 if (no rthButton == null) {102 no rthButton = new JRadioButton(new ImageIcon(getClass()103 .getResource("/images/ CardNButton.png")));104 no rthButton.setBounds(new Rectangle(0, 0, 55, 32));105 no rthButton.setToolTipText(Messages.getString("NorthTip"));41 private JRadioButton getNoTopButton() { 42 if (noTopButton == null) { 43 noTopButton = new JRadioButton(new ImageIcon(getClass() 44 .getResource("/images/NoTopButton.png"))); 45 noTopButton.setBounds(new Rectangle(5, 5, 30, 30)); 46 noTopButton.setToolTipText(Messages.getString("NorthTip")); 106 47 } 107 return northButton; 108 } 109 110 private JRadioButton getSouthButton() { 111 if (southButton == null) { 112 southButton = new JRadioButton(new ImageIcon(getClass() 113 .getResource("/images/CardSButton.png"))); 114 southButton.setBounds(new Rectangle(0, 32, 55, 32)); 115 southButton.setToolTipText(Messages.getString("SouthTip")); 116 } 117 return southButton; 118 } 119 120 private JRadioButton getEastButton() { 121 if (eastButton == null) { 122 eastButton = new JRadioButton(new ImageIcon(getClass().getResource( 123 "/images/CardEButton.png"))); 124 eastButton.setBounds(new Rectangle(0, 64, 55, 32)); 125 eastButton.setToolTipText(Messages.getString("EastTip")); 126 } 127 return eastButton; 128 } 129 130 private JRadioButton getWestButton() { 131 if (westButton == null) { 132 westButton = new JRadioButton(new ImageIcon(getClass().getResource( 133 "/images/CardWButton.png"))); 134 westButton.setBounds(new Rectangle(0, 96, 55, 32)); 135 westButton.setToolTipText(Messages.getString("WestTip")); 136 } 137 return westButton; 138 } 139 140 private JRadioButton getIsolButton() { 141 if (isolButton == null) { 142 isolButton = new JRadioButton(new ImageIcon(getClass().getResource( 143 "/images/IsolButton.png"))); 144 isolButton.setBounds(new Rectangle(0, 128, 55, 32)); 145 isolButton.setToolTipText(Messages.getString("IsolTip")); 146 } 147 return isolButton; 148 } 149 150 private JRadioButton getPillarButton() { 151 if (pillarButton == null) { 152 pillarButton = new JRadioButton(new ImageIcon(getClass() 153 .getResource("/images/PillarButton.png"))); 154 pillarButton.setBounds(new Rectangle(55, 0, 90, 32)); 155 pillarButton.setToolTipText(Messages.getString("PillarTip")); 156 } 157 return pillarButton; 158 } 159 160 private JRadioButton getSparButton() { 161 if (sparButton == null) { 162 sparButton = new JRadioButton(new ImageIcon(getClass().getResource( 163 "/images/SparButton.png"))); 164 sparButton.setBounds(new Rectangle(55, 32, 90, 32)); 165 sparButton.setToolTipText(Messages.getString("SparTip")); 166 } 167 return sparButton; 168 } 169 170 private JRadioButton getFloatButton() { 171 if (floatButton == null) { 172 floatButton = new JRadioButton(new ImageIcon(getClass() 173 .getResource("/images/FloatButton.png"))); 174 floatButton.setBounds(new Rectangle(55, 64, 90, 32)); 175 floatButton.setToolTipText(Messages.getString("FloatTip")); 176 } 177 return floatButton; 178 } 179 180 private JRadioButton getBeaconButton() { 181 if (beaconButton == null) { 182 beaconButton = new JRadioButton(new ImageIcon(getClass() 183 .getResource("/images/BeaconButton.png"))); 184 beaconButton.setBounds(new Rectangle(55, 96, 90, 32)); 185 beaconButton.setToolTipText(Messages.getString("BeaconTip")); 186 } 187 return beaconButton; 188 } 189 190 private JRadioButton getTowerButton() { 191 if (towerButton == null) { 192 towerButton = new JRadioButton(new ImageIcon(getClass() 193 .getResource("/images/TowerButton.png"))); 194 towerButton.setBounds(new Rectangle(55, 128, 90, 32)); 195 towerButton.setToolTipText(Messages.getString("TowerTip")); 196 } 197 return towerButton; 48 return noTopButton; 198 49 } 199 50
Note:
See TracChangeset
for help on using the changeset viewer.