|
|||||||||
| 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 | |
|---|---|
private java.awt.Font |
fFont
|
private static java.lang.String |
fgCurrentFontName
|
private static int |
fgCurrentFontSize
|
private static int |
fgCurrentFontStyle
|
private int |
fHeight
|
private boolean |
fIsReadOnly
|
private OffsetLocator |
fLocator
|
private Figure |
fObservedFigure
|
private int |
fOriginX
|
private int |
fOriginY
|
private boolean |
fSizeIsDirty
|
private java.lang.String |
fText
|
private int |
fWidth
|
private static long |
serialVersionUID
|
private int |
textFigureSerializedDataVersion
|
| 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. |
protected void |
basicMoveBy(int x,
int y)
Moves the 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(FigureEvent e)
Sent when a figure changed |
void |
figureInvalidated(FigureEvent e)
Sent when an area is invalid |
void |
figureRemoved(FigureEvent e)
Sent when a figure was removed |
void |
figureRequestRemove(FigureEvent e)
Sent when requesting to remove a figure. |
void |
figureRequestUpdate(FigureEvent 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. |
protected OffsetLocator |
getLocator()
|
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. |
protected void |
markDirty()
|
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. |
private void |
readObject(java.io.ObjectInputStream s)
|
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. |
protected void |
setLocator(OffsetLocator newLocator)
|
protected void |
setObservedFigure(Figure newObservedFigure)
|
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()
|
protected java.awt.Dimension |
textExtent()
|
protected void |
updateLocation()
Updates the location relative to the connected figure. |
void |
write(StorableOutput dw)
Stores the Figure to a StorableOutput. |
| Methods inherited from class org.jhotdraw.draw.AttributedFigure |
|---|
draw, getDefaultAttribute, getDefaultAttribute, getFillColor, getFrameColor, initDefaultAttribute, setDefaultAttribute |
| Methods inherited from class org.jhotdraw.draw.AbstractFigure |
|---|
addDependendFigure, addFigureChangeListener, addToContainer, canConnect, center, clone, connectedTextLocator, connectionInsets, connectorAt, connectorVisibility, containsPoint, decompose, displayBox, displayBox, figures, findFigureInside, getDecoratedFigure, getDependendFigures, getZValue, includes, invalidate, invalidateRectangle, isEmpty, listener, removeDependendFigure, removeFigureChangeListener, removeFromContainer, setZValue, size, visit, willChange |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private int fOriginX
private int fOriginY
private transient boolean fSizeIsDirty
private transient int fWidth
private transient int fHeight
private java.lang.String fText
private java.awt.Font fFont
private boolean fIsReadOnly
private Figure fObservedFigure
private OffsetLocator fLocator
private static java.lang.String fgCurrentFontName
private static int fgCurrentFontSize
private static int fgCurrentFontStyle
private static final long serialVersionUID
private int textFigureSerializedDataVersion
| Constructor Detail |
|---|
public TextFigure()
| Method Detail |
|---|
public void moveBy(int x,
int y)
AbstractFigure
moveBy in interface FiguremoveBy in class AbstractFigurex - the x deltay - the y deltaFigure.moveBy(int, int)
protected void basicMoveBy(int x,
int y)
AbstractFigure
basicMoveBy in class AbstractFigureAbstractFigure.moveBy(int, int)
public void basicDisplayBox(java.awt.Point newOrigin,
java.awt.Point newCorner)
AbstractFigure
basicDisplayBox in interface FigurebasicDisplayBox in class AbstractFigurenewOrigin - the new originnewCorner - the new cornerFigure.basicDisplayBox(java.awt.Point, java.awt.Point)public java.awt.Rectangle displayBox()
AbstractFigure
displayBox in interface FiguredisplayBox in class AbstractFigureFigure.displayBox()public java.awt.Rectangle textDisplayBox()
textDisplayBox in interface TextHolderTextHolder.textDisplayBox()public boolean readOnly()
public void setReadOnly(boolean isReadOnly)
public java.awt.Font getFont()
getFont in interface TextHolderTextHolder.getFont()public Figure getRepresentingFigure()
getRepresentingFigure in interface TextHolderTextHolder.getRepresentingFigure()public void setFont(java.awt.Font newFont)
public void changed()
changed in interface Figurechanged in class AbstractFigureFigure.changed()public java.lang.Object getAttribute(java.lang.String name)
getAttribute in interface FiguregetAttribute in class AttributedFigureFigure.getAttribute(java.lang.String)public java.lang.Object getAttribute(FigureAttributeConstant attributeConstant)
getAttribute in interface FiguregetAttribute in class AttributedFigureFigure.getAttribute(org.jhotdraw.framework.FigureAttributeConstant)
public void setAttribute(java.lang.String name,
java.lang.Object value)
setAttribute in interface FiguresetAttribute in class AttributedFigureFigure.setAttribute(java.lang.String, java.lang.Object)
public void setAttribute(FigureAttributeConstant attributeConstant,
java.lang.Object value)
setAttribute in interface FiguresetAttribute in class AttributedFigureFigure.setAttribute(org.jhotdraw.framework.FigureAttributeConstant, java.lang.Object)public java.lang.String getText()
getText in interface TextHolderTextHolder.getText()public void setText(java.lang.String newText)
setText in interface TextHolderTextHolder.setText(java.lang.String)public boolean acceptsTyping()
acceptsTyping in interface TextHolderTextHolder.acceptsTyping()public void drawBackground(java.awt.Graphics g)
AttributedFigure
drawBackground in class AttributedFigureAttributedFigure.drawBackground(java.awt.Graphics)public void drawFrame(java.awt.Graphics g)
AttributedFigure
drawFrame in class AttributedFigureAttributedFigure.drawFrame(java.awt.Graphics)protected java.awt.Dimension textExtent()
protected void markDirty()
public int overlayColumns()
overlayColumns in interface TextHolderTextHolder.overlayColumns()public HandleEnumeration handles()
AbstractFigure
handles in interface Figurehandles in class AbstractFigureFigure.handles()public void write(StorableOutput dw)
AttributedFigure
write in interface Storablewrite in class AttributedFigureStorable.write(org.jhotdraw.util.StorableOutput)
public void read(StorableInput dr)
throws java.io.IOException
AttributedFigure
read in interface Storableread in class AttributedFigurejava.io.IOExceptionStorable.read(org.jhotdraw.util.StorableInput)
private void readObject(java.io.ObjectInputStream s)
throws java.lang.ClassNotFoundException,
java.io.IOException
java.lang.ClassNotFoundException
java.io.IOExceptionpublic void connect(Figure figure)
TextHolder
connect in interface TextHolderTextHolder.connect(org.jhotdraw.draw.Figure)public void figureChanged(FigureEvent e)
FigureListener
figureChanged in interface FigureListenerFigureListener.figureChanged(org.jhotdraw.draw.FigureEvent)public void figureRemoved(FigureEvent e)
FigureListener
figureRemoved in interface FigureListenerFigureListener.figureRemoved(org.jhotdraw.draw.FigureEvent)public void figureRequestRemove(FigureEvent e)
FigureListener
figureRequestRemove in interface FigureListenerFigureListener.figureRequestRemove(org.jhotdraw.draw.FigureEvent)public void figureInvalidated(FigureEvent e)
FigureListener
figureInvalidated in interface FigureListenerFigureListener.figureInvalidated(org.jhotdraw.draw.FigureEvent)public void figureRequestUpdate(FigureEvent e)
FigureListener
figureRequestUpdate in interface FigureListenerFigureListener.figureRequestUpdate(org.jhotdraw.draw.FigureEvent)protected void updateLocation()
public void release()
AbstractFigure
release in interface Figurerelease in class AbstractFigureFigure.release()public void disconnect(Figure disconnectFigure)
disconnect in interface TextHolderTextHolder.disconnect(org.jhotdraw.draw.Figure)protected void setObservedFigure(Figure newObservedFigure)
public Figure getObservedFigure()
protected void setLocator(OffsetLocator newLocator)
protected OffsetLocator getLocator()
public TextHolder getTextHolder()
Figure
getTextHolder in interface FiguregetTextHolder in class AbstractFigureFigure.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 | ||||||||