fr.inria.zvtm.glyphs
Class Glyph

java.lang.Object
  extended by fr.inria.zvtm.glyphs.Glyph
All Implemented Interfaces:
Translucent, Cloneable
Direct Known Subclasses:
ClosedShape, Composite, DPath, SemZoomGlyph, VPoint, VSegment

public abstract class Glyph
extends Object
implements Cloneable, Translucent

Parent class of all graphical objects.

Author:
Emmanuel Pietriga

Field Summary
 AlphaComposite alphaC
          AlphaComposite used to paint glyph if not opaque.
protected  double coef
           
protected  Color color
           
protected  Color cursorInsideColor
           
static short ENTERED_GLYPH
          Value sent to cursor when it enters this glyph.
static short EXITED_GLYPH
          Value sent to cursor when it exits this glyph.
protected  Color fColor
           
protected  float[] HSV
           
static short NO_CURSOR_EVENT
          Value sent to cursor when it neither enters nor exit this glyph.
protected  double orient
          Glyph's orientation in [0:2Pi[ (read-only).
protected  boolean sensit
           
protected  double size
          Diameter of bounding circle (read-only).
 Object stickedTo
          Object to which this glyph is sticked (could be a VCursor, a Camera or a Glyph).
protected  Stroke stroke
          For internal use.
protected  boolean visible
           
 double vx
          Horizontal coordinate of the glyph's geomatrical center, in virtual space.
 double vy
          Vertical coordinate of the glyph's geomatrical center, in virtual space.
protected  int vz
          z-index
 
Fields inherited from interface fr.inria.zvtm.glyphs.Translucent
acO
 
Constructor Summary
Glyph()
           
 
Method Summary
abstract  void addCamera(int verifIndex)
          Create new projected coordinates.
 void addHSVbColor(float h, float s, float v)
          Set the glyph's border color (absolute value, HSV color space).
 void addHSVColor(float h, float s, float v)
          Set the glyph's main color (absolute value, HSV color space).
 Object clone()
           
 boolean containedInRegion(double wb, double nb, double eb, double sb, int i)
          Method used internally to find out if it is necessary to project and draw the glyph through a lens for a given camera.
abstract  boolean coordInside(int jpx, int jpy, int camIndex, double cvx, double cvy)
          Detect whether the given point is inside this glyph or not.
abstract  void draw(Graphics2D g, int vW, int vH, int i, Stroke stdS, AffineTransform stdT, int dx, int dy)
          Draw this glyph.
abstract  void drawForLens(Graphics2D g, int vW, int vH, int i, Stroke stdS, AffineTransform stdT, int dx, int dy)
          Draw this glyph through a lens.
abstract  boolean fillsView(double w, double h, int camIndex)
          Find out if this glyph completely fills a view.
 Color getBorderColor()
          Get the glyph's border color (use getColor for text, paths, segments, etc.).
 double[] getBounds()
          Get the bounding box of this Glyph in virtual space coordinates.
 Color getColor()
          Get the glyph's current main color.
 Color getDefaultColor()
          Get the glyph's default main color.
static Color getDefaultCursorInsideHighlightColor()
           
 float[] getHSVbColor()
          Get border color's HSV components.
 float[] getHSVColor()
          Get main color's HSV components.
abstract  Shape getJava2DShape()
          Get the Java2D Shape corresponding to this Glyph.
 Point2D.Double getLocation()
          Get the coordinates of the glyph's geometrical center.
abstract  double getOrient()
          Get the glyph's orientation.
 Object getOwner()
          Get the object this glyph represents in the client application.
abstract  double getSize()
          Get glyph's size (diameter of bounding circle).
 Glyph[] getStickedGlyphArray()
          Get the list of glyphs sticked to this one.
 Stroke getStroke()
          Get the stroke used to paint glyph's border.
 float getTranslucencyValue()
          Get alpha channel value (translucency).
 String getType()
          Get the type of this glyph.
 int getZindex()
          Get this object's z-index.
abstract  void highlight(boolean b, Color selectedColor)
          Highlight this glyph to give visual feedback when the cursor is inside it.
abstract  void initCams(int nbCam)
          Initialize projected coordinates.
 boolean isBorderDrawn()
          Indicates whether the glyph's border is drawn or not.
 boolean isFilled()
          Indicates whether this glyph's interior is filled or not.
 boolean isSelected()
          Get this glyph's selection status.
 boolean isSensitive()
          Indicates whether ZVTM sends events related to cursor entry/exit in/from this glyph or not.
 boolean isVisible()
          Get this glyph's visibility status.
 boolean isVisibleThroughLens()
          Get this glyph's visibility status when seen through a lens.
abstract  short mouseInOut(int jpx, int jpy, int camIndex, double cvx, double cvy)
          Method used internally for firing picking-related events.
 void move(double x, double y)
          Translate the glyph by (x,y) - relative translation.
 void moveTo(double x, double y)
          Translate the glyph to (x,y) - absolute translation.
abstract  void orientTo(double angle)
          Set the glyph's absolute orientation.
abstract  void project(Camera c, Dimension d)
          Project glyph w.r.t a given camera's coordinate system, prior to actual painting.
abstract  void projectForLens(Camera c, int lensWidth, int lensHeight, float lensMag, double lensx, double lensy)
          Project glyph w.r.t a given camera's coordinate system, prior to actual painting through a lens.
 void propagateMove(double x, double y)
          Propagate this glyph's movement to all glyphs constrained by this one.
abstract  void removeCamera(int index)
          Dispose of projected coordinates.
abstract  void resetMouseIn()
          Reset memory of cursor being inside the glyph.
abstract  void resetMouseIn(int i)
          Reset memory of cursor being inside the glyph for projected coordinates associated with camera at index i.
abstract  void reSize(double factor)
          Set glyph's size by multiplying its bounding circle diameter by a factor.
 void select(boolean b)
          Select this glyph.
 void setBorderColor(Color c)
          Set the glyph's border color (use setColor for text, paths, segments, etc.).
 void setColor(Color c)
          Set the glyph's main color.
 void setCursorInsideHighlightColor(Color c)
          Set the glyph's border color when cursor is inside it.
static void setDefaultCursorInsideHighlightColor(Color c)
           
 void setHSVbColor(float h, float s, float v)
          Set the glyph's border color (absolute value, HSV color space).
 void setHSVColor(float h, float s, float v)
          Set the glyph's main color (absolute value, HSV color space).
 void setOwner(Object o)
          Set the object this glyph represents in the client application.
 void setSensitivity(boolean b)
          Make this glyph sensitive (or not).
 void setStroke(Stroke s)
          Set a custom stroke to paint glyph's border.
 void setTranslucencyValue(float alpha)
          Set alpha channel value (translucency).
 void setType(String t)
          Set the type of this glyph.
 void setVisible(boolean b)
          Make this glyph (in)visible (the glyph remains sensitive to cursor in/out events).
Use methods VirtualSpace.show(Glyph g) and VirtualSpace.hide(Glyph g) to make a glyph both (in)visible and (in)sensitive.
 void setZindex(int z)
          FOR INTERNAL USE ONLY.
abstract  void sizeTo(double s)
          Set glyph's size by setting its bounding circle's diameter.
 void stick(Glyph g)
          Attach a glyph to this one.
static void stickToGlyph(Glyph g1, Glyph g2)
          Stick glyph g1 to glyph g2.
 String toString()
          Get a string representation of this glyph.
 void unstick(Glyph g)
          Unattach a glyph from this one.
 void unstickAllGlyphs()
          Unattach all glyphs attached to this one.
static void unstickAllGlyphs(Glyph g)
          Unstick all glyphs sticked to Glyph g.
static void unstickFromGlyph(Glyph g1, Glyph g2)
          Unstick glyph g1 from glyph g2.
 boolean visibleInDisc(double dvx, double dvy, double dvr, Shape dvs, int camIndex, int jpx, int jpy, int dpr)
          Find out if a glyph is visible in a circular area.
 boolean visibleInRegion(double wb, double nb, double eb, double sb, int i)
          Method used internally to find out if it is necessary to project and draw this glyph for a given camera.
 boolean visibleInViewport(double wb, double nb, double eb, double sb, Camera c)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

vx

public double vx
Horizontal coordinate of the glyph's geomatrical center, in virtual space.

See Also:
moveTo(double x, double y), move(double x, double y), getLocation()

vy

public double vy
Vertical coordinate of the glyph's geomatrical center, in virtual space.

See Also:
moveTo(double x, double y), move(double x, double y), getLocation()

vz

protected int vz
z-index


size

protected double size
Diameter of bounding circle (read-only).

See Also:
sizeTo(double s), reSize(double factor), getSize()

orient

protected double orient
Glyph's orientation in [0:2Pi[ (read-only).

See Also:
getOrient(), orientTo(double angle)

visible

protected boolean visible

sensit

protected boolean sensit

color

protected Color color

HSV

protected float[] HSV

fColor

protected Color fColor

cursorInsideColor

protected Color cursorInsideColor

alphaC

public AlphaComposite alphaC
AlphaComposite used to paint glyph if not opaque. Set to null if glyph is opaque. Temporarily made public until all glyphs get into the same package.


stroke

protected Stroke stroke
For internal use. Dot not tamper with.


stickedTo

public Object stickedTo
Object to which this glyph is sticked (could be a VCursor, a Camera or a Glyph).


ENTERED_GLYPH

public static final short ENTERED_GLYPH
Value sent to cursor when it enters this glyph. For internal use.

See Also:
Constant Field Values

EXITED_GLYPH

public static final short EXITED_GLYPH
Value sent to cursor when it exits this glyph. For internal use.

See Also:
Constant Field Values

NO_CURSOR_EVENT

public static final short NO_CURSOR_EVENT
Value sent to cursor when it neither enters nor exit this glyph. For internal use.

See Also:
Constant Field Values

coef

protected double coef
Constructor Detail

Glyph

public Glyph()
Method Detail

getOwner

public Object getOwner()
Get the object this glyph represents in the client application. The owner can be any arbitrary Java object set by the client application, that the programmer wants to be easily accessible through the Glyph (typically the owner will be an object that models a logical concept of which a visual depiction is given by the glyph). Multiple glyphs can have the same owner. A glyph can only have one owner.

Returns:
null if not associated with anything.

setOwner

public void setOwner(Object o)
Set the object this glyph represents in the client application. The owner can be any arbitrary Java object set by the client application, that the programmer wants to be easily accessible through the Glyph (typically the owner will be an object that models a logical concept of which a visual depiction is given by the glyph). Multiple glyphs can have the same owner. A glyph can only have one owner.

Parameters:
o - provided by client application, null by default.

getType

public String getType()
Get the type of this glyph. Arbitrary String, set by client application. Null if not set. This is somewhat equivalent to tagging an object, but it only one type can be associated with a glyph.

Returns:
null if not set

setType

public void setType(String t)
Set the type of this glyph. This is somewhat equivalent to tagging an object, but it only one type can be associated with a glyph.

Parameters:
t - arbitrary string, set by client application. Null if not set.

toString

public String toString()
Get a string representation of this glyph.

Overrides:
toString in class Object

move

public void move(double x,
                 double y)
Translate the glyph by (x,y) - relative translation.

See Also:
moveTo(double x, double y)

moveTo

public void moveTo(double x,
                   double y)
Translate the glyph to (x,y) - absolute translation.

See Also:
move(double x, double y)

getLocation

public Point2D.Double getLocation()
Get the coordinates of the glyph's geometrical center.

Returns:
a copy of the glyph's location. Changing the x,y coordinates of the returned point will not have any effect on the glyph's position.

getSize

public abstract double getSize()
Get glyph's size (diameter of bounding circle).


sizeTo

public abstract void sizeTo(double s)
Set glyph's size by setting its bounding circle's diameter.

See Also:
reSize(double factor)

reSize

public abstract void reSize(double factor)
Set glyph's size by multiplying its bounding circle diameter by a factor.

See Also:
sizeTo(double s)

getOrient

public abstract double getOrient()
Get the glyph's orientation.


orientTo

public abstract void orientTo(double angle)
Set the glyph's absolute orientation.

Parameters:
angle - in [0:2Pi[

getZindex

public int getZindex()
Get this object's z-index.

Returns:
the default value, 0 if a z-index was not specified

setZindex

public void setZindex(int z)
FOR INTERNAL USE ONLY. Will have no effect on actual z-ordering. Use appropriate methods in VirtualSpace.

See Also:
VirtualSpace.onTop(Glyph g), VirtualSpace.atBottom(Glyph g), VirtualSpace.above(Glyph g1,Glyph g2), VirtualSpace.below(Glyph g1,Glyph g2)

setSensitivity

public void setSensitivity(boolean b)
Make this glyph sensitive (or not).


isSensitive

public boolean isSensitive()
Indicates whether ZVTM sends events related to cursor entry/exit in/from this glyph or not.


setVisible

public void setVisible(boolean b)
Make this glyph (in)visible (the glyph remains sensitive to cursor in/out events).
Use methods VirtualSpace.show(Glyph g) and VirtualSpace.hide(Glyph g) to make a glyph both (in)visible and (in)sensitive.

Parameters:
b - true to make glyph visible, false to make it invisible
See Also:
VirtualSpace.show(Glyph g), VirtualSpace.hide(Glyph g)

isVisible

public boolean isVisible()
Get this glyph's visibility status.

Returns:
true if visible

isVisibleThroughLens

public boolean isVisibleThroughLens()
Get this glyph's visibility status when seen through a lens. This is equivalent to isVisible() for most glyphs, except LText.

Returns:
true if visible

setDefaultCursorInsideHighlightColor

public static void setDefaultCursorInsideHighlightColor(Color c)

getDefaultCursorInsideHighlightColor

public static Color getDefaultCursorInsideHighlightColor()

isFilled

public boolean isFilled()
Indicates whether this glyph's interior is filled or not. Relevant for closed shapes only. Does not make sense for glyphs such as text, paths and segments (returns true in those cases).


isBorderDrawn

public boolean isBorderDrawn()
Indicates whether the glyph's border is drawn or not. Relevant for closed shapes only. Does not make sense for glyphs such as text, paths and segments (returns true in those cases).


setCursorInsideHighlightColor

public void setCursorInsideHighlightColor(Color c)
Set the glyph's border color when cursor is inside it. IMPORTANT: add ing the glyph to a virtual space after calling this method might override this color. Relevant for closed shapes only. Does not make sense for glyphs such as text, paths and segments.

Parameters:
c - set to null to keep the original color.

setColor

public void setColor(Color c)
Set the glyph's main color. This is the fill color for closed shapes, or stroke color for other glyphs (text, paths, segments, etc.).


setBorderColor

public void setBorderColor(Color c)
Set the glyph's border color (use setColor for text, paths, segments, etc.). This will have an effect only for Glyphs that have a border, such as instances of ClosedShape.

See Also:
setColor(Color c)

setHSVColor

public void setHSVColor(float h,
                        float s,
                        float v)
Set the glyph's main color (absolute value, HSV color space).

Parameters:
h - hue in [0.0, 1.0]
s - saturation in [0.0, 1.0]
v - value (brightness) in [0.0, 1.0]
See Also:
addHSVColor(float h,float s,float v)

addHSVColor

public void addHSVColor(float h,
                        float s,
                        float v)
Set the glyph's main color (absolute value, HSV color space).

Parameters:
h - hue so that the final hue is in [0.0, 1.0]
s - saturation so that the final saturation is in [0.0, 1.0]
v - value so that the final value (brightness) is in [0.0, 1.0]\
See Also:
setHSVColor(float h,float s,float v)

setHSVbColor

public void setHSVbColor(float h,
                         float s,
                         float v)
Set the glyph's border color (absolute value, HSV color space). Use setColor for text, paths, segments, etc. This will have an effect only for Glyphs that have a border, such as instances of ClosedShape.

Parameters:
h - hue in [0.0, 1.0]
s - saturation in [0.0, 1.0]
v - value (brightness) in [0.0, 1.0]
See Also:
addHSVbColor(float h,float s,float v)

addHSVbColor

public void addHSVbColor(float h,
                         float s,
                         float v)
Set the glyph's border color (absolute value, HSV color space). Use setColor for text, paths, segments, etc. This will have an effect only for Glyphs that have a border, such as instances of ClosedShape.

Parameters:
h - hue so that the final hue is in [0.0, 1.0]
s - saturation so that the final saturation is in [0.0, 1.0]
v - value so that the final value (brightness) is in [0.0, 1.0]
See Also:
setHSVbColor(float h,float s,float v)

getHSVColor

public float[] getHSVColor()
Get main color's HSV components. This is the original array, not a copy.


getHSVbColor

public float[] getHSVbColor()
Get border color's HSV components. This is the original array, not a copy.

Returns:
{0, 0, 0} if the glyph does not have a border (e.g., is not an instanceof ClosedShape)

getColor

public Color getColor()
Get the glyph's current main color. This might be different from the default main color depending on the Glyph's current status. This is the fill color for closed shapes, or stroke color for other glyphs (text, paths, segments, etc.).

See Also:
getDefaultColor()

getDefaultColor

public Color getDefaultColor()
Get the glyph's default main color. This might be different from the current main color depending on the Glyph's current status. This is the fill color for closed shapes, or stroke color for other glyphs (text, paths, segments, etc.).

See Also:
getColor()

getBorderColor

public Color getBorderColor()
Get the glyph's border color (use getColor for text, paths, segments, etc.).

Returns:
Color.BLACK if the glyph does not have a border (e.g., is not an instanceof ClosedShape)
See Also:
getColor()

highlight

public abstract void highlight(boolean b,
                               Color selectedColor)
Highlight this glyph to give visual feedback when the cursor is inside it.


setTranslucencyValue

public void setTranslucencyValue(float alpha)
Set alpha channel value (translucency).

Specified by:
setTranslucencyValue in interface Translucent
Parameters:
alpha - in [0;1.0]. 0 is fully transparent, 1 is opaque

getTranslucencyValue

public float getTranslucencyValue()
Get alpha channel value (translucency).

Specified by:
getTranslucencyValue in interface Translucent
Returns:
a value in [0;1.0]. 0 is fully transparent, 1 is opaque

select

public void select(boolean b)
Select this glyph. This just flags the glyph as selected.

Parameters:
b - true to select glyph, false to unselect it

isSelected

public boolean isSelected()
Get this glyph's selection status.

Returns:
true if selected.

setStroke

public void setStroke(Stroke s)
Set a custom stroke to paint glyph's border.

Parameters:
s - stroke (null to set standard 1px-thick stroke)

getStroke

public Stroke getStroke()
Get the stroke used to paint glyph's border.

Returns:
null if default 1px-thick solid stroke

propagateMove

public void propagateMove(double x,
                          double y)
Propagate this glyph's movement to all glyphs constrained by this one. Called automatically by ZVTM when translating this glyph.


stick

public void stick(Glyph g)
Attach a glyph to this one. Translations of this glyph will be propagated to g.

Parameters:
g - glyph to be attached to this one

unstick

public void unstick(Glyph g)
Unattach a glyph from this one. Translations of this glyph will no longer be propagated to g.

Parameters:
g - glyph to be unattached from this one

unstickAllGlyphs

public void unstickAllGlyphs()
Unattach all glyphs attached to this one. Translations of this glyph will no longer be propagated to them.


getStickedGlyphArray

public Glyph[] getStickedGlyphArray()
Get the list of glyphs sticked to this one.

Returns:
null if no glyph is attached to this one

project

public abstract void project(Camera c,
                             Dimension d)
Project glyph w.r.t a given camera's coordinate system, prior to actual painting. Called internally.

Parameters:
c - camera
d - dimension of View using camera c

projectForLens

public abstract void projectForLens(Camera c,
                                    int lensWidth,
                                    int lensHeight,
                                    float lensMag,
                                    double lensx,
                                    double lensy)
Project glyph w.r.t a given camera's coordinate system, prior to actual painting through a lens. Called internally.

Parameters:
c - camera
lensWidth - width of lens activated in View using this camera
lensHeight - height of lens activated in View using this camera
lensMag - magnification factor of lens activated in View using this camera
lensx - horizontal coordinateof lens activated in View using this camera
lensy - vertical coordinate of lens activated in View using this camera

draw

public abstract void draw(Graphics2D g,
                          int vW,
                          int vH,
                          int i,
                          Stroke stdS,
                          AffineTransform stdT,
                          int dx,
                          int dy)
Draw this glyph.

Parameters:
g - graphics context in which the glyph should be drawn
vW - associated View width (used by some closed shapes to determine if it is worth painting the glyph's border)
vH - associated View height (used by some closed shapes to determine if it is worth painting the glyph's border)
i - camera index in the virtual space containing the glyph
stdS - default stroke
stdT - identity transform
dx - horizontal offset
dy - vertical offset

drawForLens

public abstract void drawForLens(Graphics2D g,
                                 int vW,
                                 int vH,
                                 int i,
                                 Stroke stdS,
                                 AffineTransform stdT,
                                 int dx,
                                 int dy)
Draw this glyph through a lens.

Parameters:
g - graphics context in which the glyph should be drawn
vW - associated View width (used by some closed shapes to determine if it is worth painting the glyph's border)
vH - associated View height (used by some closed shapes to determine if it is worth painting the glyph's border)
i - camera index in the virtual space containing the glyph
stdS - default stroke
stdT - identity transform
dx - horizontal offset
dy - vertical offset

initCams

public abstract void initCams(int nbCam)
Initialize projected coordinates. Called internally when glyph is created in order to create the initial set of projected coordinates w.r.t the number of cameras in the virtual space.

Parameters:
nbCam - current number of cameras in the virtual space
See Also:
addCamera(int verifIndex), removeCamera(int index)

addCamera

public abstract void addCamera(int verifIndex)
Create new projected coordinates. Called internally to create new projected coordinates to use with the new camera.

Parameters:
verifIndex - camera index, just to be sure that the number of projected coordinates is consistent with the number of cameras.
See Also:
initCams(int nbCam), removeCamera(int index)

removeCamera

public abstract void removeCamera(int index)
Dispose of projected coordinates. If a camera is removed from the virtual space to which this glyphs belongs, the corresponding projected coordinates should be deleted. the array of projected coordinates should not be modified however, because other cameras' index remain the same. The corresponding index in the array should just be set to null.

See Also:
initCams(int nbCam), addCamera(int verifIndex)

coordInside

public abstract boolean coordInside(int jpx,
                                    int jpy,
                                    int camIndex,
                                    double cvx,
                                    double cvy)
Detect whether the given point is inside this glyph or not.

Parameters:
jpx - provide projected JPanel coordinates of the associated view, not virtual space coordinates
jpy - provide projected JPanel coordinates of the associated view, not virtual space coordinates
cvx - virtual space coordinates
cvy - virtual space coordinates

resetMouseIn

public abstract void resetMouseIn()
Reset memory of cursor being inside the glyph.


resetMouseIn

public abstract void resetMouseIn(int i)
Reset memory of cursor being inside the glyph for projected coordinates associated with camera at index i.


mouseInOut

public abstract short mouseInOut(int jpx,
                                 int jpy,
                                 int camIndex,
                                 double cvx,
                                 double cvy)
Method used internally for firing picking-related events.

Parameters:
jpx - provide projected JPanel coordinates of the associated view, not virtual space coordinates
jpy - provide projected JPanel coordinates of the associated view, not virtual space coordinates
cvx - virtual space coordinates
cvy - virtual space coordinates
Returns:
VCursor.ENTERED_GLYPH if cursor has entered the glyph, VCursor.EXITED_GLYPH if it has exited the glyph, VCursor.NO_CURSOR_EVENT if nothing has changed (meaning the cursor was already inside or outside it)

visibleInRegion

public boolean visibleInRegion(double wb,
                               double nb,
                               double eb,
                               double sb,
                               int i)
Method used internally to find out if it is necessary to project and draw this glyph for a given camera.

Parameters:
wb - west region boundary (virtual space coordinates)
nb - north region boundary (virtual space coordinates)
eb - east region boundary (virtual space coordinates)
sb - south region boundary (virtual space coordinates)
i - camera index (useuful only for some glyph classes redefining this method)
Returns:
true if the glyph is currently visible in the region delimited by wb, nb, eb, sb, symbolising the region seen through a camera

visibleInViewport

public boolean visibleInViewport(double wb,
                                 double nb,
                                 double eb,
                                 double sb,
                                 Camera c)

containedInRegion

public boolean containedInRegion(double wb,
                                 double nb,
                                 double eb,
                                 double sb,
                                 int i)
Method used internally to find out if it is necessary to project and draw the glyph through a lens for a given camera.

Parameters:
wb - west region boundary (virtual space coordinates)
nb - north region boundary (virtual space coordinates)
eb - east region boundary (virtual space coordinates)
sb - south region boundary (virtual space coordinates)
i - camera index (useuful only for some glyph classes redefining this method)
Returns:
true if the glyph intersects the region delimited by wb, nb, eb, sb

fillsView

public abstract boolean fillsView(double w,
                                  double h,
                                  int camIndex)
Find out if this glyph completely fills a view. (In which case it is not necessary to repaint objects below it in the drawing stack). If implemented, this method should be very efficient, as it is used by an optional top-down clipping algorithm. Otherwise it might cost more time than it can potentially save. Until now it has only been implemented for non-reorientable rectangles and was activated only for treemap-like representations in which a lot of rectangles can potentially overlap each other.


visibleInDisc

public boolean visibleInDisc(double dvx,
                             double dvy,
                             double dvr,
                             Shape dvs,
                             int camIndex,
                             int jpx,
                             int jpy,
                             int dpr)
Find out if a glyph is visible in a circular area. Not implemented yet for most glyph classes. Used for instance to implement DynaSpot picking.


getBounds

public double[] getBounds()
Get the bounding box of this Glyph in virtual space coordinates.

Returns:
west, north, east and south bounds in virtual space.

stickToGlyph

public static void stickToGlyph(Glyph g1,
                                Glyph g2)
Stick glyph g1 to glyph g2. Behaves like a one-way constraint.


unstickFromGlyph

public static void unstickFromGlyph(Glyph g1,
                                    Glyph g2)
Unstick glyph g1 from glyph g2.


unstickAllGlyphs

public static void unstickAllGlyphs(Glyph g)
Unstick all glyphs sticked to Glyph g.


getJava2DShape

public abstract Shape getJava2DShape()
Get the Java2D Shape corresponding to this Glyph. Virtual Space coordinates.


clone

public Object clone()
Overrides:
clone in class Object


Copyright © 2000-2002 Xerox Corporation. All Rights Reserved
Copyright © 2003 World Wide Web Consortium. All Rights Reserved
Copyright © 2004-2011 INRIA. All Rights Reserved
Licensed under the GNU LGPL. For full terms see the file COPYING.