org.jplot2d.element.impl
Class XYLegendItemImpl
- java.lang.Object
-
- org.jplot2d.element.impl.ElementImpl
-
- org.jplot2d.element.impl.LegendItemImpl
-
- org.jplot2d.element.impl.XYLegendItemImpl
-
- All Implemented Interfaces:
- Element, ElementEx, LegendItemEx, XYLegendItemEx, LegendItem
public class XYLegendItemImpl extends LegendItemImpl implements XYLegendItemEx
-
-
Constructor Summary
Constructors Constructor and Description XYLegendItemImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleancanContribute()Returnstrueif the item has a text can be displayed in legend.voidcopyFrom(ElementEx src)Copies all properties from given src to this element.voiddraw(java.awt.Graphics2D g)This method is called by LegendImpl.XYGraphExgetParent()Gets the parent of this component.java.awt.geom.Dimension2DgetSize()floatgetSymbolSize()Returns the size of the symbol draw in legend.java.lang.StringgetText()Returns the text displayed in the legend itemvoidgraphSymbolSizeChanged()Called by XYGraphEx to notify XYLegendItemEx that the symbol size has been changed.voidlegendEffectiveFontChanged()Called by legend when its effective font changedvoidsetLegend(LegendEx legend)voidsetSymbolSize(float size)Set the size of symbol draw in legend.voidsetText(java.lang.String text)Sets the text displayed in the legend item-
Methods inherited from class org.jplot2d.element.impl.LegendItemImpl
getBounds, getId, getInvokeStepFormParent, getLegend, getLocation, isVisible, setLocation, setVisible
-
Methods inherited from class org.jplot2d.element.impl.ElementImpl
copyStructure, getEnvironment, getFullId, notify, setParent, toString
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.jplot2d.element.impl.LegendItemEx
getLegend, setLocation
-
Methods inherited from interface org.jplot2d.element.LegendItem
isVisible, setVisible
-
Methods inherited from interface org.jplot2d.element.impl.ElementEx
copyStructure, getFullId, getInvokeStepFormParent, notify, setParent
-
Methods inherited from interface org.jplot2d.element.Element
getEnvironment, getId
-
-
-
-
Method Detail
-
getParent
public XYGraphEx getParent()
Description copied from interface:ElementGets the parent of this component.- Specified by:
getParentin interfaceElement- Specified by:
getParentin interfaceElementEx- Specified by:
getParentin interfaceLegendItemEx- Specified by:
getParentin interfaceXYLegendItemEx- Specified by:
getParentin interfaceLegendItem- Overrides:
getParentin classLegendItemImpl- Returns:
- the parent of this component
-
setLegend
public void setLegend(LegendEx legend)
- Specified by:
setLegendin interfaceLegendItemEx- Overrides:
setLegendin classLegendItemImpl
-
legendEffectiveFontChanged
public void legendEffectiveFontChanged()
Description copied from interface:LegendItemExCalled by legend when its effective font changed- Specified by:
legendEffectiveFontChangedin interfaceLegendItemEx
-
getSize
public java.awt.geom.Dimension2D getSize()
- Specified by:
getSizein interfaceLegendItemEx
-
getText
public java.lang.String getText()
Description copied from interface:LegendItemExReturns the text displayed in the legend item- Specified by:
getTextin interfaceLegendItemEx- Returns:
- the text
-
setText
public void setText(java.lang.String text)
Description copied from interface:LegendItemExSets the text displayed in the legend item- Specified by:
setTextin interfaceLegendItemEx- Parameters:
text- the text displayed in the legend item
-
canContribute
public boolean canContribute()
Description copied from interface:LegendItemExReturnstrueif the item has a text can be displayed in legend.- Specified by:
canContributein interfaceLegendItemEx- Returns:
- the indicator
-
getSymbolSize
public float getSymbolSize()
Description copied from interface:LegendItemReturns the size of the symbol draw in legend. The default symbol size isFloat.NaN, means the same size as the symbol size of XYGraph.- Specified by:
getSymbolSizein interfaceLegendItem- Returns:
- the size of the symbol draw in legend
-
setSymbolSize
public void setSymbolSize(float size)
Description copied from interface:LegendItemSet the size of symbol draw in legend. Setting toFloat.NaNmeans the same size as the symbol size of XYGraph.- Specified by:
setSymbolSizein interfaceLegendItem- Parameters:
size- the size of symbols draw in legend
-
graphSymbolSizeChanged
public void graphSymbolSizeChanged()
Description copied from interface:XYLegendItemExCalled by XYGraphEx to notify XYLegendItemEx that the symbol size has been changed.- Specified by:
graphSymbolSizeChangedin interfaceXYLegendItemEx
-
draw
public void draw(java.awt.Graphics2D g)
Description copied from interface:LegendItemExThis method is called by LegendImpl. The given g has been transformed to legend's paper space.- Specified by:
drawin interfaceLegendItemEx- Parameters:
g- the graphic to draw.
-
copyFrom
public void copyFrom(ElementEx src)
Description copied from interface:ElementExCopies all properties from given src to this element. Notice properties of sub-elements are not copied over.- Specified by:
copyFromin interfaceElementEx- Overrides:
copyFromin classLegendItemImpl- Parameters:
src- the src
-
-
DMelt 3.0 © DataMelt by jWork.ORG