infovis
Interface Visualization

All Superinterfaces:
LabeledComponent, Orientable, SwingConstants
All Known Implementing Classes:
BasicVisualizationInteractor, ColumnsVisualization, ColumnVisualization, DefaultAxisVisualization, DefaultVisualization, DefaultVisualizationInteractor, ExcentricLabelVisualization, ExcentricVisualizationInteractor, GraphVisualization, HistogramVisualization, IcicleTreeVisualization, LinkVisualization, MatrixAxisVisualization, MatrixVisualization, NodeLinkGraphVisualization, NodeLinkTreeVisualization, ParallelCoordinatesVisualization, RulerVisualization, ScatterPlotVisualization, StrokingVisualization, TimeSeriesVisualization, TreeInteractor, TreemapVisualization, TreeVisualization, VisualFisheyeInteractor, VisualizationLayers, VisualizationProxy, VisualSelectionInteractor

public interface Visualization
extends LabeledComponent, Orientable

A visualization implements a set of services to visualize a table data structure and allow interaction.

A visualization is responsible for computing the position and shape of graphical marks that will be used to visualize the items of its table. Computed shapes are stored in a ShapeColumn maintained by the visualization. Graphical marks are managed by ItemRenderers associated to the visualization.

Visualizations maintain an extensible set of visual attributes. A visual attribute can for example be "color", or "alpha" (transparency); it specify some part of the visual appearance of each displayed item. A visual attribute can be associated with a table attribute (a column) to specify that the color or size should be computed from a specified attribute.

For example, if a table has a "name" column and a "price" column, the name can be associated with the color and the price to the size in a visualization using the following lines:

 visualization.setVisualColumn("color", visualization.getTable().getColumn("name"));
 visualization.setVisualColumn("size", visualization.getTable().getColumn("price"));
 

Visualization also implements picking and can maintain an Interactor object for managing the interaction.

The list of items is managed through a Permutation that can be used to reodered the items when visualized or to filter them. There are two types of filtering available in visualizations. Shallow filtering is managed though a FilterColumn managed by the visualization that is best suited to implementing dynamic queries. Deep filtering is managed though the permutation and changes the portion of the dataset viewed by the visualization.

Version:
$Revision: 1.71 $
Author:
Jean-Daniel Fekete

Nested Class Summary
 
Nested classes/interfaces inherited from interface infovis.visualization.magicLens.LabeledComponent
LabeledComponent.LabeledItem
 
Field Summary
static String PROPERTY_INTERACTOR
          Name of the property for interactor change notification.
static String PROPERTY_ITEM_RENDERER
          Name of the property for ItermRenderer change notification.
static String PROPERTY_LAYOUT
          Name of the property for layout change notification.
static String PROPERTY_ORIENTATION
          Name of the property for orientation change notification.
static String PROPERTY_PARENT
          Name of the property for parent change notification.
static String PROPERTY_PERMUTATION
          Name of the property for permutation change notification.
static String PROPERTY_RULERS
          Name of the property for Ruler change notification.
static String VC_DESCRIPTOR_PROPERTY_PREFIX
          Prefix properties for VisualColumnDescriptor change notification.
static String VISUAL_ALPHA
          Name of the alpha visual column.
static String VISUAL_COLOR
          Name of the color visual column.
static String VISUAL_FILTER
          Name of the filter visual column.
static String VISUAL_HOVER
          Name of the hover visual column.
static String VISUAL_LABEL
          Name of the label visual column.
static String VISUAL_SELECTION
          Name of the selection visual column.
static String VISUAL_SHAPE
          Name of the shape visual column.
static String VISUAL_SIZE
          Name of the size visual column.
 
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
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener l)
          Adds a PropertyChangeListener to the listener list.
 void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
          Add a PropertyChangeListener for a specific property.
 LabeledComponent.LabeledItem createLabelItem(int row)
          Returns the LabeledComponent.LabeledItem for a specified row.
 void dispose()
          Releases all the resources used by the visualization.
 Visualization findVisualization(Class cls)
          Returns the visualization of a specified class from a stack of visualizations or null.
 void fireVisualColumnDescriptorChanged(String name)
          Fires property change notifications for the specified Visual Column Descriptor.
 Rectangle2D getBounds()
          Returns the last bounds allocated to this visualization.
 FilterColumn getFilter()
          Returns the FilterColumn managing the dynamic queries of the visualization.
 VisualizationInteractor getInteractor()
          Returns the VisualizationInteractor associated with this Visualization or null if no interaction is managed.
 ItemRenderer getItemRenderer()
          Returns the root ItemRenderer responsible for rendering the items of this visualization.
 JComponent getParent()
          Returns the owning VisualizationPanel.
 Permutation getPermutation()
          Returns the current permutation.
 Dimension getPreferredSize()
          Returns the preferred dimension of the Visualization or null if the Visualization can adapt to any dimension.
 int getRowAtIndex(int index)
          Returns the row at a specified permuted index.
 int getRowCount()
          Returns the numnber of rows visualized, not counting the ones deeply filtered.
 int getRowIndex(int row)
          Returns the index at a specified permuted row.
 Table getRulerTable()
          Returns a table of Rulers.
 BooleanColumn getSelection()
          Returns the current BooleanColumn managing the selection of this Visualization.
 Shape getShapeAt(int row)
          Returns the shape of stored for a specified row or null if none is store.
 Table getTable()
          Returns the Table.
 Column getVisualColumn(String name)
          Returns the column associated with a specified visual dimension or null.
 VisualColumnDescriptor getVisualColumnDescriptor(String name)
          Returns the VisualColumnDescriptor associated with a specified visual dimension.
 Iterator getVisualColumnIterator()
          Returns an Iterator on the names of all the visual columns defined by this visualization.
 Visualization getVisualization(int index)
          Returns a dependent Visualization used by this Visualization in its stack.
 void invalidate()
          Invalidates the contents of the Visualization.
 void invalidate(Column c)
          Invalidates the contents of the Visualization if the column has requested so.
 boolean isFiltered(int row)
          Returns true if the row is filtered.
 RowIterator iterator()
          Returns a RowIterator over the visualized items in direct order, taking the permutation into account.
 void paint(Graphics2D graphics, Rectangle2D bounds)
          Method for painting the visualization.
 IntArrayList pickAll(Rectangle2D hitBox, Rectangle2D bounds, IntArrayList pick)
          Pick all the items under a rectangle.
 int pickTop(double x, double y, Rectangle2D bounds)
          Pick the top item.
 int pickTop(Rectangle2D hitBox, Rectangle2D bounds)
          Pick the top item.
 void print(Graphics2D graphics, Rectangle2D bounds)
          Method for printing the visualization.
 void removePropertyChangeListener(PropertyChangeListener l)
          Remove a PropertyChangeListener from the listener list.
 void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)
          Remove a PropertyChangeListener for a specific property.
 void repaint()
          Trigger a repaint on the visualization pane.
 RowIterator reverseIterator()
          Returns a RowIterator over the visualized items in reverse order, taking the permutation into account.
 void setInteractor(VisualizationInteractor inter)
          Sets the VisualizationInteractor associated with this Visualization or null if no interaction is desired.
 void setItemRenderer(ItemRenderer ir)
          Sets the root ItemRenderer responsible for rendering the items of this visualization.
 void setParent(JComponent parent)
          Sets the owning VisualizationPanel.
 void setPermutation(Permutation perm)
          Sets the permutation using a Permutation.
 void setShapeAt(int row, Shape s)
          Associate a shape with a specified row.
 boolean setVisualColumn(String name, Column column)
          Associate a column to a visual dimension.
 void validateShapes(Rectangle2D bounds)
          Recomputes the shapes associated with the rows if the visualization has changed or the bounds have changed.
 
Methods inherited from interface infovis.visualization.magicLens.LabeledComponent
getComponent, pickAll
 
Methods inherited from interface infovis.visualization.Orientable
getOrientation, setOrientation
 

Field Detail

VISUAL_HOVER

static final String VISUAL_HOVER
Name of the hover visual column.

See Also:
Constant Field Values

VISUAL_SELECTION

static final String VISUAL_SELECTION
Name of the selection visual column.

See Also:
Constant Field Values

VISUAL_FILTER

static final String VISUAL_FILTER
Name of the filter visual column.

See Also:
Constant Field Values

VISUAL_LABEL

static final String VISUAL_LABEL
Name of the label visual column.

See Also:
Constant Field Values

VISUAL_COLOR

static final String VISUAL_COLOR
Name of the color visual column.

See Also:
Constant Field Values

VISUAL_SIZE

static final String VISUAL_SIZE
Name of the size visual column.

See Also:
Constant Field Values

VISUAL_ALPHA

static final String VISUAL_ALPHA
Name of the alpha visual column.

See Also:
Constant Field Values

VISUAL_SHAPE

static final String VISUAL_SHAPE
Name of the shape visual column.

See Also:
Constant Field Values

PROPERTY_PARENT

static final String PROPERTY_PARENT
Name of the property for parent change notification.

See Also:
Constant Field Values

PROPERTY_PERMUTATION

static final String PROPERTY_PERMUTATION
Name of the property for permutation change notification.

See Also:
Constant Field Values

PROPERTY_ORIENTATION

static final String PROPERTY_ORIENTATION
Name of the property for orientation change notification.

See Also:
Constant Field Values

PROPERTY_INTERACTOR

static final String PROPERTY_INTERACTOR
Name of the property for interactor change notification.

See Also:
Constant Field Values

PROPERTY_LAYOUT

static final String PROPERTY_LAYOUT
Name of the property for layout change notification.

See Also:
Constant Field Values

PROPERTY_ITEM_RENDERER

static final String PROPERTY_ITEM_RENDERER
Name of the property for ItermRenderer change notification.

See Also:
Constant Field Values

PROPERTY_RULERS

static final String PROPERTY_RULERS
Name of the property for Ruler change notification.

See Also:
Constant Field Values

VC_DESCRIPTOR_PROPERTY_PREFIX

static final String VC_DESCRIPTOR_PROPERTY_PREFIX
Prefix properties for VisualColumnDescriptor change notification.

See Also:
Constant Field Values
Method Detail

findVisualization

Visualization findVisualization(Class cls)
Returns the visualization of a specified class from a stack of visualizations or null.

Parameters:
cls - the specified class
Returns:
the visualization of a specified class from a stack of visualizations or null.

getVisualization

Visualization getVisualization(int index)
Returns a dependent Visualization used by this Visualization in its stack.

Parameters:
index - the index of the dependent visualization
Returns:
a dependent Visualization used by this Visualization in its stack or NIL if none exist at this index.

dispose

void dispose()
Releases all the resources used by the visualization.


getTable

Table getTable()
Returns the Table.

Returns:
the Table.

getBounds

Rectangle2D getBounds()
Returns the last bounds allocated to this visualization.

Returns:
the last bounds allocated to this visualization.

getParent

JComponent getParent()
Returns the owning VisualizationPanel.

Returns:
the owning VisualizationPanel.

setParent

void setParent(JComponent parent)
Sets the owning VisualizationPanel.

Parameters:
parent - owning VisualizationPanel.

invalidate

void invalidate(Column c)
Invalidates the contents of the Visualization if the column has requested so. Otherwise, just repaint.

Parameters:
c - the Column triggering the invalidate/repaint.

invalidate

void invalidate()
Invalidates the contents of the Visualization.


repaint

void repaint()
Trigger a repaint on the visualization pane.


setVisualColumn

boolean setVisualColumn(String name,
                        Column column)
Associate a column to a visual dimension. For example, the color can be set according to a column containing a date. For that, you would call the method as: vis.setVisualColumn("color", dateColumn)

Parameters:
name - The name of the visual dimension
column - the column associated with the visual dimension or null.
Returns:
true is the visualization has been changed.

getVisualColumn

Column getVisualColumn(String name)
Returns the column associated with a specified visual dimension or null.

Parameters:
name - the name of the visual dimension
Returns:
the column associated with a specified visual dimension or null.

getVisualColumnDescriptor

VisualColumnDescriptor getVisualColumnDescriptor(String name)
Returns the VisualColumnDescriptor associated with a specified visual dimension.

Parameters:
name - the name of the visual dimension
Returns:
the VisualColumnDescriptor associated with a specified visual dimension.

getVisualColumnIterator

Iterator getVisualColumnIterator()
Returns an Iterator on the names of all the visual columns defined by this visualization.

Returns:
an Iterator on the names of all the visual columns defined by this visualization.

fireVisualColumnDescriptorChanged

void fireVisualColumnDescriptorChanged(String name)
Fires property change notifications for the specified Visual Column Descriptor. The property will be called "VC_DESCRIPTOR_"+name or Visualization.VC_DESCRIPTOR_PROPERTY_PREFIX+name

Parameters:
name - the VisualColumnDescriptor name

getItemRenderer

ItemRenderer getItemRenderer()
Returns the root ItemRenderer responsible for rendering the items of this visualization.

Returns:
the root ItemRenderer responsible for rendering the items managed by this visualization.

setItemRenderer

void setItemRenderer(ItemRenderer ir)
Sets the root ItemRenderer responsible for rendering the items of this visualization.

If the specified ItemRenderer is not instanciated, it will be instantiated by this method.

Parameters:
ir - the root ItemRenderer responsible for rendering the items of this visualization.

getSelection

BooleanColumn getSelection()
Returns the current BooleanColumn managing the selection of this Visualization. This is a facade method since the selection visual column can be obtained by VisualSelection.get(vis).getSelectionColumn().

Returns:
the current BooleanColumn managing the selection of this Visualization

getFilter

FilterColumn getFilter()
Returns the FilterColumn managing the dynamic queries of the visualization. This is a facade method since the filter visual column can be obtained by VisualFilter.get(vis).getFilterColumn().

Returns:
the FilterColumn of the visualization.

isFiltered

boolean isFiltered(int row)
Returns true if the row is filtered. This is a facade method since the filter visual column can be obtained by VisualFilter.get(vis).getFilterColumn().isFiltered(row).

Parameters:
row - the row.
Returns:
true if the row is filtered.

getPreferredSize

Dimension getPreferredSize()
Returns the preferred dimension of the Visualization or null if the Visualization can adapt to any dimension.

Returns:
the preferred dimension of the Visualization or null if the Visualization can adapt to any dimension.

validateShapes

void validateShapes(Rectangle2D bounds)
Recomputes the shapes associated with the rows if the visualization has changed or the bounds have changed.

Parameters:
bounds - the bounding box of the visualization.

paint

void paint(Graphics2D graphics,
           Rectangle2D bounds)
Method for painting the visualization.

Parameters:
graphics - the graphics.
bounds - the bounding box of the visualization.

print

void print(Graphics2D graphics,
           Rectangle2D bounds)
Method for printing the visualization.

Parameters:
graphics - the graphics.
bounds - the bounding box of the visualization.

getShapeAt

Shape getShapeAt(int row)
Returns the shape of stored for a specified row or null if none is store.

Parameters:
row - the row.
Returns:
the shape of stored for a specified row or null if none is store.

setShapeAt

void setShapeAt(int row,
                Shape s)
Associate a shape with a specified row.

Parameters:
row - the row.
s - the shape.

getRulerTable

Table getRulerTable()
Returns a table of Rulers.

Returns:
a table of Rulers or null if the visualization doesn't support rulers.

createLabelItem

LabeledComponent.LabeledItem createLabelItem(int row)
Returns the LabeledComponent.LabeledItem for a specified row.

Parameters:
row - the row
Returns:
the LabeledComponent.LabeledItem for a specified row.

pickTop

int pickTop(double x,
            double y,
            Rectangle2D bounds)
Pick the top item.

Parameters:
x - the X coordinate.
y - the Y coordinate.
bounds - the bounding box of the visualization.
Returns:
int the index of the item on top.

pickTop

int pickTop(Rectangle2D hitBox,
            Rectangle2D bounds)
Pick the top item.

Parameters:
hitBox - the bounds where the top item is searched.
bounds - the total bounds where the visualization is displayed.
Returns:
int the index of the item on top.

pickAll

IntArrayList pickAll(Rectangle2D hitBox,
                     Rectangle2D bounds,
                     IntArrayList pick)
Pick all the items under a rectangle.

Parameters:
hitBox - the bounds where the top item is searched.
bounds - the total bounds where the visualization is displayed.
pick - an IntArrayList that will contain each row of items intersecting the hitBox.
Returns:
int the index of the item on top.

getInteractor

VisualizationInteractor getInteractor()
Returns the VisualizationInteractor associated with this Visualization or null if no interaction is managed.

Returns:
the VisualizationInteractor associated with this Visualization or null if no interaction is managed.

setInteractor

void setInteractor(VisualizationInteractor inter)
Sets the VisualizationInteractor associated with this Visualization or null if no interaction is desired.

Parameters:
inter - the VisualizationInteractor to set.

getPermutation

Permutation getPermutation()
Returns the current permutation.

Returns:
the current permutation.

setPermutation

void setPermutation(Permutation perm)
Sets the permutation using a Permutation.

Parameters:
perm - The permutation

getRowCount

int getRowCount()
Returns the numnber of rows visualized, not counting the ones deeply filtered.

Returns:
the numnber of rows visualized.

getRowAtIndex

int getRowAtIndex(int index)
Returns the row at a specified permuted index.

Parameters:
index - the index.
Returns:
the row at a specified permuted index.

getRowIndex

int getRowIndex(int row)
Returns the index at a specified permuted row.

Parameters:
row - the row.
Returns:
the index at a specified permuted row.

iterator

RowIterator iterator()
Returns a RowIterator over the visualized items in direct order, taking the permutation into account.

Returns:
a RowIterator over the visualized items in direct order

reverseIterator

RowIterator reverseIterator()
Returns a RowIterator over the visualized items in reverse order, taking the permutation into account.

Returns:
a RowIterator over the visualized items in reverse order

addPropertyChangeListener

void addPropertyChangeListener(PropertyChangeListener l)
Adds a PropertyChangeListener to the listener list. The listener is registered for all properties. See the fields in PNode and subclasses that start with PROPERTY_ to find out which properties exist.

Parameters:
l - The PropertyChangeListener to be added

addPropertyChangeListener

void addPropertyChangeListener(String propertyName,
                               PropertyChangeListener listener)
Add a PropertyChangeListener for a specific property. The listener will be invoked only when a call on firePropertyChange names that specific property. See the fields in PNode and subclasses that start with PROPERTY_ to find out which properties are supported.

Parameters:
propertyName - The name of the property to listen on.
listener - The PropertyChangeListener to be added

removePropertyChangeListener

void removePropertyChangeListener(PropertyChangeListener l)
Remove a PropertyChangeListener from the listener list. This removes a PropertyChangeListener that was registered for all properties.

Parameters:
l - The PropertyChangeListener to be removed

removePropertyChangeListener

void removePropertyChangeListener(String propertyName,
                                  PropertyChangeListener listener)
Remove a PropertyChangeListener for a specific property.

Parameters:
propertyName - The name of the property that was listened on.
listener - The PropertyChangeListener to be removed


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