|
|||||||||
| 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 Glyph

java.lang.Objectcom.xerox.VTM.glyphs.Glyph
- All Implemented Interfaces:
- java.lang.Cloneable
- Direct Known Subclasses:
- FPolygon, RectangleNR, VBoolShape, VCbCurve, VCircle, VCirImage, VCirShape, VDiamond, VEllipse, VImage, VOctagon, VPath, VPoint, VPolygon, VQdCurve, VRectangle, VRoundRect, VSegment, VShape, VText, VTriangle
- public abstract class Glyph
- extends java.lang.Object
- implements java.lang.Cloneable
- extends java.lang.Object
glyph - parent class of all graphical objects
| Field Summary | |
java.awt.Color |
bColor
standard color of border |
java.awt.Color |
borderColor
current color of border |
(package private) net.claribole.zvtm.glyphs.CGlyph |
cGlyph
composite glyph associated with this glyph (meaning that this glyph is either a primary or secondary glyph inside a CGlyph) |
float |
coef
projection coef |
java.awt.Color |
color
color of interior |
(package private) boolean |
dashedContour
|
static float |
DEFAULT_STROKE_WIDTH
first is width of line, last is offset |
(package private) java.util.Vector |
dependants
|
(package private) boolean |
filled
|
(package private) java.awt.Font |
font
special font used in this object only (null if default font) |
static float |
fontSize
font size in pixels |
(package private) int |
fontSizePolicy
1=always draw text 0=draw text when approx fits inside object -1=never draw text 2=as VText |
protected float[] |
HSV
HSV coordinates of interior color in range 0.0-1.0 |
protected float[] |
HSVb
HSV coordinates of border color |
(package private) java.lang.Long |
ID
Glyph ID |
java.awt.Color |
mouseInsideColor
color of border when cursor is inside glyph |
(package private) float |
orient
object orientation [0:2Pi[ |
(package private) java.lang.Object |
owner
ref to the object this glyph represents |
(package private) boolean |
paintBorder
|
(package private) boolean |
selected
tells whether this glyph is selected or not (default is false) |
java.awt.Color |
selectedColor
color of border when glyph is selected (can be different fom color when cursor is inside glyph) |
(package private) boolean |
sensit
tells whether we should detect entry/exit in this glyph |
(package private) float |
size
radius of bounding circle |
(package private) java.util.Vector |
stickedGlyphs
glyphs sticked to this one |
java.lang.Object |
stickedTo
object to which this glyph is sticked to (could be a VCursor or a Glyph) |
(package private) java.awt.BasicStroke |
stroke
|
(package private) float |
strokeWidth
|
(package private) java.lang.String |
text
text that should be drawn with glyph |
(package private) int |
textHeight
height of text in pixels (only available in textDraw()) |
(package private) int |
textPos
tells if string should be painted inside glyph (=0), on top of glyph (=1), or under glyph (=-1) |
(package private) int |
textWidth
width of text in pixels (only available in textDraw()) |
(package private) java.lang.String |
type
type of object (can be any string) |
(package private) boolean |
visible
tells whether this glyph is visible or not (default is true) |
com.xerox.VTM.engine.VirtualSpaceManager |
vsm
ref to VSM |
long |
vx
coordinate in virtual space (geometric center of object) |
long |
vy
coordinate in virtual space (geometric center of object) |
float |
vz
altitude (in virtual space) |
| Constructor Summary | |
Glyph()
|
|
| Method Summary | |
abstract void |
addCamera(int verifIndex)
used internally to create new projected coordinates to use with the new camera |
void |
addDependant(Glyph g)
add a glyph to the list of glyphs depending on this one - put glyphs that depend on this one here (for instance segments to hide when hiding this object...). |
void |
addHSVbColor(float h,
float s,
float v)
set relative border color in HSV coord sys |
void |
addHSVColor(float h,
float s,
float v)
set relative fill color in HSV coord sys |
abstract java.lang.Object |
clone()
This method may be called to create a new copy of the Object. |
abstract boolean |
coordInside(int x,
int y,
int camIndex)
detects whether the given point is inside this glyph or not |
abstract void |
draw(java.awt.Graphics2D g,
int vW,
int vH,
int i,
java.awt.Stroke stdS,
java.awt.geom.AffineTransform stdT)
draw his 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 |
abstract 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) |
net.claribole.zvtm.glyphs.CGlyph |
getCGlyph()
returns the composite glyph associated with this glyph (meaning that this glyph is either a primary or secondary glyph inside a CGlyph) - returns null if none |
java.awt.Color |
getColor()
get fill color as an object |
java.awt.Color |
getColorb()
get border color as an object |
java.util.Vector |
getDependants()
get list of glyphs depending on this one |
boolean |
getFillStatus()
tells whether this glyph is filled or not |
java.awt.Font |
getFont()
returns the font used for this glyph's text |
float[] |
getHSVbColor()
get border color |
float[] |
getHSVColor()
get fill color |
java.lang.Long |
getID()
get glyph ID |
com.xerox.VTM.engine.LongPoint |
getLocation()
returns coordinates of the glyph's geom center as a LongPoint |
abstract float |
getOrient()
get orientation |
java.lang.Object |
getOwner()
get object this glyph represents |
boolean |
getPaintBorderStatus()
tells whether a glyph's border is painted or not |
abstract float |
getSize()
get size of object (radius of bounding circle) |
java.util.Vector |
getStickedGlyphs()
return the list of glyphs sticked to this one (empty vector if none) |
java.awt.BasicStroke |
getStroke()
returns the stroke used to paint the border of this glyph (null if none) |
float |
getStrokeWidth()
returns the stroke width used to paint the border of this glyph (default is 1.0) |
java.lang.String |
getText()
get text associated with this glyph |
java.lang.String |
getType()
get glyph type |
abstract 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 |
boolean |
isSelected()
get this glyph's selection state (returns true if selected) |
boolean |
isSensitive()
tells whether mouse sends events related to entry/exit in this glyph or not |
boolean |
isVisible()
get this glyph's visibility state (returns true if visible) |
abstract 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 |
move(long x,
long y)
relative translation (offset) |
void |
moveTo(long x,
long y)
absolute translation |
abstract void |
orientTo(float angle)
set absolute orientation |
abstract 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 |
propagateMove(long x,
long y)
propagate this glyph's movement to all glyphs constrained by this one (pos) |
abstract 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 |
removeDependant(Glyph g)
remove a glyph frmo the list of glyphs depending on this one (nothing happens if g is not in the list) |
abstract void |
resetMouseIn(int i)
reset prevMouseIn for projected coordinates nb i |
abstract void |
reSize(float factor)
multiply bounding circle radius by factor |
void |
select(boolean b)
select this glyph |
void |
setBorderColor(java.awt.Color c)
used by glyph constructor to initialize color |
void |
setCGlyph(net.claribole.zvtm.glyphs.CGlyph c)
set the composite glyph associated with this glyph (meaning that this glyph is either a primary or secondary glyph inside a CGlyph) - do not call this method manually ; called autolatically when adding the glyph in the cglyph |
void |
setColor(java.awt.Color c)
used by glyph constructor to initialize color |
void |
setDashed(boolean b)
|
void |
setFill(boolean b)
|
void |
setFontSizePolicy(int policy)
set the font size display policy |
void |
setHSVbColor(float h,
float s,
float v)
set absolute border color in HSV coord sys |
void |
setHSVColor(float h,
float s,
float v)
set absolute fill color in HSV coord sys |
void |
setID(java.lang.Long ident)
set glyph ID (make sure there is no conflict) |
void |
setMouseInsideColor(java.awt.Color c)
set border color when cursor is inside glyph |
void |
setOwner(java.lang.Object o)
associate an application object with this glyph |
void |
setPaintBorder(boolean b)
|
void |
setSelectedColor(java.awt.Color c)
set border color when glyph is selected |
void |
setSensitivity(boolean b)
set sensitivity of this glyph |
void |
setSpecialFont(java.awt.Font f)
change font for this specific text object - f=null to get back to default font |
void |
setStroke(java.awt.BasicStroke b)
|
void |
setStrokeWidth(float w)
|
void |
setText(java.lang.String t)
set text that should be painted with this glyph |
void |
setTextPos(int p)
|
void |
setType(java.lang.String t)
set glyph type |
void |
setVisible(boolean b)
make this glyph (in)visible |
void |
setVSM(com.xerox.VTM.engine.VirtualSpaceManager v)
set a ref to the virtual space manager |
abstract void |
sizeTo(float radius)
set size of object by setting its bounding circle's radius |
void |
stick(Glyph g)
attach glyph to this one |
java.lang.String |
toString()
returns a String with ID, position, and altitude |
void |
unstick(Glyph g)
detach glyph from this one |
boolean |
usesSpecialFont()
tells whether this glyph is using a special font or not (note: using a special font does not necessarily means that this font is different from the default font (although it should, but this is at programer's prerogative)) |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
ID
java.lang.Long ID
- Glyph ID
vx
public long vx
- coordinate in virtual space (geometric center of object)
vy
public long vy
- coordinate in virtual space (geometric center of object)
vz
public float vz
- altitude (in virtual space)
size
float size
- radius of bounding circle
orient
float orient
- object orientation [0:2Pi[
selected
boolean selected
- tells whether this glyph is selected or not (default is false)
visible
boolean visible
- tells whether this glyph is visible or not (default is true)
sensit
boolean sensit
- tells whether we should detect entry/exit in this glyph
text
java.lang.String text
- text that should be drawn with glyph
fontSizePolicy
int fontSizePolicy
- 1=always draw text 0=draw text when approx fits inside object -1=never draw text 2=as VText
textPos
int textPos
- tells if string should be painted inside glyph (=0), on top of glyph (=1), or under glyph (=-1)
textWidth
int textWidth
- width of text in pixels (only available in textDraw())
textHeight
int textHeight
- height of text in pixels (only available in textDraw())
fontSize
public static float fontSize
- font size in pixels
font
java.awt.Font font
- special font used in this object only (null if default font)
owner
java.lang.Object owner
- ref to the object this glyph represents
type
java.lang.String type
- type of object (can be any string)
cGlyph
net.claribole.zvtm.glyphs.CGlyph cGlyph
- composite glyph associated with this glyph (meaning that this glyph is either a primary or secondary glyph inside a CGlyph)
dependants
java.util.Vector dependants
coef
public float coef
- projection coef
vsm
public com.xerox.VTM.engine.VirtualSpaceManager vsm
- ref to VSM
color
public java.awt.Color color
- color of interior
borderColor
public java.awt.Color borderColor
- current color of border
selectedColor
public java.awt.Color selectedColor
- color of border when glyph is selected (can be different fom color when cursor is inside glyph)
mouseInsideColor
public java.awt.Color mouseInsideColor
- color of border when cursor is inside glyph
bColor
public java.awt.Color bColor
- standard color of border
HSV
protected float[] HSV
- HSV coordinates of interior color in range 0.0-1.0
HSVb
protected float[] HSVb
- HSV coordinates of border color
DEFAULT_STROKE_WIDTH
public static float DEFAULT_STROKE_WIDTH
- first is width of line, last is offset
stroke
java.awt.BasicStroke stroke
dashedContour
boolean dashedContour
strokeWidth
float strokeWidth
paintBorder
boolean paintBorder
filled
boolean filled
stickedGlyphs
java.util.Vector stickedGlyphs
- glyphs sticked to this one
stickedTo
public java.lang.Object stickedTo
- object to which this glyph is sticked to (could be a VCursor or a Glyph)
| Constructor Detail |
Glyph
public Glyph()
| Method Detail |
setSensitivity
public void setSensitivity(boolean b)
- set sensitivity of this glyph
isSensitive
public boolean isSensitive()
- tells whether mouse sends events related to entry/exit in this glyph or not
setCGlyph
public void setCGlyph(net.claribole.zvtm.glyphs.CGlyph c)
- set the composite glyph associated with this glyph (meaning that this glyph is either a primary or secondary glyph inside a CGlyph) - do not call this method manually ; called autolatically when adding the glyph in the cglyph
getCGlyph
public net.claribole.zvtm.glyphs.CGlyph getCGlyph()
- returns the composite glyph associated with this glyph (meaning that this glyph is either a primary or secondary glyph inside a CGlyph) - returns null if none
addDependant
public void addDependant(Glyph g)
- add a glyph to the list of glyphs depending on this one - put glyphs that depend on this one here (for instance segments to hide when hiding this object...). What should be done with dependants depends on the application (the programmer has to specify what to do with dependants when something happens to this glyph manually - we just store them here) - this list has to be maintained manually (if a glyph is destroyed, it is not removed from dependant lists in which it might appear)
removeDependant
public void removeDependant(Glyph g)
- remove a glyph frmo the list of glyphs depending on this one (nothing happens if g is not in the list)
getDependants
public java.util.Vector getDependants()
- get list of glyphs depending on this one
setDashed
public void setDashed(boolean b)
setStrokeWidth
public void setStrokeWidth(float w)
setStroke
public void setStroke(java.awt.BasicStroke b)
getStroke
public java.awt.BasicStroke getStroke()
- returns the stroke used to paint the border of this glyph (null if none)
getStrokeWidth
public float getStrokeWidth()
- returns the stroke width used to paint the border of this glyph (default is 1.0)
setPaintBorder
public void setPaintBorder(boolean b)
getPaintBorderStatus
public boolean getPaintBorderStatus()
- tells whether a glyph's border is painted or not
setSelectedColor
public void setSelectedColor(java.awt.Color c)
- set border color when glyph is selected
setMouseInsideColor
public void setMouseInsideColor(java.awt.Color c)
- set border color when cursor is inside glyph
select
public void select(boolean b)
- select this glyph
isSelected
public boolean isSelected()
- get this glyph's selection state (returns true if selected)
setVisible
public void setVisible(boolean b)
- make this glyph (in)visible
isVisible
public boolean isVisible()
- get this glyph's visibility state (returns true if visible)
setFill
public void setFill(boolean b)
getFillStatus
public boolean getFillStatus()
- tells whether this glyph is filled or not
draw
public abstract void draw(java.awt.Graphics2D g, int vW, int vH, int i, java.awt.Stroke stdS, java.awt.geom.AffineTransform stdT)
- draw his glyph
project
public abstract void project(com.xerox.VTM.engine.Camera c, com.xerox.VTM.engine.ViewPanel v)
- project shape in camera coord sys prior to actual painting
move
public void move(long x,
long y)
- relative translation (offset)
moveTo
public void moveTo(long x,
long y)
- absolute translation
propagateMove
public void propagateMove(long x,
long y)
- propagate this glyph's movement to all glyphs constrained by this one (pos)
getSize
public abstract float getSize()
- get size of object (radius of bounding circle)
sizeTo
public abstract void sizeTo(float radius)
- set size of object by setting its bounding circle's radius
reSize
public abstract void reSize(float factor)
- multiply bounding circle radius by factor
getOrient
public abstract float getOrient()
- get orientation
orientTo
public abstract void orientTo(float angle)
- set absolute orientation
initCams
public abstract 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 abstract void addCamera(int verifIndex)
- used internally to create new projected coordinates to use with the new camera
removeCamera
public abstract 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
coordInside
public abstract boolean coordInside(int x,
int y,
int camIndex)
- detects whether the given point is inside this glyph or not
resetMouseIn
public abstract void resetMouseIn(int i)
- reset prevMouseIn for projected coordinates nb i
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 abstract 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)
mouseInOut
public abstract 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)
setColor
public void setColor(java.awt.Color c)
- used by glyph constructor to initialize color
setBorderColor
public void setBorderColor(java.awt.Color c)
- used by glyph constructor to initialize color
setHSVColor
public void setHSVColor(float h,
float s,
float v)
- set absolute fill color in HSV coord sys
addHSVColor
public void addHSVColor(float h,
float s,
float v)
- set relative fill color in HSV coord sys
setHSVbColor
public void setHSVbColor(float h,
float s,
float v)
- set absolute border color in HSV coord sys
addHSVbColor
public void addHSVbColor(float h,
float s,
float v)
- set relative border color in HSV coord sys
getHSVColor
public float[] getHSVColor()
- get fill color
getHSVbColor
public float[] getHSVbColor()
- get border color
getColor
public java.awt.Color getColor()
- get fill color as an object
getColorb
public java.awt.Color getColorb()
- get border color as an object
getText
public java.lang.String getText()
- get text associated with this glyph
setText
public void setText(java.lang.String t)
- set text that should be painted with this glyph
setSpecialFont
public void setSpecialFont(java.awt.Font f)
- change font for this specific text object - f=null to get back to default font
getFont
public java.awt.Font getFont()
- returns the font used for this glyph's text
usesSpecialFont
public boolean usesSpecialFont()
- tells whether this glyph is using a special font or not (note: using a special font does not necessarily means that this font is different from the default font (although it should, but this is at programer's prerogative))
setFontSizePolicy
public void setFontSizePolicy(int policy)
- set the font size display policy
setTextPos
public void setTextPos(int p)
getID
public java.lang.Long getID()
- get glyph ID
setID
public void setID(java.lang.Long ident)
- set glyph ID (make sure there is no conflict)
getOwner
public java.lang.Object getOwner()
- get object this glyph represents
setOwner
public void setOwner(java.lang.Object o)
- associate an application object with this glyph
getType
public java.lang.String getType()
- get glyph type
setType
public void setType(java.lang.String t)
- set glyph type
setVSM
public void setVSM(com.xerox.VTM.engine.VirtualSpaceManager v)
- set a ref to the virtual space manager
stick
public void stick(Glyph g)
- attach glyph to this one
unstick
public void unstick(Glyph g)
- detach glyph from this one
getStickedGlyphs
public java.util.Vector getStickedGlyphs()
- return the list of glyphs sticked to this one (empty vector if none)
getLocation
public com.xerox.VTM.engine.LongPoint getLocation()
- returns coordinates of the glyph's geom center as a LongPoint
toString
public java.lang.String toString()
- returns a String with ID, position, and altitude
clone
public abstract java.lang.Object clone()
- Description copied from class:
java.lang.Object - This method may be called to create a new copy of the
Object. The typical behavior is as follows:
o == o.clone()is falseo.getClass() == o.clone().getClass()is trueo.equals(o)is true
However, these are not strict requirements, and may be violated if necessary. Of the three requirements, the last is the most commonly violated, particularly if the subclass does not override Object.equals(Object)>
Object.equals(Object)55 .If the Object you call clone() on does not implement java.lang.Cloneable (which is a placeholder interface), then a CloneNotSupportedException is thrown. Notice that Object does not implement Cloneable; this method exists as a convenience for subclasses that do.
Object's implementation of clone allocates space for the new Object using the correct class, without calling any constructors, and then fills in all of the new field values with the old field values. Thus, it is a shallow copy. However, subclasses are permitted to make a deep copy.
All array types implement Cloneable, and override this method as follows (it should never fail):
public Object clone() { try { super.clone(); } catch (CloneNotSupportedException e) { throw new InternalError(e.getMessage()); } }
|
|||||||||
| Home >> All >> com >> xerox >> VTM >> [ glyphs overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
com.xerox.VTM.glyphs.Glyph