DESY ACOP Beans Home

de.desy.acop.displayers.chart
Class ScalePanel

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 de.desy.acop.displayers.chart.ScalePanel
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class ScalePanel
extends javax.swing.JPanel

ScalePanel is a visual bean which allows selection and configuration of certain chart scaling properties. This bean is independent of any chart and only supplies the certain components for setting properties. Upon the change of any of the properties a PropertyChangeEvent is fired which notifies all registered listeners.

Version:
$Id: Templates.xml,v 1.10 2004/01/13 16:17:13 jbobnar Exp $
Author:
Jaka Bobnar
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static java.lang.String CLEAR_CMD
           
static java.lang.String DEFAULT_SCALE_CMD
           
static java.lang.String PANE_DOWN_ACTION
           
static java.lang.String PANE_UP_ACTION
           
static java.lang.String ZOOM_IN_ACTION
           
static java.lang.String ZOOM_OUT_ACTION
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, 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
ScalePanel()
          Constructs a new ScalePanel.
 
Method Summary
 void addActionListener(java.awt.event.ActionListener l)
          Adds the action listener which is notified when pane up or down is pressed.
 AcopGraphStyleEnum[] getAvailableStyles()
          Returns the styles which are available for selection.
 double getDefaultMax()
          Returns the default maximum value.
 double getDefaultMin()
          Returns the default minimum value.
 double getForcedDxFraction()
          Returns the forced dx fraction.
 double getMax()
          Returns the maximum value.
 double getMin()
          Returns the minimum value.
 boolean getRelativeScaleMode()
          Returns the relative scale mode.
 AcopGraphStyleEnum getStyle()
          Return the style selected in the combo.
 boolean isAutoScale()
          Returns the auto scale property value.
 boolean isExtraDigits()
          Returns true if this panel shows extra digits.
 boolean isLogCritical()
          Returns true if log critical warning is shown.
 void removeActionListener(java.awt.event.ActionListener l)
          Removes the action listener.
 void setAutoScale(boolean auto)
          Sets the auto scale property.
 void setAvailableStyles(AcopGraphStyleEnum[] styles)
          Sets the styles which are available for selection.
 void setDefaultMax(double defaultMax)
          Sets the default maximum value.
 void setDefaultMin(double defaultMin)
          Sets the default minimum value.
 void setEnabled(boolean e)
           
 void setExtraDigits(boolean extraDigits)
          Sets the flag whether extra digits are shown on this panel or not.
 void setForcedDxFraction(double forced)
          Sets the forced dx.
 void setLogCritical(boolean logCritical)
          Shows/hides label showing a warning that data is logarithmically critical.
 void setMax(double max)
          Sets maximum value.
 void setMax(double max, boolean notify)
          Sets the maximum value and notifies the listeners of property change if requested.
 void setMin(double min)
          Sets the minimum.
 void setMin(double min, boolean notify)
          Sets the minimum value and notifies the listeners of property change if requested.
 void setMinMaxEnabled(boolean enabled)
          Enables/disables the input panel for minimum and maximum.
 void setRelativeScaleMode(boolean relative)
          Sets the relative scale mode.
 void setStyle(AcopGraphStyleEnum style)
          Sets selected style.
 void setStyleComboRenderer(javax.swing.ListCellRenderer renderer)
          Sets the style combo renderer.
 
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, 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, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, 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, 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

CLEAR_CMD

public static final java.lang.String CLEAR_CMD
See Also:
Constant Field Values

DEFAULT_SCALE_CMD

public static final java.lang.String DEFAULT_SCALE_CMD
See Also:
Constant Field Values

PANE_DOWN_ACTION

public static final java.lang.String PANE_DOWN_ACTION
See Also:
Constant Field Values

PANE_UP_ACTION

public static final java.lang.String PANE_UP_ACTION
See Also:
Constant Field Values

ZOOM_IN_ACTION

public static final java.lang.String ZOOM_IN_ACTION
See Also:
Constant Field Values

ZOOM_OUT_ACTION

public static final java.lang.String ZOOM_OUT_ACTION
See Also:
Constant Field Values
Constructor Detail

ScalePanel

public ScalePanel()
Constructs a new ScalePanel.

Method Detail

setExtraDigits

public void setExtraDigits(boolean extraDigits)
Sets the flag whether extra digits are shown on this panel or not. If true the precision of all numbers is larger than if false.

Parameters:
extraDigits - true if high precision should be used

isExtraDigits

public boolean isExtraDigits()
Returns true if this panel shows extra digits.

Returns:
true if extra digits are shown

addActionListener

public void addActionListener(java.awt.event.ActionListener l)
Adds the action listener which is notified when pane up or down is pressed.

Parameters:
l - the listener to add

removeActionListener

public void removeActionListener(java.awt.event.ActionListener l)
Removes the action listener.

Parameters:
l - the listener to remove

setEnabled

public void setEnabled(boolean e)
Overrides:
setEnabled in class javax.swing.JComponent

isAutoScale

public boolean isAutoScale()
Returns the auto scale property value.

Returns:
the auto scale

setAutoScale

public void setAutoScale(boolean auto)
Sets the auto scale property.

Parameters:
auto - new auto scale value

setRelativeScaleMode

public void setRelativeScaleMode(boolean relative)
Sets the relative scale mode. The majority of properties is enabled only when in the relative scale mode.

Parameters:
relative -

setMinMaxEnabled

public void setMinMaxEnabled(boolean enabled)
Enables/disables the input panel for minimum and maximum.

Parameters:
enabled -

getRelativeScaleMode

public boolean getRelativeScaleMode()
Returns the relative scale mode.

Returns:
relative scale mode

isLogCritical

public boolean isLogCritical()
Returns true if log critical warning is shown.

Returns:
true if critical for logarithmic values

setLogCritical

public void setLogCritical(boolean logCritical)
Shows/hides label showing a warning that data is logarithmically critical.

Parameters:
logCritical -

getMax

public double getMax()
Returns the maximum value.

Returns:
the max

setMax

public void setMax(double max)
Sets maximum value.

Parameters:
max - new maximum value

setMax

public void setMax(double max,
                   boolean notify)
Sets the maximum value and notifies the listeners of property change if requested.

Parameters:
max - new maximum value
notify - should listeners be notified

getMin

public double getMin()
Returns the minimum value.

Returns:
the minimum value

setMin

public void setMin(double min)
Sets the minimum.

Parameters:
min - ne wminimum value

setMin

public void setMin(double min,
                   boolean notify)
Sets the minimum value and notifies the listeners of property change if requested.

Parameters:
min - new minimum value
notify - should listeners be notified

getDefaultMax

public double getDefaultMax()
Returns the default maximum value.

Returns:
the defaultMax

setDefaultMax

public void setDefaultMax(double defaultMax)
Sets the default maximum value.

Parameters:
defaultMax - new default maximum

getDefaultMin

public double getDefaultMin()
Returns the default minimum value.

Returns:
the defaultMin

setDefaultMin

public void setDefaultMin(double defaultMin)
Sets the default minimum value.

Parameters:
defaultMin - new default minimum

getStyle

public AcopGraphStyleEnum getStyle()
Return the style selected in the combo.

Returns:
return the selected axis scale

setStyle

public void setStyle(AcopGraphStyleEnum style)
Sets selected style. The selected style needs to be one of the avaialble styles.

Parameters:
style - new style

setAvailableStyles

public void setAvailableStyles(AcopGraphStyleEnum[] styles)
Sets the styles which are available for selection.

Parameters:
styles -

getAvailableStyles

public AcopGraphStyleEnum[] getAvailableStyles()
Returns the styles which are available for selection.

Returns:

setStyleComboRenderer

public void setStyleComboRenderer(javax.swing.ListCellRenderer renderer)
Sets the style combo renderer. The renderer should expect the values to be of type AcopGraphStyleEnum.

Parameters:
renderer - the renderer to used in combo

setForcedDxFraction

public void setForcedDxFraction(double forced)
Sets the forced dx. This dx will be used to multiply the original step when performing zoom in/out and scale up/down.

Parameters:
forced - new dx fraction

getForcedDxFraction

public double getForcedDxFraction()
Returns the forced dx fraction.

Returns:
forced dx fraction


Copyright © 2010. All Rights Reserved.