Package de.latlon.deejump.plugin.style
Class LayerStyle2SLDPlugIn
- java.lang.Object
-
- com.vividsolutions.jump.workbench.plugin.AbstractPlugIn
-
- de.latlon.deejump.plugin.style.LayerStyle2SLDPlugIn
-
- All Implemented Interfaces:
EnableChecked,Iconified,PlugIn,Recordable,ShortcutEnabled
public class LayerStyle2SLDPlugIn extends AbstractPlugIn
...- Author:
- Ugo Taddei
-
-
Field Summary
Fields Modifier and Type Field Description static ImageIconICONprotected static TransformertransformerTheTransformerobject used in the transformation of a task/project/layer xml to sld.-
Fields inherited from class com.vividsolutions.jump.workbench.plugin.AbstractPlugIn
shortcutKeys, shortcutModifiers
-
-
Constructor Summary
Constructors Constructor Description LayerStyle2SLDPlugIn()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description EnableCheckcreateEnableCheck(WorkbenchContext workbenchContext)booleanexecute(PlugInContext context)Execute the PlugIn.IcongetIcon()Plugin icon assumed to be 16x16 by defaultStringgetName()Returns a very brief description of this PlugIn e.g.voidinitialize(PlugInContext context)Called when Workbench starts up to allow plugins to initialize themselves.voidinstall(PlugInContext context)Use this method to install the LayerStyle2SLD plugin in the toolbarstatic doubletoRealWorldScale(double scaleFactor, double jumpScale)static StringtransformContext(InputStream layerXML, Map<String,String> parameters)static StringtransformContext(Reader layerXML, Map<String,String> parameters)-
Methods inherited from class com.vividsolutions.jump.workbench.plugin.AbstractPlugIn
addParameter, createName, execute, execute, getBooleanParam, getContext, getDoubleParam, getEnableCheck, getIcon, getIcon, getIntegerParam, getParameter, getParameters, getShortcutKeys, getShortcutKeyStroke, getShortcutModifiers, getStringParam, getWorkbenchContext, isRollingBackInvalidEdits, isShortcutEnabled, reportNothingToUndoYet, setParameters, setShortcutKeys, setShortcutModifiers, toActionListener, toString
-
-
-
-
Field Detail
-
ICON
public static final ImageIcon ICON
-
transformer
protected static Transformer transformer
TheTransformerobject used in the transformation of a task/project/layer xml to sld.
-
-
Method Detail
-
getName
public String getName()
Description copied from interface:PlugInReturns a very brief description of this PlugIn e.g. for display as a menu item- Specified by:
getNamein interfacePlugIn- Overrides:
getNamein classAbstractPlugIn- Returns:
- the class name, minus "PlugIn", with spaces inserted at the appropriate point before each uppercase+lowercase and lowercase+uppercase combination.
-
install
public void install(PlugInContext context) throws Exception
Use this method to install the LayerStyle2SLD plugin in the toolbar- Parameters:
context- PlugInContext- Throws:
Exception- if an Exception occurs
-
initialize
public void initialize(PlugInContext context) throws Exception
Description copied from interface:PlugInCalled when Workbench starts up to allow plugins to initialize themselves.- Specified by:
initializein interfacePlugIn- Overrides:
initializein classAbstractPlugIn- Parameters:
context- context of the PlugIn- Throws:
Exception- if an exception occur during initialization
-
execute
public boolean execute(PlugInContext context) throws Exception
Description copied from class:AbstractPlugInExecute the PlugIn.- Specified by:
executein interfacePlugIn- Overrides:
executein classAbstractPlugIn- Parameters:
context- context of this PlugIn- Returns:
- true if the PlugIn has been executed
- Throws:
Exception- if an Exception occurs during execution- See Also:
ThreadedPlugIn
-
getIcon
public Icon getIcon()
Description copied from class:AbstractPlugInPlugin icon assumed to be 16x16 by default- Specified by:
getIconin interfaceIconified- Overrides:
getIconin classAbstractPlugIn- Returns:
- the icon
-
transformContext
public static String transformContext(InputStream layerXML, Map<String,String> parameters) throws TransformerException
- Parameters:
layerXML- xml InputStream defining the symbolizationparameters- Map of parameters for XML transformation- Returns:
- the transformed XML (?)
- Throws:
TransformerException- if an Exception occurs during XML transformation
-
transformContext
public static String transformContext(Reader layerXML, Map<String,String> parameters) throws TransformerException
- Parameters:
layerXML- Reader reading symbology definition in XMLparameters- a Map of parameters- Returns:
- the transformed XML (?)
- Throws:
TransformerException- if an Exception occurs during XML transformation
-
createEnableCheck
public EnableCheck createEnableCheck(WorkbenchContext workbenchContext)
- Parameters:
workbenchContext- the WorkbenchContext- Returns:
- the EnableCheck object to enable/disable the PlugIn
-
toRealWorldScale
public static double toRealWorldScale(double scaleFactor, double jumpScale)- Parameters:
scaleFactor- scale factor between internalScale (screen pixels to model units) and realScale (image and model in homogeneous coordinates)jumpScale- map scale as defined in the min/max scale style interface- Returns:
- the scale TODO seems that we do a lot of redundant work to compute this scale
-
-