Changeset 29344 in osm for applications/editors/josm/plugins/reltoolbox/src
- Timestamp:
- 2013-03-06T21:44:56+01:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/reltoolbox/src/relcontext/actions/AddRemoveMemberAction.java
r28693 r29344 18 18 import org.openstreetmap.josm.data.osm.RelationMember; 19 19 import org.openstreetmap.josm.data.osm.Way; 20 import org.openstreetmap.josm.gui.util.GuiHelper; 20 21 import org.openstreetmap.josm.tools.ImageProvider; 21 22 import org.openstreetmap.josm.tools.Shortcut; … … 127 128 protected void updateIcon() { 128 129 // todo: change icon based on selection 129 int state = 0; // 0=unknown, 1=add, 2=remove, 3=both130 final int state; // 0=unknown, 1=add, 2=remove, 3=both 130 131 if( getCurrentDataSet() == null || getCurrentDataSet().getSelected() == null 131 132 || getCurrentDataSet().getSelected().isEmpty() || rel == null || rel.get() == null ) … … 147 148 } 148 149 } 150 GuiHelper.runInEDT(new Runnable() { 151 @Override 152 public void run() { 149 153 // String name = state == 0 ? "?" : state == 1 ? "+" : state == 2 ? "-" : "±"; 150 154 // putValue(Action.NAME, name); 151 if( state == 0) {155 if (state == 0) { 152 156 // putValue(NAME, "?"); 153 putValue(SMALL_ICON, ImageProvider.get("relcontext", "addremove")); 154 } else { 155 String iconName = state == 1 ? "add" : state == 2 ? "remove" : "addremove"; 156 putValue(NAME, null); 157 putValue(SMALL_ICON, ImageProvider.get("relcontext", iconName)); 158 } 157 putValue(SMALL_ICON, ImageProvider.get("relcontext", "addremove")); 158 } else { 159 String iconName = state == 1 ? "add" : state == 2 ? "remove" : "addremove"; 160 putValue(NAME, null); 161 putValue(SMALL_ICON, ImageProvider.get("relcontext", iconName)); 162 } 163 } 164 }); 159 165 } 160 166 }
Note:
See TracChangeset
for help on using the changeset viewer.