com.levigo.jadice.swing.thumbnailview
Class LightboxThumbnailTool

java.lang.Object
  extended by com.levigo.jadice.swing.tool.Tool
      extended by com.levigo.jadice.swing.thumbnailview.LightboxThumbnailTool
All Implemented Interfaces:
MenuContributor

public class LightboxThumbnailTool
extends Tool

The LightboxThumbnailTool presents a ThumbnailView in semi-transparent fashion inside a PageView. It may be configured to automatically activate the thumbnail view if the mouse enters e certain region along the lower edge of the PageView, or to require manual activation by clicking on a small "tab" docked along the lower edge..


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
LightboxThumbnailTool()
           
 
Method Summary
protected  void autoUpdateState()
           
 int getActivationMargin()
          Returns the activation margin, expressed in percent of the light-box's preferred height.
 int getDeactivationMargin()
          Returns the deactivation margin, expressed in percent of the light-box's preferred height.
 ThumbnailView getThumbnailView()
          Returns the embedded thumbnail view
protected  void handleMouseExited(MouseEditEvent e, boolean isActive)
          Invoked when the mouse cursor exits the unobscured part of component's geometry.
protected  void handleMouseMoved(MouseEditEvent e, boolean isActive)
          Invoked when the mouse cursor has been moved onto a component but no buttons have been pushed.
 boolean isActive()
          Deprecated. Use isLightboxVisible() instead.
 boolean isAutoActivate()
          Returns whether the light-box shall become visible automatically if the mouse enters the light-box's activation zone.
 boolean isAutoDeactivate()
          Returns whether the light-box shall become invisible automatically if the mouse leaves the light-box's deactivation zone.
 boolean isLightboxVisible()
          Returns the visibility of the thumbnail light-box.
 boolean isPinned()
          Returns the selected state of the pin button in the visble light-box.
 void setActivationMargin(int activationMargin)
          Set the activation margin, expressed in percent of the light-box's preferred height.
 void setActive(boolean active)
          Receive notification from the tool manager about the tool's active state.
 void setAutoActivate(boolean autoActivate)
          Set whether the light-box shall auto-activate itself once the mouse enters the activation zone along the bottom edge of the viewport.
 void setAutoDeactivate(boolean autoDeactivate)
          Sets whether the light-box shall become invisible automatically once the mouse leaves the light-box's deactivation zone.
 void setDeactivationMargin(int deactivationMargin)
          Sets the deactivation margin, expressed in percent of the light-box's preferred height.
protected  void setEnabled(boolean enabled)
          Receive notification from the tool manager about the tool's enabled state.
 void setLightboxVisible(boolean visible)
          Set the thumbnail light-box visibility.
protected  void setManager(ToolManager manager)
          Receives the ToolManager instance, which the Tool implementation has been registered for.
 void setPinned(boolean pinned)
          Sets the selected state of the pin button in the visible light-box.
 
Methods inherited from class com.levigo.jadice.swing.tool.Tool
contribute, getActivationFeedback, getActivationRequest, getActivationRequestForKeyPressed, getActivationRequestForMouseDragged, getActivationRequestForMousePressed, getCursor, getDispatchPriority, getManager, getRenderPriority, handleEditEvent, handleKeyPressed, handleKeyReleased, handleKeyTyped, handleMouseClicked, handleMouseDragged, handleMouseEntered, handleMousePressed, handleMouseReleased, handleMouseWheelMoved, propagatePropertyChange, render, setCursor, setStatusFeedback
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LightboxThumbnailTool

public LightboxThumbnailTool()
Method Detail

setEnabled

protected void setEnabled(boolean enabled)
Description copied from class: Tool
Receive notification from the tool manager about the tool's enabled state. In general, tools need not and should not try to implement different behaviour depending on the enabled state, as this is already covered by the ToolManager calling the Tool.handleEditEvent(boolean, EditEvent) and Tool.render(RenderParameters, boolean) in the appropriate state only. However, some tools may need to perform extended actions (for example, for resource management purposes) upon a change of the enabled state.

Overrides:
setEnabled in class Tool

handleMouseMoved

protected void handleMouseMoved(MouseEditEvent e,
                                boolean isActive)
Description copied from class: Tool
Invoked when the mouse cursor has been moved onto a component but no buttons have been pushed.

Overrides:
handleMouseMoved in class Tool
isActive - whether this tool is currently active

handleMouseExited

protected void handleMouseExited(MouseEditEvent e,
                                 boolean isActive)
Description copied from class: Tool
Invoked when the mouse cursor exits the unobscured part of component's geometry.

Overrides:
handleMouseExited in class Tool
isActive - whether this tool is currently active

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
See Also:
Tool.setManager(com.levigo.jadice.swing.tool.ToolManager)

setLightboxVisible

@CallOnEDT
public void setLightboxVisible(boolean visible)
Set the thumbnail light-box visibility.

Parameters:
visible -
Throws:
IllegalStateException - this method is annotated to be called on the EDT. Calling from any other thread will cause an IllegalStateException.

isLightboxVisible

@CallOnEDT
public boolean isLightboxVisible()
Returns the visibility of the thumbnail light-box.

Returns:
visibility of the thumbnail light-box
Throws:
IllegalStateException - this method is annotated to be called on the EDT. Calling from any other thread will cause an IllegalStateException.

setActive

@CallOnEDT
public void setActive(boolean active)
Receive notification from the tool manager about the tool's active state. Set whether the light-box shall be active (visible) or inactive.

Overrides:
setActive in class Tool
Parameters:
active -

isActive

@CallOnEDT
public boolean isActive()
Deprecated. Use isLightboxVisible() instead.

Returns whether the light-box is visible.

Hint: The term "active" is slightly misleading, since its meaning is in fact the the visible state of the thumbs and does not mean the auto-activation due to the tool election and activation mechanism practised by the toolmanager.

Returns:
whether the thumbnail light-box is visible

isPinned

@CallOnEDT
public boolean isPinned()
Returns the selected state of the pin button in the visble light-box. The pin state is considered within the auto deactivation mechanism and therefore it comes only into account when the light-box is visible.

Returns:
whether the pin button is selected or not
See Also:
setPinned(boolean)

setPinned

@CallOnEDT
public void setPinned(boolean pinned)
Sets the selected state of the pin button in the visible light-box. The pin state is considered within the auto deactivation mechanism and therefore it comes only into account when the light-box is visible.

Parameters:
pinned - whether the pin button is selected or not
Throws:
IllegalStateException - this method is annotated to be called on the EDT. Calling from any other thread will cause an IllegalStateException.
See Also:
isPinned()

setAutoActivate

public void setAutoActivate(boolean autoActivate)
Set whether the light-box shall auto-activate itself once the mouse enters the activation zone along the bottom edge of the viewport.

Hint: The terms "activate" and "activation" are slightly misleading, since its meaning is in fact the the visible state of the thumbs and does not mean the auto-activation due to the tool election and activation mechanism practised by the toolmanager.

Parameters:
autoActivate -
See Also:
isAutoActivate(), #getAactivationMargin(), setActivationMargin(int)

isAutoActivate

public boolean isAutoActivate()
Returns whether the light-box shall become visible automatically if the mouse enters the light-box's activation zone.

Returns:
boolean the auto active behaviour.
See Also:
setAutoActivate(boolean), getActivationMargin(), setActivationMargin(int)

setAutoDeactivate

public void setAutoDeactivate(boolean autoDeactivate)
Sets whether the light-box shall become invisible automatically once the mouse leaves the light-box's deactivation zone.

Hint: The terms "de-activate" and "de-activation" are slightly misleading, since its meaning is in fact the the visible state of the thumbs and does not mean the auto-activation due to the tool election and activation mechanism practised by the toolmanager.

Parameters:
autoDeactivate -
See Also:
isAutoDeactivate(), getDeactivationMargin(), setDeactivationMargin(int)

isAutoDeactivate

public boolean isAutoDeactivate()
Returns whether the light-box shall become invisible automatically if the mouse leaves the light-box's deactivation zone.

Returns:
boolean
See Also:
setAutoDeactivate(boolean), getDeactivationMargin(), setDeactivationMargin(int)

autoUpdateState

protected void autoUpdateState()

setDeactivationMargin

public void setDeactivationMargin(int deactivationMargin)
Sets the deactivation margin, expressed in percent of the light-box's preferred height. If the mouse leaves this area along the bottom edge of the viewport, the light-box is closed automatically if autoDeactivate has been set to true.

For best results this value must be >100.

Hint: The terms "de-activate" and "de-activation" are slightly misleading, since its meaning is in fact the the visible state of the thumbs and does not mean the auto-activation due to the tool election and activation mechanism practised by the toolmanager.

Parameters:
deactivationMargin -
See Also:
getDeactivationMargin(), isAutoDeactivate(), setAutoDeactivate(boolean)

getDeactivationMargin

public int getDeactivationMargin()
Returns the deactivation margin, expressed in percent of the light-box's preferred height.

Returns:
deactivation margin
See Also:
setDeactivationMargin(int), isAutoDeactivate(), setAutoDeactivate(boolean)

setActivationMargin

public void setActivationMargin(int activationMargin)
Set the activation margin, expressed in percent of the light-box's preferred height. If the mouse enters this area along the bottom edge of the viewport, the light-box becomes automatically visible if autoActivate has been set to true. If autoActivate is false, the activation tab is made visible instead.

For best results this value must be >100.

Hint: The terms "activate" and "activation" are slightly misleading, since its meaning is in fact the the visible state of the thumbs and does not mean the auto-activation due to the tool election and activation mechanism practised by the toolmanager.

Parameters:
activationMargin -
See Also:
getActivationMargin(), isAutoActivate(), setAutoActivate(boolean)

getActivationMargin

public int getActivationMargin()
Returns the activation margin, expressed in percent of the light-box's preferred height.

Returns:
activation margin
See Also:
setActivationMargin(int), isAutoActivate(), setAutoActivate(boolean)

getThumbnailView

public ThumbnailView getThumbnailView()
Returns the embedded thumbnail view

Returns:
the embedded thumbnail view


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