org.jplot2d.element
Interface Title
-
- All Superinterfaces:
- Element, MovableComponent, PComponent, TextComponent
- All Known Subinterfaces:
- TitleEx
- All Known Implementing Classes:
- TitleImpl
public interface Title extends TextComponent, MovableComponent
A text title of plot. A plot may has multiple title. They are always in top-down order.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description doublegetGapFactor()Returns the ratio of gap to its height.HAligngetHAlign()Get the horizontal alignment.java.awt.geom.Point2DgetLocation()Gets the location of this title.TitlePositiongetPosition()Gets the current position of this title in a layer.VAligngetVAlign()Get the vertical alignment.booleanisMovable()Returnstrueif the component is movable by mouse dragging.voidsetGapFactor(double factor)Sets the ratio of gap to its height.voidsetHAlign(HAlign halign)Set the horizontal alignment.voidsetLocation(java.awt.geom.Point2D loc)Moves this title to a new location.voidsetMovable(boolean movable)Set if the component is movable by mouse dragging.voidsetPosition(TitlePosition position)Sets the position of this title.voidsetVAlign(VAlign valign)Set the vertical alignment.-
Methods inherited from interface org.jplot2d.element.TextComponent
getText, setText
-
Methods inherited from interface org.jplot2d.element.MovableComponent
setLocation
-
Methods inherited from interface org.jplot2d.element.PComponent
getBounds, getColor, getEffectiveFont, getFontName, getFontScale, getFontSize, getFontStyle, getPaperTransform, getParent, getSelectableBounds, getSize, getZOrder, isCacheable, isSelectable, isVisible, setCacheable, setColor, setFont, setFontName, setFontScale, setFontSize, setFontStyle, setSelectable, setVisible, setZOrder
-
Methods inherited from interface org.jplot2d.element.Element
getEnvironment, getId
-
-
-
-
Method Detail
-
getPosition
TitlePosition getPosition()
Gets the current position of this title in a layer.- Returns:
- the position.
-
setPosition
void setPosition(TitlePosition position)
Sets the position of this title. Possible value is FREE, TOPLEFT, TOPCENTER, TOPRIGHT, BOTTOMLEFT, BOTTOMCENTER, BOTTOMRIGHT. Only when position isFREE, the title can be located bysetLocation(Point2D),#setHAlign(),#setVAlign().- Parameters:
position- the position of this title.
-
getLocation
java.awt.geom.Point2D getLocation()
Gets the location of this title.- Specified by:
getLocationin interfacePComponent- Returns:
- an instance of
Pointrepresenting the base point of this title
-
setLocation
void setLocation(java.awt.geom.Point2D loc)
Moves this title to a new location.Notice: This method should be called when the position is
null, otherwise the behavior is not defined.- Specified by:
setLocationin interfaceMovableComponent- Parameters:
loc- the base point of the title
-
getHAlign
HAlign getHAlign()
Get the horizontal alignment.- Specified by:
getHAlignin interfaceTextComponent- Returns:
- the horizontal alignment.
-
setHAlign
void setHAlign(HAlign halign)
Set the horizontal alignment. The alignment can be LEFT, CENTER, or RIGHT. eg, LEFT means the base point is on the left of this title.Notice: This method should be called when the position is
null, otherwise the behavior is not defined.- Specified by:
setHAlignin interfaceTextComponent- Parameters:
halign- horizontal alignment.
-
getVAlign
VAlign getVAlign()
Get the vertical alignment.- Specified by:
getVAlignin interfaceTextComponent- Returns:
- the vertical alignment.
-
setVAlign
void setVAlign(VAlign valign)
Set the vertical alignment. The alignment can be TOP, MIDDLE, or BOTTOM. eg, TOP means the base point is on the top of this title.Notice: This method should be called when the position is
null, otherwise the behavior is not defined.- Specified by:
setVAlignin interfaceTextComponent- Parameters:
valign- The vertical alignment.
-
getGapFactor
double getGapFactor()
Returns the ratio of gap to its height. The default value is 1/4.- Returns:
- the gap factor
-
setGapFactor
void setGapFactor(double factor)
Sets the ratio of gap to its height. The gap is under the title when its position is TOPLEFT, TOPCENTER, TOPRIGHT. The gap is above the title when its position is BOTTOMLEFT, BOTTOMCENTER, BOTTOMRIGHT.
-
isMovable
boolean isMovable()
Description copied from interface:MovableComponentReturnstrueif the component is movable by mouse dragging. Only selectable component can be movable.- Specified by:
isMovablein interfaceMovableComponent- Returns:
trueif movable
-
setMovable
void setMovable(boolean movable)
Description copied from interface:MovableComponentSet if the component is movable by mouse dragging.- Specified by:
setMovablein interfaceMovableComponent- Parameters:
movable-trueif movable
-
-
DMelt 3.0 © DataMelt by jWork.ORG