|
|||||||||
| 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
lt.monarch.chart.legend.Legend
public class Legend extends AbstractLegend
Legend view. Maintains a list of legend entries and renders a legend.




You can set background color ant border paint style using PaintStyle object. Text properties can be set using TextStyle object.
| Modifier and Type | Class and Description |
|---|---|
static class |
Legend.RangeRepresentation
Inner range representation class used for representing ranges, such as: 1..6 or 1-6 or [1-6] |
| Nested classes/interfaces inherited from class lt.monarch.chart.engine.AbstractLegend |
|---|
AbstractLegend.LegendEntryEntity |
| Modifier and Type | Field and Description |
|---|---|
protected lt.monarch.chart.legend.Legend.MouseEvents |
mouseEvents
Mouse event listener |
| Fields inherited from class lt.monarch.chart.engine.AbstractLegend |
|---|
actualSize, currentSelection, cursorChanged, dimension, drawBounds, entries, horizontalLabelAlignment, labelSorting, lastPt, layout, margin, mouseClick, moveCursor, orientation, scrollRange, style, tempCursor, textPainter, textStyle, verticalLabelAlignment, wordWrappingEnabled |
| Fields inherited from class lt.monarch.chart.AbstractView |
|---|
layoutInvalid, paintStyle |
| Constructor and Description |
|---|
Legend()
Creates an empty legend object |
Legend(Chart chart)
Creates a legend object and initializes it with data from the chart object |
Legend(LegendEntry[] entries)
Creates a legend object and initializes it with the entry list |
| Modifier and Type | Method and Description |
|---|---|
protected void |
activate()
Activates the legend. |
void |
addEntries(LegendEntry[] ll)
Adds a list of entries the the legend at once. |
void |
addEntries(LegendEntry[] ll,
boolean skipDuplicates)
Adds a list of entries the the legend at once. |
void |
addEntry(LegendEntry entry)
Adds a new entry to the legend. |
void |
addEntry(LegendEntry entry,
boolean skipDuplicates)
Adds a new entry to the legend. |
void |
addEntry(java.lang.String text,
LegendSymbol symbol)
Constructs and adds a new entry to the legend. |
void |
addSeparator()
Adds a separator to the legend. |
void |
addSeparator(java.lang.String label)
Adds a separator to the legend. |
protected void |
deactivate()
Deactivates the legend. |
protected java.awt.Dimension[] |
getEntryDimensions(AbstractGraphics g)
Computes and returns dimensions of legend entries. |
int |
getMaxColumns()
Returns number of columns allowed in the legend layout. |
protected int |
getMaxKeyWidth(AbstractGraphics g)
Returns the width of the widest legend symbol. |
java.awt.Dimension |
getPreferredSize(AbstractGraphics g)
Gets the preferred size of this legend. |
Legend.RangeRepresentation |
getRangeRepresentation()
Gets range representation for the labels |
protected void |
layout(AbstractGraphics g)
Layouts the legend. |
protected void |
paint(AbstractGraphics g)
Paints the legend in the specified Graphics context. |
void |
setMaxColumns(int maxColumns)
Sets number of columns allowed in the legend. |
| Methods inherited from class lt.monarch.chart.AbstractView |
|---|
addViewListener, clone, container, finalize, getAlignmentX, getAlignmentY, getBounds, getChartObjectBounds, getContainer, getGraphicsType, getHeight, getMaximumSize, getMinimumSize, getPaintMode, getPaintStyle, getParent, getSize, getSize, getStyle, getWidth, getX, getY, invalidate, isLayoutValid, 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 |
|---|
protected lt.monarch.chart.legend.Legend.MouseEvents mouseEvents
| Constructor Detail |
|---|
public Legend()
public Legend(Chart chart)
chart - chart object to be usedpublic Legend(LegendEntry[] entries)
entries - legend entries| Method Detail |
|---|
public void setMaxColumns(int maxColumns)
maxColumns - maximum allowed columnspublic int getMaxColumns()
public void addEntry(LegendEntry entry)
AbstractLegend
addEntry in class AbstractLegendentry - new legend entry
public void addEntry(java.lang.String text,
LegendSymbol symbol)
AbstractLegend
addEntry in class AbstractLegendtext - legend entry labelsymbol - legend entry symbolpublic void addEntries(LegendEntry[] ll)
AbstractLegend
addEntries in class AbstractLegendll - array of legend entries
public void addEntry(LegendEntry entry,
boolean skipDuplicates)
entry - new legend entryskipDuplicates - true if duplicated entries must be skipped, false otherwise.
public void addEntries(LegendEntry[] ll,
boolean skipDuplicates)
ll - array of legend entriesskipDuplicates - true if duplicated entries must be skipped, false otherwise.public void addSeparator()
AbstractLegend
addSeparator in class AbstractLegendpublic void addSeparator(java.lang.String label)
AbstractLegend
addSeparator in class AbstractLegendlabel - Separator labelprotected int getMaxKeyWidth(AbstractGraphics g)
g - the Graphics context in which legend will be paintedprotected java.awt.Dimension[] getEntryDimensions(AbstractGraphics g)
g - the Graphics context in which legend will be paintedDimension objects, representing dimensions of the legend
entriespublic java.awt.Dimension getPreferredSize(AbstractGraphics g)
AbstractLegend
getPreferredSize in interface ViewgetPreferredSize in class AbstractLegendg - the Graphics context in which legend will be paintedprotected void layout(AbstractGraphics g)
layout in class AbstractView<LegendPaintTags>g - the Graphics context in which legend will be paintedprotected void paint(AbstractGraphics g)
paint in class AbstractView<LegendPaintTags>g - the Graphics context in which to paint legendprotected void activate()
activate in class AbstractView<LegendPaintTags>protected void deactivate()
deactivate in class AbstractView<LegendPaintTags>public Legend.RangeRepresentation getRangeRepresentation()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||