|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.levigo.jadice.swing.tool.Tool com.levigo.jadice.swing.crosshair.CrossHairTool
public class CrossHairTool
An instance of this class may be added as a Tool
to a PageView
. It provides a
crosshair mode, which means mouse motions will be followed by a crosshair rendered above the
documents display.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.levigo.jadice.swing.tool.Tool |
---|
Tool.ActivationRequest |
Field Summary |
---|
Fields inherited from class com.levigo.jadice.swing.tool.Tool |
---|
DEFAULT_PRIORITY, MAX_PRIORITY, MIN_PRIORITY |
Constructor Summary | |
---|---|
CrossHairTool()
Constructor |
Method Summary | |
---|---|
int |
getActivationModifiers()
Returns the mask of modifier keys (Shift, Control, Alt etc.) and mouse buttons (left, right etc.) to be used to change the frozen state. |
Color |
getColor()
Returns the line color |
FrozenMode |
getFrozenMode()
Returns the current frozen mode behaviour. |
int |
getLineWidth()
Returns the line width |
protected int |
getRenderPriority()
Return the render priority for this tool. |
protected void |
handleMouseClicked(MouseEditEvent e,
boolean isActive)
Invoked when the mouse button has been clicked (pressed and released) on a component. |
protected void |
handleMouseMoved(MouseEditEvent e,
boolean isActive)
Invoked when the mouse cursor has been moved onto a component but no buttons have been pushed. |
protected void |
handleMousePressed(MouseEditEvent e,
boolean isActive)
Invoked when a mouse button has been pressed on a component. |
protected void |
handleMouseReleased(MouseEditEvent e,
boolean isActive)
Invoked when a mouse button has been released on a component. |
boolean |
isFrozen()
Gets the frozen state. |
protected void |
render(RenderParameters parameters,
boolean isActive)
Renders the Tool's UI onto the given Graphics2D context using the given
RenderControls . |
void |
setActivationModifiers(int activationModifiers)
Set the mask of modifier keys (Shift, Control, Alt etc.) and mouse buttons (left, right etc.) to be used to change the frozen state. |
void |
setColor(Color color)
Changes the line color |
void |
setFrozen(boolean frozen)
Sets / unsets the frozen state where the pane will remain in focus of the last point before being set to frozen. |
void |
setFrozenMode(FrozenMode frozenMode)
Changes the frozen mode behaviour. |
void |
setLineWidth(int lineWidth)
Changes the line width |
protected void |
setManager(ToolManager manager)
Receives the ToolManager instance, which the Tool implementation has been
registered for. |
Methods inherited from class com.levigo.jadice.swing.tool.Tool |
---|
contribute, getActivationFeedback, getActivationRequest, getActivationRequestForKeyPressed, getActivationRequestForMouseDragged, getActivationRequestForMousePressed, getCursor, getDispatchPriority, getManager, handleEditEvent, handleKeyPressed, handleKeyReleased, handleKeyTyped, handleMouseDragged, handleMouseEntered, handleMouseExited, handleMouseWheelMoved, propagatePropertyChange, setActive, setCursor, setEnabled, setStatusFeedback |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CrossHairTool()
Method Detail |
---|
protected int getRenderPriority()
Tool
Tool.MIN_PRIORITY
...Tool.MAX_PRIORITY
.
The default priority is equal to Tool.DEFAULT_PRIORITY
.
getRenderPriority
in class Tool
protected void render(RenderParameters parameters, boolean isActive)
Tool
Graphics2D
context using the given
RenderControls
.
This render method is called within the context and during the rendering of a single page. The page being rendered is passed to implementors of this method in order to be able to control and influence the page rendering.
render
in class Tool
parameters
- the view component which is currently being renderedisActive
- whether the called tool is currently activepublic Color getColor()
public void setColor(Color color)
color
- public int getLineWidth()
public void setLineWidth(int lineWidth)
lineWidth
- public boolean isFrozen()
true
if the pane is in frozen state; false
otherwisepublic void setFrozen(boolean frozen)
frozen
- the frozen flag to be set#getFrozenStateMode()
protected void handleMouseClicked(MouseEditEvent e, boolean isActive)
Tool
handleMouseClicked
in class Tool
isActive
- whether this tool is currently activeprotected void handleMouseMoved(MouseEditEvent e, boolean isActive)
Tool
handleMouseMoved
in class Tool
isActive
- whether this tool is currently activeprotected void handleMousePressed(MouseEditEvent e, boolean isActive)
Tool
handleMousePressed
in class Tool
isActive
- whether this tool is currently activeprotected void handleMouseReleased(MouseEditEvent e, boolean isActive)
Tool
handleMouseReleased
in class Tool
isActive
- whether this tool is currently activeprotected void setManager(ToolManager manager)
Tool
ToolManager
instance, which the Tool
implementation has been
registered for. If the Tool
is deregistered
this
method will be called with null.
setManager
in class Tool
public FrozenMode getFrozenMode()
FrozenMode
public void setFrozenMode(FrozenMode frozenMode)
frozenMode
- the new mode to change to
IllegalArgumentException
- the given frozen mode to change to must not be
null
.public int getActivationModifiers()
getActivationModifiers
in interface ModifierActivated
setActivationModifiers(int)
,
setFrozen(boolean)
,
isFrozen()
public void setActivationModifiers(int activationModifiers)
InputEvent.getModifiersEx()
, i.e. it must use the InputEvent
constants
containing _DOWN_
in their name.
setActivationModifiers
in interface ModifierActivated
activationModifiers
- InputEvent.ALT_DOWN_MASK
,
InputEvent.ALT_GRAPH_DOWN_MASK
,
InputEvent.CTRL_DOWN_MASK
,
InputEvent.SHIFT_DOWN_MASK
,
InputEvent.BUTTON1_DOWN_MASK
,
InputEvent.BUTTON2_DOWN_MASK
,
InputEvent.BUTTON3_DOWN_MASK
,
setFrozen(boolean)
,
isFrozen()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |