source: osm/applications/editors/josm/plugins/indoorhelper/src/views/ToolBoxView.java@ 34795

Last change on this file since 34795 was 34734, checked in by donvip, 6 years ago

fix warnings

File size: 21.7 KB
Line 
1/*
2 * Indoorhelper is a JOSM plug-in to support users when creating their own indoor maps.
3 * Copyright (C) 2016 Erik Gruschka
4 * Copyright (C) 2018 Rebecca Schmidt
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19package views;
20
21import static org.openstreetmap.josm.tools.I18n.tr;
22
23import java.awt.BorderLayout;
24import java.awt.Color;
25import java.awt.GridBagConstraints;
26import java.awt.GridBagLayout;
27import java.awt.Insets;
28import java.awt.event.ActionListener;
29import java.awt.event.FocusEvent;
30import java.awt.event.FocusListener;
31import java.awt.event.ItemListener;
32import java.util.List;
33
34import javax.swing.JButton;
35import javax.swing.JCheckBox;
36import javax.swing.JLabel;
37import javax.swing.JPanel;
38import javax.swing.JSeparator;
39import javax.swing.border.EmptyBorder;
40
41import org.openstreetmap.josm.gui.dialogs.ToggleDialog;
42import org.openstreetmap.josm.gui.widgets.DisableShortcutsOnFocusGainedTextField;
43import org.openstreetmap.josm.gui.widgets.JosmComboBox;
44
45import model.TagCatalog;
46import model.TagCatalog.IndoorObject;
47
48/**
49*
50* This is the main toolbox of the indoorhelper plug-in.
51*
52* @author egru
53* @author rebsc
54*
55*/
56@SuppressWarnings("serial")
57public class ToolBoxView extends ToggleDialog {
58 private JPanel dialogPanel;
59 private JPanel contentPanel;
60 private JLabel levelLabel;
61 private JCheckBox levelCheckBox;
62 private JLabel levelNameLabel;
63 private DisableShortcutsOnFocusGainedTextField levelNameField;
64 private JLabel repeatOnLabel;
65 private DisableShortcutsOnFocusGainedTextField repeatOnField;
66 private JLabel objectLabel;
67 private JosmComboBox<TagCatalog.IndoorObject> objectBox;
68 private JLabel nameLabel;
69 private DisableShortcutsOnFocusGainedTextField nameField;
70 private JLabel refLabel;
71 private DisableShortcutsOnFocusGainedTextField refField;
72 private JLabel multiLabel;
73 private JButton multiOuterButton;
74 private JButton multiInnerButton;
75 private JCheckBox multiCheckBox;
76 private JPanel buttonBar;
77 private JButton applyButton;
78 private JSeparator separator1;
79 private JSeparator separator2;
80 private PresetButton preset1;
81 private PresetButton preset2;
82 private PresetButton preset3;
83 private PresetButton preset4;
84 private JButton addLevelButton;
85 private JButton helpButton;
86
87 public ToolBoxView() {
88 super(tr("Indoor Mapping Helper"), "indoorhelper",
89 tr("Toolbox for indoor mapping assistance"), null, 300, true);
90
91 initComponents();
92 }
93
94 private void initComponents() {
95 dialogPanel = new JPanel();
96 contentPanel = new JPanel();
97 levelLabel = new JLabel();
98 levelCheckBox = new JCheckBox();
99 levelNameLabel = new JLabel();
100 levelNameField = new DisableShortcutsOnFocusGainedTextField();
101 repeatOnLabel = new JLabel();
102 repeatOnField = new DisableShortcutsOnFocusGainedTextField();
103 objectLabel = new JLabel();
104 objectBox = new JosmComboBox<>(TagCatalog.IndoorObject.values());
105 nameLabel = new JLabel();
106 nameField = new DisableShortcutsOnFocusGainedTextField();
107 refLabel = new JLabel();
108 refField = new DisableShortcutsOnFocusGainedTextField();
109 multiLabel = new JLabel();
110 multiOuterButton = new JButton();
111 multiInnerButton = new JButton();
112 multiCheckBox = new JCheckBox();
113 buttonBar = new JPanel();
114 applyButton = new JButton();
115 separator1 = new JSeparator();
116 separator2 = new JSeparator();
117 preset1 = new PresetButton(IndoorObject.ROOM);
118 preset2 = new PresetButton(IndoorObject.STEPS);
119 preset3 = new PresetButton(IndoorObject.CONCRETE_WALL);
120 preset4 = new PresetButton(IndoorObject.GLASS_WALL);
121 addLevelButton = new JButton();
122 helpButton = new JButton();
123
124 //======== this ========
125 //Container contentPane = this.get;
126 //contentPane.setLayout(new BorderLayout());
127
128 //======== dialogPane ========
129
130 dialogPanel.setBorder(new EmptyBorder(12, 12, 12, 12));
131 dialogPanel.setLayout(new BorderLayout());
132
133 //======== contentPanel ========
134
135 contentPanel.setLayout(new GridBagLayout());
136 ((GridBagLayout) contentPanel.getLayout()).columnWidths = new int[] {
137 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
138 ((GridBagLayout) contentPanel.getLayout()).rowHeights = new int[] {0, 0, 0, 0, 0, 0, 0, 0};
139 ((GridBagLayout) contentPanel.getLayout()).columnWeights = new double[] {
140 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
141 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0E-4};
142 ((GridBagLayout) contentPanel.getLayout()).rowWeights = new double[] {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0E-4};
143
144 //---- addLevelButton ----
145 addLevelButton.setText(tr("Insert level"));
146 addLevelButton.setToolTipText(tr("Add a new level to layer."));
147 addLevelButton.setEnabled(false);
148 contentPanel.add(addLevelButton, new GridBagConstraints(12, 1, 3, 1, 0.0, 1.0,
149 GridBagConstraints.CENTER, GridBagConstraints.BOTH,
150 new Insets(0, 0, 5, 30), 0, 0));
151
152 //---- helpButton ----
153 helpButton.setText(tr("<html><b>?</strong></b>"));
154 helpButton.setToolTipText(tr("Show Help-Browser."));
155 helpButton.setBackground(Color.LIGHT_GRAY);
156 helpButton.setEnabled(false);
157 contentPanel.add(helpButton, new GridBagConstraints(0, 0, 1, 1, 0.0, 1.0,
158 GridBagConstraints.CENTER, GridBagConstraints.BOTH,
159 new Insets(0, 0, 5, 0), 0, 0));
160
161 //---- levelNameLabel ----
162 levelNameLabel.setText(tr("Level name"));
163 contentPanel.add(levelNameLabel, new GridBagConstraints(0, 1, 3, 1, 0.0, 1.0,
164 GridBagConstraints.CENTER, GridBagConstraints.BOTH,
165 new Insets(0, 0, 5, 5), 0, 0));
166
167 //---- levelNameField ----
168 levelNameField.setEnabled(false);
169 levelNameField.setToolTipText(tr("Sets optional name tag for a level."));
170 contentPanel.add(levelNameField, new GridBagConstraints(3, 1, 3, 1, 0.0, 1.0,
171 GridBagConstraints.CENTER, GridBagConstraints.BOTH,
172 new Insets(0, 0, 5, 30), 0, 0));
173
174 //---- levelLabel ----
175 levelLabel.setText(tr("Working level: NONE"));
176 levelLabel.setToolTipText(tr("Shows the current working level."));
177 contentPanel.add(levelLabel, new GridBagConstraints(6, 1, 3, 1, 0.0, 1.0,
178 GridBagConstraints.CENTER, GridBagConstraints.BOTH,
179 new Insets(0, 0, 5, 5), 0, 0));
180
181 //---- levelCheckBox ----
182 levelCheckBox.setToolTipText(tr("Deactivate automatic level tagging."));
183 contentPanel.add(levelCheckBox, new GridBagConstraints(9, 1, 1, 1, 0.0, 1.0,
184 GridBagConstraints.CENTER, GridBagConstraints.BOTH,
185 new Insets(0, 0, 5, 5), 0, 0));
186 contentPanel.add(separator1, new GridBagConstraints(0, 2, 0, 1, 0.0, 0.0,
187 GridBagConstraints.CENTER, GridBagConstraints.BOTH,
188 new Insets(0, 0, 5, 5), 0, 0));
189
190 //---- objectLabel ----
191 objectLabel.setText(tr("Object"));
192 contentPanel.add(objectLabel, new GridBagConstraints(0, 3, 3, 1, 0.0, 1.0,
193 GridBagConstraints.CENTER, GridBagConstraints.BOTH,
194 new Insets(0, 0, 5, 5), 0, 0));
195
196 //---- objectBox ----
197 objectBox.setEnabled(false);
198 objectBox.setPrototypeDisplayValue(IndoorObject.CONCRETE_WALL);
199 objectBox.setToolTipText(tr("The object preset you want to tag."));
200 contentPanel.add(objectBox, new GridBagConstraints(3, 3, 3, 1, 0.0, 1.0,
201 GridBagConstraints.CENTER, GridBagConstraints.BOTH,
202 new Insets(0, 0, 5, 30), 0, 0));
203
204 //---- nameLabel ----
205 nameLabel.setText(tr("Name"));
206 contentPanel.add(nameLabel, new GridBagConstraints(0, 4, 3, 1, 0.0, 1.0,
207 GridBagConstraints.CENTER, GridBagConstraints.BOTH,
208 new Insets(0, 0, 5, 5), 0, 0));
209
210 //---- nameField ----
211 nameField.setEnabled(false);
212 nameField.addFocusListener(new FocusListener() {
213
214 @Override
215 public void focusLost(FocusEvent e) {}
216
217 @Override
218 public void focusGained(FocusEvent e) {
219 nameField.selectAll();
220 }
221 });
222 nameField.setToolTipText(tr("Sets the name tag."));
223 contentPanel.add(nameField, new GridBagConstraints(3, 4, 3, 1, 0.0, 1.0,
224 GridBagConstraints.CENTER, GridBagConstraints.BOTH,
225 new Insets(0, 0, 5, 30), 0, 0));
226
227 //---- refLabel ----
228 refLabel.setText(tr("Reference"));
229 contentPanel.add(refLabel, new GridBagConstraints(0, 5, 3, 1, 0.0, 1.0,
230 GridBagConstraints.CENTER, GridBagConstraints.BOTH,
231 new Insets(0, 0, 5, 5), 0, 0));
232
233 //---- refField ----
234 refField.setEnabled(false);
235 refField.addFocusListener(new FocusListener() {
236
237 @Override
238 public void focusLost(FocusEvent e) {}
239
240 @Override
241 public void focusGained(FocusEvent e) {
242 refField.selectAll();
243 }
244 });
245 refField.setToolTipText(tr("Sets the referance tag."));
246 contentPanel.add(refField, new GridBagConstraints(3, 5, 3, 1, 0.0, 1.0,
247 GridBagConstraints.CENTER, GridBagConstraints.BOTH,
248 new Insets(0, 0, 5, 30), 0, 0));
249
250 //---- repeatOnLabel ----
251 repeatOnLabel.setText(tr("Repeat on"));
252 contentPanel.add(repeatOnLabel, new GridBagConstraints(0, 6, 3, 1, 0.0, 1.0,
253 GridBagConstraints.CENTER, GridBagConstraints.BOTH,
254 new Insets(0, 0, 5, 5), 0, 0));
255
256 //---- repeatOnField ----
257 repeatOnField.setEnabled(false);
258 repeatOnField.addFocusListener(new FocusListener() {
259
260 @Override
261 public void focusLost(FocusEvent e) {}
262
263 @Override
264 public void focusGained(FocusEvent e) {
265 repeatOnField.selectAll();
266 }
267 });
268 repeatOnField.setToolTipText(
269 tr("Sets the repeat on tag when highway objects are selected. Please tag like this: -3-4 or -2--3 or 5-6 ."));
270 contentPanel.add(repeatOnField, new GridBagConstraints(3, 6, 3, 1, 0.0, 1.0,
271 GridBagConstraints.CENTER, GridBagConstraints.BOTH,
272 new Insets(0, 0, 5, 30), 0, 0));
273 contentPanel.add(separator2, new GridBagConstraints(0, 7, 0, 1, 0.0, 1.0,
274 GridBagConstraints.CENTER, GridBagConstraints.BOTH,
275 new Insets(0, 0, 5, 5), 0, 0));
276
277 //---- preset1 ----
278 preset1.setEnabled(false);
279 contentPanel.add(preset1, new GridBagConstraints(6, 3, 1, 1, 0.0, 0.0,
280 GridBagConstraints.CENTER, GridBagConstraints.BOTH,
281 new Insets(0, 0, 5, 5), 0, 0));
282 //---- preset2 ----
283 preset2.setEnabled(false);
284 contentPanel.add(preset2, new GridBagConstraints(6, 4, 1, 1, 0.0, 0.0,
285 GridBagConstraints.CENTER, GridBagConstraints.BOTH,
286 new Insets(0, 0, 5, 5), 0, 0));
287 //---- preset3 ----
288 preset3.setEnabled(false);
289 contentPanel.add(preset3, new GridBagConstraints(6, 5, 1, 1, 0.0, 0.0,
290 GridBagConstraints.CENTER, GridBagConstraints.BOTH,
291 new Insets(0, 0, 5, 5), 0, 0));
292
293 //---- preset4 ----
294 preset4.setEnabled(false);
295 contentPanel.add(preset4, new GridBagConstraints(6, 6, 1, 1, 0.0, 0.0,
296 GridBagConstraints.CENTER, GridBagConstraints.BOTH,
297 new Insets(0, 0, 5, 5), 0, 0));
298
299 //---- multiLabel ----
300 multiLabel.setText(tr("Multipolygon"));
301 contentPanel.add(multiLabel, new GridBagConstraints(0, 8, 3, 1, 0.0, 1.0,
302 GridBagConstraints.CENTER, GridBagConstraints.BOTH,
303 new Insets(0, 0, 5, 5), 0, 0));
304
305 //---- multiOuterButton ----
306 multiOuterButton.setText(tr("OUTER"));
307 multiOuterButton.setToolTipText(tr("Creation-Tool for multipolygon with role: outer. To finish press the spacebar."));
308 multiOuterButton.setEnabled(false);
309 contentPanel.add(multiOuterButton, new GridBagConstraints(3, 8, 3, 1, 0.0, 1.0,
310 GridBagConstraints.CENTER, GridBagConstraints.BOTH,
311 new Insets(0, 0, 5, 30), 0, 0));
312
313 //---- multiInnerButton ----
314 multiInnerButton.setText(tr("INNER"));
315 multiInnerButton.setToolTipText(
316 tr("Creation-Tool for multipolygons with role: inner. To finish press spacebar. To add to relation select \"outer\" and press enter."));
317 multiInnerButton.setEnabled(false);
318 contentPanel.add(multiInnerButton, new GridBagConstraints(6, 8, 1, 1, 0.0, 0.0,
319 GridBagConstraints.CENTER, GridBagConstraints.BOTH,
320 new Insets(0, 0, 5, 5), 0, 0));
321
322 //---- multiCheckBox ----
323 multiCheckBox.setToolTipText(tr("Deactivate multipolygon function."));
324 contentPanel.add(multiCheckBox, new GridBagConstraints(9, 8, 1, 1, 0.0, 1.0,
325 GridBagConstraints.CENTER, GridBagConstraints.BOTH,
326 new Insets(0, 0, 5, 5), 0, 0));
327
328 dialogPanel.add(contentPanel, BorderLayout.CENTER);
329
330 //======== buttonBar ========
331 buttonBar.setBorder(new EmptyBorder(12, 0, 0, 0));
332 buttonBar.setLayout(new GridBagLayout());
333 ((GridBagLayout) buttonBar.getLayout()).columnWidths = new int[] {0, 80};
334 ((GridBagLayout) buttonBar.getLayout()).columnWeights = new double[] {1.0, 0.0};
335
336 //---- applyButton ----
337 applyButton.setText(tr("Apply"));
338 applyButton.setToolTipText(tr("Add selected tags and/or relations to obeject."));
339 applyButton.setEnabled(false);
340 buttonBar.add(applyButton, new GridBagConstraints(0, 1, 2, 1, 0.0, 0.0,
341 GridBagConstraints.CENTER, GridBagConstraints.BOTH,
342 new Insets(0, 0, 0, 0), 0, 0));
343
344 dialogPanel.add(buttonBar, BorderLayout.SOUTH);
345
346 this.createLayout(dialogPanel, true, null);
347 }
348
349 /**
350 * Enables or disables the interactive UI elements of {@link #ToolBoxView}.
351 *
352 * @param enabled set this true for enabled elements
353 */
354 public void setAllUiElementsEnabled(boolean enabled) {
355 this.applyButton.setEnabled(enabled);
356 this.levelCheckBox.setEnabled(enabled);
357 this.helpButton.setEnabled(enabled);
358 this.objectBox.setEnabled(enabled);
359 this.levelNameField.setEnabled(enabled);
360 this.nameField.setEnabled(enabled);
361 this.refField.setEnabled(enabled);
362 this.levelNameField.setEnabled(enabled);
363 this.repeatOnField.setEnabled(enabled);
364 this.multiOuterButton.setEnabled(enabled);
365 this.multiInnerButton.setEnabled(enabled);
366 this.multiCheckBox.setEnabled(enabled);
367 this.helpButton.setEnabled(enabled);
368 this.addLevelButton.setEnabled(enabled);
369 this.preset1.setEnabled(enabled);
370 this.preset2.setEnabled(enabled);
371 this.preset3.setEnabled(enabled);
372 this.preset4.setEnabled(enabled);
373
374 if (enabled == false) {
375 resetUiElements();
376 }
377 }
378
379 /**
380 * Enables or disables the interactive text box elements {@link #nameField} and {@link #refField}.
381 *
382 * @param enabled set this true for enabled elements
383 */
384 public void setNRUiElementsEnabled(boolean enabled) {
385 this.nameField.setEnabled(enabled);
386 this.refField.setEnabled(enabled);
387
388 }
389
390 /**
391 * Enables or disables the interactive text box element {@link #repeatOnField}.
392 * @param enabled set this true for enabled elements
393 */
394 public void setROUiElementsEnabled(boolean enabled) {
395 this.repeatOnField.setEnabled(enabled);
396 }
397
398 /**
399 * Enables or disables the interactive text box element {@link #levelNameField} and {@link #addLevelButton}.
400 * @param enabled set this true for enabled elements
401 */
402 public void setLVLUiElementsEnabled(boolean enabled) {
403 this.levelNameField.setEnabled(enabled);
404 this.addLevelButton.setEnabled(enabled);
405
406 }
407
408 /**
409 * Enables or disables the interactive ComboBoxes {@link #multiOuterButton} and {@link #multiInnerButton}.
410 * @param enabled set this true for enabled elements
411 */
412 public void setMultiUiElementsEnabled(boolean enabled) {
413 this.multiOuterButton.setEnabled(enabled);
414 this.multiInnerButton.setEnabled(enabled);
415
416 if (enabled == false) resetUiElements();
417 }
418
419 /**
420 * Resets the view by making the UI elements disabled.
421 */
422 public void reset() {
423 this.setAllUiElementsEnabled(false);
424 }
425
426 /**
427 * Getter for the selected {@link IndoorObject} in the {@link #objectBox}.
428 *
429 * @return the selected indoor object in the object ComboBox.
430 */
431 public IndoorObject getSelectedObject() {
432 return (IndoorObject) this.objectBox.getSelectedItem();
433 }
434
435 /**
436 * Getter for the level name field.
437 *
438 * @return the {@link String} of the {@link #levelNameField}
439 */
440 public String getLevelNameText() {
441 return this.levelNameField.getText();
442 }
443
444 /**
445 * Setter for the {@link #levelNameField}.
446 *
447 * @param name the String for the {@link #levelNameField}
448 */
449 public void setLevelNameText(String name) {
450 this.levelNameField.setText(name);
451 }
452
453 /**
454 * Getter for the {@link #nameField}.
455 *
456 * @return String of the name text field
457 */
458 public String getNameText() {
459 return this.nameField.getText();
460 }
461
462 /**
463 * Setter for the current level value tag {@link #levelLabel}.
464 *
465 * @author rebsc
466 * @param levelTag level value as String
467 */
468 public void setLevelLabel(String levelTag) {
469 if (getLevelCheckBoxStatus() == false) {
470 if (!levelTag.equals("")) {
471 this.levelLabel.setText(tr("Working level: {0}", levelTag));
472 } else {
473 this.levelLabel.setText(tr("Working level: NONE"));
474 }
475 } else {
476 this.levelLabel.setText(tr("Working level: NONE"));
477 }
478 }
479
480 /**
481 * Getter for the {@link #levelCheckBox} status.
482 *
483 * @return boolean which tells if box is selected or not.
484 */
485 public boolean getLevelCheckBoxStatus() {
486 return this.levelCheckBox.isSelected();
487 }
488
489 /**
490 * Getter for the {@link #refField}.
491 *
492 * @return String of the ref text field
493 */
494 public String getRefText() {
495 return this.refField.getText();
496 }
497
498 /**
499 * Getter for the repeat on TextField.
500 * @return String of the repeat on text field
501 */
502 public String getRepeatOnText() {
503 return this.repeatOnField.getText();
504 }
505
506
507 /**
508 * Clears the text boxes and sets an empty String.
509 */
510 public void resetUiElements() {
511 this.nameField.setText("");
512 this.levelNameField.setText("");
513 this.refField.setText("");
514 this.repeatOnField.setText("");
515 this.levelNameField.setText("");
516 }
517
518 /**
519 * Set the listener for the {@link #applyButton}.
520 *
521 * @param l the listener to set
522 */
523 public void setApplyButtonListener(ActionListener l) {
524 this.applyButton.addActionListener(l);
525 }
526
527 /**
528 * Set the listener for {@link #levelCheckBox}.
529 * @param l the listener to set
530 */
531 public void setLevelCheckBoxListener(ItemListener l) {
532 this.levelCheckBox.addItemListener(l);
533 }
534
535 /**
536 * Set the listener for {@link #helpButton}.
537 * @param l the listener to set
538 */
539 public void setHelpButtonListener(ActionListener l) {
540 this.helpButton.addActionListener(l);
541 }
542
543 /**
544 * Set the listener for {@link #addLevelButton}.
545 * @param l the listener to set
546 */
547 public void setAddLevelButtonListener(ActionListener l) {
548 this.addLevelButton.addActionListener(l);
549 }
550
551
552 /**
553 * Set the listener for {@link #objectBox}.
554 *
555 * @param l the listener to set
556 */
557 public void setObjectItemListener(ItemListener l) {
558 this.objectBox.addItemListener(l);
559 }
560
561 /**
562 * Set the listener for the {@link #multiOuterButton}.
563 *
564 * @param l the listener to set
565 */
566 public void setOuterButtonListener(ActionListener l) {
567 this.multiOuterButton.addActionListener(l);
568 }
569
570 /**
571 * Set the listener for the {@link #multiInnerButton}.
572 *
573 * @param l the listener to set
574 */
575 public void setInnerButtonListener(ActionListener l) {
576 this.multiInnerButton.addActionListener(l);
577 }
578
579 /**
580 * Set the listener for the {@link #multiCheckBox}.
581 *
582 * @param l the listener to set
583 */
584 public void setMultiCheckBoxListener(ItemListener l) {
585 this.multiCheckBox.addItemListener(l);
586 }
587
588 public void setPresetButtons(List<IndoorObject> objects) {
589 this.preset1.setIndoorObject(objects.get(0));
590 this.preset2.setIndoorObject(objects.get(1));
591 this.preset3.setIndoorObject(objects.get(2));
592 this.preset4.setIndoorObject(objects.get(3));
593 }
594
595 public void setPreset1Listener(ActionListener l) {
596 this.preset1.addActionListener(l);
597 }
598
599 public void setPreset2Listener(ActionListener l) {
600 this.preset2.addActionListener(l);
601 }
602
603 public void setPreset3Listener(ActionListener l) {
604 this.preset3.addActionListener(l);
605 }
606
607 public void setPreset4Listener(ActionListener l) {
608 this.preset4.addActionListener(l);
609 }
610
611 public IndoorObject getPreset1() {
612 return preset1.getIndoorObject();
613 }
614
615 public IndoorObject getPreset2() {
616 return preset2.getIndoorObject();
617 }
618
619 public IndoorObject getPreset3() {
620 return preset3.getIndoorObject();
621 }
622
623 public IndoorObject getPreset4() {
624 return preset4.getIndoorObject();
625 }
626}
Note: See TracBrowser for help on using the repository browser.