infovis.visualization.render
Class DefaultVisualLabel

java.lang.Object
  extended by infovis.visualization.render.AbstractItemRenderer
      extended by infovis.visualization.render.AbstractVisualColumn
          extended by infovis.visualization.render.VisualLabel
              extended by infovis.visualization.render.DefaultVisualLabel
All Implemented Interfaces:
ColumnFilter, ItemRenderer, Orientable, VisualColumnDescriptor, Cloneable, SwingConstants
Direct Known Subclasses:
TreemapVisualLabel, VisualLabelUnder, VisualStrokingLabel, WrappingVisualLabel

public class DefaultVisualLabel
extends VisualLabel
implements Orientable

Default implementation of VisualLabel.

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

Field Summary
static String[] DEFAULT_LABEL_COLUMN_NAMES
          Column names that can become label names by default.
 
Fields inherited from class infovis.visualization.render.VisualLabel
VISUAL
 
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
DefaultVisualLabel()
          Default constructor.
DefaultVisualLabel(boolean showingLabel)
          Constructor.
DefaultVisualLabel(boolean showingLabel, Color defaultColor)
          Constructor.
DefaultVisualLabel(Color defaultColor)
          Constructor.
DefaultVisualLabel(ItemRenderer child, boolean showingLabel)
          Constructor.
DefaultVisualLabel(ItemRenderer child, boolean showingLabel, Color defaultColor)
          Constructor.
 
Method Summary
 Column findDefaultLabelColumn()
          Returns a column that will be a default label or null.
static Column findDefaultLabelColumn(Table t)
          Returns a column from a table that will be a default label or null.
 double getHeight(String label)
          
 float getJustification()
          Returns the label justification betwenn 0 (left) and 1 (right).
 LabelClipper getLabelClipper()
          Returns the current LabelClipper.
 short getOrientation()
          Returns the orientation manages by this interface.
 double getWidth(String label)
          
 boolean isClipped()
          Returns true if the label is clipped by the item shape.
 boolean isOutlined()
          Returns true if the fonts is outlined.
 boolean isShowingLabel()
          Returns the showingLabel.
 void paint(Graphics2D graphics, int row, Shape s)
          
 void setClipped(boolean clipped)
          Set to true if the label is clipped by the item shape.
 void setJustification(float justification)
          Sets the label justification betwenn 0 (left) and 1 (right).
 void setLabelClipper(LabelClipper labelClipper)
          Sets the current LabelClipper.
 void setOrientation(short orientation)
          Sets the orientation of this interface.
 void setOutlined(boolean outlined)
          Set to true if the fonts should be outlined.
 void setShowingLabel(boolean showingLabel)
          Sets the showingLabel.
 
Methods inherited from class infovis.visualization.render.VisualLabel
get, get, getColumn, getDefaultColor, getFont, getLabelAt, getLabelAt, setColumn, setDefaultColor, setFont
 
Methods inherited from class infovis.visualization.render.AbstractVisualColumn
contrastColor, contrastColor, filter, getFilter, invalidate, isInvalidate, setFilter, setInvalidate
 
Methods inherited from class infovis.visualization.render.AbstractItemRenderer
addRenderer, compile, compileGroup, findNamed, findNamed, getName, getRenderer, getRendererCount, getVisualization, indexOf, insertAfterNamed, insertBeforeNamed, insertRenderer, install, instantiate, invalidate, isPrototype, pick, removeNamed, removeRenderer, repaint, replaceNamed, replaceNamed, setRenderer, uninstall
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface infovis.visualization.VisualColumnDescriptor
getName
 

Field Detail

DEFAULT_LABEL_COLUMN_NAMES

public static final String[] DEFAULT_LABEL_COLUMN_NAMES
Column names that can become label names by default.

Constructor Detail

DefaultVisualLabel

public DefaultVisualLabel(ItemRenderer child,
                          boolean showingLabel,
                          Color defaultColor)
Constructor.

Parameters:
child - first children or null.
showingLabel - true if label are shown
defaultColor - default color

DefaultVisualLabel

public DefaultVisualLabel(boolean showingLabel,
                          Color defaultColor)
Constructor.

Parameters:
showingLabel - true if label are shown
defaultColor - default color

DefaultVisualLabel

public DefaultVisualLabel(Color defaultColor)
Constructor.

Parameters:
defaultColor - default color

DefaultVisualLabel

public DefaultVisualLabel(boolean showingLabel)
Constructor.

Parameters:
showingLabel - true if label are shown

DefaultVisualLabel

public DefaultVisualLabel()
Default constructor.


DefaultVisualLabel

public DefaultVisualLabel(ItemRenderer child,
                          boolean showingLabel)
Constructor.

Parameters:
child - first children or null.
showingLabel - true if label are shown
Method Detail

findDefaultLabelColumn

public Column findDefaultLabelColumn()
Returns a column that will be a default label or null.

Returns:
a column that will be a default label or null

findDefaultLabelColumn

public static Column findDefaultLabelColumn(Table t)
Returns a column from a table that will be a default label or null.

Parameters:
t - the table
Returns:
a column from a table that will be a default label or null

getWidth

public double getWidth(String label)

Overrides:
getWidth in class VisualLabel

getHeight

public double getHeight(String label)

Overrides:
getHeight in class VisualLabel

paint

public void paint(Graphics2D graphics,
                  int row,
                  Shape s)

Specified by:
paint in interface ItemRenderer
Overrides:
paint in class VisualLabel

isShowingLabel

public boolean isShowingLabel()
Returns the showingLabel.

Returns:
boolean

setShowingLabel

public void setShowingLabel(boolean showingLabel)
Sets the showingLabel.

Parameters:
showingLabel - The showingLabel to set

getOrientation

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

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

setOrientation

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

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

getLabelClipper

public LabelClipper getLabelClipper()
Returns the current LabelClipper.

Returns:
the current LabelClipper

setLabelClipper

public void setLabelClipper(LabelClipper labelClipper)
Sets the current LabelClipper.

Parameters:
labelClipper - the LabelClipper or null.

getJustification

public float getJustification()
Returns the label justification betwenn 0 (left) and 1 (right).

Returns:
the label justification betwenn 0 (left) and 1 (right).

setJustification

public void setJustification(float justification)
Sets the label justification betwenn 0 (left) and 1 (right).

Parameters:
justification - the justification

isClipped

public boolean isClipped()
Returns true if the label is clipped by the item shape.

Returns:
true if the label is clipped by the item shape

setClipped

public void setClipped(boolean clipped)
Set to true if the label is clipped by the item shape.

Parameters:
clipped - the value

isOutlined

public boolean isOutlined()
Returns true if the fonts is outlined.

Returns:
true if the fonts is outlined

setOutlined

public void setOutlined(boolean outlined)
Set to true if the fonts should be outlined.

Parameters:
outlined - true if the fonts should be outlined.


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