Changeset 12831 in josm for trunk/src/org
- Timestamp:
- 2017-09-12T19:35:55+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 3 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/MapPaintDialog.java
r12651 r12831 68 68 import org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSStyleSource; 69 69 import org.openstreetmap.josm.gui.preferences.map.MapPaintPreference; 70 import org.openstreetmap.josm.gui.mappaint.StyleSettingGuiFactory; 70 71 import org.openstreetmap.josm.gui.util.FileFilterAllFiles; 71 72 import org.openstreetmap.josm.gui.util.GuiHelper; … … 700 701 } else { 701 702 for (StyleSetting s : style.settings) { 702 s.addMenuEntry(setMenu);703 StyleSettingGuiFactory.getStyleSettingGui(s).addMenuEntry(setMenu); 703 704 } 704 705 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/StyleSetting.java
r12651 r12831 2 2 package org.openstreetmap.josm.gui.mappaint; 3 3 4 import java.awt.event.ActionEvent;5 import java.util.Arrays;6 7 import javax.swing.AbstractAction;8 import javax.swing.Action;9 import javax.swing.JCheckBoxMenuItem;10 import javax.swing.JMenu;11 12 4 import org.openstreetmap.josm.Main; 13 import org.openstreetmap.josm.gui.MainApplication;14 import org.openstreetmap.josm.gui.mappaint.loader.MapPaintStyleLoader;15 5 import org.openstreetmap.josm.tools.Logging; 16 6 … … 38 28 39 29 /** 40 * Adds the menu entry for this style setting to the menu41 * @param menu The menu to add the setting to42 */43 void addMenuEntry(JMenu menu);44 45 /**46 30 * gets the value for this setting 47 31 * @return The value the user selected … … 63 47 this.label = label; 64 48 this.def = def; 65 }66 67 @Override68 public void addMenuEntry(JMenu menu) {69 final JCheckBoxMenuItem item = new JCheckBoxMenuItem();70 Action a = new AbstractAction(label) {71 @Override72 public void actionPerformed(ActionEvent e) {73 setValue(item.isSelected());74 MainApplication.worker.submit(new MapPaintStyleLoader(Arrays.asList(parentStyle)));75 }76 };77 item.setAction(a);78 item.setSelected((boolean) getValue());79 menu.add(item);80 49 } 81 50
Note:
See TracChangeset
for help on using the changeset viewer.