|
|||||||||
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.internal.tool.AbstractBaseTool com.levigo.jadice.swing.annotation.AnnotationTool
public class AnnotationTool
A tool used to edit Annotation
s.
Nested Class Summary | |
---|---|
static class |
AnnotationTool.Mode
|
Nested classes/interfaces inherited from class com.levigo.jadice.swing.tool.Tool |
---|
Tool.ActivationRequest |
Field Summary | |
---|---|
static ExtResourceBundle |
BUNDLE
|
Fields inherited from class com.levigo.jadice.swing.internal.tool.AbstractBaseTool |
---|
activeGesture, currentPage, enableContextToolbar, isActive, lastRenderControls, lastRenderedPageBounds |
Fields inherited from class com.levigo.jadice.swing.tool.Tool |
---|
DEFAULT_PRIORITY, MAX_PRIORITY, MIN_PRIORITY |
Constructor Summary | |
---|---|
AnnotationTool()
|
Method Summary | |
---|---|
protected void |
activateToolbar()
|
protected void |
afterHandleEditEvent(boolean isActive,
EditEvent e,
Object gadget)
|
protected Object |
beforeHandleEditEvent(boolean isActive,
EditEvent e)
|
protected void |
checkForRenderGeometryChange(RenderControls pageRenderControls,
Rectangle renderedPageBounds)
|
void |
clearSelection()
Deselect all annotations. |
void |
contribute(ContributionContext context,
MenuBuilder contextMenu)
This method is called in order to give the menu contributor a chance to contribute context menu entries via the supplied MenuBuilder . |
void |
deleteSelected()
Delete all selected annotations. |
void |
deselect(Annotation a)
Deselect given annotation object. |
Tool.ActivationRequest |
getActivationFeedback(MouseEditEvent e)
Provide feedback for the user about what would happen, if the mouse were pressed at the current location. |
protected com.levigo.jadice.swing.internal.annotation.editors.AnnotationHoverEditor |
getContextToolbar()
|
AnnotationFactory |
getCreateMode()
Returns the annotation factory used to create the annotation(s) while in create mode. |
Rectangle |
getCurrentPageRenderBounds()
|
RenderControls |
getCurrentPageRenderControls()
|
protected int |
getDispatchPriority()
Return the dispatch priority for this tool. |
Set<DocumentLayer> |
getEditableAnnotationLayers()
Return all DocumentLayer that are considered for annotation editing purposes. |
com.levigo.jadice.swing.internal.annotation.editors.SwingAnnotationEditor |
getEditor()
|
AnnotationTool.Mode |
getMode()
Returns the annotation mode. |
DocumentLayer |
getNewAnnotationLayer()
Return the layer onto which newly created annotations are to be placed. |
protected Point |
getPreferredToolbarLocation()
|
List<Annotation> |
getSelection()
Returns an unmodifiable view of the currently selected annotations. |
protected void |
handleEditEventPreDispatch(EditEvent e)
|
protected void |
handleKeyPressed(KeyEditEvent e,
boolean isActive)
Invoked when a key has been pressed. |
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. |
static boolean |
isOverSelectionPoint(MouseEditEvent e,
List<Annotation> selection)
|
boolean |
isResetAnnotationModeAfterCreation()
Returns the resetAnnotationModeAfterCreation. |
static void |
paintHandles(com.levigo.jadice.swing.internal.tool.Handle[] handles,
RenderParameters parameters)
|
protected void |
render(RenderParameters parameters,
boolean isActive)
Renders the Tool's UI onto the given Graphics2D context using the given
RenderControls . |
void |
select(Annotation annotation,
Page onPage)
Selects the given annotation |
void |
select(Collection<Annotation> annotations,
Page page)
Selects all the annotations within the given collection |
protected void |
setActive(boolean active)
Receive notification from the tool manager about the tool's active state. |
void |
setCreateMode(AnnotationFactory annotationFactory)
Set the tool's mode to create annotations of the given type ( AnnotationTool.Mode.CREATE ). |
void |
setEditMode()
(Re-)Set the tool's mode to edit existing annotations ( AnnotationTool.Mode.EDIT ). |
protected void |
setManager(ToolManager manager)
Receives the ToolManager instance, which the Tool implementation has been
registered for. |
void |
setNewAnnotationLayer(DocumentLayer newAnnotationLayer)
Set the layer onto which newly created annotations are to be placed. |
void |
setResetAnnotationModeAfterCreation(boolean resetAnnotationModeAfterCreation)
Sets the resetAnnotationModeAfterCreation. |
protected boolean |
shallHandleEditEvent(boolean isActive,
EditEvent e)
|
protected boolean |
toolbarShallBeActive()
|
Methods inherited from class com.levigo.jadice.swing.internal.tool.AbstractBaseTool |
---|
autoscroll, deactivateToolbar, endGesture, getActiveGesture, getCurrentPage, getUndoManager, handleEditEvent, isEnableContextToolbar, serviceGesture, setEnableContextToolbar, startGesture, switchFocus, updateToolbarLocation, updateToolbarVisibility |
Methods inherited from class com.levigo.jadice.swing.tool.Tool |
---|
getActivationRequest, getActivationRequestForKeyPressed, getActivationRequestForMouseDragged, getActivationRequestForMousePressed, getCursor, getManager, getRenderPriority, handleKeyReleased, handleKeyTyped, handleMouseClicked, handleMouseDragged, handleMouseEntered, handleMouseExited, handleMouseWheelMoved, propagatePropertyChange, setCursor, setEnabled, setStatusFeedback |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final ExtResourceBundle BUNDLE
Constructor Detail |
---|
@CallOnEDT public AnnotationTool()
Method Detail |
---|
protected void handleKeyPressed(KeyEditEvent e, boolean isActive)
Tool
KeyEvent
for a
definition of a key pressed event.
handleKeyPressed
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 active@CallOnEDT public Tool.ActivationRequest getActivationFeedback(MouseEditEvent e)
Tool
MouseEvent.MOUSE_MOVED
events. If this
method returns null
no feedback is provided at all.
The activation request returned from this method is the same object that is used during
Tool.getActivationRequestForKeyPressed(KeyEditEvent)
to signal the auto-activation
candidacy.
This method should only return an activation request if it will actually candidate for
auto-activation later on using Tool.getActivationRequestForMousePressed(MouseEditEvent)
or
Tool.getActivationRequestForMouseDragged(MouseEditEvent)
.
getActivationFeedback
in class Tool
@CallOnEDT public void clearSelection()
IllegalStateException
- if the calling thread is not the Event Dispatch
Thread
@CallOnEDT public void deselect(Annotation a)
a
- Annotation to deselect
IllegalStateException
- if the calling thread is not the Event Dispatch
Thread
@CallOnEDT public void select(Annotation annotation, Page onPage)
annotation
- onPage
- the page on which the annotation resides
IllegalStateException
- if the calling thread is not the Event Dispatch
Thread
@CallOnEDT public void select(Collection<Annotation> annotations, Page page)
annotations
- page
- the page on which the annotations reside
IllegalStateException
- if the calling thread is not the Event Dispatch
Thread
protected boolean shallHandleEditEvent(boolean isActive, EditEvent e)
shallHandleEditEvent
in class com.levigo.jadice.swing.internal.tool.AbstractBaseTool
protected Object beforeHandleEditEvent(boolean isActive, EditEvent e)
beforeHandleEditEvent
in class com.levigo.jadice.swing.internal.tool.AbstractBaseTool
protected void afterHandleEditEvent(boolean isActive, EditEvent e, Object gadget)
afterHandleEditEvent
in class com.levigo.jadice.swing.internal.tool.AbstractBaseTool
protected void handleEditEventPreDispatch(EditEvent e)
handleEditEventPreDispatch
in class com.levigo.jadice.swing.internal.tool.AbstractBaseTool
protected void activateToolbar()
activateToolbar
in class com.levigo.jadice.swing.internal.tool.AbstractBaseTool
protected boolean toolbarShallBeActive()
toolbarShallBeActive
in class com.levigo.jadice.swing.internal.tool.AbstractBaseTool
@CallOnEDT public com.levigo.jadice.swing.internal.annotation.editors.SwingAnnotationEditor getEditor()
protected com.levigo.jadice.swing.internal.annotation.editors.AnnotationHoverEditor getContextToolbar()
getContextToolbar
in class com.levigo.jadice.swing.internal.tool.AbstractBaseTool
protected void handleMouseMoved(MouseEditEvent e, boolean isActive)
Tool
handleMouseMoved
in class Tool
isActive
- whether this tool is currently active@CallOnEDT public static boolean isOverSelectionPoint(MouseEditEvent e, List<Annotation> selection)
protected void handleMouseReleased(MouseEditEvent e, boolean isActive)
Tool
handleMouseReleased
in class Tool
isActive
- whether this tool is currently active@CallOnEDT public AnnotationFactory getCreateMode()
@CallOnEDT public AnnotationTool.Mode getMode()
@CallOnEDT public void setEditMode()
AnnotationTool.Mode.EDIT
).
protected void setActive(boolean active)
Tool
setActive
in class com.levigo.jadice.swing.internal.tool.AbstractBaseTool
@CallOnEDT public void setCreateMode(AnnotationFactory annotationFactory)
AnnotationTool.Mode.CREATE
).
annotationFactory
-
IllegalStateException
- if the calling thread is not the Event Dispatch
Thread
@CallOnEDT public boolean isResetAnnotationModeAfterCreation()
IllegalStateException
- if the calling thread is not the Event Dispatch
Thread
@CallOnEDT public void setResetAnnotationModeAfterCreation(boolean resetAnnotationModeAfterCreation)
resetAnnotationModeAfterCreation
- The resetAnnotationModeAfterCreation to set
IllegalStateException
- if the calling thread is not the Event Dispatch
Thread
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
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 com.levigo.jadice.swing.internal.tool.AbstractBaseTool
parameters
- the view component which is currently being renderedisActive
- whether the called tool is currently activeprotected void checkForRenderGeometryChange(RenderControls pageRenderControls, Rectangle renderedPageBounds)
checkForRenderGeometryChange
in class com.levigo.jadice.swing.internal.tool.AbstractBaseTool
@CallOnEDT public static void paintHandles(com.levigo.jadice.swing.internal.tool.Handle[] handles, RenderParameters parameters)
handles
- parameters
- the render parametersprotected 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
@CallOnEDT public List<Annotation> getSelection()
@CallOnEDT public void deleteSelected()
IllegalStateException
- if the calling thread is not the Event Dispatch
Thread
@CallOnEDT public void contribute(ContributionContext context, MenuBuilder contextMenu)
MenuContributor
MenuBuilder
.
contribute
in interface MenuContributor
contribute
in class Tool
context
- the ContributionContext
which provides contribution context informationscontextMenu
- the MenuBuilder
to which the tool may contribute entries.protected Point getPreferredToolbarLocation()
getPreferredToolbarLocation
in class com.levigo.jadice.swing.internal.tool.AbstractBaseTool
@CallOnEDT public Rectangle getCurrentPageRenderBounds()
@CallOnEDT public RenderControls getCurrentPageRenderControls()
@CallOnEDT public Set<DocumentLayer> getEditableAnnotationLayers()
DocumentLayer
that are considered for annotation editing purposes. By
default only the DocumentLayer.ANNOTATIONS
is considered.
The list is live and can be edited to add or remove layers to be considered.
@CallOnEDT public DocumentLayer getNewAnnotationLayer()
DocumentLayer.ANNOTATIONS
.
@CallOnEDT public void setNewAnnotationLayer(DocumentLayer newAnnotationLayer)
DocumentLayer.ANNOTATIONS
.
newAnnotationLayer
- the document layer for new annotations
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |