com.sas.models
Class RangeSegment

com.sas.models.RangeSegment
All Implemented Interfaces:
PropertyBagChangedListener, PropertyBagChangedSource, PropertyBagInterface, StaticPropertyBagInterface, com.sas.DeepClonable, RangeInterface, RangeSegmentInterface, com.sas.PublicClonable, com.sas.util.Countable, java.beans.PropertyChangeListener, java.io.ObjectInputValidation, java.io.Serializable, java.lang.Cloneable, java.util.EventListener

public class RangeSegment
implements RangeSegmentInterface, java.io.Serializable

A RangeSegment defines one portion of a RangeCollection object.

Creating a RangeSegment

RangeSegments can be created in the following ways:

    // Specify minimum, maximum, and color values
    RangeSegment segment = new RangeSegment(minimum, maximum, Color);
 
 or

    // Specify only minimum and maximum values
    RangeSegment segment = new RangeSegment(minimum, maximum);
 
Note: If a null color is specified (or no color at all), then the default color is java.awt.Color.white.

Usage

The minimum, maximum, and color attributes can be changed on the RangeSegment. Users should not change the minimum or maximum values of a particular RangeSegment if the RangeCollection containing that segment has certain restrictions (such as contiguous segments). This could lead to unpredictable and undesired results.

    // change the minimum where num is a Number object
    segment.setMinimumNumber( num );
    
    // change the maximum where num is a Number object
    segment.setMaximumNumber( num );

    // change the color where col is a java.awt.Color object
    segment.setColor( col );
 

See Also:
RangeSegmentInterface, RangeInterface, Serialized Form

Field Summary
static java.lang.String COLOR
          Proper string to use if the user wishes to alter the "COLOR" property using property bag methods.
protected  java.lang.Number max
           
protected  java.lang.Number min
           
 
Fields inherited from class com.sas.collection.PropertyBag
allPropertyBagChangedListeners, defaults, keys, NO_SUCH_ELEMENT, numProperties, pendingEventGateCount, values
 
Constructor Summary
RangeSegment(java.lang.Number minimum, java.lang.Number maximum)
          Constructor which takes a minimum and maximum.
RangeSegment(java.lang.Number minimum, java.lang.Number maximum, java.awt.Color col)
          Constructor which takes a minimum, maximum, and color.
 
Method Summary
 java.awt.Color getColor()
          Return the color of the range segment.
 java.lang.Number getMaximumNumber()
          Return the maximum value of the range segment.
 java.lang.Number getMinimumNumber()
          Return the minimum value of the range segment.
 void setColor(java.awt.Color newColor)
          Set the color of the range segment.
 void setMaximumNumber(java.lang.Number newMax)
          Set the maximum value of the range segment.
 void setMinimumNumber(java.lang.Number newMin)
          Set the minimum value of the range segment.
 
Methods inherited from class com.sas.collection.PropertyBag
addItems, addItems, addPropertyBagChangedListener, anyListeners, clone, clone, collect, containsKey, count, disableEvents, enableEvents, equals, equals, eventsEnabled, firePropertyBagChanged, firePropertyBagChanged, firingEvents, get, get, getDefaults, growPropertyBag, invalidateKeyList, listKeys, load, load, merge, merge, notifyListeners, propertyBagChanged, propertyChange, propertyIndex, remove, remove, removeAll, removePropertyBagChangedListener, resize, save, save, set, set, set, setDefaults, setProperties, setProperties, swap, swapSources, toDictionary, toProperties, toProperties, toString, validateObject
 
Methods inherited from interface com.sas.models.RangeSegmentInterface
clone
 
Methods inherited from interface com.sas.collection.PropertyBagInterface
merge, remove, removeAll, set, set
 
Methods inherited from interface com.sas.collection.StaticPropertyBagInterface
containsKey, count, get, get, listKeys, toDictionary
 
Methods inherited from interface com.sas.collection.PropertyBagChangedSource
addPropertyBagChangedListener, removePropertyBagChangedListener
 

Field Detail

COLOR

public static final java.lang.String COLOR
Proper string to use if the user wishes to alter the "COLOR" property using property bag methods.

See Also:
Constant Field Values

min

protected java.lang.Number min

max

protected java.lang.Number max
Constructor Detail

RangeSegment

public RangeSegment(java.lang.Number minimum,
                    java.lang.Number maximum)
Constructor which takes a minimum and maximum.

Parameters:
minimum - The minimum value of the RangeSegment.
maximum - The maximum value of the RangeSegment.

RangeSegment

public RangeSegment(java.lang.Number minimum,
                    java.lang.Number maximum,
                    java.awt.Color col)
Constructor which takes a minimum, maximum, and color.

Parameters:
minimum - The minimum value of the RangeSegment.
maximum - The maximum value of the RangeSegment.
col - The color of the RangeSegment.
Method Detail

getMinimumNumber

public java.lang.Number getMinimumNumber()
Return the minimum value of the range segment.

Specified by:
getMinimumNumber in interface RangeInterface
Specified by:
getMinimumNumber in interface RangeSegmentInterface
Returns:
The minimum value of the range segment.

getMaximumNumber

public java.lang.Number getMaximumNumber()
Return the maximum value of the range segment.

Specified by:
getMaximumNumber in interface RangeInterface
Specified by:
getMaximumNumber in interface RangeSegmentInterface
Returns:
The maximum value of the range segment.

setMinimumNumber

public void setMinimumNumber(java.lang.Number newMin)
Set the minimum value of the range segment. This is not recommended for average users. Use only if you have systems in place to guarantee spacing of the min and max values in the range.

Specified by:
setMinimumNumber in interface RangeInterface
Specified by:
setMinimumNumber in interface RangeSegmentInterface
Parameters:
newMin - the minimum value of the range segment.

setMaximumNumber

public void setMaximumNumber(java.lang.Number newMax)
Set the maximum value of the range segment. This is not recommended for average users. Use only if you have systems in place to guarantee spacing of the min and max values in the range.

Specified by:
setMaximumNumber in interface RangeInterface
Specified by:
setMaximumNumber in interface RangeSegmentInterface
Parameters:
newMax - the maximum value of the range segment.

getColor

public java.awt.Color getColor()
Return the color of the range segment.

Returns:
Color The color of the range segment.

setColor

public void setColor(java.awt.Color newColor)
Set the color of the range segment.

Parameters:
Color - The new color of the range segment.



Copyright © 2009 SAS Institute Inc. All Rights Reserved.