1 | package Views;
|
---|
2 |
|
---|
3 | import static org.openstreetmap.josm.tools.I18n.tr;
|
---|
4 |
|
---|
5 |
|
---|
6 | import java.awt.BorderLayout;
|
---|
7 | import java.awt.event.ActionEvent;
|
---|
8 | import java.awt.event.ActionListener;
|
---|
9 | import javax.swing.JPanel;
|
---|
10 | import javax.swing.JToggleButton;
|
---|
11 |
|
---|
12 | import org.openstreetmap.josm.gui.dialogs.ToggleDialog;
|
---|
13 |
|
---|
14 |
|
---|
15 | /**
|
---|
16 | *
|
---|
17 | * The toolbox view for the UI of the indoor mapping helper.
|
---|
18 | *
|
---|
19 | *
|
---|
20 | * @author egru
|
---|
21 | *
|
---|
22 | */
|
---|
23 |
|
---|
24 | @SuppressWarnings("serial")
|
---|
25 | public class ToolboxViewOLD extends ToggleDialog{
|
---|
26 |
|
---|
27 | /**
|
---|
28 | *
|
---|
29 | */
|
---|
30 | private JPanel toolboxPanel; // JPanel for the toolbox
|
---|
31 | private JToggleButton activatorButton; // button to activate/deactivate the toolbox
|
---|
32 |
|
---|
33 |
|
---|
34 | /**
|
---|
35 | * Constructor for the indoor helper toolbox
|
---|
36 | */
|
---|
37 | public ToolboxViewOLD() {
|
---|
38 | super(tr("Indoor Mapping Helper"), "indoorhelper", "Toolbox for indoor mapping assistance", null, 150, true);
|
---|
39 |
|
---|
40 | toolboxPanel = new JPanel(new BorderLayout());
|
---|
41 | activatorButton = new JToggleButton("OFF");
|
---|
42 |
|
---|
43 | activatorButton.addActionListener(new ActionListener() {
|
---|
44 |
|
---|
45 | // Handles the click events on the ON/OFF Button of the event
|
---|
46 |
|
---|
47 |
|
---|
48 | @Override
|
---|
49 | public void actionPerformed(ActionEvent e) {
|
---|
50 | if (activatorButton.getText().equals("OFF")){
|
---|
51 | activatorButton.setText("ON");
|
---|
52 |
|
---|
53 | LevelSelectorView levSel = new LevelSelectorView();
|
---|
54 | levSel.createFrame();
|
---|
55 |
|
---|
56 | } else if (activatorButton.getText().equals("ON")){
|
---|
57 | activatorButton.setText("OFF");
|
---|
58 | }
|
---|
59 |
|
---|
60 |
|
---|
61 | }
|
---|
62 | });
|
---|
63 | toolboxPanel.add(activatorButton, java.awt.BorderLayout.NORTH);
|
---|
64 |
|
---|
65 | this.createLayout(toolboxPanel, false, null);
|
---|
66 | }
|
---|
67 | }
|
---|