Changeset 24460 in osm for applications/editors/josm
- Timestamp:
- 2010-11-29T23:29:14+01:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/smed/plugs/harbour/src/harbour
- Files:
-
- 1 added
- 1 deleted
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed/plugs/harbour/src/harbour/panels/PanelLimits.java
r24451 r24460 2 2 3 3 import harbour.widgets.LightTile; 4 import harbour.widgets. TextFieldEx;5 import harbour.widgets.TextFieldEx.Ssize;4 import harbour.widgets.SizePanel; 5 // import harbour.widgets.SizePanel.Ssize; 6 6 import harbour.widgets.TristateCheckBox; 7 7 … … 10 10 11 11 import java.awt.Color; 12 import java.awt.GridBagLayout;13 12 import java.awt.Dimension; 14 13 import javax.swing.JLabel; … … 17 16 import java.awt.Font; 18 17 18 import javax.swing.ButtonGroup; 19 19 import javax.swing.Icon; 20 20 import javax.swing.JTextField; … … 23 23 import javax.swing.JButton; 24 24 import javax.swing.ImageIcon; 25 import java.awt.Button;26 25 27 26 28 27 public class PanelLimits extends JPanel { 29 28 29 private ButtonGroup buttons = new ButtonGroup(); 30 30 private JLabel limLabel = null; 31 31 private JCheckBox tideCheckBox = null; … … 44 44 private JCheckBox etaCheckBox = null; 45 45 private JPanel exPanel = null; 46 46 private JLabel unitLabel = null; 47 private JRadioButton meterRadioButton = null; 48 private JRadioButton feetRadioButton = null; 49 47 50 public PanelLimits() { 48 51 super(); … … 55 58 */ 56 59 private void initialize() { 60 unitLabel = new JLabel(); 61 unitLabel.setBounds(new Rectangle(235, 53, 50, 20)); 62 unitLabel.setFont(new Font("Dialog", Font.PLAIN, 12)); 63 unitLabel.setText("Einheit:"); 57 64 grLabel = new JLabel(); 58 grLabel.setBounds(new Rectangle(21 5, 222, 80, 16));65 grLabel.setBounds(new Rectangle(213, 242, 80, 16)); 59 66 grLabel.setFont(new Font("Dialog", Font.PLAIN, 12)); 60 67 grLabel.setText("Ankergrund"); … … 86 93 this.add(getAllComboBox(), null); 87 94 this.add(getExPanel(), null); 95 this.add(unitLabel, null); 96 this.add(getMeterRadioButton(), null); 97 this.add(getFeetRadioButton(), null); 98 99 buttons.add(feetRadioButton); 100 buttons.add(meterRadioButton); 88 101 } 89 102 … … 169 182 if (allComboBox == null) { 170 183 allComboBox = new JComboBox(); 171 allComboBox.setBounds(new Rectangle(135, 70, 190, 20));184 allComboBox.setBounds(new Rectangle(135, 83, 190, 20)); 172 185 allComboBox.setFont(new Font("Dialog", Font.PLAIN, 12)); 173 186 allComboBox.addActionListener(new java.awt.event.ActionListener() { 174 187 public void actionPerformed(java.awt.event.ActionEvent e) { 188 189 if(((SizePanel) exPanel).selTextField == null ) return; 175 190 int type = allComboBox.getSelectedIndex(); 176 Ssize sType = ((TextFieldEx) exPanel).getSizeType(); 177 if(sType == TextFieldEx.VS_SIZE ) { 191 if(type < 0) return; 192 193 ((SizePanel) exPanel).selTextField.setIndex(type, false); 194 /* 195 Ssize sType = ((SizePanel) exPanel).getSizeType(); 196 if(sType == SizePanel.VS_SIZE ) { 178 197 switch (type) { 179 case TextFieldEx.NOT_SELECTED:180 if(((TextFieldEx) exPanel).selTextField != null ) ((TextFieldEx) exPanel).selTextField.setText("");198 case SizePanel.NOT_SELECTED: 199 ((SizePanel) exPanel).selTextField.setText(""); 181 200 break; 182 201 183 case TextFieldEx.LARGE:184 (( TextFieldEx) exPanel).selTextField.setText("> 500ft");202 case SizePanel.UNKNOWN: 203 ((SizePanel) exPanel).selTextField.setText("unbekannt"); 185 204 break; 186 187 case TextFieldEx.MEDIUM:188 (( TextFieldEx) exPanel).selTextField.setText("bis 500ft");205 206 default: 207 ((SizePanel) exPanel).selTextField.setText(((SizePanel) exPanel).vsSize[type-1][((SizePanel) exPanel).units]); 189 208 break; 190 191 case TextFieldEx.UNKNOWN:192 ((TextFieldEx) exPanel).selTextField.setText("unbekannt");193 break;194 195 209 } 196 197 210 } 211 212 if(sType == SizePanel.AN_SIZE) { 213 switch (type) { 214 case SizePanel.NOT_SELECTED: 215 ((SizePanel) exPanel).selTextField.setText(""); 216 break; 217 218 case SizePanel.CAT_UNKNOWN: 219 ((SizePanel) exPanel).selTextField.setText("unbekannt"); 220 break; 221 222 default: 223 ((SizePanel) exPanel).selTextField.setText(((SizePanel) exPanel).anSize[type-1][((SizePanel) exPanel).units]); 224 break; 225 } 226 } */ 198 227 } 199 228 }); … … 215 244 216 245 grButton = new LightTile(grey, green, yellow, red); 217 grButton.setBounds(new Rectangle(16 4, 220, 50, 20));246 grButton.setBounds(new Rectangle(162, 240, 50, 20)); 218 247 } 219 248 return grButton; … … 228 257 if (olCheckBox == null) { 229 258 olCheckBox = new TristateCheckBox(); 230 olCheckBox.setBounds(new Rectangle( 2, 95, 133, 20));259 olCheckBox.setBounds(new Rectangle(7, 109, 133, 20)); 231 260 olCheckBox.setFont(new Font("Dialog", Font.PLAIN, 12)); 232 261 olCheckBox.setText("Overhead Limits"); … … 243 272 if (turnCheckBox == null) { 244 273 turnCheckBox = new TristateCheckBox(); 245 turnCheckBox.setBounds(new Rectangle( 2, 118, 105, 20));274 turnCheckBox.setBounds(new Rectangle(7, 132, 105, 20)); 246 275 turnCheckBox.setFont(new Font("Dialog", Font.PLAIN, 12)); 247 276 turnCheckBox.setText("Wendeplatz"); … … 258 287 if (impCheckBox == null) { 259 288 impCheckBox = new TristateCheckBox(); 260 impCheckBox.setBounds(new Rectangle( 2, 141, 95, 20));289 impCheckBox.setBounds(new Rectangle(7, 155, 95, 20)); 261 290 impCheckBox.setFont(new Font("Dialog", Font.PLAIN, 12)); 262 291 impCheckBox.setText("Zollhafen"); … … 273 302 if (usCheckBox == null) { 274 303 usCheckBox = new TristateCheckBox(); 275 usCheckBox.setBounds(new Rectangle( 2, 164, 125, 20));304 usCheckBox.setBounds(new Rectangle(7, 178, 125, 20)); 276 305 usCheckBox.setFont(new Font("Dialog", Font.PLAIN, 12)); 277 306 usCheckBox.setText("US. Vertretung"); … … 288 317 if (etaCheckBox == null) { 289 318 etaCheckBox = new TristateCheckBox(); 290 etaCheckBox.setBounds(new Rectangle( 2, 187, 120, 20));319 etaCheckBox.setBounds(new Rectangle(7, 201, 120, 20)); 291 320 etaCheckBox.setText("ETA Nachricht"); 292 321 etaCheckBox.setFont(new Font("Dialog", Font.PLAIN, 12)); … … 302 331 private JPanel getExPanel() { 303 332 if (exPanel == null) { 304 exPanel = new TextFieldEx();333 exPanel = new SizePanel(); 305 334 exPanel.setLayout(null); 306 exPanel.setBounds(new Rectangle(135, 95, 190, 112));307 (( TextFieldEx) exPanel).setComboBox(allComboBox);308 (( TextFieldEx) exPanel).initialize();335 exPanel.setBounds(new Rectangle(135, 110, 190, 112)); 336 ((SizePanel) exPanel).setComboBox(allComboBox); 337 ((SizePanel) exPanel).initialize(); 309 338 } 310 339 return exPanel; 311 340 } 341 342 /** 343 * This method initializes meterRadioButton 344 * 345 * @return javax.swing.JRadioButton 346 */ 347 private JRadioButton getMeterRadioButton() { 348 if (meterRadioButton == null) { 349 meterRadioButton = new JRadioButton(); 350 meterRadioButton.setBounds(new Rectangle(290, 45, 38, 20)); 351 meterRadioButton.setFont(new Font("Dialog", Font.PLAIN, 12)); 352 meterRadioButton.setSelected(true); 353 meterRadioButton.setText("m"); 354 meterRadioButton.addActionListener(new java.awt.event.ActionListener() { 355 public void actionPerformed(java.awt.event.ActionEvent e) { 356 ((SizePanel) exPanel).units = SizePanel.METER; 357 ((SizePanel) exPanel).changeUnits(); 358 } 359 }); 360 } 361 return meterRadioButton; 362 } 363 364 /** 365 * This method initializes feetRadioButton 366 * 367 * @return javax.swing.JRadioButton 368 */ 369 private JRadioButton getFeetRadioButton() { 370 if (feetRadioButton == null) { 371 feetRadioButton = new JRadioButton(); 372 feetRadioButton.setBounds(new Rectangle(290, 62, 38, 20)); 373 feetRadioButton.setFont(new Font("Dialog", Font.PLAIN, 12)); 374 feetRadioButton.setText("ft"); 375 feetRadioButton.addActionListener(new java.awt.event.ActionListener() { 376 public void actionPerformed(java.awt.event.ActionEvent e) { 377 ((SizePanel) exPanel).units = SizePanel.FEET; 378 ((SizePanel) exPanel).changeUnits(); 379 } 380 }); 381 } 382 return feetRadioButton; 383 } 312 384 }
Note:
See TracChangeset
for help on using the changeset viewer.