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 | */
|
---|
19 |
|
---|
20 | package views;
|
---|
21 |
|
---|
22 | import javax.swing.JButton;
|
---|
23 |
|
---|
24 | import model.TagCatalog.IndoorObject;
|
---|
25 |
|
---|
26 | /**
|
---|
27 | * Button with a specific IndoorObject attached to it.
|
---|
28 | * @author egru
|
---|
29 | *
|
---|
30 | */
|
---|
31 | @SuppressWarnings("serial")
|
---|
32 | class PresetButton extends JButton {
|
---|
33 |
|
---|
34 | private IndoorObject indoorObject;
|
---|
35 |
|
---|
36 | PresetButton(IndoorObject object) {
|
---|
37 | this.setIndoorObject(object);
|
---|
38 | }
|
---|
39 |
|
---|
40 | public IndoorObject getIndoorObject() {
|
---|
41 | return this.indoorObject;
|
---|
42 | }
|
---|
43 |
|
---|
44 | public void setIndoorObject(IndoorObject object) {
|
---|
45 | this.indoorObject = object;
|
---|
46 | this.setText(indoorObject.toString());
|
---|
47 | this.setToolTipText("Fast Tag: "+indoorObject.toString());
|
---|
48 | }
|
---|
49 | }
|
---|