Skip to content

Commit eafffa3

Browse files
committed
disabled select on legend when mode not available
1 parent 4b612af commit eafffa3

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

com.opendoorlogistics.studio/src/com/opendoorlogistics/studio/components/map/plugins/LegendPlugin.java

+7
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
import com.opendoorlogistics.core.utils.strings.Strings;
4141
import com.opendoorlogistics.core.utils.ui.SwingUtils;
4242
import com.opendoorlogistics.studio.components.map.FindDrawableTables;
43+
import com.opendoorlogistics.studio.components.map.plugins.selection.SelectPlugin;
4344
import com.opendoorlogistics.studio.components.map.plugins.utils.PluginUtils;
4445
import com.opendoorlogistics.studio.components.map.plugins.utils.PluginUtils.ActionFactory;
4546
import com.opendoorlogistics.studio.controls.checkboxtable.CheckBoxItem;
@@ -233,6 +234,12 @@ void parseItem(ODLTableReadOnly table, int row) {
233234
api.setViewToBestFit(copy);
234235
}
235236
else if(buttonColumn == 1){
237+
ODLTableReadOnly drawables = api.getMapDataApi().getUnfilteredActiveTable();
238+
if(drawables==null || ( (drawables.getFlags() & SelectPlugin.NEEDS_FLAGS)!=SelectPlugin.NEEDS_FLAGS)){
239+
// check we can select things
240+
return;
241+
}
242+
236243
// select the items
237244
final TLongHashSet ids = new TLongHashSet();
238245
new ParseLegendItems() {

com.opendoorlogistics.studio/src/com/opendoorlogistics/studio/components/map/plugins/selection/SelectPlugin.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
import com.opendoorlogistics.utils.ui.Icons;
4848

4949
public class SelectPlugin implements MapPlugin {
50-
private final static long NEEDS_FLAGS = TableFlags.UI_SET_ALLOWED;
50+
public final static long NEEDS_FLAGS = TableFlags.UI_SET_ALLOWED;
5151
private static final ImageIcon SELECTION_TOOLS_ICON = Icons.loadFromStandardPath("select-options.png");
5252
private static final ImageIcon SHOW_ALL_ICON = Icons.loadFromStandardPath("show-all-objects.png");
5353
private static final ImageIcon SHOW_SEL_ONLY = Icons.loadFromStandardPath("show-selected-objects-only.png");

com.opendoorlogistics.studio/src/resources/About.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<P STYLE="margin-bottom: 0cm"><B>Open Door Logistics Studio, version VERSION_NUMBER (Java JAVA_VERSION)</B></P>
55
<P STYLE="margin-bottom: 0cm">See <A HREF="http://www.opendoorlogistics.com/">www.opendoorlogistics.com</A>
66
for help and support. Consultancy, software development, support and training services are available.</P>
7-
<P STYLE="margin-bottom: 0cm">Copyright (c) 2014 Open Door Logistics.</P>
7+
<P STYLE="margin-bottom: 0cm">Copyright (c) 2015 Open Door Logistics.</P>
88
<P STYLE="margin-bottom: 0cm">All rights reserved. This program and
99
the accompanying materials are made available under the terms of the
1010
GNU Lesser Public License v3 which accompanies this distribution,

0 commit comments

Comments
 (0)