com.levigo.jadice.swing.lens
Class LensView

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by com.levigo.jadice.swing.lens.LensView
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable

public class LensView
extends JComponent

A lens component for the jadice PageView extending a JComponent for an easy integration.

See Also:
Serialized Form

Nested Class Summary
static class LensView.LensInputEventTool
          A tool to retrieve and processes MouseEvents and KeyEvents registered by the Canvas.
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
static String PROPERTY_FROZEN_STATE
          Property for firePropertyChange by the frozen state change
static String PROPERTY_SCALE
          Property for firePropertyChange by the scale change
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
LensView()
          Constructs a new lens instance.
LensView(PageView view)
          Constructs a new lens instance and associate it with given viewer.
 
Method Summary
 void addNotify()
           
 void addPropertyChangeListener(PropertyChangeListener listener)
           
 void doLayout()
           
protected  void firePropertyChange(String propertyName, Object oldValue, Object newValue)
           
 String getFrozenLabelText()
          Returns the text of the frozen label indicator.
 FrozenStateMode getFrozenStateMode()
          Return the frozen state mode which describes how instances of LensView handle the frozen mode.
 float getMinimumScale()
           
 PageView getPageView()
           
 float getScale()
          Gets the scale.
 float getScaleStep()
           
 boolean isFrozen()
          Gets the frozen state.
 void paint(Graphics g)
           
 void removeNotify()
           
 void removePropertyChangeListener(PropertyChangeListener listener)
           
 void setFrozen(boolean frozen)
          Sets / unsets the frozen state where the lens will remain in focus of the last point before being set to frozen.
 void setFrozenLabelText(String text)
          Sets the text of the frozen label indicator.
 void setFrozenStateMode(FrozenStateMode frozenStateMode)
          Set the frozen state mode, which describes how instances of LensView handle the frozen mode.
 void setMinimumScale(float minimumScale)
          Set the minimum value for scaling the page.
 void setPageView(PageView aPageView)
          Associate this lens instance with given viewer
 void setScale(float scale)
          Sets the scale.
 void setScaleStep(float defaultScaleStep)
          Set the default step to increase / decrease the scale value
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROPERTY_SCALE

public static final String PROPERTY_SCALE
Property for firePropertyChange by the scale change

See Also:
Constant Field Values

PROPERTY_FROZEN_STATE

public static final String PROPERTY_FROZEN_STATE
Property for firePropertyChange by the frozen state change

See Also:
Constant Field Values
Constructor Detail

LensView

public LensView()
Constructs a new lens instance.


LensView

public LensView(PageView view)
Constructs a new lens instance and associate it with given viewer.

Parameters:
view - the viewer associated with the lens
See Also:
setPageView(PageView)
Method Detail

doLayout

public void doLayout()
Overrides:
doLayout in class Container

setPageView

public void setPageView(PageView aPageView)
Associate this lens instance with given viewer

NOTE: Once the page view has been realized, this method must not be called on a thread other than the Event Dispatch Thread. For details please see: TGASwingUtil.ensureEventDispatchThread(Component)

Parameters:
aPageView - viewer to associate
Throws:
IllegalStateException - if the component has been realized and the calling thread is not the Event Dispatch Thread

paint

public void paint(Graphics g)
Overrides:
paint in class JComponent
See Also:
Component.paint(java.awt.Graphics)

addNotify

public void addNotify()
Overrides:
addNotify in class JComponent
See Also:
JComponent.addNotify()

removeNotify

public void removeNotify()
Overrides:
removeNotify in class JComponent
See Also:
Component.removeNotify()

isFrozen

public boolean isFrozen()
Gets the frozen state.

Returns:
true if the lens is in frozen state; false otherwise

setFrozen

public void setFrozen(boolean frozen)
Sets / unsets the frozen state where the lens will remain in focus of the last point before being set to frozen.

Parameters:
frozen - the frozen flag to be set

getFrozenStateMode

public FrozenStateMode getFrozenStateMode()
Return the frozen state mode which describes how instances of LensView handle the frozen mode.

Returns:
the frozen state mode used by instances of LensView
See Also:
FrozenStateMode

setFrozenStateMode

public void setFrozenStateMode(FrozenStateMode frozenStateMode)
Set the frozen state mode, which describes how instances of LensView handle the frozen mode.

Parameters:
frozenStateMode - the frozen state mode used by instances of LensView
See Also:
FrozenStateMode

getFrozenLabelText

public String getFrozenLabelText()
Returns the text of the frozen label indicator.

Returns:
frozen label text

setFrozenLabelText

public void setFrozenLabelText(String text)
Sets the text of the frozen label indicator.

Parameters:
text - the text to be displayed when frozen.

getScale

public float getScale()
Gets the scale.

Returns:
Returns a float

setScale

public void setScale(float scale)
Sets the scale.

Parameters:
scale - The scale to be set.

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Overrides:
addPropertyChangeListener in class Container
See Also:
Component.addPropertyChangeListener(java.beans.PropertyChangeListener)

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Overrides:
removePropertyChangeListener in class Component
See Also:
Component.removePropertyChangeListener(java.beans.PropertyChangeListener)

firePropertyChange

protected void firePropertyChange(String propertyName,
                                  Object oldValue,
                                  Object newValue)
Overrides:
firePropertyChange in class Component
See Also:
Component.firePropertyChange(java.lang.String, java.lang.Object, java.lang.Object)

getPageView

public PageView getPageView()

getMinimumScale

public float getMinimumScale()
Returns:
the minimum value for scaling the page.

setMinimumScale

public void setMinimumScale(float minimumScale)
Set the minimum value for scaling the page.

Parameters:
minimumScale - minimum scaling value

getScaleStep

public float getScaleStep()
Returns:
the default step to increase / decrease the scale value

setScaleStep

public void setScaleStep(float defaultScaleStep)
Set the default step to increase / decrease the scale value

Parameters:
defaultScaleStep - scale value


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