All Packages Class Hierarchy This Package Previous Next Index
Class dtai.gwt.DrawLines
java.lang.Object
|
+----dtai.gwt.DrawLines
- public class DrawLines
- extends Object
DrawLine - draws a line with varying thickness and dashes if selected.
-
ALL_HANDLES
-
-
CLICK_TOLERANCE
-
-
INSIDE_HANDLES
-
-
NO_HANDLES
-
-
npoints
- number of points in the line
-
OUTSIDE_HANDLES
-
-
RADIANS_TO_DEGREES
-
-
xpoints
- array of x coordinates of the points
-
ypoints
- array of y coordinates of the points
-
DrawLines()
- Drawlines
-
DrawLines(int)
- drawslines with a specified number of points in line
-
DrawLines(int[], int[], int)
- DrawLines
-
contains(int, int)
- contains
-
draw(GadgetGraphics)
- draw
-
drawHandle(GadgetGraphics, int, int)
- drawHandle
-
findClosestSegment(int, int)
- finds the index of the segment closest to the given point
-
findClosestVertex(int, int)
- finds the index of the vertex closest to the given point
-
getBoundingBox()
- getBoundingBox
-
getDashOffLen()
- returns the setting
-
getDashOnLen()
- returns the setting
-
getHandles()
- getHandles
-
getThickness()
- Gets the thickness of the line
-
handleContains(int, int, int, int)
- handleContains
-
segmentContains(int, int, int, int, int, int)
- segmentContains
-
setDashOffLen(int)
- The line is solid if dashOffLen == 0.
-
setDashOnLen(int)
- This is ignored if dashOffLen == 0.
-
setHandles(int)
- setHandles
-
setPoints(int[], int[], int)
- sets the x points, y points, and number of points on line
-
setThickness(int)
- Sets the thickness of the line.
xpoints
public int xpoints[]
- array of x coordinates of the points
ypoints
public int ypoints[]
- array of y coordinates of the points
npoints
public int npoints
- number of points in the line
NO_HANDLES
public static final int NO_HANDLES
INSIDE_HANDLES
public static final int INSIDE_HANDLES
OUTSIDE_HANDLES
public static final int OUTSIDE_HANDLES
ALL_HANDLES
public static final int ALL_HANDLES
CLICK_TOLERANCE
protected static final int CLICK_TOLERANCE
RADIANS_TO_DEGREES
protected static final double RADIANS_TO_DEGREES
DrawLines
public DrawLines()
- Drawlines
DrawLines
public DrawLines(int npoints)
- drawslines with a specified number of points in line
- Parameters:
- npoints - number of points in line
DrawLines
public DrawLines(int xpoints[],
int ypoints[],
int npoints)
- DrawLines
- Parameters:
- xpoints - array of x coordinates of the points
- ypoints - array of y coordinates of the points
- npoints - number of points in line
setPoints
public void setPoints(int xpoints[],
int ypoints[],
int npoints)
- sets the x points, y points, and number of points on line
- Parameters:
- xpoints - array of x coordinates of the points
- ypoints - array of y coordinates of the points
- npoints - number of points in line
setThickness
public void setThickness(int thickness)
- Sets the thickness of the line.
- Parameters:
- thickness - thickness of the line
getThickness
public int getThickness()
- Gets the thickness of the line
- Returns:
- thickness
setHandles
public void setHandles(int handles)
- setHandles
- Parameters:
- handles - new value for handles
getHandles
public int getHandles()
- getHandles
- Returns:
- handles
setDashOnLen
public void setDashOnLen(int len)
- This is ignored if dashOffLen == 0. Otherwise, it's the
approximate number of pixels in length to draw a dash in the line.
- Parameters:
- len - approximate number of pixels in a dash of the line.
getDashOnLen
public int getDashOnLen()
- returns the setting
- Returns:
- dashOnLen
setDashOffLen
public void setDashOffLen(int len)
- The line is solid if dashOffLen == 0. Otherwise, this is the
approximate number of pixels in length to skip between dashes.
- Parameters:
- setDashOffLen - approximate number of pixels to skip between dashes.
getDashOffLen
public int getDashOffLen()
- returns the setting
- Returns:
- dashOffLen
handleContains
public boolean handleContains(int point_x,
int point_y,
int vertex_x,
int vertex_y)
- handleContains
- Parameters:
- point_x - x coordinate of point in question
- point_y - y coordinate of point in question
- vertex_x - x coordinate of rectangle vertex
- vertex_y - y coordinate of rectangle vertex
- Returns:
- specified point is/is not in the handle rectangle
drawHandle
public void drawHandle(GadgetGraphics g,
int x,
int y)
- drawHandle
- Parameters:
- g - GadgetGraphics window
- x - x coordinate
- y - y coordinate
draw
public void draw(GadgetGraphics g)
- draw
- Parameters:
- g - GadgetGraphics window
segmentContains
public boolean segmentContains(int x,
int y,
int from_x,
int from_y,
int to_x,
int to_y)
- segmentContains
- Parameters:
- x - x coordinate of point in question
- y - y coordinate of point in question
- from_x - starting x coordinate of segment
- from_y - starting y coordinate of segment
- to_x - ending x coordinate of segment
- to_y - ending y coordinate of segment
- Returns:
- given point is/is not on given segment
contains
public boolean contains(int x,
int y)
- contains
- Parameters:
- x - x coordinate
- y - y coordinate
- Returns:
- point is/is not on line
getBoundingBox
public Rectangle getBoundingBox()
- getBoundingBox
- Returns:
- Rectangle
findClosestSegment
public int findClosestSegment(int x,
int y)
- finds the index of the segment closest to the given point
- Parameters:
- x - x coordinate
- y - y coordinate
- Returns:
- index of segment closest to given point
findClosestVertex
public int findClosestVertex(int x,
int y)
- finds the index of the vertex closest to the given point
- Parameters:
- x - x coordinate
- y - y coordinate
- Returns:
- index of vertex closest to given point
All Packages Class Hierarchy This Package Previous Next Index