lt.monarch.chart.view
Class LabeledChart

java.lang.Object
  extended by lt.monarch.chart.AbstractView<E>
      extended by lt.monarch.chart.view.CompositeView<E>
          extended by lt.monarch.chart.view.DecoratedView<LabeledChartPaintTags>
              extended by lt.monarch.chart.view.LabeledChart
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, StyleEditorEntity, View, ViewListener, ExpandableDecoration

public class LabeledChart
extends DecoratedView<LabeledChartPaintTags>

Decorates a chart with a title and a legend.
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.view.DecoratedView
bottomAlignment, bottomOverlap, bottomView, leftAlignment, leftOverlap, leftView, rightAlignment, rightOverlap, rightView, topAlignment, topOverlap, topView, view
 
Fields inherited from class lt.monarch.chart.view.CompositeView
views
 
Fields inherited from class lt.monarch.chart.AbstractView
layoutInvalid, paintStyle, style
 
Constructor Summary
Constructor and Description
LabeledChart(Chart chart)
          Constructs a labeled view for the specified chart.
 
Method Summary
Modifier and Type Method and Description
 java.awt.Dimension getPreferredSize(AbstractGraphics g)
          Gets the preferred size of this view in the specified Graphics context.
 LabelView<LabeledChartPaintTags> getTitleView()
          Gets title view object
protected  void layout(AbstractGraphics g)
          Prepares the view by arranging all internal views and calculates required constants.
 void setFooter(java.lang.String s)
          Adds a footer.
 void setHeader(java.lang.String s)
          Adds a header.
 void setLeftNote(java.lang.String s)
          Adds a left note.
 void setRightNote(java.lang.String s)
          Adds a right note.
 void setTitle(java.lang.String s)
          Adds a title.
 
Methods inherited from class lt.monarch.chart.view.DecoratedView
getBottomAlignment, getBottomView, getLeftAlignment, getLeftView, getRightAlignment, getRightView, getTopAlignment, getTopView, getViewSize, isHorizontallyExpandable, isVerticallyExpandable, narrow, removeView, setBottomView, setBottomView, setBottomView, setLeftView, setLeftView, setLeftView, setRightView, setRightView, setRightView, setTopView, setTopView, setTopView
 
Methods inherited from class lt.monarch.chart.view.CompositeView
addView, dispose, getContainingObjects, getGraphicsType, getViewCount, getViews, paint, setContainer, setView, validate, viewActivated, viewDeactivated, viewInvalidated
 
Methods inherited from class lt.monarch.chart.AbstractView
activate, addViewListener, clone, container, deactivate, finalize, getAlignmentX, getAlignmentY, getBounds, getChartObjectBounds, getContainer, getHeight, getMaximumSize, getMinimumSize, getPaintMode, getPaintStyle, getParent, getSize, getSize, getStyle, getStyle, getWidth, getX, getY, invalidate, isLayoutValid, removeViewListener, render, repaint, repaint, setAlignmentX, setAlignmentY, setBounds, setBounds, setLocation, setMaximumSize, setMinimumSize, setPaintMode, setPreferredSize, setSize
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LabeledChart

public LabeledChart(Chart chart)
Constructs a labeled view for the specified chart.

Parameters:
chart - chart to be decorated
Method Detail

setTitle

public void setTitle(java.lang.String s)
Adds a title. Title is rendered using the 'chart.title' stylesheet entityStyle.

Parameters:
s - title string

getTitleView

public LabelView<LabeledChartPaintTags> getTitleView()
Gets title view object

Returns:
title view object

setHeader

public void setHeader(java.lang.String s)
Adds a header.

Parameters:
s - header string

setFooter

public void setFooter(java.lang.String s)
Adds a footer.

Parameters:
s - footer string

setLeftNote

public void setLeftNote(java.lang.String s)
Adds a left note. Note is rendered vertically.

Parameters:
s - text string

setRightNote

public void setRightNote(java.lang.String s)
Adds a right note. Note is rendered vertically.

Parameters:
s - text string

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 DecoratedView<LabeledChartPaintTags>
Parameters:
g - the Graphics context in which view will be painted
Returns:
a dimension object indicating this view's preferred size.

layout

protected void layout(AbstractGraphics g)
Description copied from class: AbstractView
Prepares the view by arranging all internal views and calculates required constants.

Overrides:
layout in class DecoratedView<LabeledChartPaintTags>
Parameters:
g - graphics context