public class VSegment<T> extends Glyph implements RectangularShape
Modifier and Type | Field and Description |
---|---|
double |
vh
Height in virtual space.
|
double |
vw
Width in virtual space.
|
alphaC, coef, color, cursorInsideColor, ENTERED_GLYPH, EXITED_GLYPH, fColor, HSV, NO_CURSOR_EVENT, orient, sensit, size, stickedTo, stroke, visible, vx, vy, vz
acO
Constructor and Description |
---|
VSegment(double x1,
double y1,
double x2,
double y2,
int z,
Color c)
give the end points of segment
|
VSegment(double x1,
double y1,
double x2,
double y2,
int z,
Color c,
float alpha)
give the end points of segment
|
VSegment(double x,
double y,
int z,
Color c,
double lgth,
double angle)
give the centre of segment and half its length and orient
|
VSegment(double x,
double y,
int z,
Color c,
float alpha,
double lgth,
double angle)
give the centre of segment and half its length and orient
|
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)
Not implemented for VSegment.
|
boolean |
coordInsideP(int jpx,
int jpy,
Camera c)
Not implemented for VSegment.
|
boolean |
coordInsideV(double cvx,
double cvy,
Camera c)
Not implemented for VSegment.
|
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[] |
getBounds()
Get the bounding box of this Glyph in virtual space coordinates.
|
Point2D.Double[] |
getEndPoints()
Get the segment's two endpoints
|
double |
getHeight()
Get width in virtual space.
|
Shape |
getJava2DShape()
Get the Java2D Shape corresponding to this Glyph.
|
double |
getOrient()
Get the glyph's orientation.
|
double |
getSize()
Get glyph's size (diameter of bounding circle).
|
double |
getWidth()
Get width in virtual space.
|
void |
highlight(boolean b,
Color selectedColor)
Highlight this glyph to give visual feedback when the cursor is inside it.
|
void |
initCams(int nbCam)
Initialize projected coordinates.
|
boolean |
intersects(int x,
int y,
int camIndex)
Detects whether the point (x,y) lies on the segment or not.
|
boolean |
intersects(int x,
int y,
int tolerance,
int camIndex)
Detects whether the point (x,y) lies on the segment or not.
|
boolean |
intersectsV(double cvx,
double cvy,
double tolerance)
Detects whether the point (x,y) lies on the segment or not.
|
void |
orientTo(double angle)
Set the glyph's absolute 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 |
setEndPoints(double x1,
double y1,
double x2,
double y2)
Change the segment's location, size and orientation by giving its two endpoints (absolute coordinates).
|
void |
setHeight(double h)
Set height in virtual space.
|
void |
setWidth(double w)
Set width in virtual space.
|
void |
setWidthHeight(double w,
double h) |
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)
Find out if a glyph is visible in a circular area.
|
addHSVbColor, addHSVColor, containedInRegion, getBorderColor, getColor, getDefaultColor, getDefaultCursorInsideHighlightColor, getHSVbColor, getHSVColor, getLocation, getOwner, getStickedGlyphArray, getStroke, getTranslucencyValue, getType, getZindex, isBorderDrawn, isFilled, isSelected, isSensitive, isVisible, isVisibleThroughLens, move, moveTo, propagateMove, select, setBorderColor, setColor, setCursorInsideHighlightColor, setDefaultCursorInsideHighlightColor, setHSVbColor, setHSVColor, setOwner, setSensitivity, setStroke, setTranslucencyValue, setType, setVisible, setZindex, stick, stickToGlyph, toString, unstick, unstickAllGlyphs, unstickAllGlyphs, unstickFromGlyph, visibleInRegion, visibleInViewport
public double vw
public double vh
public VSegment(double x1, double y1, double x2, double y2, int z, Color c)
x1
- coordinate of endpoint 1 in virtual spacey1
- coordinate of endpoint 1 in virtual spacex2
- coordinate of endpoint 2 in virtual spacey2
- coordinate of endpoint 2 in virtual spacez
- z-index (pass 0 if you do not use z-ordering)c
- fill colorpublic VSegment(double x1, double y1, double x2, double y2, int z, Color c, float alpha)
x1
- coordinate of endpoint 1 in virtual spacey1
- coordinate of endpoint 1 in virtual spacex2
- coordinate of endpoint 2 in virtual spacey2
- coordinate of endpoint 2 in virtual spacez
- z-index (pass 0 if you do not use z-ordering)c
- fill coloralpha
- in [0;1.0]. 0 is fully transparent, 1 is opaquepublic VSegment(double x, double y, int z, Color c, double lgth, double angle)
x
- coordinate in virtual spacey
- coordinate in virtual spacez
- z-index (pass 0 if you do not use z-ordering)lgth
- length in virtual spaceangle
- orientationc
- fill colorpublic VSegment(double x, double y, int z, Color c, float alpha, double lgth, double angle)
x
- coordinate in virtual spacey
- coordinate in virtual spacez
- z-index (pass 0 if you do not use z-ordering)lgth
- length in virtual spaceangle
- orientationc
- fill coloralpha
- 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 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 double getOrient()
Glyph
public void orientTo(double angle)
Glyph
public double getSize()
Glyph
public double[] getBounds()
public void setEndPoints(double x1, double y1, double x2, double y2)
public Point2D.Double[] getEndPoints()
public double getWidth()
RectangularShape
getWidth
in interface RectangularShape
public double getHeight()
RectangularShape
getHeight
in interface RectangularShape
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 setWidth(double w)
RectangularShape
setWidth
in interface RectangularShape
public void setHeight(double h)
RectangularShape
setHeight
in interface RectangularShape
public void setWidthHeight(double w, double h)
public boolean fillsView(double w, double h, int camIndex)
Glyph
public boolean coordInside(int jpx, int jpy, Camera c, double cvx, double cvy)
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)
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)
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 intersects(int x, int y, int camIndex)
x
- EXPECTS PROJECTED JPanel COORDINATE (obtained e.g. in ViewListener's mouse methods as jpx)y
- EXPECTS PROJECTED JPanel COORDINATE (obtained e.g. in ViewListener's mouse methods as jpy)camIndex
- camera index (obtained through Camera.getIndex())public boolean intersects(int x, int y, int tolerance, int camIndex)
x
- EXPECTS PROJECTED JPanel COORDINATE (obtained e.g. in ViewListener's mouse methods as jpx)y
- EXPECTS PROJECTED JPanel COORDINATE (obtained e.g. in ViewListener's mouse methods as jpy)tolerance
- the segment's clickable thickness in pixels, not virtual space unitscamIndex
- camera index (obtained through Camera.getIndex())public boolean intersectsV(double cvx, double cvy, double tolerance)
cvx
- x-coord in virtual spacecvy
- y-coord in virtual spacetolerance
- the segment's clickable thickness in virtual space unitspublic boolean visibleInDisc(double dvx, double dvy, double dvr, Shape dvs, int camIndex, int jpx, int jpy, int dpr)
Glyph
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.