com.openpcl.viewer.panels
Class PosZoomSlider

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by com.openpcl.viewer.panels.PosZoomSlider
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class PosZoomSlider
extends JPanel

The zoom slider is in a popup dialog that shows when the "Show/Hide Zoom Slider" toolbar button is clicked. To close the popup dialog, click the same toolbar button again. The many classes in PclRenderImage and this PosZoomSlider in OpenPCLViewer and the action event methods in PosOnSceen, all have code that work together to do the below 15 ways that the view image changes zoom: 1. Drag the slider bar pointer. 2. Click one of the slider buttons 10, 20, 30 to 100, 200, 300, 400 3. Click the Zoom Out toolbar button (zoom by 2% notches) 4. Key ctrl H also zooms out 5. Click the Zoom In toolbar button (zoom by 2% notches) 6. Key ctrl Z also zooms in 7. Click the Zoom Width button 8. Key ctrl I also zooms width 9. Click the "Show/Hide Tree" toolbar button to show and hide the tree 10. Key ctrl T also shows and hides the tree 11. Make the tree panel wider or narrower by dragger the splitter right or left 12. Click the Tile button on the toolbar that changes the view frame width 13. Click the Cascade button on the toolbar that changes the view frame width 14. Drag the right edge of the view frame right or left which will make it zoom width as you drag it 15. Mazimize/restore the view frame which will make it zoom width

Author:
howard 8/7/06
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
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.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
static int sHeightForSlider
           
static int sMax1Ratio10Value
           
static int sMax1Ratio1Value
           
static int sMaxSliderValue
           
static int sMin1Ratio10Value
           
static int sMin1Ratio1Value
           
static int sMinSliderValue
           
 
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
PosZoomSlider(ChangeListener pSliderChangeListener, ActionListener pButtonActionListener)
           
 
Method Summary
 boolean getAllowImageToUpdate()
          Get if the image is allowed to update.
 void setAllowImageToUpdate(boolean pAllowImageToUpdate)
          Set if the image is allowed to update.
 void setComponentsEnabled(boolean enabled)
          Enable/disable the slider and the direct access buttons.
 void setZoomSliderLocationFromZoomFactor(double pZoomFactor, boolean pAllowImageToUpdate)
          Set the zoom slider location from the passed in zoom factor.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, 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, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, 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
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, 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, 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, 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

sHeightForSlider

public static final int sHeightForSlider
See Also:
Constant Field Values

sMinSliderValue

public static final int sMinSliderValue
See Also:
Constant Field Values

sMaxSliderValue

public static final int sMaxSliderValue
See Also:
Constant Field Values

sMin1Ratio1Value

public static final int sMin1Ratio1Value
See Also:
Constant Field Values

sMax1Ratio1Value

public static final int sMax1Ratio1Value
See Also:
Constant Field Values

sMin1Ratio10Value

public static final int sMin1Ratio10Value
See Also:
Constant Field Values

sMax1Ratio10Value

public static final int sMax1Ratio10Value
See Also:
Constant Field Values
Constructor Detail

PosZoomSlider

public PosZoomSlider(ChangeListener pSliderChangeListener,
                     ActionListener pButtonActionListener)
Method Detail

setZoomSliderLocationFromZoomFactor

public void setZoomSliderLocationFromZoomFactor(double pZoomFactor,
                                                boolean pAllowImageToUpdate)
Set the zoom slider location from the passed in zoom factor. This method is called from 2 places, so the 2nd parameter passed is whether to let the image update or not. When this method is called from the direct zoom button action listener, true is passed that allows the image to update to the new zoom factor. But when this method is called from all the other many zoom events, then false is passed which doesn't let the image update because the image has already updated from the original event.


setComponentsEnabled

public void setComponentsEnabled(boolean enabled)
Enable/disable the slider and the direct access buttons. Used for: 1. Enabling the slider and buttons when one or more Viewer frames are showing. 2. and Disabling the slider and buttons when the last Viewer frame is closed and none is showing.


getAllowImageToUpdate

public boolean getAllowImageToUpdate()
Get if the image is allowed to update. Used to stop the image from updating twice for double events


setAllowImageToUpdate

public void setAllowImageToUpdate(boolean pAllowImageToUpdate)
Set if the image is allowed to update. Used to stop the image from updating twice for double events



OpenPCL http://www.openpcl.com