com.levigo.jadice.swing.search.tool
Class AbstractSelectionRendererTool

java.lang.Object
  extended by com.levigo.jadice.swing.tool.Tool
      extended by com.levigo.jadice.swing.internal.tool.AbstractBaseTool
          extended by com.levigo.jadice.swing.search.tool.AbstractSelectionRendererTool
All Implemented Interfaces:
SelectionProvider, MenuContributor
Direct Known Subclasses:
SelectionHighlighterTool, TextSelectionTool

public abstract class AbstractSelectionRendererTool
extends com.levigo.jadice.swing.internal.tool.AbstractBaseTool
implements SelectionProvider


Nested Class Summary
 
Nested classes/interfaces inherited from class com.levigo.jadice.swing.tool.Tool
Tool.ActivationRequest
 
Field Summary
static Color DEFAULT_ACTIVE_SELECTION_COLOR
           
static Color DEFAULT_SELECTION_COLOR
           
protected static String LINE_ENDING
           
protected static String SEL_BUS_PROPERTY_PREFIX
           
 
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
protected AbstractSelectionRendererTool()
           
 
Method Summary
protected  void afterHandleEditEvent(boolean isActive, EditEvent e, Object gadget)
          If you override this method, you must call this super-implementation late in your overridden implementation.
 void clearSelection()
           
protected  List<? extends Selection> doGetSelections()
           
protected  void doSetActiveSelection(Selection activeSelection)
           
protected  void doSetSelections(List<? extends Selection> currentSelection)
           
 Selection getActiveSelection()
           
protected  Color getActiveSelectionColor()
           
 String getSelectedText()
           
protected  Color getSelectionColor()
           
 List<? extends Selection> getSelections()
           
protected  void handleEditEvent(boolean isActive, EditEvent e)
          Handle the given EditEvent.
protected  boolean isRemoveOnClick()
           
protected  void render(RenderParameters parameters, boolean isActive)
          Renders the Tool's UI onto the given Graphics2D context using the given RenderControls.
protected  void renderSelections(RenderParameters parameters, List<? extends Selection> renderSelections)
           
protected  void setActiveSelectionColor(Color activeSelectionColor)
           
protected  void setManager(ToolManager manager)
          Receives the ToolManager instance, which the Tool implementation has been registered for.
protected  void setRemoveOnClick(boolean removeOnClick)
          specifies if the selection should be removed on a single click using the mouse.
protected  void setSelectionColor(Color selectionColor)
           
protected  boolean shallRemoveOnClick(MouseEditEvent e)
           
protected  void updateTextSelection()
           
 
Methods inherited from class com.levigo.jadice.swing.internal.tool.AbstractBaseTool
activateToolbar, autoscroll, beforeHandleEditEvent, checkForRenderGeometryChange, deactivateToolbar, endGesture, getActiveGesture, getContextToolbar, getCurrentPage, getPreferredToolbarLocation, getUndoManager, handleEditEventPreDispatch, isEnableContextToolbar, serviceGesture, setActive, setEnableContextToolbar, shallHandleEditEvent, startGesture, switchFocus, toolbarShallBeActive, updateToolbarLocation, updateToolbarVisibility
 
Methods inherited from class com.levigo.jadice.swing.tool.Tool
contribute, getActivationFeedback, getActivationRequest, getActivationRequestForKeyPressed, getActivationRequestForMouseDragged, getActivationRequestForMousePressed, getCursor, getDispatchPriority, getManager, getRenderPriority, handleKeyPressed, handleKeyReleased, handleKeyTyped, handleMouseClicked, handleMouseDragged, handleMouseEntered, handleMouseExited, handleMouseMoved, handleMousePressed, handleMouseReleased, 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

LINE_ENDING

protected static final String LINE_ENDING

SEL_BUS_PROPERTY_PREFIX

protected static final String SEL_BUS_PROPERTY_PREFIX
See Also:
Constant Field Values

DEFAULT_SELECTION_COLOR

public static final Color DEFAULT_SELECTION_COLOR

DEFAULT_ACTIVE_SELECTION_COLOR

public static final Color DEFAULT_ACTIVE_SELECTION_COLOR
Constructor Detail

AbstractSelectionRendererTool

protected AbstractSelectionRendererTool()
Method Detail

doGetSelections

protected final List<? extends Selection> doGetSelections()

doSetActiveSelection

protected final void doSetActiveSelection(Selection activeSelection)

doSetSelections

protected final void doSetSelections(List<? extends Selection> currentSelection)

getActiveSelection

public final Selection getActiveSelection()

getActiveSelectionColor

protected Color getActiveSelectionColor()

getSelectedText

public String getSelectedText()

getSelectionColor

protected Color getSelectionColor()

getSelections

public List<? extends Selection> getSelections()
Specified by:
getSelections in interface SelectionProvider

afterHandleEditEvent

protected void afterHandleEditEvent(boolean isActive,
                                    EditEvent e,
                                    Object gadget)
If you override this method, you must call this super-implementation late in your overridden implementation.

Overrides:
afterHandleEditEvent in class com.levigo.jadice.swing.internal.tool.AbstractBaseTool
See Also:
AbstractBaseTool.afterHandleEditEvent(boolean, com.levigo.jadice.swing.tool.EditEvent, java.lang.Object)

isRemoveOnClick

protected boolean isRemoveOnClick()
Returns:
either true if the selection is being removed on click or false
See Also:
setRemoveOnClick(boolean)

handleEditEvent

protected void handleEditEvent(boolean isActive,
                               EditEvent e)
Description copied from class: Tool
Handle the given EditEvent. This method dispatches the edit event to the individual handleXYZ()-Methods. However, implementors may want and are allowed to override this method in order to perform standard handling tasks common to all types of events.

Overrides:
handleEditEvent in class com.levigo.jadice.swing.internal.tool.AbstractBaseTool
Parameters:
isActive - whether this tool is currently active
e - the event

render

protected void render(RenderParameters parameters,
                      boolean isActive)
Description copied from class: Tool
Renders the Tool's UI onto the given 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.

Overrides:
render in class com.levigo.jadice.swing.internal.tool.AbstractBaseTool
Parameters:
parameters - the view component which is currently being rendered
isActive - whether the called tool is currently active

renderSelections

protected void renderSelections(RenderParameters parameters,
                                List<? extends Selection> renderSelections)

setActiveSelectionColor

protected void setActiveSelectionColor(Color activeSelectionColor)

setManager

protected void setManager(ToolManager manager)
Description copied from class: Tool
Receives the ToolManager instance, which the Tool implementation has been registered for. If the Tool is deregistered this method will be called with null.

Overrides:
setManager in class Tool

setRemoveOnClick

protected void setRemoveOnClick(boolean removeOnClick)
specifies if the selection should be removed on a single click using the mouse.

Parameters:
removeOnClick - true if the selection should be removed on click

setSelectionColor

protected void setSelectionColor(Color selectionColor)

shallRemoveOnClick

protected boolean shallRemoveOnClick(MouseEditEvent e)

updateTextSelection

protected void updateTextSelection()

clearSelection

public void clearSelection()
Specified by:
clearSelection in interface SelectionProvider


Copyright © 1995-2020 levigo holding gmbh. All Rights Reserved.