prefuse.data.query
Class RangeQueryBinding

java.lang.Object
  extended by prefuse.data.query.DynamicQueryBinding
      extended by prefuse.data.query.RangeQueryBinding

public class RangeQueryBinding
extends DynamicQueryBinding

DynamicQueryBinding supporting queries based on a range of included data values.

Author:
jeffrey heer

Field Summary
 
Fields inherited from class prefuse.data.query.DynamicQueryBinding
m_field, m_query, m_tuples
 
Constructor Summary
RangeQueryBinding(TupleSet ts, java.lang.String field)
          Create a new RangeQueryBinding over the given set and data field.
RangeQueryBinding(TupleSet ts, java.lang.String field, boolean forceOrdinal)
          Create a new RangeQueryBinding over the given set and data field, optionally forcing an ordinal treatment of data.
 
Method Summary
 javax.swing.JComponent createComponent()
          Create a new horizontal range slider for interacting with the query.
 JRangeSlider createHorizontalRangeSlider()
          Create a new horizontal range slider for interacting with the query.
 JRangeSlider createRangeSlider(int orientation, int direction)
          Create a new range slider for interacting with the query, using the given orientation and direction.
 javax.swing.JSlider createSlider()
          Create a new regular (non-range) slider for interacting with the query.
 JRangeSlider createVerticalRangeSlider()
          Create a new vertical range slider for interacting with the query.
 ValuedRangeModel getModel()
          Return the ValuedRangeModel constructed by this dynamic query binding.
 NumberRangeModel getNumberModel()
          Attempts to return the ValuedRangeModel for this binding as a NumberRangeModel.
 ObjectRangeModel getObjectModel()
          Attempts to return the ValuedRangeModel for this binding as an ObjectRangeModel.
 void initModel()
           
 
Methods inherited from class prefuse.data.query.DynamicQueryBinding
getPredicate, setPredicate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RangeQueryBinding

public RangeQueryBinding(TupleSet ts,
                         java.lang.String field)
Create a new RangeQueryBinding over the given set and data field.

Parameters:
ts - the TupleSet to query
field - the data field (Table column) to query

RangeQueryBinding

public RangeQueryBinding(TupleSet ts,
                         java.lang.String field,
                         boolean forceOrdinal)
Create a new RangeQueryBinding over the given set and data field, optionally forcing an ordinal treatment of data.

Parameters:
ts - the TupleSet to query
field - the data field (Table column) to query
forceOrdinal - if true, forces all items in the range to be treated in strictly ordinal fashion. That means that if the data is numerical, the quantitative nature of the data will be ignored and only the relative ordering of the numbers will matter. In terms of mechanism, this entails that a ObjectRangeModel and not a NumberRangeModel will be used to represent the data. If the argument is false, default inference mechanisms will be used.
Method Detail

initModel

public void initModel()

getModel

public ValuedRangeModel getModel()
Return the ValuedRangeModel constructed by this dynamic query binding. This model backs any user interface components generated by this instance.

Returns:
the ValuedRangeModel for this range query binding.

getNumberModel

public NumberRangeModel getNumberModel()
Attempts to return the ValuedRangeModel for this binding as a NumberRangeModel. If the range model is not an instance of NumberRangeModel, a null value is returned.

Returns:
the ValuedRangeModel for this binding as a NumberRangeModel, or null if the range is not numerical.

getObjectModel

public ObjectRangeModel getObjectModel()
Attempts to return the ValuedRangeModel for this binding as an ObjectRangeModel. If the range model is not an instance of ObjectRangeModel, a null value is returned.

Returns:
the ValuedRangeModel for this binding as an ObjectRangeModel, or null if the range is numerical.

createComponent

public javax.swing.JComponent createComponent()
Create a new horizontal range slider for interacting with the query.

Specified by:
createComponent in class DynamicQueryBinding
Returns:
a JRangeSlider bound to this dynamic query.
See Also:
DynamicQueryBinding.createComponent()

createHorizontalRangeSlider

public JRangeSlider createHorizontalRangeSlider()
Create a new horizontal range slider for interacting with the query.

Returns:
a JRangeSlider bound to this dynamic query.

createVerticalRangeSlider

public JRangeSlider createVerticalRangeSlider()
Create a new vertical range slider for interacting with the query.

Returns:
a JRangeSlider bound to this dynamic query.

createRangeSlider

public JRangeSlider createRangeSlider(int orientation,
                                      int direction)
Create a new range slider for interacting with the query, using the given orientation and direction.

Parameters:
orientation - the orientation (horizontal or vertical) of the slider (see JRangeSlider)
direction - the direction (direction of data values) of the slider (see JRangeSlider)
Returns:
a JRangeSlider bound to this dynamic query.

createSlider

public javax.swing.JSlider createSlider()
Create a new regular (non-range) slider for interacting with the query. This allows you to select a single value at a time.

Returns:
a JSlider bound to this dynamic query.


Copyright © 2007 Regents of the University of California