prefuse.data.query
Class NumberRangeModel

java.lang.Object
  extended by javax.swing.DefaultBoundedRangeModel
      extended by prefuse.data.query.NumberRangeModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.BoundedRangeModel, ValuedRangeModel

public class NumberRangeModel
extends javax.swing.DefaultBoundedRangeModel
implements ValuedRangeModel

Range model for numerical data. Designed to support range-based dynamic queries.

Author:
jeffrey heer
See Also:
Serialized Form

Field Summary
protected  java.lang.Number m_hi
           
protected  java.lang.Number m_lo
           
protected  java.lang.Number m_max
           
protected  java.lang.Number m_min
           
protected  java.lang.Class m_type
           
 
Fields inherited from class javax.swing.DefaultBoundedRangeModel
changeEvent, listenerList
 
Constructor Summary
NumberRangeModel(double lo, double hi, double min, double max)
          Create a new NumberRangeModel for the given range.
NumberRangeModel(float lo, float hi, float min, float max)
          Create a new NumberRangeModel for the given range.
NumberRangeModel(int lo, int hi, int min, int max)
          Create a new NumberRangeModel for the given range.
NumberRangeModel(long lo, long hi, long min, long max)
          Create a new NumberRangeModel for the given range.
NumberRangeModel(java.lang.Number lo, java.lang.Number hi, java.lang.Number min, java.lang.Number max)
          Create a new NumberRangeModel for the given range.
 
Method Summary
 java.lang.Object getHighValue()
          Get the value at the high point of the range span.
 java.lang.Object getLowValue()
          Get the value at the low point of the range span.
 java.lang.Object getMaxValue()
          Get the maximum value backing the range model.
 java.lang.Object getMinValue()
          Get the minimum value backing the range model.
 void setExtent(int extent)
           
 void setHighValue(java.lang.Number n)
          Set the highest selected range value.
 void setLowValue(java.lang.Number n)
          Set the lowest selected range value.
 void setMaximum(int max)
          Not supported, throws an exception.
 void setMaxValue(java.lang.Number n)
          Set the maximum range value.
 void setMinimum(int min)
          Not supported, throws an exception.
 void setMinValue(java.lang.Number n)
          Set the minimum range value.
protected  void setRange(int val, int ext, int min, int max)
          Set the range settings in the pixel-space coordinates.
 void setRangeProperties(int val, int extent, int min, int max, boolean adj)
           
 void setValue(int val)
           
 void setValueRange(double lo, double hi, double min, double max)
          Set the range model's backing values.
 void setValueRange(int lo, int hi, int min, int max)
          Set the range model's backing values.
 void setValueRange(long lo, long hi, long min, long max)
          Set the range model's backing values.
 void setValueRange(java.lang.Number lo, java.lang.Number hi, java.lang.Number min, java.lang.Number max)
          Set the range model's backing values.
protected  void updateRange()
          Update the range settings based on current values.
protected  java.lang.Object value(int val)
           
 
Methods inherited from class javax.swing.DefaultBoundedRangeModel
addChangeListener, fireStateChanged, getChangeListeners, getExtent, getListeners, getMaximum, getMinimum, getValue, getValueIsAdjusting, removeChangeListener, setValueIsAdjusting, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.swing.BoundedRangeModel
addChangeListener, getExtent, getMaximum, getMinimum, getValue, getValueIsAdjusting, removeChangeListener, setValueIsAdjusting
 

Field Detail

m_type

protected java.lang.Class m_type

m_min

protected java.lang.Number m_min

m_max

protected java.lang.Number m_max

m_lo

protected java.lang.Number m_lo

m_hi

protected java.lang.Number m_hi
Constructor Detail

NumberRangeModel

public NumberRangeModel(int lo,
                        int hi,
                        int min,
                        int max)
Create a new NumberRangeModel for the given range.

Parameters:
lo - the low value of the selected range
hi - the high value of the selected range
min - the minimum value allowed for ranges
max - the maximum value allowed for ranges

NumberRangeModel

public NumberRangeModel(long lo,
                        long hi,
                        long min,
                        long max)
Create a new NumberRangeModel for the given range.

Parameters:
lo - the low value of the selected range
hi - the high value of the selected range
min - the minimum value allowed for ranges
max - the maximum value allowed for ranges

NumberRangeModel

public NumberRangeModel(float lo,
                        float hi,
                        float min,
                        float max)
Create a new NumberRangeModel for the given range.

Parameters:
lo - the low value of the selected range
hi - the high value of the selected range
min - the minimum value allowed for ranges
max - the maximum value allowed for ranges

NumberRangeModel

public NumberRangeModel(double lo,
                        double hi,
                        double min,
                        double max)
Create a new NumberRangeModel for the given range.

Parameters:
lo - the low value of the selected range
hi - the high value of the selected range
min - the minimum value allowed for ranges
max - the maximum value allowed for ranges

NumberRangeModel

public NumberRangeModel(java.lang.Number lo,
                        java.lang.Number hi,
                        java.lang.Number min,
                        java.lang.Number max)
Create a new NumberRangeModel for the given range.

Parameters:
lo - the low value of the selected range
hi - the high value of the selected range
min - the minimum value allowed for ranges
max - the maximum value allowed for ranges
Method Detail

updateRange

protected void updateRange()
Update the range settings based on current values.


setRange

protected void setRange(int val,
                        int ext,
                        int min,
                        int max)
Set the range settings in the pixel-space coordinates.


setRangeProperties

public void setRangeProperties(int val,
                               int extent,
                               int min,
                               int max,
                               boolean adj)
Specified by:
setRangeProperties in interface javax.swing.BoundedRangeModel
Overrides:
setRangeProperties in class javax.swing.DefaultBoundedRangeModel
See Also:
BoundedRangeModel.setRangeProperties(int, int, int, int, boolean)

setValueRange

public void setValueRange(java.lang.Number lo,
                          java.lang.Number hi,
                          java.lang.Number min,
                          java.lang.Number max)
Set the range model's backing values.

Parameters:
lo - the low value of the selected range
hi - the high value of the selected range
min - the minimum value allowed for ranges
max - the maximum value allowed for ranges

setValueRange

public void setValueRange(double lo,
                          double hi,
                          double min,
                          double max)
Set the range model's backing values.

Parameters:
lo - the low value of the selected range
hi - the high value of the selected range
min - the minimum value allowed for ranges
max - the maximum value allowed for ranges

setValueRange

public void setValueRange(int lo,
                          int hi,
                          int min,
                          int max)
Set the range model's backing values.

Parameters:
lo - the low value of the selected range
hi - the high value of the selected range
min - the minimum value allowed for ranges
max - the maximum value allowed for ranges

setValueRange

public void setValueRange(long lo,
                          long hi,
                          long min,
                          long max)
Set the range model's backing values.

Parameters:
lo - the low value of the selected range
hi - the high value of the selected range
min - the minimum value allowed for ranges
max - the maximum value allowed for ranges

getMinValue

public java.lang.Object getMinValue()
Description copied from interface: ValuedRangeModel
Get the minimum value backing the range model. This is the absolute minimum value possible for the range span.

Specified by:
getMinValue in interface ValuedRangeModel
Returns:
the minimum value
See Also:
ValuedRangeModel.getMinValue()

setMinValue

public void setMinValue(java.lang.Number n)
Set the minimum range value.

Parameters:
n - the minimum range value.

getMaxValue

public java.lang.Object getMaxValue()
Description copied from interface: ValuedRangeModel
Get the maximum value backing the range model. This is the absolute maximum value possible for the range span.

Specified by:
getMaxValue in interface ValuedRangeModel
Returns:
the maximum value
See Also:
ValuedRangeModel.getMaxValue()

setMaxValue

public void setMaxValue(java.lang.Number n)
Set the maximum range value.

Parameters:
n - the maximum range value.

getLowValue

public java.lang.Object getLowValue()
Description copied from interface: ValuedRangeModel
Get the value at the low point of the range span.

Specified by:
getLowValue in interface ValuedRangeModel
Returns:
the lowest value of the current range
See Also:
ValuedRangeModel.getLowValue()

setLowValue

public void setLowValue(java.lang.Number n)
Set the lowest selected range value.

Parameters:
n - the low value of the selected range.

getHighValue

public java.lang.Object getHighValue()
Description copied from interface: ValuedRangeModel
Get the value at the high point of the range span.

Specified by:
getHighValue in interface ValuedRangeModel
Returns:
the highest value of the current range
See Also:
ValuedRangeModel.getHighValue()

setHighValue

public void setHighValue(java.lang.Number n)
Set the highest selected range value.

Parameters:
n - the high value of the selected range.

value

protected java.lang.Object value(int val)

setMinimum

public void setMinimum(int min)
Not supported, throws an exception.

Specified by:
setMinimum in interface javax.swing.BoundedRangeModel
Overrides:
setMinimum in class javax.swing.DefaultBoundedRangeModel
Throws:
java.lang.UnsupportedOperationException
See Also:
BoundedRangeModel.setMinimum(int)

setMaximum

public void setMaximum(int max)
Not supported, throws an exception.

Specified by:
setMaximum in interface javax.swing.BoundedRangeModel
Overrides:
setMaximum in class javax.swing.DefaultBoundedRangeModel
Throws:
java.lang.UnsupportedOperationException
See Also:
BoundedRangeModel.setMaximum(int)

setValue

public void setValue(int val)
Specified by:
setValue in interface javax.swing.BoundedRangeModel
Overrides:
setValue in class javax.swing.DefaultBoundedRangeModel
See Also:
BoundedRangeModel.setValue(int)

setExtent

public void setExtent(int extent)
Specified by:
setExtent in interface javax.swing.BoundedRangeModel
Overrides:
setExtent in class javax.swing.DefaultBoundedRangeModel
See Also:
BoundedRangeModel.setExtent(int)


Copyright © 2007 Regents of the University of California