All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class CH.ifa.draw.figures.TextFigure

java.lang.Object
   |
   +----CH.ifa.draw.standard.AbstractFigure
           |
           +----CH.ifa.draw.figures.AttributeFigure
                   |
                   +----CH.ifa.draw.figures.TextFigure

public class TextFigure
extends AttributeFigure
implements FigureChangeListener, TextHolder
A text figure.

See Also:
TextTool

Constructor Index

 o TextFigure()

Method Index

 o acceptsTyping()
Tests whether the figure accepts typing.
 o basicDisplayBox(Point, Point)
Sets the display box of a figure.
 o basicMoveBy(int, int)
Moves the figure.
 o changed()
Updates the location whenever the figure changes itself.
 o connect(Figure)
 o createCurrentFont()
Creates the current font to be used for new text figures.
 o disconnect()
Disconnects the text figure.
 o displayBox()
Gets the display box of a figure.
 o drawBackground(Graphics)
Draws the background of the figure.
 o drawFrame(Graphics)
Draws the frame of the figure.
 o figureChanged(FigureChangeEvent)
 o figureInvalidated(FigureChangeEvent)
 o figureRemoved(FigureChangeEvent)
 o figureRequestRemove(FigureChangeEvent)
 o figureRequestUpdate(FigureChangeEvent)
 o getAttribute(String)
A text figure understands the "FontSize", "FontStyle", and "FontName" attributes.
 o getFont()
Gets the font.
 o getText()
Gets the text shown by the text figure.
 o handles()
Returns the handles of a Figure that can be used to manipulate some of its attributes.
 o moveBy(int, int)
Moves the figure by the given offset.
 o overlayColumns()
Gets the number of columns to be overlaid when the figure is edited.
 o read(StorableInput)
Reads the Figure from a StorableInput.
 o readOnly()
Tests whether this figure is read only.
 o release()
A figure is released from the drawing.
 o setAttribute(String, Object)
A text figure understands the "FontSize", "FontStyle", and "FontName" attributes.
 o setCurrentFontName(String)
Sets the current font name
 o setCurrentFontSize(int)
Sets the current font size.
 o setCurrentFontStyle(int)
Sets the current font style.
 o setFont(Font)
Sets the font.
 o setReadOnly(boolean)
Sets the read only status of the text figure.
 o setText(String)
Sets the text shown by the text figure.
 o textDisplayBox()
 o updateLocation()
Updates the location relative to the connected figure.
 o write(StorableOutput)
Stores the Figure to a StorableOutput.

Constructors

 o TextFigure
 public TextFigure()

Methods

 o moveBy
 public void moveBy(int x,
                    int y)
Moves the figure by the given offset.

Overrides:
moveBy in class AbstractFigure
 o basicMoveBy
 protected void basicMoveBy(int x,
                            int y)
Moves the figure.

Overrides:
basicMoveBy in class AbstractFigure
 o basicDisplayBox
 public void basicDisplayBox(Point newOrigin,
                             Point newCorner)
Sets the display box of a figure.

Overrides:
basicDisplayBox in class AbstractFigure
 o displayBox
 public Rectangle displayBox()
Gets the display box of a figure.

Overrides:
displayBox in class AbstractFigure
 o textDisplayBox
 public Rectangle textDisplayBox()
 o readOnly
 public boolean readOnly()
Tests whether this figure is read only.

 o setReadOnly
 public void setReadOnly(boolean isReadOnly)
Sets the read only status of the text figure.

 o getFont
 public Font getFont()
Gets the font.

 o setFont
 public void setFont(Font newFont)
Sets the font.

 o changed
 public void changed()
Updates the location whenever the figure changes itself.

Overrides:
changed in class AbstractFigure
 o getAttribute
 public Object getAttribute(String name)
A text figure understands the "FontSize", "FontStyle", and "FontName" attributes.

Overrides:
getAttribute in class AttributeFigure
 o setAttribute
 public void setAttribute(String name,
                          Object value)
A text figure understands the "FontSize", "FontStyle", and "FontName" attributes.

Overrides:
setAttribute in class AttributeFigure
 o getText
 public String getText()
Gets the text shown by the text figure.

 o setText
 public void setText(String newText)
Sets the text shown by the text figure.

 o acceptsTyping
 public boolean acceptsTyping()
Tests whether the figure accepts typing.

 o drawBackground
 public void drawBackground(Graphics g)
Draws the background of the figure.

Overrides:
drawBackground in class AttributeFigure
 o drawFrame
 public void drawFrame(Graphics g)
Draws the frame of the figure.

Overrides:
drawFrame in class AttributeFigure
 o overlayColumns
 public int overlayColumns()
Gets the number of columns to be overlaid when the figure is edited.

 o handles
 public Vector handles()
Returns the handles of a Figure that can be used to manipulate some of its attributes.

Overrides:
handles in class AbstractFigure
 o write
 public void write(StorableOutput dw)
Stores the Figure to a StorableOutput.

Overrides:
write in class AttributeFigure
 o read
 public void read(StorableInput dr) throws IOException
Reads the Figure from a StorableInput.

Overrides:
read in class AttributeFigure
 o connect
 public void connect(Figure figure)
 o figureChanged
 public void figureChanged(FigureChangeEvent e)
 o figureRemoved
 public void figureRemoved(FigureChangeEvent e)
 o figureRequestRemove
 public void figureRequestRemove(FigureChangeEvent e)
 o figureInvalidated
 public void figureInvalidated(FigureChangeEvent e)
 o figureRequestUpdate
 public void figureRequestUpdate(FigureChangeEvent e)
 o updateLocation
 protected void updateLocation()
Updates the location relative to the connected figure. The TextFigure is centered around the located point.

 o release
 public void release()
A figure is released from the drawing.

Overrides:
release in class AbstractFigure
 o disconnect
 public void disconnect()
Disconnects the text figure.

 o createCurrentFont
 public static Font createCurrentFont()
Creates the current font to be used for new text figures.

 o setCurrentFontName
 public static void setCurrentFontName(String name)
Sets the current font name

 o setCurrentFontSize
 public static void setCurrentFontSize(int size)
Sets the current font size.

 o setCurrentFontStyle
 public static void setCurrentFontStyle(int style)
Sets the current font style.


All Packages  Class Hierarchy  This Package  Previous  Next  Index