org.jplot2d.element.impl
Class AxisTitleImpl
- java.lang.Object
-
- org.jplot2d.element.impl.ElementImpl
-
- org.jplot2d.element.impl.AxisTitleImpl
-
- All Implemented Interfaces:
- AxisTitle, Element, AxisTitleEx, ElementEx
public class AxisTitleImpl extends ElementImpl implements AxisTitleEx
-
-
Constructor Summary
Constructors Constructor and Description AxisTitleImpl()
-
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, double x, double y)Draw this component only.java.awt.ColorgetColor()Gets the foreground color of this component.java.awt.FontgetEffectiveFont()Returns the effective font of this axis title.java.lang.StringgetFontName()Returns the name of the font.floatgetFontScale()Returns the scale apply to parent's font size when font size is NaN.floatgetFontSize()Returns the Font size.intgetFontStyle()Returns the style of the font.java.lang.StringgetId()Returns the id string of this elementInvokeStepgetInvokeStepFormParent()Return the invoke step to get this object from its parent.AxisExgetParent()Gets the parent of this component.java.awt.geom.Dimension2DgetSize()Returns the title size.java.lang.StringgetText()Returns the text string.MathElementgetTextModel()Returns the math model of this component.booleanisVisible()Determines whether this title should be visible when its parent is visible.voidsetColor(java.awt.Color color)Sets the foreground color of this component.voidsetFont(java.awt.Font font)Sets the font name, style and size for this component.voidsetFontName(java.lang.String name)Apply the new font with the given namevoidsetFontScale(float scale)Sets the scale apply to parent's font size when font size is NaN.voidsetFontSize(float size)Sets a new size of the string.voidsetFontStyle(int style)Apply a new style to the font.voidsetText(java.lang.String text)Defines the single line of text to be displayed.voidsetTextModel(MathElement model)Sets the math model of this component.voidsetVAlign(VAlign vAlign)Set the vertical alignment.voidsetVisible(boolean visible)Shows or hides this title depending on the value of parameterb.-
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.ElementEx
copyStructure, getFullId, 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
-
getInvokeStepFormParent
public InvokeStep getInvokeStepFormParent()
Description copied from interface:ElementExReturn the invoke step to get this object from its parent.- Specified by:
getInvokeStepFormParentin interfaceElementEx- Returns:
- the invoke step
-
getParent
public AxisEx getParent()
Description copied from interface:ElementGets the parent of this component.
-
isVisible
public boolean isVisible()
Description copied from interface:AxisTitleDetermines whether this title should be visible when its parent is visible. AxisTitle are initially visible.- Specified by:
isVisiblein interfaceAxisTitle- Returns:
trueif the title is visible,falseotherwise- See Also:
AxisTitle.setVisible(boolean)
-
setVisible
public void setVisible(boolean visible)
Description copied from interface:AxisTitleShows or hides this title depending on the value of parameterb.- Specified by:
setVisiblein interfaceAxisTitle- Parameters:
visible- iftrue, shows this title; otherwise, hides this title- See Also:
AxisTitle.isVisible()
-
getColor
public java.awt.Color getColor()
Description copied from interface:AxisTitleGets the foreground color of this component.- Specified by:
getColorin interfaceAxisTitle- Returns:
- this component's foreground color; if this component does not have a foreground color, the foreground color of its parent is returned
- See Also:
AxisTitle.setColor(java.awt.Color)
-
setColor
public void setColor(java.awt.Color color)
Description copied from interface:AxisTitleSets the foreground color of this component.- Specified by:
setColorin interfaceAxisTitle- Parameters:
color- the color to become this component's foreground color; if this parameter isnullthen this component will inherit the foreground color of its parent- See Also:
AxisTitle.getColor()
-
getFontName
public java.lang.String getFontName()
Description copied from interface:AxisTitleReturns the name of the font.- Specified by:
getFontNamein interfaceAxisTitle- Returns:
- the name of the font.
-
setFontName
public void setFontName(java.lang.String name)
Description copied from interface:AxisTitleApply the new font with the given name- Specified by:
setFontNamein interfaceAxisTitle- Parameters:
name- the font name.
-
getFontStyle
public int getFontStyle()
Description copied from interface:AxisTitleReturns the style of the font. The style can be PLAIN, BOLD, ITALIC, or BOLD+ITALIC.- Specified by:
getFontStylein interfaceAxisTitle- Returns:
- the style of the font
- See Also:
Font
-
setFontStyle
public void setFontStyle(int style)
Description copied from interface:AxisTitleApply a new style to the font. The style can be PLAIN, BOLD, ITALIC, or BOLD+ITALIC.- Specified by:
setFontStylein interfaceAxisTitle- Parameters:
style- the style to apply- See Also:
Font
-
getFontSize
public float getFontSize()
Description copied from interface:AxisTitleReturns the Font size.- Specified by:
getFontSizein interfaceAxisTitle- Returns:
- the font size.
-
setFontSize
public void setFontSize(float size)
Description copied from interface:AxisTitleSets a new size of the string.- Specified by:
setFontSizein interfaceAxisTitle- Parameters:
size- the new size of the font.
-
getFontScale
public float getFontScale()
Description copied from interface:AxisTitleReturns the scale apply to parent's font size when font size is NaN.- Specified by:
getFontScalein interfaceAxisTitle- Returns:
- the font scale.
-
setFontScale
public void setFontScale(float scale)
Description copied from interface:AxisTitleSets the scale apply to parent's font size when font size is NaN.- Specified by:
setFontScalein interfaceAxisTitle- Parameters:
scale- the scale
-
setFont
public void setFont(java.awt.Font font)
Description copied from interface:AxisTitleSets the font name, style and size for this component.
-
getEffectiveFont
public java.awt.Font getEffectiveFont()
Description copied from interface:AxisTitleReturns the effective font of this axis title.- Specified by:
getEffectiveFontin interfaceAxisTitle- Returns:
- the effective font of this axis title
-
getText
public java.lang.String getText()
Description copied from interface:AxisTitleReturns the text string.
-
setText
public void setText(java.lang.String text)
Description copied from interface:AxisTitleDefines 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}$".
-
getTextModel
public MathElement getTextModel()
Description copied from interface:AxisTitleExReturns the math model of this component.- Specified by:
getTextModelin interfaceAxisTitleEx- Returns:
- the math model
-
setTextModel
public void setTextModel(MathElement model)
Description copied from interface:AxisTitleExSets the math model of this component.- Specified by:
setTextModelin interfaceAxisTitleEx- Parameters:
model- the math model
-
setVAlign
public void setVAlign(VAlign vAlign)
Description copied from interface:AxisTitleExSet 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 interfaceAxisTitleEx- Parameters:
vAlign- the vertical alignment.
-
getSize
public java.awt.geom.Dimension2D getSize()
Description copied from interface:AxisTitleExReturns the title size. The units of bounds is pt (1/72 inch)- Specified by:
getSizein interfaceAxisTitleEx- Returns:
- the paper bounds of this title.
-
draw
public void draw(java.awt.Graphics2D g, double x, double y)Description copied from interface:AxisTitleExDraw this component only. All its children is not drawn.- Specified by:
drawin interfaceAxisTitleEx- Parameters:
g- to the Graphics2D drawing. The transformation of this component is not applied.x- the x positiony- the y position
-
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 classElementImpl- Parameters:
src- the src
-
-
DMelt 3.0 © DataMelt by jWork.ORG