Changeset 24751 in osm
- Timestamp:
- 2010-12-15T00:31:15+01:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/smed/plugs/harbour
- Files:
-
- 12 added
- 37 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed/plugs/harbour/src/harbour/panels/PanelEnv.java
r24356 r24751 1 1 package harbour.panels; 2 3 import java.awt.Color;4 import java.awt.GridBagLayout;5 2 6 3 import javax.swing.BorderFactory; 7 4 import javax.swing.JPanel; 8 5 import javax.swing.JLabel; 6 7 import java.awt.Color; 9 8 import java.awt.Rectangle; 10 9 … … 13 12 private static final long serialVersionUID = 1L; 14 13 private JLabel envLabel = null; 14 15 15 16 16 /** … … 37 37 this.add(envLabel, null); 38 38 } 39 40 39 } -
applications/editors/josm/plugins/smed/plugs/harbour/src/harbour/panels/PanelRelations.java
r24356 r24751 3 3 import java.awt.Color; 4 4 import java.awt.GridBagLayout; 5 import java.awt.Rectangle; 5 6 6 7 import javax.swing.BorderFactory; 7 8 import javax.swing.JPanel; 8 9 import javax.swing.JLabel; 9 import java.awt. Rectangle;10 import java.awt.Dimension; 10 11 11 12 public class PanelRelations extends JPanel { … … 31 32 relLabel.setBounds(new Rectangle(101, 18, 120, 36)); 32 33 relLabel.setText("Relationen"); 34 33 35 this.setSize(330, 270); 34 36 this.setLayout(null); … … 36 38 this.add(relLabel, null); 37 39 } 38 39 40 } -
applications/editors/josm/plugins/smed/plugs/harbour/src/harbour/panels/PanelSearchPois.java
r24677 r24751 14 14 import javax.swing.JTable; 15 15 import javax.swing.JComboBox; 16 import harbour.models.SearchTableModel; 16 17 17 18 public class PanelSearchPois extends JPanel { … … 25 26 private JTable jTable = null; 26 27 private JLabel layerLabel = null; 27 private JComboBox jComboBox = null;28 private JComboBox layerComboBox = null; 28 29 29 30 /** … … 62 63 this.add(getJScrollPane(), null); 63 64 this.add(layerLabel, null); 64 this.add(get JComboBox(), null);65 this.add(getLayerComboBox(), null); 65 66 } 66 67 … … 114 115 if (jTable == null) { 115 116 jTable = new JTable(); 117 jTable.setModel(new SearchTableModel()); 116 118 } 117 119 return jTable; … … 119 121 120 122 /** 121 * This method initializes jComboBox123 * This method initializes layerComboBox 122 124 * 123 125 * @return javax.swing.JComboBox 124 126 */ 125 private JComboBox get JComboBox() {126 if ( jComboBox == null) {127 jComboBox = new JComboBox();128 jComboBox.setBounds(new Rectangle(70, 5, 250, 20));127 private JComboBox getLayerComboBox() { 128 if (layerComboBox == null) { 129 layerComboBox = new JComboBox(); 130 layerComboBox.setBounds(new Rectangle(70, 5, 250, 20)); 129 131 } 130 return jComboBox;132 return layerComboBox; 131 133 } 132 134 -
applications/editors/josm/plugins/smed/plugs/harbour/src/harbour/panels/PanelServices.java
r24574 r24751 1 1 package harbour.panels; 2 2 3 import harbour.widgets.CraneTable; 3 4 import harbour.widgets.TristateCheckBox; 4 5 5 6 import java.awt.Color; 6 import java.awt.GridBagLayout;7 7 8 8 import javax.swing.BorderFactory; … … 12 12 import javax.swing.JCheckBox; 13 13 import java.awt.Font; 14 import javax.swing.JComboBox;15 14 import javax.swing.ImageIcon; 15 import javax.swing.JScrollPane; 16 16 17 17 public class PanelServices extends JPanel { … … 32 32 private TristateCheckBox ancCheckBox = null; 33 33 private JLabel moorLabel = null; 34 private JLabel craneLabel = null;35 private JLabel hLabel = null;36 private JLabel fLabel = null;37 private JLabel zLabel = null;38 private JLabel nLabel = null;39 34 private TristateCheckBox slipCheckBox = null; 40 private JLabel fixLabel = null;41 private TristateCheckBox hfCheckBox = null;42 private TristateCheckBox ffCheckBox = null;43 private TristateCheckBox zfCheckBox = null;44 private TristateCheckBox nfCheckBox = null;45 35 private TristateCheckBox dockCheckBox = null; 46 private JLabel mobLabel = null;47 private TristateCheckBox hmCheckBox = null;48 private TristateCheckBox fmCheckBox = null;49 private TristateCheckBox zmCheckBox = null;50 private TristateCheckBox nmCheckBox = null;51 private JLabel schwLabel = null;52 private TristateCheckBox hsCheckBox = null;53 private TristateCheckBox fsCheckBox = null;54 private TristateCheckBox zsCheckBox = null;55 private TristateCheckBox nsCheckBox = null;56 36 private JLabel DLLabel = null; 57 37 private TristateCheckBox anbCheckBox = null; … … 78 58 private TristateCheckBox imCheckBox = null; 79 59 private TristateCheckBox bmCheckBox = null; 60 private CraneTable craneScrollPane = null; 80 61 /** 81 62 * This is the default constructor … … 104 85 recLabel.setBounds(new Rectangle(187, 165, 90, 20)); 105 86 recLabel.setFont(new Font("Dialog", Font.PLAIN, 12)); 106 recLabel.setText("Entsorgung en:");87 recLabel.setText("Entsorgung:"); 107 88 servLabel = new JLabel(); 108 89 servLabel.setBounds(new Rectangle(1, 185, 45, 20)); … … 112 93 DLLabel.setBounds(new Rectangle(3, 165, 147, 20)); 113 94 DLLabel.setText("weitere Dienstleistungen"); 114 schwLabel = new JLabel();115 schwLabel.setBounds(new Rectangle(5, 142, 40, 16));116 schwLabel.setFont(new Font("Dialog", Font.PLAIN, 12));117 schwLabel.setText(" schw.");118 mobLabel = new JLabel();119 mobLabel.setBounds(new Rectangle(5, 126, 40, 16));120 mobLabel.setFont(new Font("Dialog", Font.PLAIN, 12));121 mobLabel.setText(" mobil");122 fixLabel = new JLabel();123 fixLabel.setBounds(new Rectangle(5, 110, 40, 16));124 fixLabel.setFont(new Font("Dialog", Font.PLAIN, 12));125 fixLabel.setText(" fest");126 nLabel = new JLabel();127 nLabel.setBounds(new Rectangle(200, 90, 38, 20));128 nLabel.setFont(new Font("Dialog", Font.PLAIN, 12));129 nLabel.setText(" 0-25t");130 zLabel = new JLabel();131 zLabel.setBounds(new Rectangle(150, 90, 45, 20));132 zLabel.setFont(new Font("Dialog", Font.PLAIN, 12));133 zLabel.setText(" 25-50t");134 fLabel = new JLabel();135 fLabel.setBounds(new Rectangle(100, 90, 45, 20));136 fLabel.setFont(new Font("Dialog", Font.PLAIN, 12));137 fLabel.setText("50-100t");138 hLabel = new JLabel();139 hLabel.setBounds(new Rectangle(50, 90, 45, 20));140 hLabel.setFont(new Font("Dialog", Font.PLAIN, 12));141 hLabel.setText(" >100t");142 craneLabel = new JLabel();143 craneLabel.setBounds(new Rectangle(5, 90, 42, 20));144 craneLabel.setText(" Kran");145 95 moorLabel = new JLabel(); 146 moorLabel.setBounds(new Rectangle(145, 50, 65, 16));96 moorLabel.setBounds(new Rectangle(145, 50, 70, 16)); 147 97 moorLabel.setFont(new Font("Dialog", Font.PLAIN, 12)); 148 98 moorLabel.setText("Ankerplatz:"); … … 176 126 this.add(getAncCheckBox(), null); 177 127 this.add(moorLabel, null); 178 this.add(craneLabel, null);179 this.add(hLabel, null);180 this.add(fLabel, null);181 this.add(zLabel, null);182 this.add(nLabel, null);183 128 this.add(getSlipCheckBox(), null); 184 this.add(fixLabel, null);185 this.add(getHfCheckBox(), null);186 this.add(getFfCheckBox(), null);187 this.add(getZfCheckBox(), null);188 this.add(getNfCheckBox(), null);189 129 this.add(getDockCheckBox(), null); 190 this.add(mobLabel, null);191 this.add(getHmCheckBox(), null);192 this.add(getFmCheckBox(), null);193 this.add(getZmCheckBox(), null);194 this.add(getNmCheckBox(), null);195 this.add(schwLabel, null);196 this.add(getHsCheckBox(), null);197 this.add(getFsCheckBox(), null);198 this.add(getZsCheckBox(), null);199 this.add(getNsCheckBox(), null);200 130 this.add(DLLabel, null); 201 131 this.add(getAnbCheckBox(), null); … … 222 152 this.add(getImCheckBox(), null); 223 153 this.add(getBmCheckBox(), null); 154 this.add(getCraneScrollPane(), null); 224 155 } 225 156 … … 307 238 if (railCheckBox == null) { 308 239 railCheckBox = new TristateCheckBox(); 309 railCheckBox.setBounds(new Rectangle(98, 26, 72, 20));240 railCheckBox.setBounds(new Rectangle(98, 26, 80, 20)); 310 241 railCheckBox.setFont(new Font("Dialog", Font.PLAIN, 12)); 311 242 railCheckBox.setText("Bahnhof"); … … 375 306 376 307 /** 377 * This method initializes hfCheckBox378 *379 * @return javax.swing.JCheckBox380 */381 private JCheckBox getHfCheckBox() {382 if (hfCheckBox == null) {383 hfCheckBox = new TristateCheckBox();384 hfCheckBox.setBounds(new Rectangle(60, 108, 20, 20));385 }386 return hfCheckBox;387 }388 389 /**390 * This method initializes ffCheckBox391 *392 * @return javax.swing.JCheckBox393 */394 private TristateCheckBox getFfCheckBox() {395 if (ffCheckBox == null) {396 ffCheckBox = new TristateCheckBox();397 ffCheckBox.setBounds(new Rectangle(110, 108, 20, 20));398 }399 return ffCheckBox;400 }401 402 /**403 * This method initializes zfCheckBox404 *405 * @return javax.swing.JCheckBox406 */407 private TristateCheckBox getZfCheckBox() {408 if (zfCheckBox == null) {409 zfCheckBox = new TristateCheckBox();410 zfCheckBox.setBounds(new Rectangle(160, 108, 20, 20));411 }412 return zfCheckBox;413 }414 415 /**416 * This method initializes nfCheckBox417 *418 * @return javax.swing.JCheckBox419 */420 private TristateCheckBox getNfCheckBox() {421 if (nfCheckBox == null) {422 nfCheckBox = new TristateCheckBox();423 nfCheckBox.setBounds(new Rectangle(210, 108, 20, 20));424 }425 return nfCheckBox;426 }427 428 /**429 308 * This method initializes dockCheckBox 430 309 * … … 439 318 } 440 319 return dockCheckBox; 441 }442 443 /**444 * This method initializes hmCheckBox445 *446 * @return javax.swing.JCheckBox447 */448 private TristateCheckBox getHmCheckBox() {449 if (hmCheckBox == null) {450 hmCheckBox = new TristateCheckBox();451 hmCheckBox.setBounds(new Rectangle(60, 124, 20, 20));452 }453 return hmCheckBox;454 }455 456 /**457 * This method initializes fmCheckBox458 *459 * @return javax.swing.JCheckBox460 */461 private TristateCheckBox getFmCheckBox() {462 if (fmCheckBox == null) {463 fmCheckBox = new TristateCheckBox();464 fmCheckBox.setBounds(new Rectangle(110, 124, 20, 20));465 }466 return fmCheckBox;467 }468 469 /**470 * This method initializes zmCheckBox471 *472 * @return javax.swing.JCheckBox473 */474 private TristateCheckBox getZmCheckBox() {475 if (zmCheckBox == null) {476 zmCheckBox = new TristateCheckBox();477 zmCheckBox.setBounds(new Rectangle(160, 124, 20, 20));478 }479 return zmCheckBox;480 }481 482 /**483 * This method initializes nmCheckBox484 *485 * @return javax.swing.JCheckBox486 */487 private TristateCheckBox getNmCheckBox() {488 if (nmCheckBox == null) {489 nmCheckBox = new TristateCheckBox();490 nmCheckBox.setBounds(new Rectangle(210, 124, 20, 20));491 }492 return nmCheckBox;493 }494 495 /**496 * This method initializes hsCheckBox497 *498 * @return javax.swing.JCheckBox499 */500 private TristateCheckBox getHsCheckBox() {501 if (hsCheckBox == null) {502 hsCheckBox = new TristateCheckBox();503 hsCheckBox.setBounds(new Rectangle(60, 140, 20, 20));504 }505 return hsCheckBox;506 }507 508 /**509 * This method initializes fsCheckBox510 *511 * @return javax.swing.JCheckBox512 */513 private TristateCheckBox getFsCheckBox() {514 if (fsCheckBox == null) {515 fsCheckBox = new TristateCheckBox();516 fsCheckBox.setBounds(new Rectangle(110, 140, 20, 20));517 }518 return fsCheckBox;519 }520 521 /**522 * This method initializes zsCheckBox523 *524 * @return javax.swing.JCheckBox525 */526 private TristateCheckBox getZsCheckBox() {527 if (zsCheckBox == null) {528 zsCheckBox = new TristateCheckBox();529 zsCheckBox.setBounds(new Rectangle(160, 140, 21, 21));530 }531 return zsCheckBox;532 }533 534 /**535 * This method initializes nsCheckBox536 *537 * @return javax.swing.JCheckBox538 */539 private TristateCheckBox getNsCheckBox() {540 if (nsCheckBox == null) {541 nsCheckBox = new TristateCheckBox();542 nsCheckBox.setBounds(new Rectangle(210, 140, 21, 21));543 }544 return nsCheckBox;545 320 } 546 321 … … 831 606 } 832 607 608 /** 609 * This method initializes craneScrollPane 610 * 611 * @return javax.swing.JScrollPane 612 */ 613 private CraneTable getCraneScrollPane() { 614 if (craneScrollPane == null) { 615 craneScrollPane = new CraneTable(); 616 craneScrollPane.setBounds(new Rectangle(3, 90, 207, 66)); 617 } 618 return craneScrollPane; 619 } 620 833 621 } -
applications/editors/josm/plugins/smed/plugs/harbour/src/harbour/widgets/TristateCheckBox.java
r24540 r24751 3 3 import java.awt.event.ActionEvent; 4 4 import java.awt.event.ActionListener; 5 import java.awt.event.ItemEvent; 5 6 import java.awt.event.ItemListener; 6 7 import java.awt.event.MouseAdapter; … … 32 33 33 34 private TristateDecorator model; 35 private TristateCheckBox box; 34 36 35 37 Icon d = new ImageIcon(getClass().getResource("/images/qm_12x12.png")); … … 40 42 public TristateCheckBox(String text, Icon icon, State initial) { 41 43 super(text,icon); 44 45 box = this; 42 46 43 47 // add a listener for when the mouse is pressed … … 46 50 grabFocus(); 47 51 model.nextState(); 52 53 fireItemStateChanged(new ItemEvent(box, 54 ItemEvent.ITEM_STATE_CHANGED, 55 box, 56 box.isSelected() ? ItemEvent.SELECTED : ItemEvent.DESELECTED)); 57 48 58 if(model.getState() == NOT_SELECTED) setIcon(n); 49 59 if(model.getState() == DONT_CARE) setIcon(d); … … 70 80 model = new TristateDecorator(getModel()); 71 81 setModel(model); 72 setState(DONT_CARE); 73 setIcon(d); 82 setState(initial); 74 83 } 75 84 … … 93 102 * DONT_CARE. If state == null, it is treated as DONT_CARE 94 103 */ 95 public void setState(State state) { model.setState(state); } 104 public void setState(State state) { 105 if(state == NOT_SELECTED) setIcon(n); 106 if(state == DONT_CARE) setIcon(d); 107 if(state == SELECTED) setIcon(s); 108 109 fireItemStateChanged(new ItemEvent(this, 110 ItemEvent.ITEM_STATE_CHANGED, 111 this, 112 this.isSelected() ? ItemEvent.SELECTED : ItemEvent.DESELECTED)); 113 114 model.setState(state); 115 } 96 116 97 117 /** … … 113 133 */ 114 134 private class TristateDecorator implements ButtonModel { 115 135 116 136 private final ButtonModel other; 117 137
Note:
See TracChangeset
for help on using the changeset viewer.