org.jplot2d.element.impl
Class SymbolAnnotationImpl
- java.lang.Object
-
- org.jplot2d.element.impl.ElementImpl
-
- org.jplot2d.element.impl.ComponentImpl
-
- org.jplot2d.element.impl.AnnotationImpl
-
- org.jplot2d.element.impl.PointAnnotationImpl
-
- org.jplot2d.element.impl.SymbolAnnotationImpl
-
- All Implemented Interfaces:
- Annotation, Element, AnnotationEx, ComponentEx, ElementEx, PointAnnotationEx, SymbolAnnotationEx, MovableComponent, PComponent, PointAnnotation, SymbolAnnotation, TextComponent
- Direct Known Subclasses:
- CoordinateAnnotationImpl
public class SymbolAnnotationImpl extends PointAnnotationImpl implements SymbolAnnotationEx
-
-
Constructor Summary
Constructors Constructor and Description SymbolAnnotationImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidcopyFrom(ElementEx src)Copies all properties from given src to this element.voiddraw(java.awt.Graphics2D g)Draw this component only.doublegetAngle()Returns the rotation angle of the text.java.awt.geom.Rectangle2DgetBounds()Returns the paper bounds relative to its location.HAligngetHAlign()java.lang.StringgetId()Returns the id string of this elementPaperTransformgetPaperTransform()Returns the paper transform of this component, which can be used to convert between device coordinate and paper coordinate of this component.floatgetSymbolScale()Returns the scale apply to effective font size to derive symbol size when symbol size is NaN.SymbolShapegetSymbolShape()Returns the symbol shape of this annotationfloatgetSymbolSize()Returns the symbol size of this annotationjava.lang.StringgetText()Returns the text string.MathElementgetTextModel()floatgetTextOffsetFactorX()Returns the X offset factor of text.floatgetTextOffsetFactorY()Returns the Y offset of text.The offset is relative to the base point of this annotation.VAligngetVAlign()voidsetAngle(double angle)Set the rotation angle of the text.voidsetHAlign(HAlign hAlign)Set the horizontal alignment.voidsetSymbolScale(float scale)Sets the scale apply to effective font size to derive symbol size when symbol size is NaN.voidsetSymbolShape(SymbolShape symbol)Sets the symbol shape of this annotationvoidsetSymbolSize(float size)Sets the symbol shape of this annotationvoidsetText(java.lang.String text)Defines the single line of text to be displayed.voidsetTextModel(MathElement model)voidsetTextOffsetFactorX(float offset)Sets the X offset factor of text.voidsetTextOffsetFactorY(float offset)Sets the Y offset of text.The offset is relative to the base point of this annotation.voidsetVAlign(VAlign vAlign)Set the vertical alignment.-
Methods inherited from class org.jplot2d.element.impl.PointAnnotationImpl
getLocation, getSize, getValuePoint, setLocation, setValuePoint, setValuePoint
-
Methods inherited from class org.jplot2d.element.impl.AnnotationImpl
getInvokeStepFormParent, getParent, setLocation, thisEffectiveColorChanged, thisEffectiveFontChanged
-
Methods inherited from class org.jplot2d.element.impl.ComponentImpl
addPropertyChangeListener, canContribute, copyStructure, getColor, getEffectiveColor, getEffectiveFont, getEffectiveFontName, getEffectiveFontSize, getEffectiveFontStyle, getFontName, getFontScale, getFontSize, getFontStyle, getMooringMap, 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.AnnotationEx
getParent
-
Methods inherited from interface org.jplot2d.element.impl.ComponentEx
canContribute, copyStructure, getEffectiveColor, getEffectiveFontName, getEffectiveFontSize, getEffectiveFontStyle, getMooringMap, isMovable, isRedrawNeeded, parentEffectiveColorChanged, parentEffectiveFontChanged, setMovable, setRedrawNeeded, thisEffectiveColorChanged, thisEffectiveFontChanged
-
Methods inherited from interface org.jplot2d.element.impl.ElementEx
getFullId, getInvokeStepFormParent, notify, setParent
-
Methods inherited from interface org.jplot2d.element.PointAnnotation
getValuePoint, setValuePoint, setValuePoint
-
Methods inherited from interface org.jplot2d.element.Annotation
isMovable, setMovable
-
Methods inherited from interface org.jplot2d.element.MovableComponent
setLocation, setLocation
-
-
-
-
Method Detail
-
getId
public java.lang.String getId()
Description copied from interface:ElementReturns the id string of this element- Specified by:
getIdin interfaceElement- Overrides:
getIdin classPointAnnotationImpl- Returns:
- the id string
-
getPaperTransform
public PaperTransform getPaperTransform()
Description copied from interface:PComponentReturns the paper transform of this component, which can be used to convert between device coordinate and paper coordinate of this component. The original point of paper coordinate is the location point of this component.Returns
nullif the component is not added to a plot or not laid out- Specified by:
getPaperTransformin interfacePComponent- Overrides:
getPaperTransformin classComponentImpl- Returns:
- the paper transform of this component
-
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 classPointAnnotationImpl- Parameters:
src- the src
-
getSymbolShape
public SymbolShape getSymbolShape()
Description copied from interface:SymbolAnnotationReturns the symbol shape of this annotation- Specified by:
getSymbolShapein interfaceSymbolAnnotation- Returns:
- the symbol shape of this annotation
-
setSymbolShape
public void setSymbolShape(SymbolShape symbol)
Description copied from interface:SymbolAnnotationSets the symbol shape of this annotation- Specified by:
setSymbolShapein interfaceSymbolAnnotation- Parameters:
symbol- the symbol shape of this annotation
-
getSymbolSize
public float getSymbolSize()
Description copied from interface:SymbolAnnotationReturns the symbol size of this annotation- Specified by:
getSymbolSizein interfaceSymbolAnnotation- Returns:
- the symbol size of this annotation
-
setSymbolSize
public void setSymbolSize(float size)
Description copied from interface:SymbolAnnotationSets the symbol shape of this annotation- Specified by:
setSymbolSizein interfaceSymbolAnnotation
-
getSymbolScale
public float getSymbolScale()
Description copied from interface:SymbolAnnotationReturns the scale apply to effective font size to derive symbol size when symbol size is NaN.- Specified by:
getSymbolScalein interfaceSymbolAnnotation- Returns:
- the font scale.
-
setSymbolScale
public void setSymbolScale(float scale)
Description copied from interface:SymbolAnnotationSets the scale apply to effective font size to derive symbol size when symbol size is NaN.- Specified by:
setSymbolScalein interfaceSymbolAnnotation- Parameters:
scale- the scale
-
getTextOffsetFactorX
public float getTextOffsetFactorX()
Description copied from interface:SymbolAnnotationReturns the X offset factor of text. The offset is relative to the base point of this annotation. The factor apply to the half size of symbol.- Specified by:
getTextOffsetFactorXin interfaceSymbolAnnotation- Returns:
- the X offset factor of text
-
setTextOffsetFactorX
public void setTextOffsetFactorX(float offset)
Description copied from interface:SymbolAnnotationSets the X offset factor of text. The offset is relative to the base point of this annotation. The factor apply to the half size of symbol.- Specified by:
setTextOffsetFactorXin interfaceSymbolAnnotation- Parameters:
offset- the X offset factor of text
-
getTextOffsetFactorY
public float getTextOffsetFactorY()
Description copied from interface:SymbolAnnotationReturns the Y offset of text.The offset is relative to the base point of this annotation. The factor apply to the half size of symbol.- Specified by:
getTextOffsetFactorYin interfaceSymbolAnnotation- Returns:
- the Y offset factor of text
-
setTextOffsetFactorY
public void setTextOffsetFactorY(float offset)
Description copied from interface:SymbolAnnotationSets the Y offset of text.The offset is relative to the base point of this annotation. The factor apply to the half size of symbol.- Specified by:
setTextOffsetFactorYin interfaceSymbolAnnotation- Parameters:
offset- the Y offset factor of text
-
getHAlign
public HAlign getHAlign()
- Specified by:
getHAlignin interfaceTextComponent- Returns:
- the horizontal alignment.
-
setHAlign
public void setHAlign(HAlign hAlign)
Description copied from interface:TextComponentSet the horizontal alignment. The alignment can be LEFT, CENTER, or RIGHT. eg, LEFT means the title is on the left of the base point.- Specified by:
setHAlignin interfaceTextComponent- Parameters:
hAlign- the horizontal alignment.
-
getVAlign
public VAlign getVAlign()
- Specified by:
getVAlignin interfaceTextComponent- Returns:
- the vertical alignment or null if not set.
-
setVAlign
public void setVAlign(VAlign vAlign)
Description copied from interface:TextComponentSet the vertical alignment. The alignment can be TOP, MIDDLE, or BOTTOM. eg, TOP means the title is on the top of the base point- Specified by:
setVAlignin interfaceTextComponent- Parameters:
vAlign- the vertical alignment.
-
getAngle
public double getAngle()
Description copied from interface:SymbolAnnotationReturns the rotation angle of the text.- Specified by:
getAnglein interfaceSymbolAnnotation- Returns:
- the rotation angle value
-
setAngle
public void setAngle(double angle)
Description copied from interface:SymbolAnnotationSet the rotation angle of the text. The angle start to count from horizontal direction and grow in counter-clock wise direction.- Specified by:
setAnglein interfaceSymbolAnnotation- Parameters:
angle- the rotation angle
-
getText
public java.lang.String getText()
Description copied from interface:TextComponentReturns the text string.- Specified by:
getTextin interfaceTextComponent- Returns:
- a String
-
setText
public void setText(java.lang.String text)
Description copied from interface:TextComponentDefines the single line of text to be displayed. The string can be in TeX-like syntax. A pair of "$" mark into math mode and out math mode. In math mode, Greek letter can be inputed as \alpha, \beta, etc. Superscripts (up high) and subscripts (down low) can be inputed by using "^" and "_". Notice that ^ and _ apply only to the next single character. If you want several things to be superscripted or subscripted, just enclose them in braces. eg: "plain text $x_\alpha^{2y}$".- Specified by:
setTextin interfaceTextComponent
-
getTextModel
public MathElement getTextModel()
-
setTextModel
public void setTextModel(MathElement model)
-
getBounds
public java.awt.geom.Rectangle2D getBounds()
Description copied from interface:PComponentReturns the paper bounds relative to its location. The units of bounds is pt (1/72 inch)- Specified by:
getBoundsin interfacePComponent- Overrides:
getBoundsin classComponentImpl- Returns:
- the paper bounds of this component.
-
draw
public void draw(java.awt.Graphics2D g)
Description copied from interface:ComponentExDraw this component only. All its children is not drawn.- Specified by:
drawin interfaceComponentEx- Parameters:
g- to the Graphics2D drawing. The transformation of this component is not applied.
-
-
DMelt 3.0 © DataMelt by jWork.ORG