org.geotools.swt.styling
Class SimpleStyleConfigurator

Object
  extended by Window
      extended by Dialog
          extended by AbstractSimpleConfigurator
              extended by 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:

Notes:

We will do our best to make this thing reusable on an Array of Symbolizers.

Since:
1.0.0
Author:
Jody Garnett

Nested Class Summary
 
Nested classes/interfaces inherited from class Window
Window.IExceptionHandler
 
Field Summary
static StyleFactory sf
           
 
Fields inherited from class AbstractSimpleConfigurator
build, featureCollection, style
 
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
 
Constructor Summary
SimpleStyleConfigurator(Shell parent, SimpleFeatureCollection featureCollection, Style style)
          Construct SimpleStyleConfigurator.
 
Method Summary
protected  void buttonPressed(int buttonId)
           
protected  void configureShell(Shell shell)
           
protected  Control createDialogArea(Composite parent)
           
 Mode determineMode(SimpleFeatureType schema, boolean askUser)
           
protected  Point getInitialSize()
           
protected  void refresh()
           
static Style showDialog(Shell parent, Layer layer)
           
static Style showDialog(Shell parent, SimpleFeatureSource featureSource, Style style)
           
static String styleToString(Style style)
          Converts a style to its string representation to be written to file.
 void synchronize()
          Synchronize the SLD with the array of symbolizers
 
Methods inherited from class AbstractSimpleConfigurator
getStyle, selectionEvent, setLayout, subpart
 
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
 

Field Detail

sf

public static StyleFactory sf
Constructor Detail

SimpleStyleConfigurator

public SimpleStyleConfigurator(Shell parent,
                               SimpleFeatureCollection featureCollection,
                               Style style)
Construct SimpleStyleConfigurator.

Method Detail

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.