source: josm/trunk/src/org/openstreetmap/josm/gui/mappaint/StyleSettingGuiFactory.java@ 13691

Last change on this file since 13691 was 12832, checked in by bastiK, 7 years ago

see #15229 - fix checkstyle warning

File size: 1.1 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.gui.mappaint;
3
4import 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 */
11public 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.