|
UC Berkeley Group for User Interface Research Updated November 17, 2000 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.berkeley.guir.lib.satin.objects.GraphicalObjectImpl | +--edu.berkeley.guir.lib.satin.stroke.TimedStroke
A single Stroke that can paint itself. This is not a Component because there would be too many components. This work is based off of Chris Long's GDT Gesture class.
This software is distributed under the Berkeley Software License.
Revisions: - SATIN-v1.0-1.0.0, May 17 1998, JH Created class - SATIN-v2.1-1.0.0, Aug 11 2000, JH Touched for SATIN release
Inner classes inherited from class edu.berkeley.guir.lib.satin.SatinConstants |
SatinConstants.ObjectPoolAffineTransform, SatinConstants.ObjectPoolPoint2D, SatinConstants.ObjectPoolPolygon2D, SatinConstants.ObjectPoolRectangle2D, SatinConstants.ObjectPoolStringBuffer, SatinConstants.UniqueAffineTransform, SatinConstants.UniquePoint2D, SatinConstants.UniquePolygon2D, SatinConstants.UniqueRectangle2D |
Field Summary | |
static String |
TIMEDSTROKE_STYLE_FILE
The name of the file containins the current stroke properties. |
Fields inherited from interface edu.berkeley.guir.lib.satin.objects.GraphicalObject |
GESTUREINTRP_CLPROPERTY, INKINTRP_CLPROPERTY, STYLE_CLPROPERTY, VIEW_CLPROPERTY |
Constructor Summary | |
TimedStroke()
Create an empty Stroke. |
|
TimedStroke(Polygon p)
Create a stroke based on this Polygon. |
|
TimedStroke(Polygon2D p)
Create a stroke based on this Polygon. |
|
TimedStroke(TimedStroke tstk)
Make a copy of the points of this TimedStroke. |
Method Summary | |
void |
addPoint(double x,
double y)
Add a point to this Stroke. |
void |
addPoint(double x,
double y,
long time)
|
void |
addPoint(float x,
float y)
|
void |
addPoint(float x,
float y,
long time)
|
void |
addPoint(Point2D pt)
Add a point to this Stroke. |
void |
addPoint(Point2D pt,
long time)
|
void |
changePoint(int n,
double x,
double y)
Change the nth point of the stroke to the given coordinates. |
void |
clearPoints()
|
Object |
clone()
Create a duplicate of this stroke. |
protected TimedStroke |
clone(TimedStroke stk)
For clone chaining purposes. |
protected void |
defaultRender(SatinGraphics g)
The default method for rendering. |
TimedStroke |
doneAddingPoints()
Tell the stroke that we won't add any more points. |
String |
getButtonString()
|
Point2D |
getEndPoint2D(int cdsys)
|
Point2D |
getEndPoint2D(int cdsys,
AffineTransform tx,
Point2D pt)
|
long |
getEndTime()
Get the end time of this Timed Stroke. |
double |
getLength2D(int cdsys)
|
int |
getNumPoints()
Get the number of points in the stroke. |
TimedPolygon2D |
getPolygon2D(int cdsys)
|
TimedPolygon2D |
getPolygon2D(int cdsys,
AffineTransform tx,
TimedPolygon2D p)
|
Point2D |
getStartPoint2D(int cdsys)
|
Point2D |
getStartPoint2D(int cdsys,
AffineTransform tx,
Point2D pt)
|
long |
getStartTime()
Get the start time of this Timed Stroke. |
TimedStroke |
getSubstroke(double start,
double end)
Get a portion of this stroke by percentages of length. |
boolean |
isLeftButton()
Check if left button is down. |
boolean |
isMiddleButton()
Check if middle button is down. |
boolean |
isRightButton()
Check if right button is down. |
static void |
main(String[] argv)
|
protected void |
renderSelected(SatinGraphics g,
Rectangle2D rect)
Render some selection handles on the stroke itself. |
static void |
setDrawFix(boolean flag)
Straight lines aren't being rendered correctly. |
void |
setLeftButton(boolean flag)
Set whether the left button is down. |
void |
setMiddleButton(boolean flag)
Set whether the middle button is down. |
void |
setRightButton(boolean flag)
Set whether the right button is down. |
String |
toDebugString()
Some debugging info. |
Methods inherited from class java.lang.Object |
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final String TIMEDSTROKE_STYLE_FILE
Constructor Detail |
public TimedStroke()
public TimedStroke(Polygon p)
p
- is the Polygon to copy as the basis for this stroke.
Should be non-null. Polygon should be in relative coordinates.public TimedStroke(Polygon2D p)
p
- is the TimedPolygon to copy as the basis for this stroke.
Should be non-null. TimedPolygon should be in relative coordinates.public TimedStroke(TimedStroke tstk)
tstk
- is the TimedStroke to copy.Method Detail |
public static void setDrawFix(boolean flag)
public boolean isLeftButton()
public boolean isMiddleButton()
public boolean isRightButton()
public void setLeftButton(boolean flag)
public void setMiddleButton(boolean flag)
public void setRightButton(boolean flag)
public final void addPoint(float x, float y)
public final void addPoint(double x, double y)
x
- is the x-Location to add.y
- is the y-Location to add.public final void addPoint(Point2D pt)
pt
- is the Point to add.public final void addPoint(double x, double y, long time)
public final void addPoint(float x, float y, long time)
public final void addPoint(Point2D pt, long time)
public final TimedStroke doneAddingPoints()
public final void clearPoints()
public final void changePoint(int n, double x, double y)
public TimedStroke getSubstroke(double start, double end)
start
- is the start percentage of length, between 0 and 1
inclusive.end
- is the ending percentage of length, between 0 and 1
inclusive, and greater than start.public int getNumPoints()
public TimedPolygon2D getPolygon2D(int cdsys)
public TimedPolygon2D getPolygon2D(int cdsys, AffineTransform tx, TimedPolygon2D p)
public Point2D getStartPoint2D(int cdsys)
public Point2D getStartPoint2D(int cdsys, AffineTransform tx, Point2D pt)
public Point2D getEndPoint2D(int cdsys)
public Point2D getEndPoint2D(int cdsys, AffineTransform tx, Point2D pt)
public double getLength2D(int cdsys)
public long getStartTime()
public long getEndTime()
protected void defaultRender(SatinGraphics g)
GraphicalObjectImpl
defaultRender
in class GraphicalObjectImpl
protected void renderSelected(SatinGraphics g, Rectangle2D rect)
renderSelected
in class GraphicalObjectImpl
edu.berkeley.guir.lib.satin.objects.GraphicalObjectImpl
g
- is the SatinGraphics context.rect
- is the bounding box (absolute coordinates).public String getButtonString()
public String toDebugString()
GraphicalObjectImpl
Do not call method toString() in any implementation of toDebugString(). Method toString() calls toDebugString().
toDebugString
in class GraphicalObjectImpl
public Object clone()
clone
in class GraphicalObjectImpl
protected TimedStroke clone(TimedStroke stk)
GraphicalObjectImpl.clone(GraphicalObjectImpl)
public static void main(String[] argv)
|
Copyright Information | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |