Line | |
---|
1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.gui.mappaint;
|
---|
3 |
|
---|
4 | import org.openstreetmap.josm.gui.mappaint.StyleSetting.BooleanStyleSetting;
|
---|
5 |
|
---|
6 | /**
|
---|
7 | * Factory to create matching {@link StyleSettingGui} instances for given
|
---|
8 | * {@link StyleSetting} objects.
|
---|
9 | * @since 12831
|
---|
10 | */
|
---|
11 | public final class StyleSettingGuiFactory {
|
---|
12 |
|
---|
13 | private StyleSettingGuiFactory() {
|
---|
14 | // hide constructor
|
---|
15 | }
|
---|
16 |
|
---|
17 | /**
|
---|
18 | * Create a matching {@link StyleSettingGui} instances for a given
|
---|
19 | * {@link StyleSetting} object.
|
---|
20 | * @param setting the {@code StyleSetting} object
|
---|
21 | * @return matching {@code StyleSettingGui}
|
---|
22 | * @throws UnsupportedOperationException when class of {@link StyleSetting}
|
---|
23 | * is not supported
|
---|
24 | */
|
---|
25 | public static StyleSettingGui getStyleSettingGui(StyleSetting setting) {
|
---|
26 | if (setting instanceof BooleanStyleSetting) {
|
---|
27 | return new BooleanStyleSettingGui((BooleanStyleSetting) setting);
|
---|
28 | }
|
---|
29 | throw new UnsupportedOperationException("class " + setting.getClass() + " not supported");
|
---|
30 | }
|
---|
31 |
|
---|
32 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.