public class VRing<T> extends ClosedShape
Modifier and Type | Field and Description |
---|---|
double |
angle |
int |
angleDeg |
static double |
DEG2RAD_FACTOR |
double |
orient |
int |
orientDeg |
Point2D.Double |
p1 |
Point2D.Double |
p2 |
Point2D.Double |
p3 |
Point2D.Double |
p4 |
static double |
RAD2DEG_FACTOR |
bColor, borderColor, cursorInsideFColor, HSVb
alphaC, coef, color, cursorInsideColor, ENTERED_GLYPH, EXITED_GLYPH, fColor, HSV, NO_CURSOR_EVENT, sensit, size, stickedTo, stroke, visible, vx, vy, vz
acO
Constructor and Description |
---|
VRing(double x,
double y,
int z,
double vs,
double ag,
float irr,
double or,
Color c,
Color bc)
Construct a slice by giving its size, angle and orientation
|
VRing(double x,
double y,
int z,
double vs,
double ag,
float irr,
double or,
Color c,
Color bc,
float alpha)
Construct a slice by giving its size, angle and orientation
|
VRing(double x,
double y,
int z,
double vs,
int ag,
float irr,
int or,
Color c,
Color bc)
Construct a slice by giving its size, angle and orientation
|
VRing(double x,
double y,
int z,
double vs,
int ag,
float irr,
int or,
Color c,
Color bc,
float alpha)
Construct a slice by giving its size, angle and orientation
|
Modifier and Type | Method and Description |
---|---|
void |
addCamera(int verifIndex)
Create new projected coordinates.
|
Object |
clone() |
boolean |
coordInside(int jpx,
int jpy,
Camera c,
double cvx,
double cvy)
Detect whether the given point is inside this glyph or not.
|
boolean |
coordInsideP(int jpx,
int jpy,
Camera c)
Detect whether the given point is inside this glyph or not.
|
boolean |
coordInsideV(double cvx,
double cvy,
Camera c)
Detect whether the given point is inside this glyph or not.
|
void |
draw(Graphics2D g,
int vW,
int vH,
int i,
Stroke stdS,
AffineTransform stdT,
int dx,
int dy)
Draw this glyph.
|
void |
drawForLens(Graphics2D g,
int vW,
int vH,
int i,
Stroke stdS,
AffineTransform stdT,
int dx,
int dy)
Draw this glyph through a lens.
|
boolean |
fillsView(double w,
double h,
int camIndex)
Find out if this glyph completely fills a view.
|
double |
getAngle()
Get the arc angle.
|
float |
getInnerRatio()
Returns the inner radius ratio, as a percentage
of the outer radius.
|
Shape |
getJava2DShape()
Get the Java2D Shape corresponding to this Glyph.
|
double |
getOrient()
Get the slice's orientation.
|
double |
getSize()
Get glyph's size (diameter of bounding circle).
|
void |
initCams(int nbCam)
Initialize projected coordinates.
|
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.
|
void |
orientTo(double ag)
Set the slice's orientation.
|
void |
project(Camera c,
Dimension d)
Project glyph w.r.t a given camera's coordinate system, prior to actual painting.
|
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 |
removeCamera(int index)
Dispose of projected coordinates.
|
void |
reSize(double factor)
Set glyph's size by multiplying its bounding circle diameter by a factor.
|
void |
setAngle(double ag)
Set the arc angle.
|
void |
sizeTo(double s)
Set glyph's size by setting its bounding circle's diameter.
|
boolean |
visibleInDisc(double dvx,
double dvy,
double dvr,
Shape dvs,
int camIndex,
int jpx,
int jpy,
int dpr)
The disc is actually approximated to its bounding box here.
|
addHSVbColor, getBorderColor, getDefaultBorderColor, getHSVbColor, highlight, isBorderDrawn, isFilled, setBorderColor, setCursorInsideFillColor, setDrawBorder, setFilled, setHSVbColor
addHSVColor, containedInRegion, getBounds, getColor, getDefaultColor, getDefaultCursorInsideHighlightColor, getHSVColor, getLocation, getOwner, getStickedGlyphArray, getStroke, getTranslucencyValue, getType, getZindex, isSelected, isSensitive, isVisible, isVisibleThroughLens, propagateMove, select, setColor, setCursorInsideHighlightColor, setDefaultCursorInsideHighlightColor, setHSVColor, setOwner, setSensitivity, setStroke, setTranslucencyValue, setType, setVisible, setZindex, stick, stickToGlyph, toString, unstick, unstickAllGlyphs, unstickAllGlyphs, unstickFromGlyph, visibleInRegion, visibleInViewport
public static final double RAD2DEG_FACTOR
public static final double DEG2RAD_FACTOR
public Point2D.Double p1
public Point2D.Double p2
public Point2D.Double p3
public Point2D.Double p4
public double angle
public double orient
public int angleDeg
public int orientDeg
public VRing(double x, double y, int z, double vs, double ag, float irr, double or, Color c, Color bc)
x
- x-coordinate in virtual space of vertex that is not an arc endpointy
- y-coordinate in virtual space of vertex that is not an arc endpointz
- z-index (pass 0 if you do not use z-ordering)vs
- arc radius in virtual spaceag
- arc angle (in rad)irr
- inner ring radius as a percentage of outer ring radius (from center of ring); 0 to create a pie sliceor
- slice orientation in virtual space (interpreted as the orientation of the segment linking the vertex that is not an arc endpoint to the middle of the arc) (in rad)c
- fill colorbc
- border colorpublic VRing(double x, double y, int z, double vs, double ag, float irr, double or, Color c, Color bc, float alpha)
x
- x-coordinate in virtual space of vertex that is not an arc endpointy
- y-coordinate in virtual space of vertex that is not an arc endpointz
- z-index (pass 0 if you do not use z-ordering)vs
- arc radius in virtual spaceag
- arc angle (in rad)irr
- inner ring radius as a percentage of outer ring radius (from center of ring); 0 to create a pie slice *@param or slice orientation in virtual space (interpreted as the orientation of the segment linking the vertex that is not an arc endpoint to the middle of the arc) (in rad)c
- fill colorbc
- border coloralpha
- alpha channel value in [0;1.0] 0 is fully transparent, 1 is opaquepublic VRing(double x, double y, int z, double vs, int ag, float irr, int or, Color c, Color bc)
x
- x-coordinate in virtual space of vertex that is not an arc endpointy
- y-coordinate in virtual space of vertex that is not an arc endpointz
- z-index (pass 0 if you do not use z-ordering)vs
- arc radius in virtual spaceag
- arc angle (in rad)irr
- inner ring radius as a percentage of outer ring radius (from center of ring); 0 to create a pie slice *@param or slice orientation in virtual space (interpreted as the orientation of the segment linking the vertex that is not an arc endpoint to the middle of the arc) (in degrees)c
- fill colorbc
- border colorpublic VRing(double x, double y, int z, double vs, int ag, float irr, int or, Color c, Color bc, float alpha)
x
- x-coordinate in virtual space of vertex that is not an arc endpointy
- y-coordinate in virtual space of vertex that is not an arc endpointz
- z-index (pass 0 if you do not use z-ordering)vs
- arc radius in virtual spaceag
- arc angle (in degrees)irr
- inner ring radius as a percentage of outer ring radius (from center of ring); 0 to create a pie sliceor
- slice orientation in virtual space (interpreted as the orientation of the segment linking the vertex that is not an arc endpoint to the middle of the arc) (in degrees)c
- fill colorbc
- border coloralpha
- alpha channel value in [0;1.0] 0 is fully transparent, 1 is opaquepublic void initCams(int nbCam)
Glyph
initCams
in class Glyph
nbCam
- current number of cameras in the virtual spaceGlyph.addCamera(int verifIndex)
,
Glyph.removeCamera(int index)
public float getInnerRatio()
public double getOrient()
public boolean fillsView(double w, double h, int camIndex)
Glyph
public void addCamera(int verifIndex)
Glyph
addCamera
in class Glyph
verifIndex
- camera index, just to be sure that the number of projected coordinates is consistent with the number of cameras.Glyph.initCams(int nbCam)
,
Glyph.removeCamera(int index)
public void removeCamera(int index)
Glyph
removeCamera
in class Glyph
Glyph.initCams(int nbCam)
,
Glyph.addCamera(int verifIndex)
public void moveTo(double x, double y)
Glyph
moveTo
in class Glyph
Glyph.move(double x, double y)
public void move(double x, double y)
Glyph
move
in class Glyph
Glyph.moveTo(double x, double y)
public void sizeTo(double s)
Glyph
sizeTo
in class Glyph
Glyph.reSize(double factor)
public void reSize(double factor)
Glyph
reSize
in class Glyph
Glyph.sizeTo(double s)
public void orientTo(double ag)
public void setAngle(double ag)
ag
- in [0:2Pi[public double getAngle()
public double getSize()
Glyph
public boolean coordInside(int jpx, int jpy, Camera c, double cvx, double cvy)
Glyph
coordInside
in class Glyph
jpx
- provide projected JPanel coordinates of the associated view, not virtual space coordinatesjpy
- provide projected JPanel coordinates of the associated view, not virtual space coordinatesc
- camera through which the glyph is observed (only a few types of Glyph actually require this information: SICircle, SIRectangle, VText)cvx
- virtual space coordinatescvy
- virtual space coordinatesGlyph.coordInsideV(double cvx, double cvy, Camera c)
,
Glyph.coordInsideP(int jpx, int jpy, Camera c)
public boolean coordInsideV(double cvx, double cvy, Camera c)
Glyph
coordInsideV
in class Glyph
cvx
- virtual space coordinatescvy
- virtual space coordinatesc
- camera through which the glyph is observed (only a few types of Glyph actually require this information: SICircle, SIRectangle, VText)Glyph.coordInside(int jpx, int jpy, Camera c, double cvx, double cvy)
,
Glyph.coordInsideP(int jpx, int jpy, Camera c)
public boolean coordInsideP(int jpx, int jpy, Camera c)
Glyph
coordInsideP
in class Glyph
jpx
- provide projected JPanel coordinates of the associated view, not virtual space coordinatesjpy
- provide projected JPanel coordinates of the associated view, not virtual space coordinatesc
- camera through which the glyph is observedGlyph.coordInsideV(double cvx, double cvy, Camera c)
,
Glyph.coordInside(int jpx, int jpy, Camera c, double cvx, double cvy)
public boolean visibleInDisc(double dvx, double dvy, double dvr, Shape dvs, int camIndex, int jpx, int jpy, int dpr)
visibleInDisc
in class Glyph
public void project(Camera c, Dimension d)
Glyph
public void projectForLens(Camera c, int lensWidth, int lensHeight, float lensMag, double lensx, double lensy)
Glyph
projectForLens
in class Glyph
c
- cameralensWidth
- width of lens activated in View using this cameralensHeight
- height of lens activated in View using this cameralensMag
- magnification factor of lens activated in View using this cameralensx
- horizontal coordinateof lens activated in View using this cameralensy
- vertical coordinate of lens activated in View using this camerapublic void draw(Graphics2D g, int vW, int vH, int i, Stroke stdS, AffineTransform stdT, int dx, int dy)
Glyph
draw
in class Glyph
g
- graphics context in which the glyph should be drawnvW
- 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 glyphstdS
- default strokestdT
- identity transformdx
- horizontal offsetdy
- vertical offsetpublic void drawForLens(Graphics2D g, int vW, int vH, int i, Stroke stdS, AffineTransform stdT, int dx, int dy)
Glyph
drawForLens
in class Glyph
g
- graphics context in which the glyph should be drawnvW
- 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 glyphstdS
- default strokestdT
- identity transformdx
- horizontal offsetdy
- vertical offsetpublic Shape getJava2DShape()
Glyph
getJava2DShape
in class Glyph
Copyright © 2000-2002 Xerox Corporation. All Rights Reserved
Copyright © 2003 World Wide Web Consortium. All Rights Reserved
Copyright © 2004-2015 INRIA. All Rights Reserved
Licensed under the GNU LGPL. For full terms see the file COPYING.