org.geotools.swt.styling
Class SimpleStyleConfigurator
Object
Window
Dialog
AbstractSimpleConfigurator
SimpleStyleConfigurator
- All Implemented Interfaces:
- IShellProvider
public class SimpleStyleConfigurator
- extends AbstractSimpleConfigurator
Defines a "simple" StyleConfigurator for working with SLD documents.
This style configurator is defined as follows:
<code>
Mode: (*) Point ( ) Line ( ) Polygon
+-+ +-------+ +------+ +------+
Line: |x| | color | |size\/| |100%\/|
+-+ +-------+ +------+ +------+
+-+ +-------+ +------+
Fill: |x| | color | | 90%\/|
+-+ +-------+ +------+
+-+ +----------------+ +------+
Label: |x| | title\/| | Font |
+-+ +----------------+ +------+
+-+ +-------+ +------+
Point: |x| | star\/| |size\/|
+-+ +-------+ +------+
+-+ +-------------+
Min scale d.: |x| | scale\/|
+-+ +-------------+
+-+ +-------------+
Max scale d.: |x| | scale\/|
+-+ +-------------+
</code>
Where:
- Mode is used to switch between Point / Line / Polygon
- Line is used for:
LineString: line color, width, opacity
Polygon: border color, width, opacity
Point: border color, width, opacity
- Fill is used for Polygon or Point fill color, opacity
- Label is used to choose attribute and set font (the only dialog)
- Point is used to set the marker type and size
- Min/max scale denominator define at which scale the layer is visible
Notes:
- RasterSymbolizer is handled by its own thing, as is WMS etc...
- Layout as per the SLDEditorPart examples - so we can take advantage of more or less room.
- Presets is a good idea, just not here
- Apply/Revert buttons to be green/red
- Advanced (edit the SLD) can be in the view menu
- If possible replace color button with a drop down list (may not be possible)
We will do our best to make this thing reusable on an Array of Symbolizers.
- Since:
- 1.0.0
- Author:
- Jody Garnett
Nested classes/interfaces inherited from class Window |
Window.IExceptionHandler |
Fields inherited from class Dialog |
blockedHandler, buttonBar, DIALOG_DEFAULT_BOUNDS, DIALOG_PERSISTLOCATION, DIALOG_PERSISTSIZE, dialogArea, DLG_IMG_ERROR, DLG_IMG_HELP, DLG_IMG_INFO, DLG_IMG_MESSAGE_ERROR, DLG_IMG_MESSAGE_INFO, DLG_IMG_MESSAGE_WARNING, DLG_IMG_QUESTION, DLG_IMG_WARNING, ELLIPSIS |
Fields inherited from class Window |
CANCEL, OK |
Methods inherited from class Dialog |
applyDialogFont, cancelPressed, close, convertHeightInCharsToPixels, convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, convertWidthInCharsToPixels, create, createButton, createButtonBar, createButtonsForButtonBar, createContents, dialogFontIsDefault, getBlockedHandler, getButton, getButtonBar, getCancelButton, getDialogArea, getDialogBoundsSettings, getDialogBoundsStrategy, getImage, getInitialLocation, getOKButton, initializeBounds, initializeDialogUnits, isResizable, okPressed, setBlockedHandler, setButtonLayoutData, setButtonLayoutFormData, shortenText |
Methods inherited from class Window |
canHandleShellCloseEvent, constrainShellSize, createShell, getConstrainedShellBounds, getContents, getDefaultImage, getDefaultImages, getDefaultOrientation, getLayout, getParentShell, getReturnCode, getShell, getShellListener, getShellStyle, getWindowManager, handleFontChange, handleShellCloseEvent, open, setBlockOnOpen, setDefaultImage, setDefaultImages, setDefaultModalParent, setDefaultOrientation, setExceptionHandler, setParentShell, setReturnCode, setShellStyle, setWindowManager |
Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
sf
public static StyleFactory sf
SimpleStyleConfigurator
public SimpleStyleConfigurator(Shell parent,
SimpleFeatureCollection featureCollection,
Style style)
- Construct
SimpleStyleConfigurator
.
configureShell
protected void configureShell(Shell shell)
- Overrides:
configureShell
in class Window
getInitialSize
protected Point getInitialSize()
- Overrides:
getInitialSize
in class Dialog
createDialogArea
protected Control createDialogArea(Composite parent)
- Overrides:
createDialogArea
in class Dialog
buttonPressed
protected void buttonPressed(int buttonId)
- Overrides:
buttonPressed
in class Dialog
styleToString
public static String styleToString(Style style)
throws Exception
- Converts a style to its string representation to be written to file.
- Parameters:
style
- the style to convert.
- Returns:
- the style string.
- Throws:
Exception
determineMode
public Mode determineMode(SimpleFeatureType schema,
boolean askUser)
refresh
protected void refresh()
synchronize
public void synchronize()
- Synchronize the SLD with the array of symbolizers
showDialog
public static Style showDialog(Shell parent,
Layer layer)
throws IOException
- Throws:
IOException
showDialog
public static Style showDialog(Shell parent,
SimpleFeatureSource featureSource,
Style style)
throws IOException
- Throws:
IOException
Copyright © 1996-2014 Geotools. All Rights Reserved.