|
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.stroke.StrokeAssembler
Accumulates mouse events and creates Stroke objects.
Through an ingenious hack [tm], this StrokeAssembler is always the last
MouseListener to receive an event. Furthermore, it ignores consumed events
(ie AWTEvent.consume()
). So, if you get mouse events and don't
want others to use the event, then just consume it.
There should only be one instance of this class per Sheet.
This software is distributed under the Berkeley Software License.
Revisions: - SATIN-v1.0-1.0.0, Oct 09 1998, JH Created class - SATIN-v2.1-1.0.0, Aug 11 2000, JH Touched for SATIN release - SATIN-v2.1-1.0.1, Oct 30 2000, JH Fixed some problems with auto-pan Fixed a bug with bounds (auto-pan at wrong places) Modified auto-pan to work only if pen moved outside sheet bds
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 |
Constructor Summary | |
StrokeAssembler(Sheet parent)
Constructor. |
Method Summary | |
Object |
clone()
A happy clone we are. |
boolean |
isEnabled()
Check whether we are creating strokes or not. |
boolean |
isLeftButtonAccepted()
|
boolean |
isMiddleButtonAccepted()
|
boolean |
isRightButtonAccepted()
|
void |
mouseClicked(MouseEvent evt)
|
void |
mouseDragged(MouseEvent evt)
Handle mouse dragged with button down. |
void |
mouseEntered(MouseEvent evt)
|
void |
mouseExited(MouseEvent evt)
|
void |
mouseMoved(MouseEvent evt)
|
void |
mousePressed(MouseEvent evt)
Handle mouse button first pressed. |
void |
mouseReleased(MouseEvent evt)
Handle release of mouse button. |
void |
onDelete(Watchable w)
Callback method for notifications of deletions, that is this Graphical Object has been deleted and you should remove it. |
void |
onNotify(Watchable w,
Object arg)
Callback method for generic notifications. |
void |
onRepaint(GraphicalObject gob)
|
void |
onRepaint(Rectangle rect)
|
void |
onUpdate(Watchable w,
Object arg)
Callback method for notifications. |
void |
onUpdate(Watchable w,
String strProperty,
Object oldVal,
Object newVal)
Update on transforms by the Sheet, so we can apply strokes correctly. |
void |
setAcceptLeftButton(boolean flag)
|
void |
setAcceptMiddleButton(boolean flag)
|
void |
setAcceptRightButton(boolean flag)
|
void |
setAutoScroll(boolean flag)
Set whether auto scroll when drawing is enabled or not. |
void |
setEnabled(boolean flag)
Set whether we should be creating strokes or not. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public StrokeAssembler(Sheet parent)
parent
- is the Sheet component that holds this object.Method Detail |
public void setEnabled(boolean flag)
public boolean isEnabled()
public boolean isLeftButtonAccepted()
public boolean isMiddleButtonAccepted()
public boolean isRightButtonAccepted()
public void setAcceptLeftButton(boolean flag)
public void setAcceptMiddleButton(boolean flag)
public void setAcceptRightButton(boolean flag)
public void setAutoScroll(boolean flag)
public final void mouseClicked(MouseEvent evt)
mouseClicked
in interface MouseListener
public final void mouseEntered(MouseEvent evt)
mouseEntered
in interface MouseListener
public final void mouseExited(MouseEvent evt)
mouseExited
in interface MouseListener
public final void mouseMoved(MouseEvent evt)
mouseMoved
in interface MouseMotionListener
public final void mousePressed(MouseEvent evt)
mousePressed
in interface MouseListener
public final void mouseDragged(MouseEvent evt)
mouseDragged
in interface MouseMotionListener
public void mouseReleased(MouseEvent evt)
mouseReleased
in interface MouseListener
public void onNotify(Watchable w, Object arg)
Watcher
onNotify
in interface Watcher
edu.berkeley.guir.lib.satin.watch.Watcher
w
- is the Watchable object notifying you.arg
- is some agreed upon argument.Watchable.notifyWatchers()
,
Watchable.notifyWatchers(java.lang.Object)
public void onUpdate(Watchable w, Object arg)
Watcher
onUpdate
in interface Watcher
edu.berkeley.guir.lib.satin.watch.Watcher
w
- is the Watchable object that has been updated.arg
- is some agreed upon argument.Watchable.notifyWatchersUpdate(Object)
public void onUpdate(Watchable w, String strProperty, Object oldVal, Object newVal)
onUpdate
in interface Watcher
edu.berkeley.guir.lib.satin.watch.Watcher
w
- is the Watchable object that has been updated.strProperty
- is the name of the property to update.oldVal
- is the old value of the property. This should usually
be a clone of the old value, so that modifying this
value should have no effect. Whether this is a copy or
a reference should be defined in the SatinConstants
file.newVal
- is the new value of the property. This should usually
be a clone of the old value, so that modifying this
value should have no effect. However, don't clone
if it is prohibitively expensive to do so. Whether
this is a copy or a reference should be defined in the
SatinConstants file.SatinConstants
,
Watchable.notifyWatchersUpdate(String, Object, Object)
public void onRepaint(GraphicalObject gob)
public void onRepaint(Rectangle rect)
public void onDelete(Watchable w)
Watcher
onDelete
in interface Watcher
edu.berkeley.guir.lib.satin.watch.Watcher
w
- is the Watchable object to be deleted.Watchable.notifyWatchersDelete()
public Object clone()
Watcher
clone
in interface Watcher
clone
in class Object
|
Copyright Information | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |