org.jplot2d.element.impl
Class XYGraphImpl
- java.lang.Object
-
- org.jplot2d.element.impl.ElementImpl
-
- org.jplot2d.element.impl.ComponentImpl
-
- org.jplot2d.element.impl.GraphImpl
-
- org.jplot2d.element.impl.XYGraphImpl
-
- All Implemented Interfaces:
- Element, Graph, ComponentEx, ElementEx, GraphEx, XYGraphEx, PComponent, XYGraph
public class XYGraphImpl extends GraphImpl implements XYGraphEx
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.jplot2d.element.XYGraph
XYGraph.ChartType, XYGraph.FillClosureType
-
-
Constructor Summary
Constructors Constructor and Description XYGraphImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidclearIndSymbolColor()Clear individual symbol colors and reset all data point to the overall symbol color, which assigned byXYGraph.setSymbolColor(Color)voidcopyFrom(ElementEx src)Copies all properties from given src to this element.ComponentExcopyStructure(java.util.Map<ElementEx,ElementEx> orig2copyMap)Create a structural copy of this element and put them into orig2copyMap.voiddraw(java.awt.Graphics2D graphics)Draw this component only.XYGraph.ChartTypegetChartType()XYGraphDatagetData()Returns the graph data that this graph will draw.java.awt.ColorgetEffectiveSymbolColor()java.awt.ColorgetEffectiveSymbolColor(int idx)floatgetErrorbarCapSize()Returns the errorbar cap size in pt.XYGraph.FillClosureTypegetFillClosureType()Returns the method type to close the line for filling.java.awt.PaintgetFillPaint()java.lang.StringgetId()Returns the id string of this elementjava.awt.ColorgetIndSymbolColor(int idx)Returns the special color for data point idx.XYLegendItemExgetLegendItem()Returns the legend item associated with this graph.java.awt.BasicStrokegetLineStroke()java.lang.StringgetName()Returns the text displayed in the legend itemjava.awt.ColorgetSymbolColor()Returns the overall color of the symbols.SymbolShapegetSymbolShape()Returns the symbol shape.floatgetSymbolSize()Returns the size of the symbol usedbooleanisFillEnabled()booleanisLineVisible()booleanisSymbolVisible()voidsetChartType(XYGraph.ChartType chartType)Sets the chart type.voidsetData(XYGraphData data)voidsetErrorbarCapSize(float size)Sets the errorbar cap size in pt.voidsetFillClosureType(XYGraph.FillClosureType type)Sets the method type to close the line for filling.voidsetFillEnabled(boolean fillEnabled)voidsetFillPaint(java.awt.Paint paint)voidsetIndSymbolColor(int[] idxes, java.awt.Color color)Sets special color to data point indexes.voidsetIndSymbolColor(int idx, java.awt.Color color)Sets special color to data point index.voidsetLineStroke(java.awt.BasicStroke stroke)voidsetLineVisible(boolean lineVisible)voidsetName(java.lang.String text)Sets the text displayed in the legend itemvoidsetSymbolColor(java.awt.Color color)Set the overall color of the symbols.voidsetSymbolShape(SymbolShape symbolShape)Sets the specified symbol shape to be used.voidsetSymbolSize(float size)Set the size of symbolsvoidsetSymbolVisible(boolean symbolVisible)voidthisEffectiveColorChanged()Called when setColor() or parentEffectiveColorChanged() change the effective color of this component.-
Methods inherited from class org.jplot2d.element.impl.GraphImpl
getInvokeStepFormParent, getLocation, getParent, getSize, setLocation, thisEffectiveFontChanged
-
Methods inherited from class org.jplot2d.element.impl.ComponentImpl
addPropertyChangeListener, canContribute, getBounds, getColor, getEffectiveColor, getEffectiveFont, getEffectiveFontName, getEffectiveFontSize, getEffectiveFontStyle, getFontName, getFontScale, getFontSize, getFontStyle, getMooringMap, getPaperTransform, getSelectableBounds, getZOrder, isCacheable, isMovable, isRedrawNeeded, isSelectable, isVisible, parentEffectiveColorChanged, parentEffectiveFontChanged, removePropertyChangeListener, setCacheable, setColor, setFont, setFontName, setFontScale, setFontSize, setFontStyle, setMovable, setRedrawNeeded, setSelectable, setVisible, setZOrder
-
Methods inherited from class org.jplot2d.element.impl.ElementImpl
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.ComponentEx
canContribute, getEffectiveColor, getEffectiveFontName, getEffectiveFontSize, getEffectiveFontStyle, getMooringMap, isMovable, isRedrawNeeded, parentEffectiveColorChanged, parentEffectiveFontChanged, setMovable, setRedrawNeeded, thisEffectiveFontChanged
-
Methods inherited from interface org.jplot2d.element.PComponent
getBounds, getColor, getEffectiveFont, getFontName, getFontScale, getFontSize, getFontStyle, getLocation, getPaperTransform, getSelectableBounds, getSize, getZOrder, isCacheable, isSelectable, isVisible, setCacheable, setColor, setFont, setFontName, setFontScale, setFontSize, setFontStyle, setSelectable, setVisible, setZOrder
-
Methods inherited from interface org.jplot2d.element.impl.ElementEx
getFullId, getInvokeStepFormParent, notify, setParent
-
Methods inherited from interface org.jplot2d.element.Element
getEnvironment
-
-
-
-
Method Detail
-
getId
public java.lang.String getId()
Description copied from interface:ElementReturns the id string of this element
-
getLegendItem
public XYLegendItemEx getLegendItem()
Description copied from interface:XYGraphReturns the legend item associated with this graph.- Specified by:
getLegendItemin interfaceXYGraphEx- Specified by:
getLegendItemin interfaceXYGraph- Returns:
- the legend item
-
getName
public java.lang.String getName()
Description copied from interface:XYGraphReturns the text displayed in the legend item
-
setName
public void setName(java.lang.String text)
Description copied from interface:XYGraphSets the text displayed in the legend item
-
getData
public XYGraphData getData()
Description copied from interface:GraphReturns the graph data that this graph will draw.
-
setData
public void setData(XYGraphData data)
-
isSymbolVisible
public boolean isSymbolVisible()
- Specified by:
isSymbolVisiblein interfaceXYGraph
-
setSymbolVisible
public void setSymbolVisible(boolean symbolVisible)
- Specified by:
setSymbolVisiblein interfaceXYGraph
-
isLineVisible
public boolean isLineVisible()
- Specified by:
isLineVisiblein interfaceXYGraph
-
setLineVisible
public void setLineVisible(boolean lineVisible)
- Specified by:
setLineVisiblein interfaceXYGraph
-
getChartType
public XYGraph.ChartType getChartType()
- Specified by:
getChartTypein interfaceXYGraph- Returns:
- the chart type
-
setChartType
public void setChartType(XYGraph.ChartType chartType)
Sets the chart type.- Specified by:
setChartTypein interfaceXYGraph- Parameters:
chartType- the chart type
-
getSymbolShape
public SymbolShape getSymbolShape()
Description copied from interface:XYGraphReturns the symbol shape.- Specified by:
getSymbolShapein interfaceXYGraph- Returns:
- the symbol shape
-
setSymbolShape
public void setSymbolShape(SymbolShape symbolShape)
Description copied from interface:XYGraphSets the specified symbol shape to be used.- Specified by:
setSymbolShapein interfaceXYGraph- Parameters:
symbolShape- the symbol shape
-
getSymbolSize
public float getSymbolSize()
Description copied from interface:XYGraphReturns the size of the symbol used- Specified by:
getSymbolSizein interfaceXYGraph- Returns:
- the size of the symbol used
-
setSymbolSize
public void setSymbolSize(float size)
Description copied from interface:XYGraphSet the size of symbols- Specified by:
setSymbolSizein interfaceXYGraph- Parameters:
size- the size of symbols
-
getSymbolColor
public java.awt.Color getSymbolColor()
Description copied from interface:XYGraphReturns the overall color of the symbols.- Specified by:
getSymbolColorin interfaceXYGraph- Returns:
- the Color of the symbols, can be
null
-
setSymbolColor
public void setSymbolColor(java.awt.Color color)
Description copied from interface:XYGraphSet the overall color of the symbols. If the given color isnull, the color of the symbols will be the same of the color of the line.- Specified by:
setSymbolColorin interfaceXYGraph- Parameters:
color- the color of the symbols
-
getIndSymbolColor
public java.awt.Color getIndSymbolColor(int idx)
Description copied from interface:XYGraphReturns the special color for data point idx. Ornullif the data point use the overall symbol color.- Specified by:
getIndSymbolColorin interfaceXYGraph- Parameters:
idx- data point idx- Returns:
- the color for data point idx.
-
setIndSymbolColor
public void setIndSymbolColor(int idx, java.awt.Color color)Description copied from interface:XYGraphSets special color to data point index. This method can be called many times to assign different color to the given index.- Specified by:
setIndSymbolColorin interfaceXYGraph
-
setIndSymbolColor
public void setIndSymbolColor(int[] idxes, java.awt.Color color)Description copied from interface:XYGraphSets special color to data point indexes. This method can be called many times to assign different color to the given indexes.- Specified by:
setIndSymbolColorin interfaceXYGraph
-
clearIndSymbolColor
public void clearIndSymbolColor()
Description copied from interface:XYGraphClear individual symbol colors and reset all data point to the overall symbol color, which assigned byXYGraph.setSymbolColor(Color)- Specified by:
clearIndSymbolColorin interfaceXYGraph
-
getEffectiveSymbolColor
public java.awt.Color getEffectiveSymbolColor()
- Specified by:
getEffectiveSymbolColorin interfaceXYGraphEx
-
getEffectiveSymbolColor
public java.awt.Color getEffectiveSymbolColor(int idx)
- Specified by:
getEffectiveSymbolColorin interfaceXYGraphEx
-
thisEffectiveColorChanged
public void thisEffectiveColorChanged()
Description copied from interface:ComponentExCalled when setColor() or parentEffectiveColorChanged() change the effective color of this component.- Specified by:
thisEffectiveColorChangedin interfaceComponentEx
-
getLineStroke
public java.awt.BasicStroke getLineStroke()
- Specified by:
getLineStrokein interfaceXYGraph
-
setLineStroke
public void setLineStroke(java.awt.BasicStroke stroke)
- Specified by:
setLineStrokein interfaceXYGraph
-
isFillEnabled
public boolean isFillEnabled()
- Specified by:
isFillEnabledin interfaceXYGraph
-
setFillEnabled
public void setFillEnabled(boolean fillEnabled)
- Specified by:
setFillEnabledin interfaceXYGraph
-
getFillPaint
public java.awt.Paint getFillPaint()
- Specified by:
getFillPaintin interfaceXYGraph
-
setFillPaint
public void setFillPaint(java.awt.Paint paint)
- Specified by:
setFillPaintin interfaceXYGraph
-
getFillClosureType
public XYGraph.FillClosureType getFillClosureType()
Description copied from interface:XYGraphReturns the method type to close the line for filling.- Specified by:
getFillClosureTypein interfaceXYGraph- Returns:
- the closure type
-
setFillClosureType
public void setFillClosureType(XYGraph.FillClosureType type)
Description copied from interface:XYGraphSets the method type to close the line for filling.- Specified by:
setFillClosureTypein interfaceXYGraph- Parameters:
type- the closure type
-
getErrorbarCapSize
public float getErrorbarCapSize()
Description copied from interface:XYGraphReturns the errorbar cap size in pt. If the cap size is 0, no cap is drawn.- Specified by:
getErrorbarCapSizein interfaceXYGraph- Returns:
- the errorbar cap size
-
setErrorbarCapSize
public void setErrorbarCapSize(float size)
Description copied from interface:XYGraphSets the errorbar cap size in pt. The default cap size is 0, means no cap is drawn.- Specified by:
setErrorbarCapSizein interfaceXYGraph- Parameters:
size- the errorbar cap size
-
copyStructure
public ComponentEx copyStructure(java.util.Map<ElementEx,ElementEx> orig2copyMap)
Description copied from interface:ElementExCreate a structural copy of this element and put them into orig2copyMap. All properties are not copied. The parent of the copy are not set by this method.- Specified by:
copyStructurein interfaceComponentEx- Specified by:
copyStructurein interfaceElementEx- Overrides:
copyStructurein classComponentImpl- Parameters:
orig2copyMap- original element to copy map- Returns:
- the structural copy of this element
-
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 classComponentImpl- Parameters:
src- the src
-
draw
public void draw(java.awt.Graphics2D graphics)
Description copied from interface:ComponentExDraw this component only. All its children is not drawn.- Specified by:
drawin interfaceComponentEx- Parameters:
graphics- to the Graphics2D drawing. The transformation of this component is not applied.
-
-
DMelt 3.0 © DataMelt by jWork.ORG