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

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

see #15229 - extract GUI from StyleSetting class

File size: 998 bytes
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 class StyleSettingGuiFactory {
12
13 /**
14 * Create a matching {@link StyleSettingGui} instances for a given
15 * {@link StyleSetting} object.
16 * @param setting the {@code StyleSetting} object
17 * @return matching {@code StyleSettingGui}
18 * @throws UnsupportedOperationException when class of {@link StyleSetting}
19 * is not supported
20 */
21 public static StyleSettingGui getStyleSettingGui(StyleSetting setting) {
22 if (setting instanceof BooleanStyleSetting) {
23 return new BooleanStyleSettingGui((BooleanStyleSetting) setting);
24 }
25 throw new UnsupportedOperationException("class " + setting.getClass() + " not supported");
26 }
27
28}
Note: See TracBrowser for help on using the repository browser.