public class MouseWheelZoomTool extends Tool implements ModifierActivated
Tool
used to enable zooming using the mouse wheel. Zooming is performed upon all mouse
wheel events during which the modifier state matches the one set with
setActivationModifiers(int)
(this defaults to the CONTROL key).
The zoom increments can be controlled using setScrollDivisor(int)
and bounded using
setMinZoomFactor(float)
/setMaxZoomFactor(float)
.Tool.ActivationRequest
DEFAULT_PRIORITY, MAX_PRIORITY, MIN_PRIORITY
Constructor and Description |
---|
MouseWheelZoomTool() |
Modifier and Type | Method and Description |
---|---|
int |
getActivationModifiers()
Get the mask of modifier keys (Shift, Control, Alt etc.) and mouse buttons (left, right etc.)
to be used to activate this tool.
|
protected int |
getDispatchPriority()
Return the dispatch priority for this tool.
|
float |
getMaxZoomFactor() |
float |
getMinZoomFactor() |
int |
getScrollDivisor()
Get the scroll divisor.
|
protected void |
handleMouseWheelMoved(MouseWheelEditEvent e,
boolean isActive)
Invoked when the mouse wheel is rotated.
|
void |
setActivationModifiers(int activationModifiers)
Set the mask of modifier keys (Shift, Control, Alt etc.) and mouse buttons (left, right etc.)
to be used to activate this tool.
|
void |
setMaxZoomFactor(float maxZoomFactor) |
void |
setMinZoomFactor(float minZoomFactor) |
void |
setScrollDivisor(int scrollDivisor)
Set the scroll divisor.
|
contribute, getActivationFeedback, getActivationRequest, getActivationRequestForKeyPressed, getActivationRequestForMouseDragged, getActivationRequestForMousePressed, getCursor, getManager, getRenderPriority, handleEditEvent, handleKeyPressed, handleKeyReleased, handleKeyTyped, handleMouseClicked, handleMouseDragged, handleMouseEntered, handleMouseExited, handleMouseMoved, handleMousePressed, handleMouseReleased, propagatePropertyChange, render, setActive, setCursor, setEnabled, setManager, setStatusFeedback
protected void handleMouseWheelMoved(MouseWheelEditEvent e, boolean isActive)
Tool
handleMouseWheelMoved
in class Tool
isActive
- whether this tool is currently activeMouseWheelEvent
protected int getDispatchPriority()
Tool
Tool.MIN_PRIORITY
...Tool.MAX_PRIORITY
.
The default priority is equal to Tool.MAX_PRIORITY
minus the render priority.getDispatchPriority
in class Tool
public int getScrollDivisor()
public void setScrollDivisor(int scrollDivisor)
scrollDivisor
- the scrollDivisor to setpublic float getMinZoomFactor()
public void setMinZoomFactor(float minZoomFactor)
public float getMaxZoomFactor()
public void setMaxZoomFactor(float maxZoomFactor)
public void setActivationModifiers(int activationModifiers)
InputEvent.getModifiersEx()
, i.e. it must use the InputEvent
constants
containing _DOWN_
in their name.
Default: use CONTROL key
setActivationModifiers
in interface ModifierActivated
ModifierActivated.setActivationModifiers(int)
public int getActivationModifiers()
getActivationModifiers
in interface ModifierActivated
ModifierActivated.setActivationModifiers(int)
Copyright © 2024 levigo holding gmbh. All rights reserved.