infovis.visualization
Class VisualizationProxy

java.lang.Object
  extended by infovis.visualization.VisualizationProxy
All Implemented Interfaces:
Visualization, LabeledComponent, Orientable, SwingConstants
Direct Known Subclasses:
BasicVisualizationInteractor, ExcentricLabelVisualization, VisualizationLayers

public class VisualizationProxy
extends Object
implements Visualization

Proxy of a Visualization.

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

Nested Class Summary
 
Nested classes/interfaces inherited from interface infovis.visualization.magicLens.LabeledComponent
LabeledComponent.LabeledItem
 
Field Summary
 
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
 
Constructor Summary
VisualizationProxy(Visualization visualization)
          Constructor.
 
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.
 JComponent getComponent()
          Returns the JComponent managing this LabeledCompent
 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.
 short getOrientation()
          Returns the orientation manages by this interface.
 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()
          Returns the 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.
 Set pickAll(Rectangle2D hitBox, Rectangle2D bounds, Set pick)
          Returns a list of LabeledItems under a specified 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 setOrientation(short orientation)
          Sets the orientation of this interface.
 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 setVisualization(Visualization vis)
          Sets the visualization.
 void validateShapes(Rectangle2D bounds)
          Recomputes the shapes associated with the rows if the visualization has changed or the bounds have changed.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VisualizationProxy

public VisualizationProxy(Visualization visualization)
Constructor.

Parameters:
visualization - the visualization
Method Detail

getVisualization

public Visualization getVisualization()
Returns the visualization.

Returns:
the visualization

setVisualization

public void setVisualization(Visualization vis)
Sets the visualization.

Parameters:
vis - the visualization

findVisualization

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

Specified by:
findVisualization in interface Visualization
Parameters:
cls - the specified class
Returns:
the visualization of a specified class from a stack of visualizations or null.

getVisualization

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

Specified by:
getVisualization in interface Visualization
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.

addPropertyChangeListener

public 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.

Specified by:
addPropertyChangeListener in interface Visualization
Parameters:
l - The PropertyChangeListener to be added

addPropertyChangeListener

public 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.

Specified by:
addPropertyChangeListener in interface Visualization
Parameters:
propertyName - The name of the property to listen on.
listener - The PropertyChangeListener to be added

createLabelItem

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

Specified by:
createLabelItem in interface Visualization
Parameters:
row - the row
Returns:
the LabeledComponent.LabeledItem for a specified row.

dispose

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

Specified by:
dispose in interface Visualization

getBounds

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

Specified by:
getBounds in interface Visualization
Returns:
the last bounds allocated to this visualization.

getComponent

public JComponent getComponent()
Returns the JComponent managing this LabeledCompent

Specified by:
getComponent in interface LabeledComponent
Returns:
the JComponent managing this LabeledCompent.

getFilter

public 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().

Specified by:
getFilter in interface Visualization
Returns:
the FilterColumn of the visualization.

getInteractor

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

Specified by:
getInteractor in interface Visualization
Returns:
the VisualizationInteractor associated with this Visualization or null if no interaction is managed.

getItemRenderer

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

Specified by:
getItemRenderer in interface Visualization
Returns:
the root ItemRenderer responsible for rendering the items managed by this visualization.

getOrientation

public short getOrientation()
Returns the orientation manages by this interface.

Specified by:
getOrientation in interface Orientable
Returns:
the orientation manages by this interface

getParent

public JComponent getParent()
Returns the owning VisualizationPanel.

Specified by:
getParent in interface Visualization
Returns:
the owning VisualizationPanel.

getPermutation

public Permutation getPermutation()
Returns the current permutation.

Specified by:
getPermutation in interface Visualization
Returns:
the current permutation.

getPreferredSize

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

Specified by:
getPreferredSize in interface Visualization
Returns:
the preferred dimension of the Visualization or null if the Visualization can adapt to any dimension.

getRowAtIndex

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

Specified by:
getRowAtIndex in interface Visualization
Parameters:
index - the index.
Returns:
the row at a specified permuted index.

getRowCount

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

Specified by:
getRowCount in interface Visualization
Returns:
the numnber of rows visualized.

getRowIndex

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

Specified by:
getRowIndex in interface Visualization
Parameters:
row - the row.
Returns:
the index at a specified permuted row.

getSelection

public 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().

Specified by:
getSelection in interface Visualization
Returns:
the current BooleanColumn managing the selection of this Visualization

getShapeAt

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

Specified by:
getShapeAt in interface Visualization
Parameters:
row - the row.
Returns:
the shape of stored for a specified row or null if none is store.

getTable

public Table getTable()
Returns the Table.

Specified by:
getTable in interface Visualization
Returns:
the Table.

getVisualColumn

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

Specified by:
getVisualColumn in interface Visualization
Parameters:
name - the name of the visual dimension
Returns:
the column associated with a specified visual dimension or null.

getVisualColumnIterator

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

Specified by:
getVisualColumnIterator in interface Visualization
Returns:
an Iterator on the names of all the visual columns defined by this visualization.

getVisualColumnDescriptor

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

Specified by:
getVisualColumnDescriptor in interface Visualization
Parameters:
name - the name of the visual dimension
Returns:
the VisualColumnDescriptor associated with a specified visual dimension.

fireVisualColumnDescriptorChanged

public 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

Specified by:
fireVisualColumnDescriptorChanged in interface Visualization
Parameters:
name - the VisualColumnDescriptor name

invalidate

public void invalidate()
Invalidates the contents of the Visualization.

Specified by:
invalidate in interface Visualization

invalidate

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

Specified by:
invalidate in interface Visualization
Parameters:
c - the Column triggering the invalidate/repaint.

isFiltered

public 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).

Specified by:
isFiltered in interface Visualization
Parameters:
row - the row.
Returns:
true if the row is filtered.

iterator

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

Specified by:
iterator in interface Visualization
Returns:
a RowIterator over the visualized items in direct order

reverseIterator

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

Specified by:
reverseIterator in interface Visualization
Returns:
a RowIterator over the visualized items in reverse order

validateShapes

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

Specified by:
validateShapes in interface Visualization
Parameters:
bounds - the bounding box of the visualization.

paint

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

Specified by:
paint in interface Visualization
Parameters:
graphics - the graphics.
bounds - the bounding box of the visualization.

print

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

Specified by:
print in interface Visualization
Parameters:
graphics - the graphics.
bounds - the bounding box of the visualization.

pickAll

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

Specified by:
pickAll in interface Visualization
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.

pickAll

public Set pickAll(Rectangle2D hitBox,
                   Rectangle2D bounds,
                   Set pick)
Returns a list of LabeledItems under a specified Rectangle.

Specified by:
pickAll in interface LabeledComponent
Parameters:
hitBox - the rectangle that the items should intersect
bounds - the bounds of the visualization
pick - an Set to use or null if a new one has be be allocated.
Returns:
the Set of LabeledItems under the specified Rectangle.

pickTop

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

Specified by:
pickTop in interface Visualization
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

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

Specified by:
pickTop in interface Visualization
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.

removePropertyChangeListener

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

Specified by:
removePropertyChangeListener in interface Visualization
Parameters:
l - The PropertyChangeListener to be removed

removePropertyChangeListener

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

Specified by:
removePropertyChangeListener in interface Visualization
Parameters:
propertyName - The name of the property that was listened on.
listener - The PropertyChangeListener to be removed

repaint

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

Specified by:
repaint in interface Visualization

setPermutation

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

Specified by:
setPermutation in interface Visualization
Parameters:
perm - The permutation

setInteractor

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

Specified by:
setInteractor in interface Visualization
Parameters:
inter - the VisualizationInteractor to set.

setItemRenderer

public 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.

Specified by:
setItemRenderer in interface Visualization
Parameters:
ir - the root ItemRenderer responsible for rendering the items of this visualization.

setOrientation

public void setOrientation(short orientation)
Sets the orientation of this interface.

Specified by:
setOrientation in interface Orientable
Parameters:
orientation - the orientation.

setParent

public void setParent(JComponent parent)
Sets the owning VisualizationPanel.

Specified by:
setParent in interface Visualization
Parameters:
parent - owning VisualizationPanel.

setShapeAt

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

Specified by:
setShapeAt in interface Visualization
Parameters:
row - the row.
s - the shape.

setVisualColumn

public 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)

Specified by:
setVisualColumn in interface Visualization
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.

getRulerTable

public Table getRulerTable()
Returns a table of Rulers.

Specified by:
getRulerTable in interface Visualization
Returns:
a table of Rulers or null if the visualization doesn't support rulers.


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