uk.ac.ic.doc.automed.p2p.gui.graph
Class TextBox

java.lang.Object
  extended by uk.ac.ic.doc.automed.p2p.gui.graph.GShape
      extended by uk.ac.ic.doc.automed.p2p.gui.graph.TextBox
All Implemented Interfaces:
java.awt.Shape, java.io.Serializable, GVisualisable
Direct Known Subclasses:
InputTextBox

public class TextBox
extends GShape

See Also:
Serialized Form

Nested Class Summary
(package private)  class TextBox.TextBlock
          Represents a wrapped text block
 
Field Summary
private  java.awt.Dimension unwrappedBound
           
private  TextBox.TextBlock wrappedText
           
 
Fields inherited from class uk.ac.ic.doc.automed.p2p.gui.graph.GShape
altDrawer, altDrawing, AUTO_COUNT, bound, brPoint, centrePoint, changed, color, cshape, data, defBound, displayScript, displayShape, enabled, handler, highlighted, hshape, icon, id, label, lblPoint, movable, name, onClick, PREFIX_CTRL, PREFIX_HIL, props, refresh, selectable, tlPoint, type, visible, visibleOnHighlighted, ZEROX
 
Constructor Summary
TextBox(java.awt.Point p, java.awt.Dimension bound, java.util.Properties props)
           
TextBox(java.lang.String label, java.awt.Point p, java.awt.Dimension bound, java.util.Properties props)
           
TextBox(java.lang.String label, java.lang.String name, java.awt.Point p, java.awt.Dimension bound, java.util.Properties props)
           
 
Method Summary
 void clear()
           
protected  void drawMain(java.awt.Graphics g)
           
 java.awt.Dimension getDefaultBound(java.awt.Graphics g)
          for sub-classes to implement
 int getWrapColumn()
          Return the column number at which the text is to be wrapped
 boolean isWrapped()
           
 void preDraw(java.awt.Graphics g)
          Prepare text-box for drawing, no actual drawings are performd at this stage.
Specific for TextBox is to check for the wrap-text option.
 
Methods inherited from class uk.ac.ic.doc.automed.p2p.gui.graph.GShape
clear, contains, contains, contains, contains, copyProperties, cos, dcos, draw, drawAfter, drawAlternative, drawBefore, drawControl, drawHighlighted, drawTo, dsin, dtan, equals, getAutoID, getBound, getBounds, getBounds2D, getBrPoint, getCenter, getColor, getData, getDrawerInstance, getHandlerObject, getID, getIDShape, getIsVisible, getIsVisibleOnHighlighted, getLabel, getLabelBounds, getLabelPoint, getName, getPathIterator, getPathIterator, getPoint, getProperties, getProperty, getProperty, getPropertyObject, getPropertyObjects, getStringBounds, getType, hashCode, highlightLabel, highlightLabel, intersects, intersects, isActive, isAltDrawing, isChanged, isEnabled, isHighlighted, isMovable, isMutableColor, isOnClick, isRefresh, isSelectable, newDrawerInstance, paintBlank, preDraw, redraw, redrawAfter, redrawBefore, redrawMain, refresh, setBound, setBound, setColorProperty, setColorProperty, setColorProperty, setEnabled, setHandlerObject, setIsAltDrawing, setIsChanged, setIsHighlighted, setIsMovable, setIsOnClick, setIsRefresh, setIsSelectable, setIsVisible, setLabel, setName, setProperties, setProperty, setPropertyObject, setStrokeStyle, setTLPoint, setTLPoint, setType, setUpHighlightedShape, setVisibleOnHighlighted, sin, tan, toString, update, updateControl, updateHighlighted
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

unwrappedBound

private java.awt.Dimension unwrappedBound

wrappedText

private TextBox.TextBlock wrappedText
Constructor Detail

TextBox

public TextBox(java.awt.Point p,
               java.awt.Dimension bound,
               java.util.Properties props)

TextBox

public TextBox(java.lang.String label,
               java.awt.Point p,
               java.awt.Dimension bound,
               java.util.Properties props)

TextBox

public TextBox(java.lang.String label,
               java.lang.String name,
               java.awt.Point p,
               java.awt.Dimension bound,
               java.util.Properties props)
Method Detail

getDefaultBound

public java.awt.Dimension getDefaultBound(java.awt.Graphics g)
Description copied from class: GShape
for sub-classes to implement

Overrides:
getDefaultBound in class GShape
Returns:

isWrapped

public boolean isWrapped()

getWrapColumn

public int getWrapColumn()
Return the column number at which the text is to be wrapped

Returns:

preDraw

public void preDraw(java.awt.Graphics g)
Prepare text-box for drawing, no actual drawings are performd at this stage.
Specific for TextBox is to check for the wrap-text option. If it is turned on/off then we are to create/remove a wrapped text box and update the dimension of the text box accordingly.

Overrides:
preDraw in class GShape
Parameters:
g -

drawMain

protected void drawMain(java.awt.Graphics g)
Overrides:
drawMain in class GShape

clear

public void clear()
Overrides:
clear in class GShape