lt.monarch.chart.view
Class LabelView<E extends AbstractPaintTags>

java.lang.Object
  extended by lt.monarch.chart.AbstractView<E>
      extended by lt.monarch.chart.view.LabelView<E>
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, StyleEditorEntity, View

public class LabelView<E extends AbstractPaintTags>
extends AbstractView<E>

Renders a label (or title).
Multiline strings are supported for all labels (title, footer, notes). Use a new-line character to separate lines.

See Also:
Serialized Form

Field Summary
Modifier and Type Field and Description
 
Fields inherited from class lt.monarch.chart.AbstractView
layoutInvalid, paintStyle, style
 
Constructor Summary
Constructor and Description
LabelView()
          Default label view constructor.
LabelView(java.lang.String text)
          Label view constructor
 
Method Summary
Modifier and Type Method and Description
 java.util.List<?> getContainingObjects()
          Returns nothing
 java.lang.Object getParent()
          Return the parent chart object
 java.awt.Dimension getPreferredSize(AbstractGraphics g)
          Gets the preferred size of this view in the specified Graphics context.
 AbstractStyle getStyle(StyleType styleType)
          Gets style object for the stylesheet attributes specified by style type.
 java.lang.String getText()
           
 TextStyle<E> getTextStyle()
          Text style object
protected  void paint(AbstractGraphics g)
          Paints the view.
 void setHorizontalAlignment(Alignment align)
          Sets horizontal alignment of the text
 void setOrientation(Orientation orientation)
          Sets label orientation
 void setText(java.lang.String s)
          Sets text
 void setVerticalAlignment(Alignment align)
          Set vertical alignment
 
Methods inherited from class lt.monarch.chart.AbstractView
activate, addViewListener, clone, container, deactivate, dispose, finalize, getAlignmentX, getAlignmentY, getBounds, getChartObjectBounds, getContainer, getGraphicsType, getHeight, getMaximumSize, getMinimumSize, getPaintMode, getPaintStyle, getSize, getSize, getStyle, getWidth, getX, getY, invalidate, isLayoutValid, layout, removeViewListener, render, repaint, repaint, setAlignmentX, setAlignmentY, setBounds, setBounds, setContainer, setLocation, setMaximumSize, setMinimumSize, setPaintMode, setPreferredSize, setSize, validate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LabelView

public LabelView(java.lang.String text)
Label view constructor

Parameters:
text - text of the label view

LabelView

public LabelView()
Default label view constructor. Sets empty string as text.

Method Detail

setText

public void setText(java.lang.String s)
Sets text

Parameters:
s - text to set

getText

public java.lang.String getText()

setHorizontalAlignment

public void setHorizontalAlignment(Alignment align)
Sets horizontal alignment of the text

Parameters:
align - horizontal alignment of the text

setVerticalAlignment

public void setVerticalAlignment(Alignment align)
Set vertical alignment

Parameters:
align - vertical alignment

setOrientation

public void setOrientation(Orientation orientation)
Sets label orientation

Parameters:
orientation - label orientation

getPreferredSize

public java.awt.Dimension getPreferredSize(AbstractGraphics g)
Description copied from class: AbstractView
Gets the preferred size of this view in the specified Graphics context.

Specified by:
getPreferredSize in interface View
Overrides:
getPreferredSize in class AbstractView<E extends AbstractPaintTags>
Parameters:
g - the Graphics context in which view will be painted
Returns:
a dimension object indicating this view's preferred size.

paint

protected void paint(AbstractGraphics g)
Description copied from class: AbstractView
Paints the view.

Specified by:
paint in class AbstractView<E extends AbstractPaintTags>
Parameters:
g - graphics context

getTextStyle

public TextStyle<E> getTextStyle()
Text style object

Returns:
the text style object

getStyle

public AbstractStyle getStyle(StyleType styleType)
Description copied from interface: StyleEditorEntity
Gets style object for the stylesheet attributes specified by style type.

Specified by:
getStyle in interface StyleEditorEntity
Overrides:
getStyle in class AbstractView<E extends AbstractPaintTags>
Parameters:
styleType - style type attributes
Returns:
the style object

getParent

public java.lang.Object getParent()
Description copied from interface: StyleEditorEntity
Return the parent chart object

Specified by:
getParent in interface StyleEditorEntity
Overrides:
getParent in class AbstractView<E extends AbstractPaintTags>
Returns:
the parent

getContainingObjects

public java.util.List<?> getContainingObjects()
Returns nothing

Returns:
null