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

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
              extended by com.levigo.jadice.swing.search.tool.SelectionHighlighterTool
All Implemented Interfaces:
SelectionProvider, MenuContributor

public final class SelectionHighlighterTool
extends AbstractSelectionRendererTool


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.search.tool.AbstractSelectionRendererTool
DEFAULT_ACTIVE_SELECTION_COLOR, DEFAULT_SELECTION_COLOR, LINE_ENDING, 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
SelectionHighlighterTool()
           
 
Method Summary
 void clearSelections()
           
static SelectionHighlighterTool get(ToolManager toolManager)
           
static SelectionHighlighterTool get(ToolManager toolManager, boolean create)
           
protected  int getRenderPriority()
          Return the render priority for this tool.
 String getSelectedText()
           
 Color getSelectionColor()
           
 boolean hasSelections()
          checks if there are selected text fragments on the the page
 boolean isRemoveOnClick()
           
 void setActiveSelection(Selection activeSelection)
           
 void setRemoveOnClick(boolean removeOnClick)
          specifies if the selection should be removed on a single click using the mouse.
 void setSelectionColor(Color selectionColor)
          specifies the highlighting color.
 void setSelections(List<? extends Selection> selections)
          set a list of Selection elements which should be used to highlight regions on the screen using the color specified by setSelectionColor(Color).
 
Methods inherited from class com.levigo.jadice.swing.search.tool.AbstractSelectionRendererTool
afterHandleEditEvent, clearSelection, doGetSelections, doSetActiveSelection, doSetSelections, getActiveSelection, getActiveSelectionColor, getSelections, handleEditEvent, render, renderSelections, setActiveSelectionColor, setManager, shallRemoveOnClick, 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, 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
 

Constructor Detail

SelectionHighlighterTool

public SelectionHighlighterTool()
Method Detail

get

public static SelectionHighlighterTool get(ToolManager toolManager)

get

public static SelectionHighlighterTool get(ToolManager toolManager,
                                           boolean create)

clearSelections

public void clearSelections()

getRenderPriority

protected int getRenderPriority()
Description copied from class: Tool
Return the render priority for this tool. Tools with higher dispatch priorities are rendered earlier than tools with lower priorities. The priority should be in the range Tool.MIN_PRIORITY...Tool.MAX_PRIORITY. The default priority is equal to Tool.DEFAULT_PRIORITY.

Overrides:
getRenderPriority in class Tool
Returns:
the dispatch priority

getSelectedText

public String getSelectedText()
Overrides:
getSelectedText in class AbstractSelectionRendererTool

getSelectionColor

public Color getSelectionColor()
Overrides:
getSelectionColor in class AbstractSelectionRendererTool

hasSelections

public boolean hasSelections()
checks if there are selected text fragments on the the page

Returns:
true if there are selected text fragments on the current page.

isRemoveOnClick

public boolean isRemoveOnClick()
Overrides:
isRemoveOnClick in class AbstractSelectionRendererTool
Returns:
either true if the selection is beeing removed on click or false
See Also:
setRemoveOnClick(boolean)

setActiveSelection

public void setActiveSelection(Selection activeSelection)

setRemoveOnClick

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

Overrides:
setRemoveOnClick in class AbstractSelectionRendererTool
Parameters:
removeOnClick - true if the selection should be removed on click

setSelectionColor

public void setSelectionColor(Color selectionColor)
specifies the highlighting color. The Color specified should have a alpha-value of less than 200 set, as if not, the the highlighting marker will be rendererd as a solid box (opaque not transparent).

Overrides:
setSelectionColor in class AbstractSelectionRendererTool
Parameters:
selectionColor - the color of the selection
Throws:
IllegalArgumentException - if selectionColor is null

setSelections

public void setSelections(List<? extends Selection> selections)
set a list of Selection elements which should be used to highlight regions on the screen using the color specified by setSelectionColor(Color).

Parameters:
selections - the Selections to be used for highlighting


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