|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectlt.monarch.chart.AbstractView<LegendPaintTags>
lt.monarch.chart.engine.AbstractLegend
public abstract class AbstractLegend extends AbstractView<LegendPaintTags> implements ExpandableDecoration
Abstract legend, which implements basic legend functions
| Modifier and Type | Class and Description |
|---|---|
class |
AbstractLegend.LegendEntryEntity
The legend entry chart entity. |
| Modifier and Type | Field and Description |
|---|---|
protected java.awt.Dimension |
actualSize
Actual size |
protected LegendEntry |
currentSelection
Current selection |
protected boolean |
cursorChanged
Cursor was changed |
protected java.awt.Dimension |
dimension
Preferred size |
protected Rectangle2D |
drawBounds
Drawing bounds |
protected java.util.ArrayList<LegendEntry> |
entries
Legend entries |
protected Alignment |
horizontalLabelAlignment
Horizontal label alignment |
protected SortDirection |
labelSorting
Enables sorting of the labels |
protected java.awt.Point |
lastPt
Last point |
protected LegendLayout |
layout
Legend layout |
protected int |
margin
Margin |
protected java.awt.Point |
mouseClick
Mouse click point |
protected java.awt.Cursor |
moveCursor
Moving cursor |
protected Orientation |
orientation
Orientation of the legend |
protected double |
scrollRange
Scrolling range |
Style |
style
Style of the legend. |
protected java.awt.Cursor |
tempCursor
Temporary cursor |
protected AbstractTextPainter |
textPainter
Text painter |
protected TextStyle<LegendPaintTags> |
textStyle
Legend text style |
protected Alignment |
verticalLabelAlignment
Vertical label alignment |
protected boolean |
wordWrappingEnabled
Word wrapping is enabled |
| Fields inherited from class lt.monarch.chart.AbstractView |
|---|
layoutInvalid, paintStyle |
| Constructor and Description |
|---|
AbstractLegend()
Default abstract legend constructor |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
addEntries(LegendEntry[] ll)
Adds a list of entries the the legend at once. |
abstract void |
addEntry(LegendEntry entry)
Adds a new entry to the legend. |
abstract void |
addEntry(java.lang.String text,
LegendSymbol symbol)
Constructs and adds a new entry to the legend. |
abstract void |
addSeparator()
Adds a separator to the legend. |
abstract void |
addSeparator(java.lang.String label)
Adds a separator to the legend. |
void |
dispose()
Cleans this legend object. |
java.util.List<LegendEntry> |
getContainingObjects()
Returns all containing legend entries |
java.util.Enumeration<LegendEntry> |
getEntries()
Gets entries of the legend. |
LegendEntry |
getEntry(int index)
Returns a Legend entry at specified position. |
Alignment |
getLabelHAlignment()
Returns horizontal alignment of labels. |
SortDirection |
getLabelSorting()
Gets sorting option for the labels |
Alignment |
getLabelVAlignment()
Returns vertical alignment of labels. |
LegendLayout |
getLayout()
Returns style of legend layout. |
Orientation |
getOrientation()
Returns orientation of legend layout. |
abstract java.awt.Dimension |
getPreferredSize(AbstractGraphics g)
Gets the preferred size of this legend. |
AbstractStyle |
getStyle(StyleType styleType)
Gets style object for the stylesheet attributes specified by style type. |
TextStyle<LegendPaintTags> |
getTextStyle()
Gets text style object, which is used to set text properties |
boolean |
getWordWrappingEnabled()
Returns whether or not word wrapping for text of legend entries is enabled. |
void |
initCursor()
Initialize cursor |
boolean |
isHorizontallyExpandable()
Should return true if width of this view, when persisting in
top or bottom position inside DecoratedView,
should be expanded to maximum space available. |
boolean |
isVerticallyExpandable()
Should return true if height of this view, when persisting in
left or right position inside DecoratedView,
should be expanded to maximum space available. |
protected void |
readObject(java.io.ObjectInputStream in)
|
void |
removeAllEntries()
Removes all legend entries |
void |
removeEntry(LegendEntry entry)
Removes legend entry. |
void |
setCurrentSelection(LegendEntry selection)
Selects the specified legend entry. |
void |
setHorizontalAlignment(Alignment align)
Sets Legend entries text vertical alignment. |
void |
setLabelAlignment(Alignment hAlign,
Alignment vAlign)
Sets alignment for labels. |
void |
setLabelSorting(SortDirection labelSorting)
Sets sorting option for the labels |
void |
setLayout(LegendLayout layout)
Sets the legend layout. |
void |
setOrientation(Orientation orientation)
Sets legend orientation. |
void |
setPreferredSize(java.awt.Dimension dimension)
Sets preferred size |
void |
setPreferredSize(int width,
int height)
Sets the preferred size of the receiving view. |
void |
setVerticalAlignment(Alignment align)
Sets Legend entries text vertical alignment. |
void |
setWordWrappingEnabled(boolean enable)
Enables/disabled word wrapping in text of legend entries. |
protected void |
sortLabels()
Sorts legend entry labels |
| Methods inherited from class lt.monarch.chart.AbstractView |
|---|
activate, addViewListener, clone, container, deactivate, finalize, getAlignmentX, getAlignmentY, getBounds, getChartObjectBounds, getContainer, getGraphicsType, getHeight, getMaximumSize, getMinimumSize, getPaintMode, getPaintStyle, getParent, getSize, getSize, getStyle, getWidth, getX, getY, invalidate, isLayoutValid, layout, paint, removeViewListener, render, repaint, repaint, setAlignmentX, setAlignmentY, setBounds, setBounds, setContainer, setLocation, setMaximumSize, setMinimumSize, setPaintMode, setSize, validate |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public final Style style
protected TextStyle<LegendPaintTags> textStyle
protected java.util.ArrayList<LegendEntry> entries
protected LegendLayout layout
protected Alignment horizontalLabelAlignment
protected Alignment verticalLabelAlignment
protected Orientation orientation
protected java.awt.Dimension actualSize
protected Rectangle2D drawBounds
protected int margin
protected double scrollRange
protected java.awt.Point mouseClick
protected java.awt.Point lastPt
protected LegendEntry currentSelection
protected transient java.awt.Cursor tempCursor
protected transient java.awt.Cursor moveCursor
protected boolean cursorChanged
protected AbstractTextPainter textPainter
protected boolean wordWrappingEnabled
protected SortDirection labelSorting
protected java.awt.Dimension dimension
| Constructor Detail |
|---|
public AbstractLegend()
| Method Detail |
|---|
public abstract void addEntry(LegendEntry entry)
entry - new legend entry
public abstract void addEntry(java.lang.String text,
LegendSymbol symbol)
text - legend entry labelsymbol - legend entry symbolpublic abstract void addEntries(LegendEntry[] ll)
ll - array of legend entriespublic abstract void addSeparator()
public abstract void addSeparator(java.lang.String label)
label - Separator labelpublic void setPreferredSize(java.awt.Dimension dimension)
dimension - preferred size
public void setPreferredSize(int width,
int height)
AbstractView
setPreferredSize in interface ViewsetPreferredSize in class AbstractView<LegendPaintTags>width - the preferred width of the receiving viewheight - the preferred height of the receiving viewpublic abstract java.awt.Dimension getPreferredSize(AbstractGraphics g)
getPreferredSize in interface ViewgetPreferredSize in class AbstractView<LegendPaintTags>g - the Graphics context in which legend will be paintedpublic void setOrientation(Orientation orientation)
orientation - - the orientation valuepublic Orientation getOrientation()
public void setLayout(LegendLayout layout)
layout - - legend layout type.public LegendLayout getLayout()
public void initCursor()
public void setWordWrappingEnabled(boolean enable)
enable - true for enabling, false for disabling.public boolean getWordWrappingEnabled()
public boolean isHorizontallyExpandable()
ExpandableDecorationtrue if width of this view, when persisting in
top or bottom position inside DecoratedView,
should be expanded to maximum space available.
isHorizontallyExpandable in interface ExpandableDecorationtrue if view's width should be expanded to maximum,
false other wise.public boolean isVerticallyExpandable()
ExpandableDecorationtrue if height of this view, when persisting in
left or right position inside DecoratedView,
should be expanded to maximum space available.
isVerticallyExpandable in interface ExpandableDecorationtrue if view's height should be expanded to maximum,
false other wise.
protected void readObject(java.io.ObjectInputStream in)
throws java.io.IOException
java.io.IOExceptionpublic void setHorizontalAlignment(Alignment align)
align - value of vertical alignment. Possible values are: TextPainter.CENTER, TextPainter.TOP, TextPainter.BOTTOM.public void setVerticalAlignment(Alignment align)
align - value of vertical alignment. Possible values are: TextPainter.CENTER, TextPainter.TOP, TextPainter.BOTTOM.
public void setLabelAlignment(Alignment hAlign,
Alignment vAlign)
hAlign - - horizontal alignment value.vAlign - - vertical alignment value.public Alignment getLabelVAlignment()
public Alignment getLabelHAlignment()
public void removeAllEntries()
public java.util.Enumeration<LegendEntry> getEntries()
public void removeEntry(LegendEntry entry)
entry - legend entrypublic LegendEntry getEntry(int index)
index - position of element in Legend entries array.public void dispose()
dispose in interface Viewdispose in class AbstractView<LegendPaintTags>public void setCurrentSelection(LegendEntry selection)
selection - the legend entry to selectpublic TextStyle<LegendPaintTags> getTextStyle()
public SortDirection getLabelSorting()
public void setLabelSorting(SortDirection labelSorting)
labelSorting - set ASCENDING or DESCENDING if labels should be sortedprotected void sortLabels()
public AbstractStyle getStyle(StyleType styleType)
StyleEditorEntity
getStyle in interface StyleEditorEntitygetStyle in class AbstractView<LegendPaintTags>styleType - style type attributespublic java.util.List<LegendEntry> getContainingObjects()
getContainingObjects in interface View
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||