DESY ACOP Beans Home

de.desy.acop.displayers
Class AcopTrendChart

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.AcopChartReorg
                      extended by de.desy.acop.displayers.AcopTrendChart
All Implemented Interfaces:
PopupManageable, CommonDisplayer, DataStateProvider, MultipleDataConsumer, MultipleDisplayer, MultipleAcopDisplayer<AcopGraphParameters>, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class AcopTrendChart
extends AcopChartReorg

AcopTrendChart is a wrapper for the Acop which can show multiple trends in a single chart.

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 AUTOSCALE_TO_LIVE_DATA
           
static java.lang.String CHECK_FOR_BAD_DATA
           
static java.lang.String TIME_SPAN
           
static java.lang.String TIMEOUT
           
 
Fields inherited from class de.desy.acop.displayers.AcopChartReorg
AXIS_TRACE_VISIBLE, CHUBBY_LINES, colorManager, CONSUMERS, consumersList, customizer, LINE_STYLE, maxLinkIndex, TITLE, X_AUTOSCALE, X_RANGE_MAX, X_RANGE_MIN, Y_AUTOSCALE, Y_LOG_SCALE, Y_RANGE_MAX, Y_RANGE_MIN
 
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 de.desy.acop.displayers.tools.MultipleAcopDisplayer
DISPLAYER_PARAMETERS_PROPERTY
 
Fields inherited from interface com.cosylab.gui.displayers.CommonDisplayer
C_BIT_DESCRIPTIONS, C_BIT_MASK, C_COLOR, C_CONDITION_WHEN_CLEARED, C_CONDITION_WHEN_SET, C_DESCRIPTION, C_DISPLAY_NAME, C_FORMAT, C_GRAPH_MAX, C_GRAPH_MIN, C_MAXIMUM, C_MIN_STEP, C_MINIMUM, C_POSITION, C_PROPERTY_TYPE, C_SEQUENCE_LENGTH, C_UNITS
 
Fields inherited from interface com.cosylab.gui.displayers.DataStateProvider
DATA_STATE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
AcopTrendChart()
          Constructs a new AcopTrendChart.
 
Method Summary
 void addAcopTrendChartListener(AcopTrendChartListener listener)
          Adds the AcopTrendChartListener.
 void addDisplayerParameters(AcopGraphParameters parameters)
          Adds AcopDisplayerParameters to this displayer.
 AcopTrendChartListener[] getAcopTrendChartListeners()
          Returns an array of all AcopTrendChartListeners.
<D extends DataConsumer>
D
getConsumer(java.lang.String name, java.lang.Class<D> type)
           Returns data consumer of specified data consumer type and for specified string name.
 java.util.concurrent.ExecutorService getExecutorService()
          Returns the single thread executor service.
 double getLastTimestamp()
          Returns last time stamp for this AcopTrendChart.
 THistoryConnector getTHistoryConnector()
          Returns the THistoryConnector.
 int getTimeout()
          Returns the timeout in millis.
 double getTimeSpan()
          Returns the time span for this AcopTrendChart.
 boolean isAutoScaleToLiveData()
          Returns true if charts automatically scales to live data.
 boolean isCheckForBadData()
          Returns true if history data is checked for bad data.
 boolean isNormalizedData()
          Returns true if the data in the channels is normalzied.
 boolean isSimulate()
          Returns the history simulator switch.
 void reloadHistory(AcopGraphParameters parameters)
          Reloads the history for selected parameters.
 void removeAcopTrendChartListener(AcopTrendChartListener listener)
          Removes the AcopTrendChartListener.
 DataSource removeDisplayerParameters(AcopGraphParameters parameters)
          Removes a AcopDisplayerParameters from this displayer.
protected  boolean reportError(AcopTrendChartEvent event)
           
protected  void reportProgress(AcopTrendChartEvent event)
           
 void setAutoScaleToLiveData(boolean autoScaleToLiveData)
          Enables/disables autoscaling to live data.
 void setCheckForBadData(boolean checkForBadData)
          Enables/disables checking for bad data in the history.
 void setLastTimestamp(double timestamp)
          Sets last time stamp for this AcopTrendChart.
 void setNormalizedData(boolean normalized)
          Sets the data normalized or absolute.
 void setSimulate(boolean simulate)
          Sets the history simulator.
 void setTimeout(int timeout)
          Sets the timeout for all history based TINE calls.
 void setTimeSpan(double timeSpan)
          Sets time span for this AcopTrendChart.
protected  AcopGraphParameters synchronizeGraphParameters(AcopGraphParameters parameters)
           
 void updateXScale(AcopChartConsumer consumer)
          Updates chart's x scale using so the preferred min/max of the given consumer are included in this chart's bounds.
protected  void updateXScaleOnRemove(AcopChartConsumer consumer)
           
 void updateYScale(AcopChartConsumer consumer)
          Updates chart's y scale using so the preferred min/max of the given consumer are included in this chart's bounds.
protected  void updateYScaleOnRemove(AcopChartConsumer consumer)
           
 
Methods inherited from class de.desy.acop.displayers.AcopChartReorg
addConnectionParameters, autoScale, autoScale, autoScaleXOnce, autoScaleYOnce, canAutoScale, cleanup, getAcop, getConnectionParameters, getConsumers, getCustomizer, getDataState, getDisplayerParameters, getDisplayMode, getPopupManager, getSupportedConsumerTypes, getTitle, getXRangeMax, getXRangeMin, getYRangeMax, getYRangeMin, isAxisTraceVisible, isBestScale, isChubbyLines, isDragEnabled, isDropEnabled, isPropertiesPopupEnabled, isShowGrid, isSuspended, isXAutoScale, isYAutoScale, isYLogScale, main, releaseConsumer, removeConnectionParameters, resetZoom, resume, setAxisTraceVisible, setBestScale, setChubbyLines, setConnectionParameters, setDisplayerParameters, setDisplayMode, setDragEnabled, setDropEnabled, setPropertiesPopupEnabled, setShowGrid, setTitle, setXAutoScale, setXRangeMax, setXRangeMin, setYAutoScale, setYLogScale, setYRangeMax, setYRangeMin, showLegendDialog, suspend
 
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, 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
 
Methods inherited from interface com.cosylab.gui.displayers.DataStateProvider
addPropertyChangeListener, addPropertyChangeListener, removePropertyChangeListener, removePropertyChangeListener
 

Field Detail

TIME_SPAN

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

AUTOSCALE_TO_LIVE_DATA

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

CHECK_FOR_BAD_DATA

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

TIMEOUT

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

AcopTrendChart

public AcopTrendChart()
Constructs a new AcopTrendChart.

Method Detail

getTHistoryConnector

public THistoryConnector getTHistoryConnector()
Returns the THistoryConnector.

Returns:
the connector

getExecutorService

public java.util.concurrent.ExecutorService getExecutorService()
Returns the single thread executor service.

Returns:

reportProgress

protected void reportProgress(AcopTrendChartEvent event)

reportError

protected boolean reportError(AcopTrendChartEvent event)

addAcopTrendChartListener

public void addAcopTrendChartListener(AcopTrendChartListener listener)
Adds the AcopTrendChartListener. Listener receives notifications about the progress and errors during the history loading.

Parameters:
listener - listener to be added

removeAcopTrendChartListener

public void removeAcopTrendChartListener(AcopTrendChartListener listener)
Removes the AcopTrendChartListener.

Parameters:
listener - listener to be removed

getAcopTrendChartListeners

public AcopTrendChartListener[] getAcopTrendChartListeners()
Returns an array of all AcopTrendChartListeners.

Returns:
all trend chart listeners

getConsumer

public <D extends DataConsumer> D getConsumer(java.lang.String name,
                                              java.lang.Class<D> type)
Description copied from interface: MultipleDataConsumer

Returns data consumer of specified data consumer type and for specified string name. The organization of data is indicated with name (list, table, tree organization). Multiple consumer might interprete this by it's own preferences or abilities. The name of returned consuer must equals to provided name.

Example. Names: PS1/current, PS1/readback, PS2/current, PS2/readback migth table displayer interprete as two rows (PS1 and PS2) wtih two columns (current and readback). Tree displayer migth interprete this names as two branches with two subbranches.

Note that name is not fixed consumer property. Some displayers migth expect for name to be same as DISPLAY_NAME and is changed if display name is changed.

Specified by:
getConsumer in interface MultipleDataConsumer
Overrides:
getConsumer in class AcopChartReorg
Parameters:
name - organized data name
type - required data soncumer type
Returns:
newly allocated consumer for required name and type

addDisplayerParameters

public void addDisplayerParameters(AcopGraphParameters parameters)
                            throws CommonException,
                                   java.beans.PropertyVetoException
Description copied from interface: MultipleAcopDisplayer
Adds AcopDisplayerParameters to this displayer. All previous connections are kept and this one is added to the list. Upon adding the displayer should connect to the remote point specified by this parameters and adapt the screen according to other supplied parameters.

Specified by:
addDisplayerParameters in interface MultipleAcopDisplayer<AcopGraphParameters>
Overrides:
addDisplayerParameters in class AcopChartReorg
Parameters:
parameters - remote connection point and screen parameters
Throws:
CommonException - if setting failed due to connection problem
java.beans.PropertyVetoException - if setting the property failed because of improper parameters

reloadHistory

public void reloadHistory(AcopGraphParameters parameters)
Reloads the history for selected parameters.

Parameters:
parameters - the parameters for which the history should be reloaded.

synchronizeGraphParameters

protected AcopGraphParameters synchronizeGraphParameters(AcopGraphParameters parameters)
Overrides:
synchronizeGraphParameters in class AcopChartReorg

updateXScale

public void updateXScale(AcopChartConsumer consumer)
Description copied from class: AcopChartReorg
Updates chart's x scale using so the preferred min/max of the given consumer are included in this chart's bounds.

Overrides:
updateXScale in class AcopChartReorg
Parameters:
consumer - the consumer, whose bounds changed

updateXScaleOnRemove

protected void updateXScaleOnRemove(AcopChartConsumer consumer)
Overrides:
updateXScaleOnRemove in class AcopChartReorg

getTimeSpan

public double getTimeSpan()
Returns the time span for this AcopTrendChart.

Returns:
the timeSpan

setTimeSpan

public void setTimeSpan(double timeSpan)
Sets time span for this AcopTrendChart.

Parameters:
timeSpan - the timeSpan to set

getLastTimestamp

public double getLastTimestamp()
Returns last time stamp for this AcopTrendChart.

Returns:
the last timestamp

setLastTimestamp

public void setLastTimestamp(double timestamp)
Sets last time stamp for this AcopTrendChart. Its value can only be increased.

Parameters:
timestamp - the timestamp to set

isCheckForBadData

public boolean isCheckForBadData()
Returns true if history data is checked for bad data. Bad data is any value higher than 1E30.

Returns:
the checkForBadData

setCheckForBadData

public void setCheckForBadData(boolean checkForBadData)
Enables/disables checking for bad data in the history. Bad data is any value higher than 1E30. These values are filtered out if this property is true.

Parameters:
checkForBadData - new checkForBadData

isSimulate

public boolean isSimulate()
Returns the history simulator switch.

Returns:
the simulate

setSimulate

public void setSimulate(boolean simulate)
Sets the history simulator.

Parameters:
simulate - the simulate to set

getTimeout

public int getTimeout()
Returns the timeout in millis.

Returns:
the timeout

setTimeout

public void setTimeout(int timeout)
Sets the timeout for all history based TINE calls. All calls will terminate after timeout even if no data was obtained yet.

Parameters:
timeout - the timeout to set

isAutoScaleToLiveData

public boolean isAutoScaleToLiveData()
Returns true if charts automatically scales to live data.

Returns:
the autoScaleToLiveData

setAutoScaleToLiveData

public void setAutoScaleToLiveData(boolean autoScaleToLiveData)
Enables/disables autoscaling to live data. If this flag is true the cart will automatically adjust its vertical axis to include all the values in all graphs.

Parameters:
autoScaleToLiveData - the autoScaleToLiveData to set

removeDisplayerParameters

public DataSource removeDisplayerParameters(AcopGraphParameters parameters)
Description copied from interface: MultipleAcopDisplayer
Removes a AcopDisplayerParameters from this displayer. DataSource that belongs to this parameters should be released (via AdapterFactory) and all resource associated with this parameters in the displayer should be released.

Specified by:
removeDisplayerParameters in interface MultipleAcopDisplayer<AcopGraphParameters>
Overrides:
removeDisplayerParameters in class AcopChartReorg
Parameters:
parameters - parameters to be removed
Returns:
DataSource associated with this parameters

setNormalizedData

public void setNormalizedData(boolean normalized)
Sets the data normalized or absolute. When normalized, data is plotted as percentage in the min-max area.

Parameters:
normalized - true for normalzied or false for absolute

isNormalizedData

public boolean isNormalizedData()
Returns true if the data in the channels is normalzied.

Returns:
true if normalized or false otherwise

updateYScale

public void updateYScale(AcopChartConsumer consumer)
Description copied from class: AcopChartReorg
Updates chart's y scale using so the preferred min/max of the given consumer are included in this chart's bounds.

Overrides:
updateYScale in class AcopChartReorg
Parameters:
consumer - the consumer, whose bounds changed

updateYScaleOnRemove

protected void updateYScaleOnRemove(AcopChartConsumer consumer)
Overrides:
updateYScaleOnRemove in class AcopChartReorg


Copyright © 2010. All Rights Reserved.