|
Eclipse GEF 2.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.eclipse.gef.editparts.ZoomManager
This class will manage the zoom for a GraphicalEditor. Objects interested in zoom changes should register as a ZoomListener with this class.
Field Summary | |
static int |
ANIMATE_NEVER
Style bit meaning don't animate any zooms |
static int |
ANIMATE_ZOOM_IN_OUT
Style bit meaning animate during zoomIn() and zoomOut() |
Constructor Summary | |
ZoomManager(org.eclipse.draw2d.ScalableFreeformLayeredPane pane,
org.eclipse.draw2d.Viewport viewport)
Creates a new ZoomManager |
Method Summary | |
void |
addZoomListener(ZoomListener listener)
Adds the given ZoomListener to this ZoomManager's list of listeners. |
boolean |
canZoomIn()
returns true if the zoommanager can perform zoomIn() . |
boolean |
canZoomOut()
returns true if the zoommanager can perform zoomOut() . |
protected void |
fireZoomChanged()
Notifies listeners that the zoom level has changed. |
double |
getMaxZoom()
Returns the maxZoom. |
double |
getMinZoom()
Returns the minZoom. |
double |
getNextZoomLevel()
Returns the zoom level that is one level higher than the current level. |
org.eclipse.draw2d.ScalableFreeformLayeredPane |
getPane()
Returns the pane. |
double |
getPreviousZoomLevel()
Returns the zoom level that is one level higher than the current level. |
double |
getUIMultiplier()
Returns the mutltiplier. |
org.eclipse.draw2d.Viewport |
getViewport()
Returns the viewport. |
double |
getZoom()
Returns the current zoom level. |
String |
getZoomAsText()
Returns the current zoom level as a percentage formatted String |
double[] |
getZoomLevels()
Returns the zoomLevels. |
String[] |
getZoomLevelsAsText()
Returns the list of zoom levels as Strings in percent notation |
void |
removeZoomListener(ZoomListener listener)
Removes the given ZoomListener from this ZoomManager's list of listeners. |
void |
setUIMultiplier(double multiplier)
Sets the UI multiplier. |
void |
setViewLocation(org.eclipse.draw2d.geometry.Point p)
Sets the Viewport's view associated with this ZoomManager to the passed Point |
void |
setZoom(double zoom)
Sets the zoom level to the given value. |
void |
setZoomAnimationStyle(int style)
Sets which zoom methods get animated. |
void |
setZoomAsText(String zoomString)
Sets zoom to the passed string. |
void |
setZoomLevels(double[] zoomLevels)
Sets the zoomLevels. |
void |
zoomIn()
Sets the zoom level to be one level higher |
void |
zoomOut()
Sets the zoom level to be one level lower |
void |
zoomTo(org.eclipse.draw2d.geometry.Rectangle rect)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int ANIMATE_NEVER
public static final int ANIMATE_ZOOM_IN_OUT
zoomIn()
and zoomOut()
Constructor Detail |
public ZoomManager(org.eclipse.draw2d.ScalableFreeformLayeredPane pane, org.eclipse.draw2d.Viewport viewport)
pane
- The ScalableFreeformLayeredPane associated with this ZoomManagerviewport
- The Viewport assoicated with this viewportMethod Detail |
public void addZoomListener(ZoomListener listener)
listener
- the ZoomListener to be addedpublic boolean canZoomIn()
true
if the zoommanager can perform zoomIn()
.
public boolean canZoomOut()
true
if the zoommanager can perform zoomOut()
.
protected void fireZoomChanged()
public double getMaxZoom()
public double getMinZoom()
public double getUIMultiplier()
public double getNextZoomLevel()
public org.eclipse.draw2d.ScalableFreeformLayeredPane getPane()
public double getPreviousZoomLevel()
public org.eclipse.draw2d.Viewport getViewport()
public double getZoom()
public String getZoomAsText()
public double[] getZoomLevels()
public String[] getZoomLevelsAsText()
public void removeZoomListener(ZoomListener listener)
listener
- the ZoomListener to be removedpublic void setUIMultiplier(double multiplier)
getZoomAsText()
). Similarly, the multiplier is
inversely applied when the user specifies a zoom level (setZoomAsText(String)
).
When the UI multiplier is 1.0
, the User will see the exact zoom level
that is being applied. If the value is 2.0
, then a scale of
0.5
will be labeled "100%" to the User.
multiplier
- The mutltiplier to setpublic void setViewLocation(org.eclipse.draw2d.geometry.Point p)
p
- The new location for the Viewport's view.public void setZoom(double zoom)
zoom
- the new zoom level
public void setZoomAnimationStyle(int style)
style
- the style bits determining the zoom methods to be animated.public void setZoomAsText(String zoomString)
zoomString
- The new zoom levelpublic void setZoomLevels(double[] zoomLevels)
zoomLevels
- The zoomLevels to setpublic void zoomIn()
public void zoomTo(org.eclipse.draw2d.geometry.Rectangle rect)
public void zoomOut()
|
Eclipse GEF 2.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |