com.cosylab.vdct.graphics.objects
Class TextBox

java.lang.Object
  extended by com.cosylab.vdct.graphics.objects.VisibleObject
      extended by com.cosylab.vdct.graphics.objects.TextBox
All Implemented Interfaces:
BorderObject, Clipboardable, Descriptable, Flexible, Movable, Selectable, Visitable, Popupable

public class TextBox
extends VisibleObject
implements BorderObject, Movable, Selectable, Popupable, Descriptable, Flexible, Clipboardable

Author:
ssah, msekoran To change this generated comment edit the template variable "typecomment": Window>Preferences>Java>Templates.

Field Summary
protected  java.text.AttributedString attText
           
protected  int[] breaks
           
protected  java.lang.String description
           
protected  double fontScale
           
protected  java.awt.font.FontRenderContext frc
           
protected  boolean htmlMode
           
protected  javax.swing.JLabel label
           
protected  java.awt.font.LineBreakMeasurer lineMeasurer
           
protected  java.util.Hashtable map
           
protected  java.text.AttributedCharacterIterator paragraph
           
protected  int paragraphEnd
           
protected  int paragraphStart
           
protected  java.awt.Font rfont
           
 
Fields inherited from class com.cosylab.vdct.graphics.objects.VisibleObject
x, y, zoomImage
 
Constructor Summary
TextBox(java.lang.String parName, Group parentGroup, int posX, int posY, int posX2, int posY2)
           
 
Method Summary
 void accept(Visitor visitor)
           
 boolean checkMove(int dx, int dy)
          Insert the method's description here.
 Flexible copyToGroup(java.lang.Object dsId, java.lang.String group)
          Returns the copied instance or null if the object cannot be copied.
 void destroy()
          Insert the method's description here.
protected  void draw(java.awt.Graphics g, boolean hilited)
          Insert the method's description here.
 void drawDashedBorder(java.awt.Graphics g, boolean hilited)
           
protected  void drawMultiLineText(java.awt.Graphics g, float drawPosX, float drawPosY, float formatWidth)
           
static boolean getCurrentBorder()
           
 java.lang.String getDescription()
          Insert the method's description here.
 Vertex getEndVertex()
           
 java.lang.String getFlexibleName()
          Insert the method's description here.
 java.lang.String getHashID()
          Insert the method's description here.
 java.util.Vector getItems()
          Insert the method's description here.
 java.lang.String getName()
           
 Vertex getStartVertex()
           
 int getX()
          Insert the method's description here.
 int getY()
          Insert the method's description here.
 VisibleObject hiliteComponentsCheck(int x, int y)
          Returned value inicates change Creation date: (21.12.2000 22:21:12)
 VisibleObject intersects(int px, int py)
          Default impmlementation for square (must be rescaled) Creation date: (19.12.2000 20:20:20)
 boolean isBorder()
          Returns the border.
 boolean move(int dx, int dy)
          Insert the method's description here.
 boolean moveToGroup(java.lang.Object dsId, java.lang.String group)
          Insert the method's description here.
 boolean rename(java.lang.Object dsId, java.lang.String newName)
          Insert the method's description here.
 void revalidatePosition()
          Insert the method's description here.
 void setBorder(boolean parBorder)
           
 void setColor(java.awt.Color color)
          Insert the method's description here.
 void setDescription(java.lang.String description)
          Insert the method's description here.
 void setFont(java.awt.Font parFont)
          Insert the method's description here.
 void showChangeTextDialog()
           
 void snapToGrid()
          Snap to grid.
protected  void validate()
          Insert the method's description here.
 
Methods inherited from class com.cosylab.vdct.graphics.objects.VisibleObject
forceValidation, getColor, getDsId, getFont, getHeight, getLabel, getLeftOffset, getMarkedX, getMarkedY, getMoveInsideView, getParent, getRheight, getRightOffset, getRlabelX, getRlabelY, getRootContainer, getRscale, getRwidth, getRx, getRy, getScale, getTopOffset, getVisibleColor, getWidth, intersects, isDestroyed, isVisible, isZoomRepaint, markPosition, paint, postDraw, postPaint, setDestroyed, setHeight, setLabel, setParent, setRheight, setRlabelX, setRlabelY, setRwidth, setRx, setRy, setScale, setWidth, setX, setY, setZoomRepaint, unconditionalValidation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.cosylab.vdct.graphics.popup.Popupable
getLabel
 

Field Detail

description

protected java.lang.String description

label

protected javax.swing.JLabel label

htmlMode

protected boolean htmlMode

map

protected java.util.Hashtable map

attText

protected java.text.AttributedString attText

paragraph

protected java.text.AttributedCharacterIterator paragraph

paragraphStart

protected int paragraphStart

paragraphEnd

protected int paragraphEnd

lineMeasurer

protected java.awt.font.LineBreakMeasurer lineMeasurer

breaks

protected int[] breaks

frc

protected java.awt.font.FontRenderContext frc

fontScale

protected double fontScale

rfont

protected java.awt.Font rfont
Constructor Detail

TextBox

public TextBox(java.lang.String parName,
               Group parentGroup,
               int posX,
               int posY,
               int posX2,
               int posY2)
Method Detail

showChangeTextDialog

public void showChangeTextDialog()

drawMultiLineText

protected void drawMultiLineText(java.awt.Graphics g,
                                 float drawPosX,
                                 float drawPosY,
                                 float formatWidth)

setColor

public void setColor(java.awt.Color color)
Description copied from class: VisibleObject
Insert the method's description here. Creation date: (19.12.2000 20:10:52)

Overrides:
setColor in class VisibleObject
Parameters:
color - java.awt.Color

setFont

public void setFont(java.awt.Font parFont)
Description copied from class: VisibleObject
Insert the method's description here. Creation date: (19.12.2000 20:10:52)

Overrides:
setFont in class VisibleObject
Parameters:
parFont - java.awt.Font

accept

public void accept(Visitor visitor)
Specified by:
accept in interface Visitable
Parameters:
visitor - com.cosylab.vdct.graphics.objects.Visitor

checkMove

public boolean checkMove(int dx,
                         int dy)
Description copied from interface: Movable
Insert the method's description here. Creation date: (27.12.2000 13:08:09)

Specified by:
checkMove in interface Movable
Parameters:
dx - int
dy - int
Returns:
boolean

copyToGroup

public Flexible copyToGroup(java.lang.Object dsId,
                            java.lang.String group)
Description copied from interface: Flexible
Returns the copied instance or null if the object cannot be copied. Creation date: (4.2.2001 21:59:44)

Specified by:
copyToGroup in interface Flexible
group - java.lang.String

destroy

public void destroy()
Description copied from class: VisibleObject
Insert the method's description here. Creation date: (30.1.2001 11:58:53)

Overrides:
destroy in class VisibleObject

draw

protected void draw(java.awt.Graphics g,
                    boolean hilited)
Description copied from class: VisibleObject
Insert the method's description here. Creation date: (19.12.2000 21:30:46)

Specified by:
draw in class VisibleObject
Parameters:
g - java.awt.Graphics
hilited - boolean

drawDashedBorder

public void drawDashedBorder(java.awt.Graphics g,
                             boolean hilited)

getCurrentBorder

public static boolean getCurrentBorder()

getEndVertex

public Vertex getEndVertex()

getFlexibleName

public java.lang.String getFlexibleName()
Description copied from interface: Flexible
Insert the method's description here. Creation date: (3.5.2001 10:15:48)

Specified by:
getFlexibleName in interface Flexible
Returns:
java.lang.String

getHashID

public java.lang.String getHashID()
Description copied from class: VisibleObject
Insert the method's description here. Creation date: (3.5.2001 16:40:00)

Specified by:
getHashID in class VisibleObject
Returns:
java.lang.String

getItems

public java.util.Vector getItems()
Description copied from interface: Popupable
Insert the method's description here. Creation date: (2.2.2001 20:26:25)

Specified by:
getItems in interface Popupable
Returns:
java.util.Vector

getName

public java.lang.String getName()
Specified by:
getName in interface BorderObject

getStartVertex

public Vertex getStartVertex()

move

public boolean move(int dx,
                    int dy)
Description copied from interface: Movable
Insert the method's description here. Creation date: (25.12.2000 14:13:14)

Specified by:
move in interface Movable
Parameters:
dx - int
dy - int
Returns:
boolean

moveToGroup

public boolean moveToGroup(java.lang.Object dsId,
                           java.lang.String group)
Description copied from interface: Flexible
Insert the method's description here. Creation date: (4.2.2001 22:00:01)

Specified by:
moveToGroup in interface Flexible
group - java.lang.String

rename

public boolean rename(java.lang.Object dsId,
                      java.lang.String newName)
Description copied from interface: Flexible
Insert the method's description here. Creation date: (2.5.2001 23:23:17)

Specified by:
rename in interface Flexible
newName - java.lang.String

revalidatePosition

public void revalidatePosition()
Description copied from class: VisibleObject
Insert the method's description here. Creation date: (21.12.2000 21:21:59)

Specified by:
revalidatePosition in class VisibleObject

setBorder

public void setBorder(boolean parBorder)

validate

protected void validate()
Description copied from class: VisibleObject
Insert the method's description here. Creation date: (19.12.2000 21:31:15)

Specified by:
validate in class VisibleObject

getDescription

public java.lang.String getDescription()
Description copied from interface: Descriptable
Insert the method's description here. Creation date: (9.4.2001 13:11:19)

Specified by:
getDescription in interface Descriptable
Returns:
java.lang.String
See Also:
Descriptable.getDescription()

setDescription

public void setDescription(java.lang.String description)
Description copied from interface: Descriptable
Insert the method's description here. Creation date: (24.4.2001 17:39:35)

Specified by:
setDescription in interface Descriptable
Parameters:
description - java.lang.String
See Also:
Descriptable.setDescription(String)

hiliteComponentsCheck

public VisibleObject hiliteComponentsCheck(int x,
                                           int y)
Returned value inicates change Creation date: (21.12.2000 22:21:12)

Parameters:
x - int
y - int
Returns:
com.cosylab.visible.objects.VisibleObject

intersects

public VisibleObject intersects(int px,
                                int py)
Default impmlementation for square (must be rescaled) Creation date: (19.12.2000 20:20:20)

Overrides:
intersects in class VisibleObject
Parameters:
px - int
py - int
Returns:
com.cosylab.visible.objects.VisibleObject

isBorder

public boolean isBorder()
Returns the border.

Returns:
boolean

getX

public int getX()
Description copied from class: VisibleObject
Insert the method's description here. Creation date: (19.12.2000 20:10:52)

Overrides:
getX in class VisibleObject
Returns:
int

getY

public int getY()
Description copied from class: VisibleObject
Insert the method's description here. Creation date: (19.12.2000 20:10:52)

Overrides:
getY in class VisibleObject
Returns:
int

snapToGrid

public void snapToGrid()
Description copied from class: VisibleObject
Snap to grid. Nearest point is taken.

Overrides:
snapToGrid in class VisibleObject