|
JHotDraw 7.0.6 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jhotdraw.draw.AbstractFigure
org.jhotdraw.draw.AttributedFigure
org.jhotdraw.draw.TextFigure
public class TextFigure
A text figure.
TextTool,
Serialized Form| Field Summary | |
|---|---|
protected java.awt.geom.Point2D.Double |
origin
|
| Fields inherited from class org.jhotdraw.draw.AbstractFigure |
|---|
changingDepth, decorator, listenerList |
| Constructor Summary | |
|---|---|
TextFigure()
Creates a new instance. |
|
TextFigure(java.lang.String text)
|
|
| Method Summary | |
|---|---|
void |
basicSetBounds(java.awt.geom.Point2D.Double anchor,
java.awt.geom.Point2D.Double lead)
Sets the logical bounds of the figure and of its decorator figure. |
void |
basicTransform(java.awt.geom.AffineTransform tx)
Moves the figure. |
TextFigure |
clone()
Returns a clone of the figure. |
boolean |
contains(java.awt.geom.Point2D.Double p)
Checks if a point is contained by the figure. |
java.util.Collection<Handle> |
createHandles(int detailLevel)
Creates handles used to manipulate the figure. |
protected void |
drawFill(java.awt.Graphics2D g)
This method is called by method draw() to draw the fill area of the figure. |
protected void |
drawStroke(java.awt.Graphics2D g)
This method is called by method draw() to draw the text of the figure . |
protected void |
drawText(java.awt.Graphics2D g)
|
java.awt.geom.Rectangle2D.Double |
getBounds()
Returns the logical bounds of the figure as a Rectangle. |
java.awt.geom.Rectangle2D.Double |
getFigureDrawBounds()
|
java.awt.Color |
getFillColor()
|
java.awt.Font |
getFont()
|
float |
getFontSize()
|
Insets2DDouble |
getInsets()
|
TextHolder |
getLabelFor()
|
Dimension2DDouble |
getPreferredSize()
The preferred size is used by Layouter to determine the preferred size of a Figure. |
java.lang.Object |
getRestoreData()
Gets data which can be used to restore the shape of the figure after a basicTransform has been applied to it. |
int |
getTabSize()
Gets the number of characters used to expand tabs. |
java.lang.String |
getText()
Gets the text shown by the text figure. |
java.awt.Color |
getTextColor()
|
int |
getTextColumns()
Gets the number of columns to be overlaid when the figure is edited. |
protected java.awt.font.TextLayout |
getTextLayout()
|
Tool |
getTool(java.awt.geom.Point2D.Double p)
Returns a specialized tool for the given coordinate. |
void |
invalidate()
Informs that a figure needs to be redrawn. |
boolean |
isEditable()
|
void |
read(DOMInput in)
|
void |
restoreTo(java.lang.Object geometry)
Restores the shape of the figure to a previously stored state. |
void |
setEditable(boolean b)
|
void |
setFontSize(float size)
|
void |
setText(java.lang.String newText)
Sets the text shown by the text figure. |
protected void |
validate()
|
void |
write(DOMOutput out)
|
| Methods inherited from class org.jhotdraw.draw.AttributedFigure |
|---|
applyAttributesTo, basicSetAttribute, drawConnectors, drawFigure, getAttribute, getAttributeKey, getAttributes, getStroke, getStrokeMiterLimitFactor, hasAttribute, isAttributeEnabled, readAttributes, removeAttribute, setAttribute, setAttributeEnabled, setAttributes, writeAttributes |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.jhotdraw.draw.Figure |
|---|
addFigureListener, addNotify, addUndoableEditListener, basicSetAttribute, canConnect, changed, draw, findCompatibleConnector, findConnector, findFigureInside, getActions, getAttribute, getAttributes, getCursor, getDecomposition, getDecorator, getDrawBounds, getEndPoint, getLayer, getStartPoint, getTooltip, handleDrop, handleMouseClick, includes, isConnectorsVisible, isInteractive, isVisible, remap, removeFigureListener, removeNotify, removeUndoableEditListener, requestRemove, setAttribute, setConnectorsVisible, setDecorator, setVisible, willChange |
| Field Detail |
|---|
protected java.awt.geom.Point2D.Double origin
| Constructor Detail |
|---|
public TextFigure()
public TextFigure(java.lang.String text)
| Method Detail |
|---|
public java.lang.String getText()
getText in interface TextHolderpublic void setText(java.lang.String newText)
setText in interface TextHolderpublic void basicTransform(java.awt.geom.AffineTransform tx)
AbstractFigureThis is a basic operation for which no events are fired.
basicTransform in interface FigurebasicTransform in class AbstractFiguretx - The transformation.
public void basicSetBounds(java.awt.geom.Point2D.Double anchor,
java.awt.geom.Point2D.Double lead)
FigureThis is used by Tool's which create a new Figure and by Tool's which connect a Figure to another Figure.
This is a basic operation which does not fire events.
basicSetBounds in interface Figureanchor - the start point of the boundslead - the end point of the boundsFigure.getBounds()public boolean contains(java.awt.geom.Point2D.Double p)
FigureThis is used for hit testing by Tool's.
contains in interface Figureprotected void drawStroke(java.awt.Graphics2D g)
AttributedFigure
drawStroke in class AttributedFigureprotected void drawFill(java.awt.Graphics2D g)
AttributedFigure
drawFill in class AttributedFigureprotected void drawText(java.awt.Graphics2D g)
drawText in class AttributedFigurepublic void invalidate()
AbstractFigure
invalidate in interface Figureinvalidate in class AbstractFigureprotected java.awt.font.TextLayout getTextLayout()
public java.awt.geom.Rectangle2D.Double getBounds()
Figure
getBounds in interface Figurepublic Dimension2DDouble getPreferredSize()
Figure
getPreferredSize in interface FiguregetPreferredSize in class AbstractFigurepublic java.awt.geom.Rectangle2D.Double getFigureDrawBounds()
getFigureDrawBounds in class AttributedFigurepublic java.util.Collection<Handle> createHandles(int detailLevel)
Figure
createHandles in interface FigurecreateHandles in class AbstractFiguredetailLevel - The detail level of the handles. Usually this is 0 for
bounding box handles and 1 for point handles.
Handleprotected void validate()
validate in class AbstractFigurepublic boolean isEditable()
isEditable in interface TextHolderpublic void setEditable(boolean b)
public int getTextColumns()
TextHolder
getTextColumns in interface TextHolderpublic Tool getTool(java.awt.geom.Point2D.Double p)
Returns null, if no specialized tool is available.
getTool in interface FiguregetTool in class AbstractFigure
public void read(DOMInput in)
throws java.io.IOException
read in interface DOMStorableread in class AttributedFigurejava.io.IOException
public void write(DOMOutput out)
throws java.io.IOException
write in interface DOMStorablewrite in class AttributedFigurejava.io.IOExceptionpublic int getTabSize()
getTabSize in interface TextHolderpublic TextHolder getLabelFor()
getLabelFor in interface TextHolderpublic Insets2DDouble getInsets()
getInsets in interface TextHolderpublic void restoreTo(java.lang.Object geometry)
Figure
restoreTo in interface Figurepublic java.lang.Object getRestoreData()
Figure
getRestoreData in interface FigureFigure.basicTransform(AffineTransform)public TextFigure clone()
Figure
clone in interface Figureclone in class AttributedFigurepublic java.awt.Font getFont()
getFont in interface TextHolderpublic java.awt.Color getTextColor()
getTextColor in interface TextHolderpublic java.awt.Color getFillColor()
getFillColor in interface TextHolderpublic void setFontSize(float size)
setFontSize in interface TextHolderpublic float getFontSize()
getFontSize in interface TextHolder
|
Copyright 1996-2006 © JHotDraw.org | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||