org.geotools.swt.styling.simple
Class ScaleViewer

Object
  extended by ScaleViewer

public class ScaleViewer
extends Object

Allows editing/viewing of a scale. Used to build the min/max scale editors for a rule.

Here is the pretty picture:


          +-+ +-------------+             
    Scale:|x| | 90%       \/| 
          +-+ +-------------+
 

Workflow:

  1. createControl( parent ) - set up controls
  2. setFill( stroke, mode ) - provide content from SimpleStyleConfigurator/SimpleRasterConfigurator
    1. scale values got from rules
    2. values copied into controls
    3. controls enabled based on mode & fields
  3. Listener.widgetSelected/modifyText - User performs an "edit"
  4. Listener.sync( SelectionEvent ) - update fields with values of controls
  5. fire( SelectionSevent ) - notify SimpleStyleConfigurator/SimpleRasterConfigurator of change
  6. getScale( ) - returns the specified scale

    Since:
    1.1
    Author:
    Andrea Aime

    Field Summary
    static int MAX
               
    static int MIN
               
     
    Constructor Summary
    ScaleViewer(int type)
               
     
    Method Summary
     void addListener(SelectionListener listener1)
              Accepts a listener that will be notified when content changes.
     Composite createControl(Composite parent, KeyListener kListener)
              TODO summary sentence for createControl ...
    protected  void fire(SelectionEvent event)
              TODO summary sentence for fire ...
     double getScale()
              Gets the scale denominator chosen by the user, or the default value for this type if none was selected.
     boolean isEnabled()
               
     void removeListener(SelectionListener listener1)
              Remove listener.
     void setScale(double scale2, long defaultScale)
              Sets the scale denominator, or disables the component if the provided scale is not a positive number
     
    Methods inherited from class Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    MIN

    public static final int MIN
    See Also:
    Constant Field Values

    MAX

    public static final int MAX
    See Also:
    Constant Field Values
    Constructor Detail

    ScaleViewer

    public ScaleViewer(int type)
    Method Detail

    addListener

    public void addListener(SelectionListener listener1)
    Accepts a listener that will be notified when content changes.

    Parameters:
    listener1 -

    removeListener

    public void removeListener(SelectionListener listener1)
    Remove listener.

    Parameters:
    listener1 -

    fire

    protected void fire(SelectionEvent event)
    TODO summary sentence for fire ...

    Parameters:
    event -

    createControl

    public Composite createControl(Composite parent,
                                   KeyListener kListener)
    TODO summary sentence for createControl ...

    Parameters:
    parent -
    kListener -
    Returns:
    Generated composite

    getScale

    public double getScale()
    Gets the scale denominator chosen by the user, or the default value for this type if none was selected. Default values are 0 for MIN type, Double.MAX_VALUE for the MAX type

    Parameters:
    build -
    Returns:
    Fill defined by this model

    setScale

    public void setScale(double scale2,
                         long defaultScale)
    Sets the scale denominator, or disables the component if the provided scale is not a positive number

    Parameters:
    scale -

    isEnabled

    public boolean isEnabled()


    Copyright © 1996-2014 Geotools. All Rights Reserved.