org.jhotdraw.draw
Interface TextHolderFigure
-
- All Superinterfaces:
- java.lang.Cloneable, Figure, java.io.Serializable
- All Known Implementing Classes:
- LabelFigure, NodeFigure, SVGTextAreaFigure, SVGTextFigure, TextAreaFigure, TextFigure
public interface TextHolderFigure extends Figure
The interface of aFigurethat has some editable text contents.
Design PatternsPrototype
The text creation tools create new figures by cloning a prototypeTextHolderFigureobject.
Prototype:TextHolderFigure; Client:TextCreationTool,TextAreaCreationTool.Prototype
The text input format creates new text holder figures by cloning a prototype figure object and assigning an image to it, which was read from data input. That's the reason whyFigureextends theCloneableinterface.
Prototype:TextHolderFigure; Client:TextInputFormat.
-
-
Field Summary
-
Fields inherited from interface org.jhotdraw.draw.Figure
CONNECTABLE_PROPERTY, REMOVABLE_PROPERTY, SELECTABLE_PROPERTY, TRANSFORMABLE_PROPERTY
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description doublegetBaseline()Gets the baseline of the first line of text, relative to the upper left corner of the figure bounds.java.awt.ColorgetFillColor()Returns the fill color to be used by a text editor for editing this Figure.java.awt.FontgetFont()Returns the font to be used by a text editor for editing this Figure.floatgetFontSize()Gets the font size of the text held by the TextHolderFigure.Insets2D.DoublegetInsets()Returns Insets to be used by the text editor relative to the handle bounds of the figure.TextHolderFiguregetLabelFor()Sometimes we want to use a TextHolderFigure as a label for another TextHolderFigure.intgetTabSize()Gets the number of characters used to expand tabs.java.lang.StringgetText()Returns the text held by the Text Holder.java.awt.ColorgetTextColor()Returns the text color to be used by a text editor for editing this Figure.intgetTextColumns()Gets the number of columns to be overlaid when the figure is edited.booleanisEditable()Returns true if the text of the TextHolderFigure can be edited.booleanisTextOverflow()Returns true, if the text does not fit into the bounds of the Figure.voidsetFontSize(float size)Sets the font size of the text held by the TextHolderFigure.voidsetText(java.lang.String text)Sets the text of the Text Holder.-
Methods inherited from interface org.jhotdraw.draw.Figure
addFigureListener, addNotify, addPropertyChangeListener, changed, clone, contains, createHandles, draw, findCompatibleConnector, findConnector, findFigureInside, get, getActions, getAttributes, getAttributesRestoreData, getBounds, getConnectors, getCursor, getDecomposition, getDrawingArea, getEndPoint, getLayer, getPreferredSize, getStartPoint, getTool, getToolTipText, getTransformRestoreData, handleDrop, handleMouseClick, includes, isConnectable, isRemovable, isSelectable, isTransformable, isVisible, remap, removeFigureListener, removeNotify, removePropertyChangeListener, requestRemove, restoreAttributesTo, restoreTransformTo, set, setBounds, transform, willChange
-
-
-
-
Method Detail
-
isEditable
boolean isEditable()
Returns true if the text of the TextHolderFigure can be edited.
-
getFont
java.awt.Font getFont()
Returns the font to be used by a text editor for editing this Figure.
-
getTextColor
java.awt.Color getTextColor()
Returns the text color to be used by a text editor for editing this Figure.
-
getFillColor
java.awt.Color getFillColor()
Returns the fill color to be used by a text editor for editing this Figure.
-
getLabelFor
TextHolderFigure getLabelFor()
Sometimes we want to use a TextHolderFigure as a label for another TextHolderFigure. Returns the TextHolderFigure that should be really used.
-
getTabSize
int getTabSize()
Gets the number of characters used to expand tabs.
-
getText
java.lang.String getText()
Returns the text held by the Text Holder.
-
setText
void setText(java.lang.String text)
Sets the text of the Text Holder.- Parameters:
text-
-
getTextColumns
int getTextColumns()
Gets the number of columns to be overlaid when the figure is edited.
-
setFontSize
void setFontSize(float size)
Sets the font size of the text held by the TextHolderFigure.
-
getFontSize
float getFontSize()
Gets the font size of the text held by the TextHolderFigure.
-
getBaseline
double getBaseline()
Gets the baseline of the first line of text, relative to the upper left corner of the figure bounds.
-
getInsets
Insets2D.Double getInsets()
Returns Insets to be used by the text editor relative to the handle bounds of the figure.
-
isTextOverflow
boolean isTextOverflow()
Returns true, if the text does not fit into the bounds of the Figure.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG