tool_panels
( tool_panels-1.13.jar)

tool_panels.spectrum_histo
Class Histo_3D

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 fr.esrf.tangoatk.widget.attribute.NumberImageViewer
                      extended by tool_panels.spectrum_histo.Histo_3D
All Implemented Interfaces:
fr.esrf.tangoatk.core.IAttributeStateListener, fr.esrf.tangoatk.core.IErrorListener, fr.esrf.tangoatk.core.IImageListener, fr.esrf.tangoatk.widget.util.jdraw.JDrawable, java.awt.event.ActionListener, java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible

public class Histo_3D
extends fr.esrf.tangoatk.widget.attribute.NumberImageViewer

ATK NumberImageViewer inherited class to display history data on 3D.

Author:
Pascal Verdier
See Also:
Serialized Form

Nested Class Summary
protected  class Histo_3D._3D_Point
          A class Defining a 3D point
protected  class Histo_3D._3D_Record
          A class to defined the history record
protected  class Histo_3D.MarkerMenu
           
 class Histo_3D.SetBestFitDialog
          Class Description: Basic Dialog Class to get settings
 
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
 
Fields inherited from class fr.esrf.tangoatk.widget.attribute.NumberImageViewer
axisButton, bestFitMenuItem, buttonPanel, buttonView, dblProfileMenu, displayLogMenuItem, doubleValues, fileButton, fileMenuItem, hBottomCheckMenuItem, hCenterCheckMenuItem, histoButton, histogramMenuItem, hTopCheckMenuItem, imagePanel, imageView, imgMenu, infoMenuItem, lastFileFilter, lastSnapshotLocation, lineProfile2MenuItem, lineProfileMenuItem, lineProfiler, loadButton, loadMenuItem, logValues, negativeMenuItem, noMargin, printButton, printMenuItem, profile2Button, profileButton, profileMode, saveButton, saveDataFileMenuItem, saveMenuItem, selectButton, selectColorButton, selectionColorMenuItem, selectionMaxMenuItem, selectionMenuItem, selectMaxButton, selText, settingsButton, settingsMenuItem, showGradMenuItem, snapToGridMenuItem, startHisto, statusLineMenuItem, tableButton, tableMenuItem, toolbarMenuItem, vCenterCheckMenuItem, vLeftCheckMenuItem, vRigthCheckMenuItem, zoomButton, zoomMenuItem
 
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
Histo_3D(java.awt.Component parent)
          Creates new Image Viewer to be used as a 3D history viewer
Histo_3D(java.awt.Component parent, int nbMeasMax)
          Creates new Image Viewer to be used as a 3D history viewer
 
Method Summary
protected  void addHistoData(fr.esrf.TangoApi.DeviceDataHistory[] devhisto)
          Add new data to history
protected  void addHistoData(double[] values)
          Add data to history
protected  void addHistoData(double[] values, int x_length, int y_length, int dt)
          Add new data to history.
protected  void addHistoData(double[] values, long t)
          Add new data to history.
protected  void addToMenu(javax.swing.JMenuItem jmi)
          Add item to popup menu.
protected  void addToMenu(javax.swing.JRadioButtonMenuItem jrbmi)
          Add item to popup menu.
protected  void bestFitChanged()
          Pure virtual method (do nothing) and could be overrided.
protected  void displayHistory(int y)
          Display a 2D history for specified index
protected  void displayHistory(int[] y)
          Display a 2D history for specified indexes
protected  void displayHistory(java.lang.String name)
          Display a 2D history for specified name
protected  void displayHistory(java.lang.String[] names)
          Display a 2D history for specified names
protected  void displayHistoValues(java.awt.Point p, Histo_3D._3D_Record rec)
          Display value at point
protected  void displaySelectionHistory()
          Display a 2D history for selected index
protected  void displaySpectrum(int t_idx)
          Display a 2D spectrum for specified time
protected  void editGradient()
           
static java.lang.String formatDate(long ms)
          Format the specified time to be displayed.
protected  double getData(int x, int y)
          Return value at point (x, y)
protected  java.util.Vector<Histo_3D._3D_Point> getHisto(int y)
           
protected  Histo_3D._3D_Point getMaxPoint()
          Returns the point where the maximum values has been found.
protected  int getNbRecords()
          Returns the number of measures.
protected  java.lang.String getStringValueFormat()
          return the String display format to display value as C printf
protected  java.lang.String[] getUpperThan(double threshold)
          return and array of line names (or indexes) which at least one measure is over specified threshold.
protected  java.lang.String[] getYLabels()
          Returns Y labels to display pointed name
protected  int getYSize()
          Returns the y size
protected  int getYStep()
          Returns y setp (nb pixels for one measure).
protected  boolean histoIsFull()
           
protected  boolean isInsideImage(java.awt.Point p)
          return false if the point is outside the measurement.
protected  void markerMoved(java.awt.Point p)
          Coudld be overwritten to be trigged on marker move.
 void mouseClicked(java.awt.event.MouseEvent e)
           
 void mouseDragged(java.awt.event.MouseEvent e)
           
 void mousePressed(java.awt.event.MouseEvent e)
           
 void mouseReleased(java.awt.event.MouseEvent e)
           
protected  void readBestFitMinMax()
          Initialize Best Fit with class property.
protected  Histo_3D._3D_Record record3D(int idx)
          Returns the record at index
protected  void resetHistoData()
          Reset history buffer.
protected  void setBestFitMinMax()
          Try to find a best fit (min and max value);
protected  void setBestFitProperty(java.lang.String classname, java.lang.String propname)
          Initialize properties to read best fit
 void setDefaultGradient(fr.esrf.tangoatk.widget.util.Gradient gr)
           
protected  void setDisplayed(boolean[] displayed)
          Set the indexes displayed (in case of not all)
protected  void setHistoryDepth(int nb)
          Set the history depth
protected  void setMarkerMenuText(java.lang.String str)
           
protected  void setMarkerPosition(java.awt.Point p)
          Set the marker at specified position.
protected  void setMarkerText(java.lang.String text)
          Display text associated to the marker position
protected  void setSearchBestFitVisible(boolean b)
          Set visible or not the button in the BestFit dialog.
protected  void setStringValueFormat(java.lang.String format)
          Set the String display format to display value.
protected  void setThresholdSelectionMode(int mode)
           
protected  void setWheelSwitchFormat(java.lang.String format)
           
protected  void setYLabels(java.lang.String[] labels)
          Initialize Y labels to display pointed name
protected  void setYStep(int step)
          Set y setp (nb pixels for one measure).
protected  void showMenu(java.awt.event.MouseEvent e)
          Show the popup menu.
protected  void updateChart()
          Pure virtual method (do nothing) and must be overrided.
protected  void updateImage()
          Update the image of history measurement
protected  boolean yIsInsideImage(int y)
          return false if the y index is outside the measurement.
 
Methods inherited from class fr.esrf.tangoatk.widget.attribute.NumberImageViewer
actionPerformed, addCrossMarker, addHorizontalLineMarker, addRectangleMarker, addRoiListener, addVerticalLineMarker, buildHistogramData, buildProfileData, changeSelectionColor, clearMarkers, clearModel, computeLog, constructLineProfiler, errorChange, fireRoiChange, freePopup, getAutoZoom, getBestFitMax, getBestFitMin, getComponent, getCurrentImageSize, getDescription, getExtendedParam, getExtensionList, getGradient, getGradientAxis, getImageMargin, getImageXCoord, getImageYCoord, getSelection, getSelectionMode, getSettings, getXAxis, getYAxis, getZoom, hasMarker, imageChange, initButtonPanel, initForEditing, initGradient, initImagePanel, initPopupMenu, initStatusLine, isAlignToGrid, isAutoBestFit, isBestFit, isGradientVisible, isLogValues, isNegative, isSelectionEnabled, isShowingMenu, isStatusLineVisible, isToolbarVisible, keyPressed, keyReleased, keyTyped, loadImage, loadSetting, main, mouseEntered, mouseExited, mouseMoved, mulPoint, mulRect, printImage, refreshLineProfile, refreshStatusLine, removeRoiListener, saveSetting, setAlignToGrid, setAutoBestFit, setAutoZoom, setBestFit, setBestFitMinMax, setCrossCursor, setCrossCursorColor, setData, setExtendedParam, setGradient, setGradientVisible, setImageMargin, setLogValues, setMarkerPos, setModel, setNaNcolor, setNegative, setSelection, setSelectionEnabled, setSelectionMode, setShowingMenu, setStatusLineVisible, setToolbarVisible, setVerticalExtent, setZoom, stateChange
 
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
 

Constructor Detail

Histo_3D

public Histo_3D(java.awt.Component parent)
Creates new Image Viewer to be used as a 3D history viewer

Parameters:
parent - Parent component.

Histo_3D

public Histo_3D(java.awt.Component parent,
                int nbMeasMax)
Creates new Image Viewer to be used as a 3D history viewer

Parameters:
parent - Parent component.
nbMeasMax - Nb measure maximum
Method Detail

setMarkerMenuText

protected void setMarkerMenuText(java.lang.String str)

setYLabels

protected void setYLabels(java.lang.String[] labels)
Initialize Y labels to display pointed name


getYLabels

protected java.lang.String[] getYLabels()
Returns Y labels to display pointed name


setBestFitProperty

protected void setBestFitProperty(java.lang.String classname,
                                  java.lang.String propname)
Initialize properties to read best fit

Parameters:
classname - Class name for the property
propname - Property name.

readBestFitMinMax

protected void readBestFitMinMax()
Initialize Best Fit with class property.


setBestFitMinMax

protected void setBestFitMinMax()
Try to find a best fit (min and max value);


setSearchBestFitVisible

protected void setSearchBestFitVisible(boolean b)
Set visible or not the button in the BestFit dialog.


getUpperThan

protected java.lang.String[] getUpperThan(double threshold)
return and array of line names (or indexes) which at least one measure is over specified threshold.

Parameters:
threshold - The specified threshold.

getHisto

protected java.util.Vector<Histo_3D._3D_Point> getHisto(int y)

getMaxPoint

protected Histo_3D._3D_Point getMaxPoint()
Returns the point where the maximum values has been found. In case of several, teh returned point is the first one found.


setMarkerPosition

protected void setMarkerPosition(java.awt.Point p)
Set the marker at specified position.

Parameters:
p - The specified position.

displayHistory

protected void displayHistory(java.lang.String[] names)
Display a 2D history for specified names

Parameters:
names - The specified names

displayHistory

protected void displayHistory(java.lang.String name)
Display a 2D history for specified name

Parameters:
name - The specified name

displayHistory

protected void displayHistory(int y)
Display a 2D history for specified index

Parameters:
y - The specified index

displaySelectionHistory

protected void displaySelectionHistory()
Display a 2D history for selected index


displayHistory

protected void displayHistory(int[] y)
Display a 2D history for specified indexes

Parameters:
y - The specified indexes

displaySpectrum

protected void displaySpectrum(int t_idx)
Display a 2D spectrum for specified time

Parameters:
t_idx - Time index.

setDefaultGradient

public void setDefaultGradient(fr.esrf.tangoatk.widget.util.Gradient gr)

editGradient

protected void editGradient()

setWheelSwitchFormat

protected void setWheelSwitchFormat(java.lang.String format)

setHistoryDepth

protected void setHistoryDepth(int nb)
Set the history depth

Parameters:
nb - Number of attribute mesurements

histoIsFull

protected boolean histoIsFull()

getNbRecords

protected int getNbRecords()
Returns the number of measures.


showMenu

protected void showMenu(java.awt.event.MouseEvent e)
Show the popup menu.


addToMenu

protected void addToMenu(javax.swing.JMenuItem jmi)
Add item to popup menu.


addToMenu

protected void addToMenu(javax.swing.JRadioButtonMenuItem jrbmi)
Add item to popup menu.


setYStep

protected void setYStep(int step)
Set y setp (nb pixels for one measure).


getYStep

protected int getYStep()
Returns y setp (nb pixels for one measure).


getData

protected double getData(int x,
                         int y)
Return value at point (x, y)


getYSize

protected int getYSize()
Returns the y size


setDisplayed

protected void setDisplayed(boolean[] displayed)
Set the indexes displayed (in case of not all)

Parameters:
displayed - Measure[index] is displayed if displayed[index] is true; if null, all are displayed;

updateImage

protected void updateImage()
Update the image of history measurement


setMarkerText

protected void setMarkerText(java.lang.String text)
Display text associated to the marker position

Parameters:
text - The text to be displayed

markerMoved

protected void markerMoved(java.awt.Point p)
Coudld be overwritten to be trigged on marker move.


mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Specified by:
mouseClicked in interface java.awt.event.MouseListener
Overrides:
mouseClicked in class fr.esrf.tangoatk.widget.attribute.NumberImageViewer

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Specified by:
mouseReleased in interface java.awt.event.MouseListener
Overrides:
mouseReleased in class fr.esrf.tangoatk.widget.attribute.NumberImageViewer

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Specified by:
mousePressed in interface java.awt.event.MouseListener
Overrides:
mousePressed in class fr.esrf.tangoatk.widget.attribute.NumberImageViewer

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener
Overrides:
mouseDragged in class fr.esrf.tangoatk.widget.attribute.NumberImageViewer

isInsideImage

protected boolean isInsideImage(java.awt.Point p)
return false if the point is outside the measurement.

Parameters:
p - The specified point

yIsInsideImage

protected boolean yIsInsideImage(int y)
return false if the y index is outside the measurement.

Parameters:
y - The specified index

displayHistoValues

protected void displayHistoValues(java.awt.Point p,
                                  Histo_3D._3D_Record rec)
Display value at point

Parameters:
p - where mouse has clicked.
rec - data at time for x clicked.

addHistoData

protected void addHistoData(double[] values)
Add data to history

Parameters:
values - Measured values (time will be set at call time)

addHistoData

protected void addHistoData(double[] values,
                            long t)
Add new data to history.

Parameters:
values - Measured values
t - Time where values have been measured.

addHistoData

protected void addHistoData(double[] values,
                            int x_length,
                            int y_length,
                            int dt)
Add new data to history.

Parameters:
values - Measured values
x_length - x size used for time
y_length - y size (vertical spectrum size)
dt - decreasing time step in milliseconds

addHistoData

protected void addHistoData(fr.esrf.TangoApi.DeviceDataHistory[] devhisto)
Add new data to history

Parameters:
devhisto - data from read atrribute history.

resetHistoData

protected void resetHistoData()
Reset history buffer.


setStringValueFormat

protected void setStringValueFormat(java.lang.String format)
Set the String display format to display value.

Parameters:
format - String format as C printf

getStringValueFormat

protected java.lang.String getStringValueFormat()
return the String display format to display value as C printf


updateChart

protected void updateChart()
Pure virtual method (do nothing) and must be overrided.


bestFitChanged

protected void bestFitChanged()
Pure virtual method (do nothing) and could be overrided.


record3D

protected Histo_3D._3D_Record record3D(int idx)
Returns the record at index


formatDate

public static java.lang.String formatDate(long ms)
Format the specified time to be displayed.

Parameters:
ms - The specified time (milli seconds since EPOCH)

setThresholdSelectionMode

protected void setThresholdSelectionMode(int mode)

tool_panels
( tool_panels-1.13.jar)