|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Visualization
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
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 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.
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 |
---|
static final String VISUAL_HOVER
static final String VISUAL_SELECTION
static final String VISUAL_FILTER
static final String VISUAL_LABEL
static final String VISUAL_COLOR
static final String VISUAL_SIZE
static final String VISUAL_ALPHA
static final String VISUAL_SHAPE
static final String PROPERTY_PARENT
static final String PROPERTY_PERMUTATION
static final String PROPERTY_ORIENTATION
static final String PROPERTY_INTERACTOR
static final String PROPERTY_LAYOUT
static final String PROPERTY_ITEM_RENDERER
static final String PROPERTY_RULERS
static final String VC_DESCRIPTOR_PROPERTY_PREFIX
Method Detail |
---|
Visualization findVisualization(Class cls)
cls
- the specified class
Visualization getVisualization(int index)
index
- the index of the dependent visualization
void dispose()
Table getTable()
Rectangle2D getBounds()
JComponent getParent()
void setParent(JComponent parent)
parent
- owning VisualizationPanel.void invalidate(Column c)
c
- the Column triggering the invalidate/repaint.void invalidate()
void repaint()
boolean setVisualColumn(String name, Column column)
vis.setVisualColumn("color", dateColumn)
name
- The name of the visual dimensioncolumn
- the column associated with the visual dimension
or null
.
true
is the visualization has been changed.Column getVisualColumn(String name)
null
.
name
- the name of the visual dimension
null
.VisualColumnDescriptor getVisualColumnDescriptor(String name)
VisualColumnDescriptor
associated
with a specified visual dimension.
name
- the name of the visual dimension
VisualColumnDescriptor
associated
with a specified visual dimension.Iterator getVisualColumnIterator()
Iterator
on the names of all the
visual columns defined by this visualization.
Iterator
on the names of all the
visual columns defined by this visualization.void fireVisualColumnDescriptorChanged(String name)
"VC_DESCRIPTOR_"+name
or
Visualization.VC_DESCRIPTOR_PROPERTY_PREFIX+name
name
- the VisualColumnDescriptor
nameItemRenderer getItemRenderer()
ItemRenderer
responsible for
rendering the items of this visualization.
ItemRenderer
responsible for
rendering the items managed by this visualization.void setItemRenderer(ItemRenderer ir)
ItemRenderer
responsible for
rendering the items of this visualization.
If the specified ItemRenderer
is not instanciated,
it will be instantiated by this method.
ir
- the root ItemRenderer
responsible for
rendering the items of this visualization.BooleanColumn getSelection()
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()
.
BooleanColumn
managing the selection
of this Visualization
FilterColumn getFilter()
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()
.
FilterColumn
of the visualization.boolean isFiltered(int row)
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)
.
row
- the row.
true
if the row is filtered.Dimension getPreferredSize()
null
if the Visualization can adapt to any dimension.
null
if the Visualization can adapt to any dimension.void validateShapes(Rectangle2D bounds)
bounds
- the bounding box of the visualization.void paint(Graphics2D graphics, Rectangle2D bounds)
graphics
- the graphics.bounds
- the bounding box of the visualization.void print(Graphics2D graphics, Rectangle2D bounds)
graphics
- the graphics.bounds
- the bounding box of the visualization.Shape getShapeAt(int row)
row
- the row.
void setShapeAt(int row, Shape s)
row
- the row.s
- the shape.Table getRulerTable()
null
if the visualization doesn't support rulers.LabeledComponent.LabeledItem createLabelItem(int row)
LabeledComponent.LabeledItem
for a specified row.
row
- the row
LabeledComponent.LabeledItem
for a specified row.int pickTop(double x, double y, Rectangle2D bounds)
x
- the X coordinate.y
- the Y coordinate.bounds
- the bounding box of the visualization.
int pickTop(Rectangle2D hitBox, Rectangle2D bounds)
hitBox
- the bounds where the top item is searched.bounds
- the total bounds where the visualization is displayed.
IntArrayList pickAll(Rectangle2D hitBox, Rectangle2D bounds, IntArrayList pick)
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.
VisualizationInteractor getInteractor()
VisualizationInteractor
associated with
this Visualization
or null
if no
interaction is managed.
VisualizationInteractor
associated with
this Visualization
or null
if no
interaction is managed.void setInteractor(VisualizationInteractor inter)
VisualizationInteractor
associated with
this Visualization
or null
if no
interaction is desired.
inter
- the VisualizationInteractor
to set.Permutation getPermutation()
void setPermutation(Permutation perm)
Permutation
.
perm
- The permutationint getRowCount()
int getRowAtIndex(int index)
index
- the index.
int getRowIndex(int row)
row
- the row.
RowIterator iterator()
RowIterator
over the visualized items in
direct order, taking the permutation into account.
RowIterator
over the visualized items in
direct orderRowIterator reverseIterator()
RowIterator
over the visualized items in
reverse order, taking the permutation into
account.
RowIterator
over the visualized items in
reverse ordervoid addPropertyChangeListener(PropertyChangeListener l)
l
- The PropertyChangeListener to be addedvoid addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
propertyName
- The name of the property to listen on.listener
- The PropertyChangeListener to be addedvoid removePropertyChangeListener(PropertyChangeListener l)
l
- The PropertyChangeListener to be removedvoid removePropertyChangeListener(String propertyName, PropertyChangeListener listener)
propertyName
- The name of the property that was listened on.listener
- The PropertyChangeListener to be removed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |