infovis.table.visualization
Class ScatterPlotVisualization

java.lang.Object
  extended by infovis.utils.ChangeManager
      extended by infovis.column.AbstractColumn
          extended by infovis.column.ColumnProxy
              extended by infovis.table.TableProxy
                  extended by infovis.visualization.DefaultVisualization
                      extended by infovis.table.visualization.ScatterPlotVisualization
All Implemented Interfaces:
IntComparator, Column, Metadata, Constants, Table, RowComparator, Visualization, Layout, LabeledComponent, Orientable, Serializable, EventListener, ChangeListener, TableModelListener, SwingConstants, TableModel

public class ScatterPlotVisualization
extends DefaultVisualization
implements Layout

Scatter plot visualization.

Visualize a table with a scatter plot representation.

Version:
$Revision: 1.64 $
Author:
Jean-Daniel Fekete
See Also:
Serialized Form
InfoVis factory arguments:
VisualizationFactory "Table Scatter Plot" infovis.Table

Nested Class Summary
 
Nested classes/interfaces inherited from interface infovis.visualization.magicLens.LabeledComponent
LabeledComponent.LabeledItem
 
Field Summary
static String PROPERTY_X_AXIS_MODEL
          Name of the property for x axis model change notification
static String PROPERTY_Y_AXIS_MODEL
          Name of the property for y axis model change notification
static String VISUAL_X_AXIS
           
static String VISUAL_Y_AXIS
           
 
Fields inherited from class infovis.column.AbstractColumn
MODIFIED_ALL, MODIFIED_NONE
 
Fields inherited from interface infovis.Visualization
PROPERTY_INTERACTOR, PROPERTY_ITEM_RENDERER, PROPERTY_LAYOUT, PROPERTY_ORIENTATION, PROPERTY_PARENT, PROPERTY_PERMUTATION, PROPERTY_RULERS, VC_DESCRIPTOR_PROPERTY_PREFIX, VISUAL_ALPHA, VISUAL_COLOR, VISUAL_FILTER, VISUAL_HOVER, VISUAL_LABEL, VISUAL_SELECTION, VISUAL_SHAPE, VISUAL_SIZE
 
Fields inherited from interface infovis.visualization.Orientable
DIRECTION, NAME, ORIENTATION_CENTER, ORIENTATION_EAST, ORIENTATION_INVALID, ORIENTATION_NORTH, ORIENTATION_SOUTH, ORIENTATION_WEST, SQRT2
 
Fields inherited from interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
Fields inherited from interface infovis.Table
FILTER_COLUMN, INTERNAL_PREFIX, NIL, SELECTION_COLUMN
 
Fields inherited from interface infovis.metadata.Constants
CONTRIBUTOR, COVERAGE, CREATOR, DATE, DESCRITION, FORMAT, IDENTIFIER, LANGUAGE, PUBLISHER, RELATION, RIGHTS, SOURCE, SUBJECT, TITLE, TYPE
 
Constructor Summary
ScatterPlotVisualization(Table table)
          Creates a new ScatterPlotVisualization object.
ScatterPlotVisualization(Table table, Column xAxis, Column yAxis)
          Creates a new ScatterPlotVisualization object.
ScatterPlotVisualization(Table table, String xAxis, String yAxis)
          Creates a new ScatterPlotVisualization object.
 
Method Summary
 void computeShapes(Rectangle2D bounds, Visualization vis)
          Computes the layout.
 Layout getLayout()
          Returns the layout object managed by this visualization or null if the visualization computes the layout by itself.
 int getMargin()
          Returns the margin.
 String getName()
          Returns the column name.
static NumberColumn getNumberColumn(Table t, int index)
          Returns the nth Column skipping internal columns.
 NumberColumn getNumberColumnFor(Column column)
           
 Dimension getPreferredSize(Visualization vis)
          Computes and return the preferred size for this layout and this visualization.
 Column getXAxisColumn()
          Returns the xAxisColumn.
 DoubleBoundedRangeModel getXAxisModel()
          Returns the xAxisModel.
 Column getYAxisColumn()
          Returns the yAxisColumn.
 DoubleBoundedRangeModel getYAxisModel()
          Returns the yAxisModel.
 void invalidate(Visualization vis)
          Invalidate the cached state of the layout.
 void setMargin(int margin)
          Sets the margin.
 boolean setXAxisColumn(Column xAxis)
           
 boolean setXAxisModel(NumberColumnBoundedRangeModel xAxisModel)
          Sets the xAxisModel.
 boolean setYAxisColumn(Column yAxis)
          Sets the yAxisColumn.
 boolean setYAxisModel(NumberColumnBoundedRangeModel yAxisModel)
          Sets the yAxisModel.
 void stateChanged(ChangeEvent e)
          
 
Methods inherited from class infovis.visualization.DefaultVisualization
addPropertyChangeListener, addPropertyChangeListener, computeMinMax, computeMinMaxFiltered, computeShapes, createLabelItem, dispose, findRectAt, findVisualization, firePropertyChange, firePropertyChange, firePropertyChange, fireVisualColumnDescriptorChanged, freeRectAt, getBounds, getComponent, getFilter, getFisheye, getInteractor, getItemRenderer, getItemRenderer, getItemRenderer, getOrientation, getParent, getPermutation, getPreferredSize, getRectAt, getRowAtIndex, getRowCount, getRowIndex, getRulerTable, getSelection, getShapeAt, getShapeBoundsAt, getShapes, getTable, getVisualColumn, getVisualColumnDescriptor, getVisualColumnIterator, getVisualization, getVisualizationBounds, invalidate, invalidate, isFiltered, isInvalidateColumn, isInvalidated, iterator, paint, paintItem, paintItems, paintVisualizations, pickAll, pickAll, pickItem, pickTop, pickTop, print, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, reverseIterator, setFisheye, setInteractor, setItemRenderer, setOrientation, setParent, setPermutation, setShapeAt, setVisualColumn, tableChanged, validateShapes
 
Methods inherited from class infovis.table.TableProxy
addColumn, addTableModelListener, clear, getColumn, getColumnAt, getColumnClass, getColumnCount, getColumnName, getLastRow, getValueAt, indexOf, indexOf, isCellEditable, isRowValid, removeColumn, removeTableModelListener, setColumnAt, setValueAt
 
Methods inherited from class infovis.column.ColumnProxy
addValue, addValueOrNull, capacity, compare, ensureCapacity, getClientProperty, getFormat, getMaxIndex, getMetadata, getMinIndex, getValueAt, getValueClass, hasUndefinedValue, isEmpty, isInternal, isValueUndefined, setFormat, setName, setSize, setValueAt, setValueOrNullAt, setValueUndefined, size
 
Methods inherited from class infovis.column.AbstractColumn
addChangeListener, compareValues, computeValueMap, computeValueMap, equalObj, equals, getLastModifiedRow, toString
 
Methods inherited from class infovis.utils.ChangeManager
disableNotify, enableNotify, getModCount, removeChangeListener
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface infovis.Column
addChangeListener, addValue, addValueOrNull, capacity, disableNotify, enableNotify, ensureCapacity, getFormat, getMaxIndex, getMinIndex, getValueAt, getValueClass, hasUndefinedValue, isEmpty, isInternal, isValueUndefined, removeChangeListener, setFormat, setName, setSize, setValueAt, setValueOrNullAt, setValueUndefined, size
 
Methods inherited from interface infovis.Metadata
getClientProperty, getMetadata
 
Methods inherited from interface cern.colt.function.IntComparator
compare, equals
 

Field Detail

PROPERTY_X_AXIS_MODEL

public static final String PROPERTY_X_AXIS_MODEL
Name of the property for x axis model change notification

See Also:
Constant Field Values

PROPERTY_Y_AXIS_MODEL

public static final String PROPERTY_Y_AXIS_MODEL
Name of the property for y axis model change notification

See Also:
Constant Field Values

VISUAL_X_AXIS

public static final String VISUAL_X_AXIS
See Also:
Constant Field Values

VISUAL_Y_AXIS

public static final String VISUAL_Y_AXIS
See Also:
Constant Field Values
Constructor Detail

ScatterPlotVisualization

public ScatterPlotVisualization(Table table,
                                Column xAxis,
                                Column yAxis)
Creates a new ScatterPlotVisualization object.

Parameters:
table - the table.
xAxis - the Column for the X Axis
yAxis - the Column for the Y Axis

ScatterPlotVisualization

public ScatterPlotVisualization(Table table,
                                String xAxis,
                                String yAxis)
Creates a new ScatterPlotVisualization object.

Parameters:
table - the table.
xAxis - the name of the Column for the X Axis
yAxis - the name of the Column for the Y Axis

ScatterPlotVisualization

public ScatterPlotVisualization(Table table)
Creates a new ScatterPlotVisualization object. Required columns are searched in the table, taking the first two NumberColumn s as axes.

Parameters:
table - the table.
Method Detail

getLayout

public Layout getLayout()
Description copied from class: DefaultVisualization
Returns the layout object managed by this visualization or null if the visualization computes the layout by itself.

Overrides:
getLayout in class DefaultVisualization
Returns:
the layout object managed by this visualization or null.

getName

public String getName()
Description copied from class: ColumnProxy
Returns the column name.

Specified by:
getName in interface Column
Specified by:
getName in interface Layout
Overrides:
getName in class ColumnProxy
Returns:
the column name.

invalidate

public void invalidate(Visualization vis)
Invalidate the cached state of the layout.

Call this method from the visualization when it gets invalidated.

Specified by:
invalidate in interface Layout
Parameters:
vis - the visualization.

getNumberColumn

public static NumberColumn getNumberColumn(Table t,
                                           int index)
Returns the nth Column skipping internal columns.

Parameters:
t - the Table.
index - the index of the column, skipping over internal column,
Returns:
the nth NumberColumn skipping internal columns.

getNumberColumnFor

public NumberColumn getNumberColumnFor(Column column)

computeShapes

public void computeShapes(Rectangle2D bounds,
                          Visualization vis)
Description copied from interface: Layout
Computes the layout.

Specified by:
computeShapes in interface Layout
Parameters:
bounds - the allocated bounds of the visualization.
vis - the visualization.

getPreferredSize

public Dimension getPreferredSize(Visualization vis)
Description copied from interface: Layout
Computes and return the preferred size for this layout and this visualization.

Specified by:
getPreferredSize in interface Layout
Parameters:
vis - the visualization
Returns:
the preferred size for this layout and this visualization.

getXAxisColumn

public Column getXAxisColumn()
Returns the xAxisColumn.

Returns:
Column

getYAxisColumn

public Column getYAxisColumn()
Returns the yAxisColumn.

Returns:
Column

setXAxisColumn

public boolean setXAxisColumn(Column xAxis)

setYAxisColumn

public boolean setYAxisColumn(Column yAxis)
Sets the yAxisColumn.

Parameters:
yAxis - The yAxisColumn to set
Returns:
true if the column has been set.

getMargin

public int getMargin()
Returns the margin.

Returns:
int

setMargin

public void setMargin(int margin)
Sets the margin.

Parameters:
margin - The margin to set

getXAxisModel

public DoubleBoundedRangeModel getXAxisModel()
Returns the xAxisModel.

Returns:
DoubleBoundedRangeModel

getYAxisModel

public DoubleBoundedRangeModel getYAxisModel()
Returns the yAxisModel.

Returns:
DoubleBoundedRangeModel

setXAxisModel

public boolean setXAxisModel(NumberColumnBoundedRangeModel xAxisModel)
Sets the xAxisModel.

Parameters:
xAxisModel - The xAxisModel to set
Returns:
true if the column has been set.

setYAxisModel

public boolean setYAxisModel(NumberColumnBoundedRangeModel yAxisModel)
Sets the yAxisModel.

Parameters:
yAxisModel - The yAxisModel to set
Returns:
true if the column has been set.

stateChanged

public void stateChanged(ChangeEvent e)
Description copied from class: DefaultVisualization

Specified by:
stateChanged in interface ChangeListener
Overrides:
stateChanged in class DefaultVisualization
See Also:
DefaultVisualization.stateChanged(ChangeEvent)


Copyright 2005 by Jean-Daniel Fekete and INRIA, France All rights reserved.