|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jhotdraw.standard.AbstractFigure
org.jhotdraw.figures.AttributeFigure
org.jhotdraw.figures.TextFigure
public class TextFigure
A text figure.
TextTool
,
Serialized FormField Summary |
---|
Fields inherited from interface org.jhotdraw.framework.Figure |
---|
POPUP_MENU |
Constructor Summary | |
---|---|
TextFigure()
|
Method Summary | |
---|---|
boolean |
acceptsTyping()
Tests whether the figure accepts typing. |
void |
basicDisplayBox(java.awt.Point newOrigin,
java.awt.Point newCorner)
Sets the display box of a figure. |
void |
changed()
Updates the location whenever the figure changes itself. |
void |
connect(Figure figure)
Connects a text holder to another figure. |
static java.awt.Font |
createCurrentFont()
Creates the current font to be used for new text figures. |
void |
disconnect(Figure disconnectFigure)
Disconnects a text holder from a connect figure. |
java.awt.Rectangle |
displayBox()
Gets the display box of a figure. |
void |
drawBackground(java.awt.Graphics g)
Draws the background of the figure. |
void |
drawFrame(java.awt.Graphics g)
Draws the frame of the figure. |
void |
figureChanged(FigureChangeEvent e)
Sent when a figure changed |
void |
figureInvalidated(FigureChangeEvent e)
Sent when an area is invalid |
void |
figureRemoved(FigureChangeEvent e)
Sent when a figure was removed |
void |
figureRequestRemove(FigureChangeEvent e)
Sent when requesting to remove a figure. |
void |
figureRequestUpdate(FigureChangeEvent e)
Sent when an update should happen. |
java.lang.Object |
getAttribute(FigureAttributeConstant attributeConstant)
A text figure understands the "FontSize", "FontStyle", and "FontName" attributes. |
java.lang.Object |
getAttribute(java.lang.String name)
Deprecated. use getAttribute(FigureAttributeConstant) instead |
java.awt.Font |
getFont()
Gets the font. |
Figure |
getObservedFigure()
|
Figure |
getRepresentingFigure()
Usually, a TextHolders is implemented by a Figure subclass. |
java.lang.String |
getText()
Gets the text shown by the text figure. |
TextHolder |
getTextHolder()
Some figures have the ability to hold text. |
HandleEnumeration |
handles()
Returns the handles of a Figure that can be used to manipulate some of its attributes. |
void |
moveBy(int x,
int y)
Moves the figure by the given offset. |
int |
overlayColumns()
Gets the number of columns to be overlaid when the figure is edited. |
void |
read(StorableInput dr)
Reads the Figure from a StorableInput. |
boolean |
readOnly()
Tests whether this figure is read only. |
void |
release()
A figure is released from the drawing. |
void |
setAttribute(FigureAttributeConstant attributeConstant,
java.lang.Object value)
A text figure understands the "FontSize", "FontStyle", and "FontName" attributes. |
void |
setAttribute(java.lang.String name,
java.lang.Object value)
Deprecated. use setAttribute(FigureAttributeConstant, Object) instead |
static void |
setCurrentFontName(java.lang.String name)
Sets the current font name |
static void |
setCurrentFontSize(int size)
Sets the current font size. |
static void |
setCurrentFontStyle(int style)
Sets the current font style. |
void |
setFont(java.awt.Font newFont)
Sets the font. |
void |
setReadOnly(boolean isReadOnly)
Sets the read only status of the text figure. |
void |
setText(java.lang.String newText)
Sets the text shown by the text figure. |
java.awt.Rectangle |
textDisplayBox()
|
void |
write(StorableOutput dw)
Stores the Figure to a StorableOutput. |
Methods inherited from class org.jhotdraw.figures.AttributeFigure |
---|
draw, getDefaultAttribute, getDefaultAttribute, getFillColor, getFrameColor, initDefaultAttribute, setDefaultAttribute |
Methods inherited from class org.jhotdraw.standard.AbstractFigure |
---|
addDependendFigure, addFigureChangeListener, addToContainer, canConnect, center, clone, connectedTextLocator, connectionInsets, connectorAt, connectorVisibility, containsPoint, decompose, displayBox, displayBox, figures, findFigureInside, getDecoratedFigure, getDependendFigures, getZValue, includes, invalidate, isEmpty, listener, removeDependendFigure, removeFigureChangeListener, removeFromContainer, setZValue, size, visit, willChange |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TextFigure()
Method Detail |
---|
public void moveBy(int x, int y)
AbstractFigure
moveBy
in interface Figure
moveBy
in class AbstractFigure
x
- the x deltay
- the y deltaFigure.moveBy(int, int)
public void basicDisplayBox(java.awt.Point newOrigin, java.awt.Point newCorner)
AbstractFigure
basicDisplayBox
in interface Figure
basicDisplayBox
in class AbstractFigure
newOrigin
- the new originnewCorner
- the new cornerFigure.basicDisplayBox(java.awt.Point, java.awt.Point)
public java.awt.Rectangle displayBox()
AbstractFigure
displayBox
in interface Figure
displayBox
in class AbstractFigure
Figure.displayBox()
public java.awt.Rectangle textDisplayBox()
textDisplayBox
in interface TextHolder
TextHolder.textDisplayBox()
public boolean readOnly()
public void setReadOnly(boolean isReadOnly)
public java.awt.Font getFont()
getFont
in interface TextHolder
TextHolder.getFont()
public Figure getRepresentingFigure()
getRepresentingFigure
in interface TextHolder
TextHolder.getRepresentingFigure()
public void setFont(java.awt.Font newFont)
public void changed()
changed
in interface Figure
changed
in class AbstractFigure
Figure.changed()
public java.lang.Object getAttribute(java.lang.String name)
getAttribute
in interface Figure
getAttribute
in class AttributeFigure
Figure.getAttribute(java.lang.String)
public java.lang.Object getAttribute(FigureAttributeConstant attributeConstant)
getAttribute
in interface Figure
getAttribute
in class AttributeFigure
Figure.getAttribute(org.jhotdraw.framework.FigureAttributeConstant)
public void setAttribute(java.lang.String name, java.lang.Object value)
setAttribute
in interface Figure
setAttribute
in class AttributeFigure
Figure.setAttribute(java.lang.String, java.lang.Object)
public void setAttribute(FigureAttributeConstant attributeConstant, java.lang.Object value)
setAttribute
in interface Figure
setAttribute
in class AttributeFigure
Figure.setAttribute(org.jhotdraw.framework.FigureAttributeConstant, java.lang.Object)
public java.lang.String getText()
getText
in interface TextHolder
TextHolder.getText()
public void setText(java.lang.String newText)
setText
in interface TextHolder
TextHolder.setText(java.lang.String)
public boolean acceptsTyping()
acceptsTyping
in interface TextHolder
TextHolder.acceptsTyping()
public void drawBackground(java.awt.Graphics g)
AttributeFigure
AttributeFigure.drawBackground(java.awt.Graphics)
public void drawFrame(java.awt.Graphics g)
AttributeFigure
AttributeFigure.drawFrame(java.awt.Graphics)
public int overlayColumns()
overlayColumns
in interface TextHolder
TextHolder.overlayColumns()
public HandleEnumeration handles()
AbstractFigure
handles
in interface Figure
handles
in class AbstractFigure
Figure.handles()
public void write(StorableOutput dw)
AttributeFigure
write
in interface Storable
write
in class AttributeFigure
Storable.write(org.jhotdraw.util.StorableOutput)
public void read(StorableInput dr) throws java.io.IOException
AttributeFigure
read
in interface Storable
read
in class AttributeFigure
java.io.IOException
Storable.read(org.jhotdraw.util.StorableInput)
public void connect(Figure figure)
TextHolder
connect
in interface TextHolder
TextHolder.connect(org.jhotdraw.framework.Figure)
public void figureChanged(FigureChangeEvent e)
FigureChangeListener
figureChanged
in interface FigureChangeListener
FigureChangeListener.figureChanged(org.jhotdraw.framework.FigureChangeEvent)
public void figureRemoved(FigureChangeEvent e)
FigureChangeListener
figureRemoved
in interface FigureChangeListener
FigureChangeListener.figureRemoved(org.jhotdraw.framework.FigureChangeEvent)
public void figureRequestRemove(FigureChangeEvent e)
FigureChangeListener
figureRequestRemove
in interface FigureChangeListener
FigureChangeListener.figureRequestRemove(org.jhotdraw.framework.FigureChangeEvent)
public void figureInvalidated(FigureChangeEvent e)
FigureChangeListener
figureInvalidated
in interface FigureChangeListener
FigureChangeListener.figureInvalidated(org.jhotdraw.framework.FigureChangeEvent)
public void figureRequestUpdate(FigureChangeEvent e)
FigureChangeListener
figureRequestUpdate
in interface FigureChangeListener
FigureChangeListener.figureRequestUpdate(org.jhotdraw.framework.FigureChangeEvent)
public void release()
AbstractFigure
release
in interface Figure
release
in class AbstractFigure
Figure.release()
public void disconnect(Figure disconnectFigure)
disconnect
in interface TextHolder
TextHolder.disconnect(org.jhotdraw.framework.Figure)
public Figure getObservedFigure()
public TextHolder getTextHolder()
Figure
getTextHolder
in interface Figure
getTextHolder
in class AbstractFigure
Figure.getTextHolder()
public static java.awt.Font createCurrentFont()
public static void setCurrentFontName(java.lang.String name)
public static void setCurrentFontSize(int size)
public static void setCurrentFontStyle(int style)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |