Humboldt Alignment Editor 2.5.0

eu.esdihumboldt.hale.ui.style.service.internal
Class StyleServiceImpl

java.lang.Object
  extended by eu.esdihumboldt.hale.ui.style.service.internal.AbstractStyleService
      extended by eu.esdihumboldt.hale.ui.style.service.internal.StyleServiceImpl
All Implemented Interfaces:
StyleService

public class StyleServiceImpl
extends AbstractStyleService

A default StyleService implementation that will provide simple styles for Lines, Points and Polygons if none have been loaded from an SLD.

Author:
Thorsten Reitz, Simon Templer
Partner:
01 / Fraunhofer Institute for Computer Graphics Research

Constructor Summary
StyleServiceImpl(ProjectService projectService, SchemaService schemaService)
          Create a style service.
 
Method Summary
 void addStyles(org.geotools.styling.Style... styles)
          Add styles to the style service.
 boolean addStyles(URL url)
          Add styles from a given URL.
 void clearStyles()
          Clear all styles
 org.eclipse.swt.graphics.RGB getBackground()
          Get the map background.
 org.geotools.styling.Style getDefinedStyle(TypeDefinition type)
          Get the defined style for the given type.
 org.geotools.styling.Style getNamedStyle(String name)
           
 org.geotools.styling.Style getSelectionStyle(DataSet type)
          Get a style combining all selection styles for the given data set.
 org.geotools.styling.Style getStyle()
          Get a style combining all registered styles.
 org.geotools.styling.Style getStyle(DataSet dataset)
          Get a style combining all styles for the given data set.
 org.geotools.styling.Style getStyle(TypeDefinition type, DataSet dataSet)
          This implementation will build a simple style if none is defined previously.
 void setBackground(org.eclipse.swt.graphics.RGB color)
          Set the map background.
 
Methods inherited from class eu.esdihumboldt.hale.ui.style.service.internal.AbstractStyleService
addListener, notifyBackgroundChanged, notifySettingsChanged, notifyStylesAdded, notifyStylesRemoved, removeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StyleServiceImpl

public StyleServiceImpl(ProjectService projectService,
                        SchemaService schemaService)
Create a style service.

Parameters:
projectService - the project service
schemaService - the schema service
Method Detail

getNamedStyle

public org.geotools.styling.Style getNamedStyle(String name)
Parameters:
name - the String that identifies the Style that should be returned.
Returns:
a Style for the given name. Will return a new Style object if there is no Style of the given name.
See Also:
StyleService.getNamedStyle(String)

getStyle

public org.geotools.styling.Style getStyle(TypeDefinition type,
                                           DataSet dataSet)
This implementation will build a simple style if none is defined previously.

Parameters:
type - the type definition
dataSet - the type data set
Returns:
a Style for the given type.
See Also:
StyleService.getStyle(TypeDefinition, DataSet)

getDefinedStyle

public org.geotools.styling.Style getDefinedStyle(TypeDefinition type)
Description copied from interface: StyleService
Get the defined style for the given type. If none is defined, null will be returned.

Parameters:
type - the type definition
Returns:
the type style or null
See Also:
StyleService.getDefinedStyle(TypeDefinition)

getStyle

public org.geotools.styling.Style getStyle()
Description copied from interface: StyleService
Get a style combining all registered styles.

Returns:
the style
See Also:
StyleService.getStyle()

getStyle

public org.geotools.styling.Style getStyle(DataSet dataset)
Description copied from interface: StyleService
Get a style combining all styles for the given data set.

Parameters:
dataset - the data set
Returns:
the style
See Also:
StyleService.getStyle(DataSet)

getSelectionStyle

public org.geotools.styling.Style getSelectionStyle(DataSet type)
Description copied from interface: StyleService
Get a style combining all selection styles for the given data set.

Parameters:
type - the data set
Returns:
the style
See Also:
StyleService.getSelectionStyle(DataSet)

addStyles

public void addStyles(org.geotools.styling.Style... styles)
Description copied from interface: StyleService
Add styles to the style service. Will override any styles that exist for the same types.

Parameters:
styles - the styles to add
See Also:
StyleService.addStyles(Style[])

addStyles

public boolean addStyles(URL url)
Description copied from interface: StyleService
Add styles from a given URL.

Parameters:
url - the URL from which to load an SLD document.
Returns:
true if loading the URL was successful.
See Also:
StyleService.addStyles(URL)

getBackground

public org.eclipse.swt.graphics.RGB getBackground()
Description copied from interface: StyleService
Get the map background.

Returns:
the map background color
See Also:
StyleService.getBackground()

setBackground

public void setBackground(org.eclipse.swt.graphics.RGB color)
Description copied from interface: StyleService
Set the map background.

Parameters:
color - the map background color
See Also:
StyleService.setBackground(RGB)

clearStyles

public void clearStyles()
Description copied from interface: StyleService
Clear all styles

See Also:
StyleService.clearStyles()

Humboldt Alignment Editor 2.5.0

Build 2012-12-03_12-30-59
Revision 9d2dd4b0318cda9f1393b1ddd390f7f792d70a2d