|
|||||||||
| Home >> All >> com >> xerox >> VTM >> [ glyphs overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
com.xerox.VTM.glyphs
Class VText

java.lang.Objectcom.xerox.VTM.glyphs.Glyph
com.xerox.VTM.glyphs.VText
- All Implemented Interfaces:
- java.lang.Cloneable
- Direct Known Subclasses:
- VTextOr
- public class VText
- extends Glyph
- implements java.lang.Cloneable
- extends Glyph
Standalone Text (font properties are set in the view, but can be changed for each VText using setSpecialFont()) vx and vy are coordinates of lower-left corner of String because it would be too time-consuming to compute the String's center (needs to be computed at each repaint: it requires access to Graphics2D) (besides it makes the VTM unstable)
| Field Summary | |
(package private) java.awt.geom.AffineTransform |
at
|
(package private) ProjText[] |
pc
|
private short |
text_anchor
|
static short |
TEXT_ANCHOR_END
text alignment (for text anchor) used to align a VText relative to its (vx,vy coordinates coincides with end of String) |
static short |
TEXT_ANCHOR_MIDDLE
text alignment (for text anchor) used to align a VText relative to its (vx,vy coordinates coincides with middle of String) |
static short |
TEXT_ANCHOR_START
text alignment (for text anchor) used to align a VText relative to its (vx,vy coordinates coincides with start of String) |
(package private) boolean |
zoomSensitive
|
| Fields inherited from class com.xerox.VTM.glyphs.Glyph |
bColor, borderColor, cGlyph, coef, color, dashedContour, DEFAULT_STROKE_WIDTH, dependants, filled, font, fontSize, fontSizePolicy, HSV, HSVb, ID, mouseInsideColor, orient, owner, paintBorder, selected, selectedColor, sensit, size, stickedGlyphs, stickedTo, stroke, strokeWidth, text, textHeight, textPos, textWidth, type, visible, vsm, vx, vy, vz |
| Constructor Summary | |
VText(long x,
long y,
float z,
java.awt.Color c,
java.lang.String t)
|
|
VText(long x,
long y,
float z,
java.awt.Color c,
java.lang.String t,
short ta)
|
|
VText(java.lang.String t)
|
|
| Method Summary | |
void |
addCamera(int verifIndex)
used internally to create new projected coordinates to use with the new camera |
java.lang.Object |
clone()
returns a clone of this object (only basic information is cloned for now: shape, orientation, position, size) |
boolean |
coordInside(int x,
int y,
int camIndex)
detects whether the given point is inside this glyph or not |
void |
draw(java.awt.Graphics2D g,
int vW,
int vH,
int i,
java.awt.Stroke stdS,
java.awt.geom.AffineTransform stdT)
draw glyph |
boolean |
drawMe(long w1,
long h1,
long w2,
long h2,
int i)
used to find out if it is necessary to project and draw the glyph in the current view |
boolean |
fillsView(long w,
long h,
int camIndex)
used to find out if glyph completely fills the view (in which case it is not necessary to repaint objects at a lower altitude) |
com.xerox.VTM.engine.LongPoint |
getBounds(int i)
returns width and height of the bounding box as a Point (so this is not a real Point) |
float |
getOrient()
get orientation |
float |
getSize()
get size (always =1) |
short |
getTextAnchor()
get text anchor (one of TEXT_ANCHOR_START, TEXT_ANCHOR_MIDDLE, TEXT_ANCHOR_END) |
void |
initCams(int nbCam)
called when glyph is created in order to create the initial set of projected coordinates wrt the number of cameras in the space |
void |
invalidate()
force computing of text's bounding box at next paint call |
boolean |
isZoomSensitive()
if false, text size is not sensitive to zoom |
int |
mouseInOut(int x,
int y,
int camIndex)
returns 1 if mouse has entered the glyph, -1 if it has exited the glyph, 0 if nothing has changed (meaning it was already inside or outside it) |
void |
orientTo(float angle)
set orientation (absolute) - has no effect |
void |
project(com.xerox.VTM.engine.Camera c,
com.xerox.VTM.engine.ViewPanel v)
project shape in camera coord sys prior to actual painting |
void |
removeCamera(int index)
if a camera is removed from the virtual space, we should delete the corresponding projected coordinates, but do not modify the array it self because we do not want to change other cameras' index - just point to null |
void |
resetMouseIn(int i)
reset prevMouseIn for projected coordinates nb i |
void |
reSize(float factor)
set size (relative) - has no effect |
void |
setSpecialFont(java.awt.Font f)
change font for this specific text object - f=null to get back to default font |
void |
setText(java.lang.String t)
set text that should be painted with this glyph - override Glyph method to call invalidate |
void |
setTextAnchor(short ta)
Set the text anchor |
void |
setZoomSensitive(boolean b)
if false, text size is not sensitive to zoom |
void |
sizeTo(float factor)
set size (absolute) - has no effect |
boolean |
validBounds(int i)
tells whether the bounds of the text are valid at this time or not (can be invalid if the thread in charge of painting has not dealt with this glyph since invalidate() was called on it) - might be useful to test this before calling getBounds() |
| Methods inherited from class com.xerox.VTM.glyphs.Glyph |
addDependant, addHSVbColor, addHSVColor, getCGlyph, getColor, getColorb, getDependants, getFillStatus, getFont, getHSVbColor, getHSVColor, getID, getLocation, getOwner, getPaintBorderStatus, getStickedGlyphs, getStroke, getStrokeWidth, getText, getType, isSelected, isSensitive, isVisible, move, moveTo, propagateMove, removeDependant, select, setBorderColor, setCGlyph, setColor, setDashed, setFill, setFontSizePolicy, setHSVbColor, setHSVColor, setID, setMouseInsideColor, setOwner, setPaintBorder, setSelectedColor, setSensitivity, setStroke, setStrokeWidth, setTextPos, setType, setVisible, setVSM, stick, toString, unstick, usesSpecialFont |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
TEXT_ANCHOR_START
public static short TEXT_ANCHOR_START
- text alignment (for text anchor) used to align a VText relative to its (vx,vy coordinates coincides with start of String)
TEXT_ANCHOR_MIDDLE
public static short TEXT_ANCHOR_MIDDLE
- text alignment (for text anchor) used to align a VText relative to its (vx,vy coordinates coincides with middle of String)
TEXT_ANCHOR_END
public static short TEXT_ANCHOR_END
- text alignment (for text anchor) used to align a VText relative to its (vx,vy coordinates coincides with end of String)
text_anchor
private short text_anchor
at
java.awt.geom.AffineTransform at
pc
ProjText[] pc
zoomSensitive
boolean zoomSensitive
| Constructor Detail |
VText
public VText(java.lang.String t)
VText
public VText(long x,
long y,
float z,
java.awt.Color c,
java.lang.String t)
VText
public VText(long x,
long y,
float z,
java.awt.Color c,
java.lang.String t,
short ta)
| Method Detail |
initCams
public void initCams(int nbCam)
- called when glyph is created in order to create the initial set of projected coordinates wrt the number of cameras in the space
addCamera
public void addCamera(int verifIndex)
- used internally to create new projected coordinates to use with the new camera
removeCamera
public void removeCamera(int index)
- if a camera is removed from the virtual space, we should delete the corresponding projected coordinates, but do not modify the array it self because we do not want to change other cameras' index - just point to null
- Specified by:
removeCamerain classGlyph
resetMouseIn
public void resetMouseIn(int i)
- reset prevMouseIn for projected coordinates nb i
- Specified by:
resetMouseInin classGlyph
sizeTo
public void sizeTo(float factor)
reSize
public void reSize(float factor)
orientTo
public void orientTo(float angle)
getSize
public float getSize()
getOrient
public float getOrient()
setZoomSensitive
public void setZoomSensitive(boolean b)
- if false, text size is not sensitive to zoom
isZoomSensitive
public boolean isZoomSensitive()
- if false, text size is not sensitive to zoom
drawMe
public boolean drawMe(long w1,
long h1,
long w2,
long h2,
int i)
- used to find out if it is necessary to project and draw the glyph in the current view
fillsView
public boolean fillsView(long w,
long h,
int camIndex)
- used to find out if glyph completely fills the view (in which case it is not necessary to repaint objects at a lower altitude)
coordInside
public boolean coordInside(int x,
int y,
int camIndex)
- detects whether the given point is inside this glyph or not
- Specified by:
coordInsidein classGlyph
mouseInOut
public int mouseInOut(int x,
int y,
int camIndex)
- returns 1 if mouse has entered the glyph, -1 if it has exited the glyph, 0 if nothing has changed (meaning it was already inside or outside it)
- Specified by:
mouseInOutin classGlyph
project
public void project(com.xerox.VTM.engine.Camera c, com.xerox.VTM.engine.ViewPanel v)
draw
public void draw(java.awt.Graphics2D g, int vW, int vH, int i, java.awt.Stroke stdS, java.awt.geom.AffineTransform stdT)
setText
public void setText(java.lang.String t)
- set text that should be painted with this glyph - override Glyph method to call invalidate
invalidate
public void invalidate()
- force computing of text's bounding box at next paint call
getBounds
public com.xerox.VTM.engine.LongPoint getBounds(int i)
- returns width and height of the bounding box as a Point (so this is not a real Point)
validBounds
public boolean validBounds(int i)
- tells whether the bounds of the text are valid at this time or not (can be invalid if the thread in charge of painting has not dealt with this glyph since invalidate() was called on it) - might be useful to test this before calling getBounds()
setSpecialFont
public void setSpecialFont(java.awt.Font f)
- change font for this specific text object - f=null to get back to default font
- Overrides:
setSpecialFontin classGlyph
setTextAnchor
public void setTextAnchor(short ta)
- Set the text anchor
getTextAnchor
public short getTextAnchor()
- get text anchor (one of TEXT_ANCHOR_START, TEXT_ANCHOR_MIDDLE, TEXT_ANCHOR_END)
clone
public java.lang.Object clone()
- returns a clone of this object (only basic information is cloned for now: shape, orientation, position, size)
|
|||||||||
| Home >> All >> com >> xerox >> VTM >> [ glyphs overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC