net.refractions.udig.tools.edit.preferences
Class PreferenceUtil

java.lang.Object
  extended by net.refractions.udig.tools.edit.preferences.PreferenceUtil

public class PreferenceUtil
extends java.lang.Object

Provides help for obtaining values that are preferences or will be.

Since:
1.1.0
Author:
jones

Field Summary
protected static PreferenceUtil instance
           
 
Constructor Summary
protected PreferenceUtil()
           
 
Method Summary
 java.awt.Color getDrawGeomsFill()
          Returns the color used to fill the geoms on the EditBlackboard.
 java.awt.Color getDrawGeomsLine()
          Returns the color used to draw the outline of geoms on the EditBlackboard.
 java.awt.Color getDrawSelectionFillColor()
          Returns the color used to fill selected vertices.
 java.awt.Color getDrawVertexFillColor()
          Returns the color used to fill the non-selected vertices.
 java.awt.Color getDrawVertexLineColor()
          Returns the color used to draw the boxes around vertices.
 java.awt.Color getFeedbackColor()
          Returns the color used to draw the shape to show the PostSnapping area.
 short getMessageDisplayDelay()
           
 java.awt.Color getSelectionColor()
          Returns the color used to draw the selection area.
 SnapBehaviour getSnapBehaviour()
          Returns the current preference for snap behaviour.
 int getSnappingRadius()
          Gets the radius used for post-snapping.
 int getVertexRadius()
          Returns the radius of a vertex
 boolean hideSelectedLayers()
          Returns true if selected features should be hidden upon selection.
static PreferenceUtil instance()
           
 boolean isAdvancedEditingActive()
           
static java.awt.Color reduceTransparency(java.awt.Color base, float factor)
          Reduces the transparency of the color by some factor.
 void setAdvancedEditingActive(boolean b)
           
 void setSnapBehaviour(SnapBehaviour behaviour)
           
 void setSnappingRadius(int newRadius)
          Sets the radius used for post-snapping.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

protected static PreferenceUtil instance
Constructor Detail

PreferenceUtil

protected PreferenceUtil()
Method Detail

instance

public static PreferenceUtil instance()

getVertexRadius

public int getVertexRadius()
Returns the radius of a vertex

Returns:

getDrawGeomsLine

public java.awt.Color getDrawGeomsLine()
Returns the color used to draw the outline of geoms on the EditBlackboard.

Returns:
Returns the color used to draw the outline of geoms on the EditBlackboard.

getDrawVertexLineColor

public java.awt.Color getDrawVertexLineColor()
Returns the color used to draw the boxes around vertices.

Returns:
the color used to draw the boxes around vertices.

getDrawSelectionFillColor

public java.awt.Color getDrawSelectionFillColor()
Returns the color used to fill selected vertices.

Returns:
the color used to fill selected vertices.

setSnappingRadius

public void setSnappingRadius(int newRadius)
Sets the radius used for post-snapping.

Parameters:
newRadius -

getSnappingRadius

public int getSnappingRadius()
Gets the radius used for post-snapping.

Returns:
the radius used for post-snapping

getFeedbackColor

public java.awt.Color getFeedbackColor()
Returns the color used to draw the shape to show the PostSnapping area.

Returns:
Returns the color used to draw the shape to show the PostSnapping area.

getSelectionColor

public java.awt.Color getSelectionColor()
Returns the color used to draw the selection area.

Returns:
the color used to draw the selection area.

getDrawGeomsFill

public java.awt.Color getDrawGeomsFill()
Returns the color used to fill the geoms on the EditBlackboard.

Returns:
Returns the color used to fill the geoms on the EditBlackboard.

reduceTransparency

public static java.awt.Color reduceTransparency(java.awt.Color base,
                                                float factor)
Reduces the transparency of the color by some factor.

Parameters:
base - the starting color
factor - the amount to reduce by. Should be between 0-1;
Returns:
The color with the same RGB but reduced alpha

getDrawVertexFillColor

public java.awt.Color getDrawVertexFillColor()
Returns the color used to fill the non-selected vertices.

Returns:
Returns the color used to fill the non-selected vertices.

getSnapBehaviour

public SnapBehaviour getSnapBehaviour()
Returns the current preference for snap behaviour.

Returns:
the current preference for snap behaviour.

setSnapBehaviour

public void setSnapBehaviour(SnapBehaviour behaviour)

hideSelectedLayers

public boolean hideSelectedLayers()
Returns true if selected features should be hidden upon selection. This can be quite expensive.

Returns:

isAdvancedEditingActive

public boolean isAdvancedEditingActive()

setAdvancedEditingActive

public void setAdvancedEditingActive(boolean b)

getMessageDisplayDelay

public short getMessageDisplayDelay()