|
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.command.CommandImpl
|
+--edu.berkeley.guir.lib.satin.command.ApplyTransformationCommand
|
+--edu.berkeley.guir.lib.satin.command.ZoomCommand
Zoom in or out.
Here is a code example for zooming in on the Sheet at the specified point:
class MenuZoomInListener implements ActionListener {
public void actionPerformed(ActionEvent evt) {
cmdqueue.doCommand(new ZoomCommand(TestSheet.this, 1.2,
cmdsubsys.getAbsoluteLastXLocation(),
cmdsubsys.getAbsoluteLastYLocation()));
} // of actionPerformed
} // inner class
Here is a code example for zooming in on the selected objects at the
specified point:
class MenuZoomSelObjInListener implements ActionListener {
public void actionPerformed(ActionEvent evt) {
GraphicalObjectCollection gobs;
GraphicalObject gob;
Iterator it;
gobs = cmdsubsys.getSelectedGraphicalObjects();
it = gobs.getForwardIterator();
while (it.hasNext()) {
gob = (GraphicalObject) it.next();
cmdqueue.doCommand(new ZoomCommand(gob, 1.2,
cmdsubsys.getLocalLastXLocation(gob.getParentGroup()),
cmdsubsys.getLocalLastYLocation(gob.getParentGroup())));
}
}
}
This software is distributed under the Berkeley Software License.
Revisions: - SATIN-v1.0-1.0.0, Jul 15 1999, 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 int |
CENTER_AT
Scale, using the specified point as the new center (absolute coords) after scaling. |
static int |
KEEP_CONSTANT
Scale, keeping the specified point constant (ie same absolute coordinates) before and after scaling. |
| Constructor Summary | |
ZoomCommand(GraphicalObject gob,
double scale)
Create the zoom command, zooming in the center of the GraphicalObject and keeping it constant. |
|
ZoomCommand(GraphicalObject gob,
double scale,
double x,
double y)
Create the zoom command, zooming in at the specified coordinate and keeping it constant (ie KEEP_CONSTANT). |
|
ZoomCommand(GraphicalObject gob,
double scale,
double x,
double y,
int type)
Create the zoom command. |
|
| Method Summary | |
String |
getPresentationName()
Override this method in the subclass. |
| Methods inherited from class edu.berkeley.guir.lib.satin.command.ApplyTransformationCommand |
canRedo, canUndo, die, isSignificant, redo, run, undo |
| Methods inherited from class edu.berkeley.guir.lib.satin.command.CommandImpl |
addEdit, debug, disable, enable, execute, getExecutionTime, getRedoPresentationName, getUndoPresentationName, isDisabled, isEnabled, replaceEdit, setExecutionTime, setExecutionTime, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int CENTER_AT
For example, suppose a GraphicalObject has a bounding box with center at absolute coordinates (cx,cy). If you zoom at (x,y), the absolute Location of (x,y) will be where (cx,cy) was.
public static final int KEEP_CONSTANT
For example, suppose you are zooming a GraphicalObject at (x,y). The absolute coordinates of (x,y) before and after zooming will be the same.
| Constructor Detail |
public ZoomCommand(GraphicalObject gob,
double scale)
gob - is the Graphical Object to apply a transformation upon.scale - is the amount to scale by, at the gob's center.
public ZoomCommand(GraphicalObject gob,
double scale,
double x,
double y)
KEEP_CONSTANT).gob - is the Graphical Object to apply a transformation upon.scale - is the amount to scale by, at the gob's center.x - is where to center the scale, in relative coordinates
(in gob's parent's coordinate space).y - is where to center the scale, in relative coordinates
(in gob's parent's coordinate space).
public ZoomCommand(GraphicalObject gob,
double scale,
double x,
double y,
int type)
gob - is the Graphical Object to apply a transformation upon.scale - is the amount to scale by.x - is where to center the scale, in relative coordinates
(in gob's parent's coordinate space).y - is where to center the scale, in relative coordinates
(in gob's parent's coordinate space).type - is either CENTER_AT or KEEP_CONSTANT.| Method Detail |
public String getPresentationName()
CommandImplgetPresentationName in class ApplyTransformationCommand
|
Copyright Information | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||