Style Intelligence v12.0

inetsoft.graph.guide
Class VLabel

java.lang.Object
  extended by inetsoft.graph.Visualizable
      extended by inetsoft.graph.BoundedVisualizable
          extended by inetsoft.graph.guide.VLabel
All Implemented Interfaces:
inetsoft.graph.internal.ILayout, Serializable, Cloneable, Comparable

public class VLabel
extends BoundedVisualizable

Visual label is a base class for all visual object rendering label. The position of the label is the bottom-left corner of the text. Both position and size are in math coordinate.

See Also:
Serialized Form

Field Summary
static int MOVE_ARC
          Hint to only move along the perimeter of an arc.
static int MOVE_FREE
          Free movement layout.
static int MOVE_NONE
          No movement.
static int MOVE_RIGHT
          Hint to only move horizontally to the right.
static int MOVE_UP
          Hint to only move vertically to the top.
 
Constructor Summary
VLabel(Object label)
          Constructor.
VLabel(Object label, TextSpec textSpec)
          Constructor.
 
Method Summary
 int getAlignmentX()
          Gets the the horizontal alignment.
 int getAlignmentY()
          Gets the the vertical alignment.
 int getCollisionModifier()
          Get the text collision resolution option.
 Color getColor()
          Get the text color of this label.
 Font getFont()
          Get the font of this label.
 Insets getInsets()
          Get the label insets.
 Object getLabel()
          Get label value.
 Dimension2D getMaxSize()
          Get the label max size.
protected  double getMinHeight0()
          Get min height.
protected  double getMinWidth0()
          Get min width.
protected  double getPreferredHeight0()
          Get preferred height.
protected  double getPreferredWidth0()
          Get preferred width.
 String getText()
          Get the formatted text string.
 Point2D getTextPosition()
          Get the text position of vlabel (bottom-left).
 TextSpec getTextSpec()
          Get the text attributes.
 Shape getTransformedBounds()
          Get the text bounds after screen transformation.
 boolean isLabelForm()
          Check whether label could be a LabelForm.
 boolean isTruncate()
          Check whether label could be truncated with "..".
 void paint(Graphics2D g)
          Paint the visual object on the graphics.
 void setAlignmentX(int alignx)
          Set the default horizontal alignment.
 void setAlignmentY(int aligny)
          Set the default vertical alignment.
 void setCollisionModifier(int modifier)
          Set the text collision resolution option.
 void setInsets(Insets insets)
          Set the label insets.
 void setLabelForm(boolean flag)
          Set whether label could be a LabelForm.
 void setMaxSize(Dimension2D maxSize)
          Set the label max size.
 void setTextSpec(TextSpec spec)
          Set the text attributes.
 void setTruncate(boolean truncated)
          Set whethert label could be truncated.
 String toString()
          Get the string representation.
 
Methods inherited from class inetsoft.graph.BoundedVisualizable
getBounds, getPosition, getSize, setBounds, setBounds, setPosition, setSize
 
Methods inherited from class inetsoft.graph.Visualizable
clone, compareTo, getGraphable, getMinHeight, getMinWidth, getPreferredHeight, getPreferredWidth, getScreenTransform, getZIndex, invalidate, setScreenTransform, setZIndex
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MOVE_NONE

public static final int MOVE_NONE
No movement.

See Also:
Constant Field Values

MOVE_FREE

public static final int MOVE_FREE
Free movement layout.

See Also:
Constant Field Values

MOVE_RIGHT

public static final int MOVE_RIGHT
Hint to only move horizontally to the right.

See Also:
Constant Field Values

MOVE_UP

public static final int MOVE_UP
Hint to only move vertically to the top.

See Also:
Constant Field Values

MOVE_ARC

public static final int MOVE_ARC
Hint to only move along the perimeter of an arc.

See Also:
Constant Field Values
Constructor Detail

VLabel

public VLabel(Object label)
Constructor.

Parameters:
label - the output string.

VLabel

public VLabel(Object label,
              TextSpec textSpec)
Constructor.

Parameters:
label - the output string.
textSpec - new text spec.
Method Detail

paint

public void paint(Graphics2D g)
Paint the visual object on the graphics.

Specified by:
paint in class Visualizable

getTextPosition

public Point2D getTextPosition()
Get the text position of vlabel (bottom-left). The text position may be different from the label position due to alignments.


getMinHeight0

protected double getMinHeight0()
Get min height.

Specified by:
getMinHeight0 in class Visualizable

getMinWidth0

protected double getMinWidth0()
Get min width.

Specified by:
getMinWidth0 in class Visualizable

getPreferredWidth0

protected double getPreferredWidth0()
Get preferred width.

Specified by:
getPreferredWidth0 in class Visualizable

getPreferredHeight0

protected double getPreferredHeight0()
Get preferred height.

Specified by:
getPreferredHeight0 in class Visualizable

getTransformedBounds

public Shape getTransformedBounds()
Get the text bounds after screen transformation.


getMaxSize

public Dimension2D getMaxSize()
Get the label max size.


setMaxSize

public void setMaxSize(Dimension2D maxSize)
Set the label max size.


getText

public String getText()
Get the formatted text string.


setAlignmentX

public void setAlignmentX(int alignx)
Set the default horizontal alignment. The alignment is used if the alignment in the TextSpec is not set.


setAlignmentY

public void setAlignmentY(int aligny)
Set the default vertical alignment. The alignment is used if the alignment in the TextSpec is not set.


getAlignmentX

public int getAlignmentX()
Gets the the horizontal alignment.


getAlignmentY

public int getAlignmentY()
Gets the the vertical alignment.


getLabel

public Object getLabel()
Get label value. The value may be formatted to get the text string if a format is specified.


setTextSpec

public void setTextSpec(TextSpec spec)
Set the text attributes.


getTextSpec

public TextSpec getTextSpec()
Get the text attributes.


getColor

public Color getColor()
Get the text color of this label.


getFont

public Font getFont()
Get the font of this label.


setInsets

public void setInsets(Insets insets)
Set the label insets.


getInsets

public Insets getInsets()
Get the label insets.


getCollisionModifier

public int getCollisionModifier()
Get the text collision resolution option.


setCollisionModifier

public void setCollisionModifier(int modifier)
Set the text collision resolution option.


isTruncate

public boolean isTruncate()
Check whether label could be truncated with "..".


setTruncate

public void setTruncate(boolean truncated)
Set whethert label could be truncated. If set to true, the label will be truncated with ".." when there is no splace to dislay it.


toString

public String toString()
Get the string representation.

Overrides:
toString in class Object

isLabelForm

public boolean isLabelForm()
Check whether label could be a LabelForm.


setLabelForm

public void setLabelForm(boolean flag)
Set whether label could be a LabelForm.


Copyright © 1996-2014 InetSoft Technology Corp. All Rights Reserved.