nl.cloudfarming.client.geoviewer.jxmap.MapProperties Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of geoviewer-jxmap Show documentation
Show all versions of geoviewer-jxmap Show documentation
AgroSense geoviewer JXMap implementation. Contains a map/geoviewer TopComponent based on the JXMap classes from swingx.
The newest version!
/**
* Copyright (C) 2008-2012 AgroSense Foundation.
*
* AgroSense is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* There are special exceptions to the terms and conditions of the GPLv3 as it is applied to
* this software, see the FLOSS License Exception
* .
*
* AgroSense is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with AgroSense. If not, see .
*/
package nl.cloudfarming.client.geoviewer.jxmap;
import org.openide.util.Lookup;
import org.openide.util.lookup.ServiceProvider;
/**
* Class which describes which properties can be set for the Map
the
* different properties which can be set are: Layer list in expanded
* collapsed Widget actions enabled disabled default layer list node
* actions enabled disabled
*
* Register your implementation of this class as Service provider of this class via @ServiceProvider(service=MapProperties.class)
*
*
* @author Merijn Zengers
*/
public abstract class MapProperties {
private static MapProperties implementation = Lookup.getDefault().lookup(MapProperties.class);
/**
* Tries to find the property which determines if the layer list should be
* expanded or collapsed if no property is set will return false
*
* @return
*/
public static boolean getLayerListExpandedValue() {
if (implementation != null) {
return implementation.isLayerListExpanded();
}
return false;
}
/**
* Tries to find out if the Layer node remove action should be enabled by
* looking for {@link ServiceProvider} implementations of this class if no
* implementation is found returns default true
*
* @return
*/
public static boolean getLayerNodeRemoveActionEnabledValue() {
if (implementation != null) {
return implementation.isLayerNodeRemoveActionEnabled();
}
return true;
}
/**
* Tries to find out if the Layer node settings action should be enabled by
* looking for {@link ServiceProvider} implementations of this class if no
* implementation is found returns default true
*
* @return
*/
public static boolean getLayerNodeSettingsActionEnabledValue() {
if (implementation != null) {
return implementation.isLayerNodeSettingsActionEnabled();
}
return true;
}
/**
* Tries to find out if the Layer node visibility action should be enabled by
* looking for {@link ServiceProvider} implementations of this class if no
* implementation is found returns default true
*
* @return
*/
public static boolean getLayerNodevisibilityActionEnabledValue() {
if (implementation != null) {
return implementation.isLayerNodeVisibilityActionEnabled();
}
return true;
}
/**
* Tries to find out if the actions on the widgets should be enabled by looking for {@link ServiceProvider} implementations of this class if no
* implementation is found returns default true
* @return
*/
public static boolean getWidgetStateActionsEnabledValue(){
if (implementation != null) {
return implementation.widgetStateActionsEnabled();
}
return true;
}
/**
* Tries to find out if the actions available on the node should be available on the widgets by looking for {@link ServiceProvider} implementations of this class if no
* implementation is found returns default true
* @return
*/
public static boolean getNodeActionsAvailableOnWidgetValue(){
if (implementation != null) {
return implementation.nodeActionsAvailableOnWidget();
}
return true;
}
/**
* Should the layer list be expanded
* @return
*/
public abstract boolean isLayerListExpanded();
/**
* Should the remove action on the layer node in the layer list be enabled
* @return
*/
public abstract boolean isLayerNodeRemoveActionEnabled();
/**
* Should the settings action on the layer node in the layer list be enabled
* @return
*/
public abstract boolean isLayerNodeSettingsActionEnabled();
/**
* Should the visibility action on the layer node in the layer list be enabled
* @return
*/
public abstract boolean isLayerNodeVisibilityActionEnabled();
/**
* Should the widget select, hover an object hover actions on a widget be enabled
* @return
*/
public abstract boolean widgetStateActionsEnabled();
/**
* Should the actions available on the node from which the widget is created be available on the widget itself
* @return
*/
public abstract boolean nodeActionsAvailableOnWidget();
}