Protege-2000 1.7

edu.stanford.smi.protegex.widget.diagram
Class TextualOverlay

java.lang.Object
  |
  +--edu.stanford.smi.protegex.widget.diagram.TextualOverlay
Direct Known Subclasses:
WireTextualOverlay

public class TextualOverlay
extends Object

Handles layout of more than one line of text on an actor Known issues: this code assumes, more or less, a constant font. The only "change" currently recognized is a change to _string

Author:
William Grosso

Field Summary
protected  boolean _alwaysDisplayText
           
protected  Rectangle _currentLocation
           
protected  StringDescription _descriptionOfASpace
           
protected  StringDescription _descriptionOfThreeDots
           
protected  DiagramObjectState _diagramObjectState
           
protected  Font _fontObject
           
protected  int _halfOfHeightInCurrentFont
           
protected  int _heightInCurrentFont
           
protected  ArrayList _listOfLineDescriptions
           
protected  int _maximumLineWidth
           
protected  Font _modifiedFontObject
           
protected  Point _startingPoint
           
protected  String _string
           
protected  boolean _stringChanged
           
protected  int _totalHeight
           
protected  int _widthOfASpace
           
 
Constructor Summary
TextualOverlay(DiagramObjectState diagramObjectState)
           
TextualOverlay(DiagramObjectState diagramObjectState, boolean alwaysDisplayText)
           
 
Method Summary
protected  void buildLines(Graphics g)
           
protected  boolean changed(Graphics g, Rectangle location)
           
protected  Point computeStartingPoint(Rectangle location)
           
protected  int computeXForDescription(int startingX, ThingWithWidth thingWithWidth)
           
protected  List createStringDescriptions(Graphics g)
           
 void draw(Graphics g, Rectangle location, boolean isSelected)
           
protected  void getFontObject(Graphics g)
           
 String getString()
           
 boolean isAlwaysDisplayText()
           
protected  void rebuildMetricInformation(Graphics g, Rectangle location)
           
protected  void renderText(Graphics g, Rectangle location, boolean isSelected)
           
 void setAlwaysDisplayText(boolean alwaysDisplayText)
           
 void setString(String string)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_descriptionOfASpace

protected StringDescription _descriptionOfASpace

_descriptionOfThreeDots

protected StringDescription _descriptionOfThreeDots

_diagramObjectState

protected DiagramObjectState _diagramObjectState

_fontObject

protected Font _fontObject

_modifiedFontObject

protected Font _modifiedFontObject

_currentLocation

protected Rectangle _currentLocation

_heightInCurrentFont

protected int _heightInCurrentFont

_halfOfHeightInCurrentFont

protected int _halfOfHeightInCurrentFont

_stringChanged

protected boolean _stringChanged

_string

protected String _string

_listOfLineDescriptions

protected ArrayList _listOfLineDescriptions

_totalHeight

protected int _totalHeight

_maximumLineWidth

protected int _maximumLineWidth

_widthOfASpace

protected int _widthOfASpace

_startingPoint

protected Point _startingPoint

_alwaysDisplayText

protected boolean _alwaysDisplayText
Constructor Detail

TextualOverlay

public TextualOverlay(DiagramObjectState diagramObjectState)

TextualOverlay

public TextualOverlay(DiagramObjectState diagramObjectState,
                      boolean alwaysDisplayText)
Method Detail

buildLines

protected void buildLines(Graphics g)

changed

protected boolean changed(Graphics g,
                          Rectangle location)

computeStartingPoint

protected Point computeStartingPoint(Rectangle location)

computeXForDescription

protected int computeXForDescription(int startingX,
                                     ThingWithWidth thingWithWidth)

createStringDescriptions

protected List createStringDescriptions(Graphics g)

draw

public void draw(Graphics g,
                 Rectangle location,
                 boolean isSelected)

getFontObject

protected void getFontObject(Graphics g)

getString

public String getString()

isAlwaysDisplayText

public boolean isAlwaysDisplayText()

rebuildMetricInformation

protected void rebuildMetricInformation(Graphics g,
                                        Rectangle location)

renderText

protected void renderText(Graphics g,
                          Rectangle location,
                          boolean isSelected)

setAlwaysDisplayText

public void setAlwaysDisplayText(boolean alwaysDisplayText)

setString

public void setString(String string)

Protege-2000 1.7

Submit a bug report or feature request
Protege-2000 is a trademark of Stanford University.
Copyright (c) 1998-2002 Stanford University.