|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecty.view.ViewMode
y.view.MagnifierViewMode
public class MagnifierViewMode
View mode that lets you zoom into a view region locally, while preserving the original viewport of the view. The effect is similar to a magnifier that is moved over the view.
| Field Summary |
|---|
| Fields inherited from class y.view.ViewMode |
|---|
ACTIVE_PROPERTY, ACTIVE_VIEW_PROPERTY, CHILD_MODE_PROPERTY, EDITING_PROPERTY, GRAB_FOCUS_ENABLED_PROPERTY, lastClickEvent, lastDragEvent, lastMoveEvent, lastPressEvent, lastReleaseEvent, MODIFIER_MASK_PROPERTY, NAME_PROPERTY, originalX, originalY, PARENT_MODE_PROPERTY, view |
| Constructor Summary | |
|---|---|
MagnifierViewMode()
|
|
| Method Summary | |
|---|---|
void |
activate(boolean activate)
Upon activation or deactivation the set of registered mouse wheel listeners will be changed. |
protected int |
calcRadius(int radius,
int amount)
Calculates and returns an updated magnifier radius. |
protected double |
calcZoom(double zoom,
int amount)
Calculates and returns an updated magnifier zoom level. |
protected Graph2DView |
createMagnifierView()
Creates, configures, and returns a Graph2DView that is used to render the view content for the magnifier. |
int |
getMagnifierRadius()
Returns the radius of the magnifying glass. |
double |
getMagnifierZoomFactor()
Returns the zoom factor used for the magnifier view. |
boolean |
isMouseWheelEnabled()
Returns whether or not to activate mouse wheel functionality. |
void |
mouseDraggedLeft(double x,
double y)
Updates the location of the magnifier. |
void |
mouseDraggedRight(double x,
double y)
Updates the location of the magnifier. |
void |
mouseExited(MouseEvent e)
Removes the magnifier from the view. |
void |
mouseMoved(double x,
double y)
Updates the location of the magnifier. |
void |
mouseWheelMoved(MouseWheelEvent e)
Invoked when the mouse wheel is rotated. |
void |
setMagnifierRadius(int radius)
Sets the radius of the magnifying glass. |
void |
setMagnifierZoomFactor(double zoomFactor)
Sets the zoom factor used for the magnifier view. |
void |
setMouseWheelEnabled(boolean mouseWheelEnabled)
Whether or not to activate mouse wheel functionality. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MagnifierViewMode()
| Method Detail |
|---|
public void mouseMoved(double x,
double y)
mouseMoved in class ViewModex - the x-coordinate of the mouse event in world coordinates.y - the y-coordinate of the mouse event in world coordinates.
public void mouseDraggedLeft(double x,
double y)
mouseDraggedLeft in class ViewModex - the x-coordinate of the mouse event in world coordinates.y - the y-coordinate of the mouse event in world coordinates.
public void mouseDraggedRight(double x,
double y)
mouseDraggedRight in class ViewModex - the x-coordinate of the mouse event in world coordinates.y - the y-coordinate of the mouse event in world coordinates.public void mouseExited(MouseEvent e)
mouseExited in interface MouseListenermouseExited in class ViewModeprotected Graph2DView createMagnifierView()
By default this method adopts various settings of the underlying Graph2DView. It also
sets the paintDetailThreshold to 0.0.
public void activate(boolean activate)
activate in class ViewModeactivate - set true when mode was activated
false otherwisesetMouseWheelEnabled(boolean)public void setMagnifierZoomFactor(double zoomFactor)
By default a zoom factor of 2.0 is used.
public double getMagnifierZoomFactor()
setMagnifierZoomFactor(double)public void setMagnifierRadius(int radius)
By default a radius of 100 is used.
public int getMagnifierRadius()
setMagnifierRadius(int)public void mouseWheelMoved(MouseWheelEvent e)
MouseWheelEvent
protected int calcRadius(int radius,
int amount)
radius - the current magnifier radiusamount - the amount of scroll wheel rotation or units to scroll. This value can be positive and negative.
protected double calcZoom(double zoom,
int amount)
zoom - the current magnifier zoom levelamount - the amount of scroll wheel rotation or units to scroll. This value can be positive and negative.public boolean isMouseWheelEnabled()
public void setMouseWheelEnabled(boolean mouseWheelEnabled)
Note that when this feature is enabled, already registered mouse wheel listeners will be deregistered until this mode is deactivated again.
mouseWheelEnabled -
|
© Copyright 2000-2008, yWorks GmbH. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||