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.


Variable Index

 o ALL_HANDLES
 o CLICK_TOLERANCE
 o INSIDE_HANDLES
 o NO_HANDLES
 o npoints
number of points in the line
 o OUTSIDE_HANDLES
 o RADIANS_TO_DEGREES
 o xpoints
array of x coordinates of the points
 o ypoints
array of y coordinates of the points

Constructor Index

 o DrawLines()
Drawlines
 o DrawLines(int)
drawslines with a specified number of points in line
 o DrawLines(int[], int[], int)
DrawLines

Method Index

 o contains(int, int)
contains
 o draw(GadgetGraphics)
draw
 o drawHandle(GadgetGraphics, int, int)
drawHandle
 o findClosestSegment(int, int)
finds the index of the segment closest to the given point
 o findClosestVertex(int, int)
finds the index of the vertex closest to the given point
 o getBoundingBox()
getBoundingBox
 o getDashOffLen()
returns the setting
 o getDashOnLen()
returns the setting
 o getHandles()
getHandles
 o getThickness()
Gets the thickness of the line
 o handleContains(int, int, int, int)
handleContains
 o segmentContains(int, int, int, int, int, int)
segmentContains
 o setDashOffLen(int)
The line is solid if dashOffLen == 0.
 o setDashOnLen(int)
This is ignored if dashOffLen == 0.
 o setHandles(int)
setHandles
 o setPoints(int[], int[], int)
sets the x points, y points, and number of points on line
 o setThickness(int)
Sets the thickness of the line.

Variables

 o xpoints
 public int xpoints[]
array of x coordinates of the points

 o ypoints
 public int ypoints[]
array of y coordinates of the points

 o npoints
 public int npoints
number of points in the line

 o NO_HANDLES
 public static final int NO_HANDLES
 o INSIDE_HANDLES
 public static final int INSIDE_HANDLES
 o OUTSIDE_HANDLES
 public static final int OUTSIDE_HANDLES
 o ALL_HANDLES
 public static final int ALL_HANDLES
 o CLICK_TOLERANCE
 protected static final int CLICK_TOLERANCE
 o RADIANS_TO_DEGREES
 protected static final double RADIANS_TO_DEGREES

Constructors

 o DrawLines
 public DrawLines()
Drawlines

 o DrawLines
 public DrawLines(int npoints)
drawslines with a specified number of points in line

Parameters:
npoints - number of points in line
 o 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

Methods

 o 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
 o setThickness
 public void setThickness(int thickness)
Sets the thickness of the line.

Parameters:
thickness - thickness of the line
 o getThickness
 public int getThickness()
Gets the thickness of the line

Returns:
thickness
 o setHandles
 public void setHandles(int handles)
setHandles

Parameters:
handles - new value for handles
 o getHandles
 public int getHandles()
getHandles

Returns:
handles
 o 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.
 o getDashOnLen
 public int getDashOnLen()
returns the setting

Returns:
dashOnLen
 o 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.
 o getDashOffLen
 public int getDashOffLen()
returns the setting

Returns:
dashOffLen
 o 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
 o drawHandle
 public void drawHandle(GadgetGraphics g,
                        int x,
                        int y)
drawHandle

Parameters:
g - GadgetGraphics window
x - x coordinate
y - y coordinate
 o draw
 public void draw(GadgetGraphics g)
draw

Parameters:
g - GadgetGraphics window
 o 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
 o contains
 public boolean contains(int x,
                         int y)
contains

Parameters:
x - x coordinate
y - y coordinate
Returns:
point is/is not on line
 o getBoundingBox
 public Rectangle getBoundingBox()
getBoundingBox

Returns:
Rectangle
 o 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
 o 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