fr.esrf.tangoatk.widget.attribute
Class NumberImageJViewer

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.NumberImageJViewer
All Implemented Interfaces:
IAttributeStateListener, IErrorListener, IImageListener, JDrawable, java.awt.event.ActionListener, java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.MouseWheelListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible

public class NumberImageJViewer
extends javax.swing.JPanel
implements IImageListener, java.awt.event.MouseMotionListener, java.awt.event.MouseListener, java.awt.event.MouseWheelListener, java.awt.event.ActionListener, java.awt.event.KeyListener, JDrawable

A high level class to display a TANGO image and handle several image manipulation function.

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.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  LabelViewer attNameLabel
           
protected  boolean autoBestFit
           
protected  javax.swing.JCheckBox autoBestFitCheck
           
protected  double autoBfMax
           
protected  double autoBfMin
           
protected  boolean autoZoom
           
protected  javax.swing.JLabel avgLabel
           
protected  javax.swing.JButton axisButton
           
protected  javax.swing.JButton axisCloseButton
           
protected  javax.swing.JDialog axisDialog
           
protected  javax.swing.JCheckBox bestFitCheck
           
protected  javax.swing.JCheckBoxMenuItem bestFitMenuItem
           
protected  double bfa0
           
protected  double bfa1
           
protected  double bfMax
           
protected  double bfMin
           
protected  javax.swing.JPanel buttonPanel
           
protected  javax.swing.JScrollPane buttonView
           
protected  javax.swing.JButton cancelButton
           
protected  javax.swing.JPanel cfgPanel
           
protected  double curSelMax
           
protected  double curSelMin
           
protected  javax.swing.JCheckBoxMenuItem displayLogMenuItem
           
protected  double[][] doubleValues
           
protected  javax.swing.JButton fileButton
           
protected  javax.swing.JMenuItem fileMenuItem
           
protected  boolean firstRefresh
           
protected  Gradient gColor
           
protected  int[] gColormap
           
protected  javax.swing.JButton gradButton
           
protected  JGradientViewer gradientTool
           
protected  javax.swing.JLabel gradLabel
           
protected  JGradientEditor gradViewer
           
protected  javax.swing.JButton histoButton
           
protected  javax.swing.JMenuItem histogramMenuItem
           
protected  JImageJ imagePanel
           
protected  javax.swing.JComboBox imageSizeCombo
           
protected  javax.swing.JLabel imageSizeLabel
           
protected  javax.swing.JPopupMenu imgMenu
           
protected  javax.swing.JMenuItem infoMenuItem
           
protected  javax.swing.JMenuItem innerRoiColorMenuItem
           
protected  boolean isBestFit
           
protected  boolean isNegative
           
protected  int iSz
           
protected  java.lang.String lastConfig
           
protected  javax.swing.filechooser.FileFilter lastFileFilter
           
protected  java.lang.String lastSnapshotLocation
           
protected  javax.swing.JMenuItem lineProfileMenuItem
           
protected  LineProfilerViewer lineProfiler
           
protected  javax.swing.event.EventListenerList listenerList
           
protected  javax.swing.JButton loadButton
           
protected  javax.swing.JMenuItem loadMenuItem
           
protected  boolean logValues
           
protected  javax.swing.JLabel maxBestFitLabel
           
protected  javax.swing.JTextField maxBestFitText
           
protected  javax.swing.JLabel minBestFitLabel
           
protected  javax.swing.JTextField minBestFitText
           
protected  INumberImage model
           
protected  javax.swing.JCheckBox negativeCheck
           
protected  javax.swing.JCheckBoxMenuItem negativeMenuItem
           
protected  java.awt.Insets noMargin
           
protected  javax.swing.JButton okButton
           
protected  java.awt.Rectangle oldSelection
           
protected  javax.swing.JMenuItem outerRoiColorMenuItem
           
protected  java.awt.Font panelFont
           
protected  javax.swing.JButton printButton
           
protected  javax.swing.JMenuItem printMenuItem
           
protected  javax.swing.JButton profileButton
           
protected  int profileMode
           
protected  javax.swing.JButton propButton
           
protected  javax.swing.JLabel rangeLabel
           
protected  javax.swing.JMenuItem roiColorMenuItem
           
protected  javax.swing.JButton roiColorsButton
           
protected  javax.swing.JPopupMenu roiColorsMenu
           
protected  javax.swing.JButton saveButton
           
protected  javax.swing.JMenuItem saveDataFileMenuItem
           
protected  javax.swing.JMenuItem saveMenuItem
           
protected  javax.swing.JButton selectButton
           
protected  javax.swing.JMenuItem selectedInnerRoiColorMenuItem
           
protected  javax.swing.JMenuItem selectedOuterRoiColorMenuItem
           
protected  javax.swing.JMenuItem selectedRoiColorMenuItem
           
protected  javax.swing.JMenuItem selectionColorMenuItem
           
protected  javax.swing.JMenuItem selectionMaxMenuItem
           
protected  javax.swing.JMenuItem selectionMenuItem
           
protected  javax.swing.JButton selectMaxButton
           
protected  javax.swing.JLabel selLabel
           
protected  javax.swing.JTextField selText
           
protected  javax.swing.JButton settingsButton
           
protected  javax.swing.JDialog settingsDialog
           
protected  javax.swing.JMenuItem settingsMenuItem
           
protected  javax.swing.JPanel settingsPanel
           
protected  javax.swing.JCheckBoxMenuItem showGradMenuItem
           
protected  boolean showingMenu
           
protected  boolean sigHistogram
           
protected  javax.swing.JCheckBox sigHistogramCheck
           
protected  int startHisto
           
protected  javax.swing.JLabel statusLabel
           
protected  javax.swing.JCheckBoxMenuItem statusLineMenuItem
           
protected  javax.swing.JButton tableButton
           
protected  javax.swing.JFrame tableDialog
           
protected  javax.swing.JMenuItem tableMenuItem
           
protected  JTableRow tablePanel
           
protected  javax.swing.JTabbedPane tabPane
           
protected  javax.swing.JCheckBoxMenuItem toolbarMenuItem
           
protected  boolean userZoom
           
protected  int verticalExtent
           
protected  AxisPanel xAxisPanel
           
protected  AxisPanel yAxisPanel
           
protected  javax.swing.JButton zoomButton
           
protected  javax.swing.JPanel zoomCfgPanel
           
protected  javax.swing.JComboBox zoomCombo
           
protected  javax.swing.JFrame zoomDialog
           
protected  int zoomFactor
           
protected  JImage zoomImage
           
protected  javax.swing.JMenuItem zoomMenuItem
           
protected  javax.swing.JPanel zoomPanel
           
protected  javax.swing.JLabel zoomText
           
protected  javax.swing.JScrollPane zoomView
           
protected  int zoomXOrg
           
protected  int zoomYOrg
           
 
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
NumberImageJViewer()
          Create a new NumberImageViewer
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent evt)
           
 void addRoiListener(IRoiListener l)
           
protected  void adjustToolbarSize()
           
protected  void applySettings()
           
protected  java.lang.String applySettings(CfFileReader f)
           
protected  int bestFit(double v)
           
protected  double[] buildHistogramData()
           
protected  double[] buildProfileData()
           
protected  boolean buildTable()
           
protected  boolean buildZoom()
           
protected  void changeExteriorROIColor()
           
protected  void changeExteriorROISelectionColor()
           
protected  void changeInteriorROIColor()
           
protected  void changeInteriorROISelectionColor()
           
protected  void changeROIColor()
           
protected  void changeROISelectionColor()
           
 void clearModel()
          Removes all listener belonging to the viewer.
protected  void computeAutoZoom()
           
protected  double[][] computeLog(double[][] values)
           
protected  void computeVerticalExtent()
           
protected  void constructLineProfiler()
           
protected  void constructSettingsPanel()
           
protected  void constructTablePanel()
           
protected  void constructZoomPanel()
           
protected  void convertImage()
           
 void errorChange(ErrorEvent errorEvent)
           
 void fireRoiChange()
           
protected  void freePopup()
           
protected  java.awt.image.BufferedImage get8BitImage()
           
 boolean getAutoZoom()
          Determines wheter this image viewer has auto zoom enabled.
 double getBestFitMax()
          Returns current best fit max value (user value)
 double getBestFitMin()
          Returns current best fit min value (user value)
 javax.swing.JComponent getComponent()
          Returns the JComponent that implements this interface.
 java.awt.Dimension getCurrentImageSize()
          Returns the current image size
 double[][] getData(ij.gui.Roi roi)
           
 double[][] getData(ij.gui.Roi roi, double[][] imageData, boolean innerRoi)
           
 java.lang.String getDescription(java.lang.String name)
          Get a description of this extensions.
 java.lang.String getExtendedParam(java.lang.String name)
          Returns the specified parameter value.
protected  java.lang.String getExtension(java.io.File f)
          getExtension returns the extension of a given file, that is the part after the last `.' in the filename.
 java.lang.String[] getExtensionList()
          Returns list of extension name for this objects (Empty array for none).
 Gradient getGradient()
          Returns current colormap
 JLAxis getGradientAxis()
          Returna handle to the Gradient axis.
 java.awt.Insets getImageMargin()
          Returns image margin.
 JImageJ getImagePanel()
           
 int getImageXCoord(int x)
          Converts the component horizontal coordinate to the image coordinate.
 int getImageYCoord(int y)
          Converts the component vertical coordinate to the image coordinate.
protected  java.lang.String getLabelInfoString()
           
 INumberImage getModel()
           
 java.awt.Rectangle getSelection()
          Return current floating rectangle selection
 java.lang.String getSettings()
          returns the configuration as string.
 JLAxis getXAxis()
          Returns a handle to the x axis.
 JLAxis getYAxis()
          Return a handle to the Y axis.
 int getZoom()
          Return the current zoom factor index.
 void imageChange(NumberImageEvent evt)
           
protected  void initButtonPanel()
           
 void initForEditing()
          Call after a component of a JDSwingObject is created, this give a default look and feel for editing.
protected  void initGradient()
           
protected  void initImagePanel()
           
protected  void initPopupMenu()
           
protected  void initStatusLine()
           
 boolean isAutoBestFit()
          Returns true when automatic best fit is enabled
 boolean isBestFit()
          Returns true when best fit is on
 boolean isGradientVisible()
          Returns true when the gradient is visible.
 boolean isLogValues()
           
 boolean isNegative()
          Returns true only if negative image is displayed
 boolean isShowingMenu()
          Returns true is the image viewer menu is displayed when clicking on the right mouse button.
 boolean isStatusLineVisible()
          Returns true when the status line is visible.
 boolean isToolbarVisible()
          Returns true when the toolbar is visible.
 void keyPressed(java.awt.event.KeyEvent e)
           
 void keyReleased(java.awt.event.KeyEvent e)
           
 void keyTyped(java.awt.event.KeyEvent e)
           
protected  void loadButtonActionPerformed()
           
 void loadImage(java.lang.String fileName)
          Load an image (gif,jpg or png) into the viewer.
 java.lang.String loadSetting(java.lang.String filename)
          Load NumberImageViewer settings.
static void main(java.lang.String[] args)
           
 void mouseClicked(java.awt.event.MouseEvent e)
           
 void mouseDragged(java.awt.event.MouseEvent e)
           
 void mouseEntered(java.awt.event.MouseEvent e)
           
 void mouseExited(java.awt.event.MouseEvent e)
           
 void mouseMoved(java.awt.event.MouseEvent e)
           
 void mousePressed(java.awt.event.MouseEvent e)
           
 void mouseReleased(java.awt.event.MouseEvent e)
           
 void mouseWheelMoved(java.awt.event.MouseWheelEvent e)
           
protected  void preComputeBestFit()
           
 void printImage()
          Prints out this image.
protected  void refreshComponents()
           
protected  void refreshLineProfile()
           
protected  void refreshSelectionMinMax()
           
protected  void refreshStatusLine()
           
 void removeRoiListener(IRoiListener l)
           
protected  void saveButtonActionPerformed()
           
protected  void saveEdf(java.lang.String filename)
           
protected  void saveFile()
           
 void saveSetting(java.lang.String filename)
          Save settings.
protected  void selectionChanged()
           
 void setAutoBestFit(boolean b)
          Sets the auto Best fit mode.
 void setAutoZoom(boolean auto)
          Enables or disables the auto zoom.
 void setBestFit(boolean b)
          Displays the image using the whole color range.
 void setBestFitMinMax(double min, double max)
          Sets the value of best fit min and max when automatic best fit is off.
 void setData(double[][] v)
          Sets data to display.
 boolean setExtendedParam(java.lang.String name, java.lang.String value, boolean popupErr)
          Sets the specified param.
 void setGradient(Gradient g)
          Sets the colormap
 void setGradientVisible(boolean b)
          Displays or hides the gradient (right panel).
 void setImageMargin(java.awt.Insets i)
          Sets the image margin.
 void setLogValues(boolean logValues)
           
 void setModel(INumberImage v)
          setModel Set the model.
 void setNegative(boolean b)
          Displays negative image when enabled
 void setSelection(java.awt.Rectangle r)
          Sets the floating selection.
 void setShowingMenu(boolean b)
          True to enable menu displayed when clicking on right mouse button.
 void setStatusLineVisible(boolean b)
          Displays or hides the status line (bottom panel).
 void setToolbarVisible(boolean b)
          Displays or hides the toolbar.
 void setVerticalExtent(int ratio)
          Extend verticaly the image.
 void setZoom(int zoomIndex)
          Sets the image zoom factor (does not affect the zoom dialog).
protected  void showAxisDialog()
           
protected  void showGradientEditor()
           
protected  void showJdrawError(boolean popup, java.lang.String paramName, java.lang.String message)
           
protected  void showPropertyFrame()
           
protected  void showSettings()
           
protected  void showTable()
           
protected  void showZoom()
           
 void stateChange(AttributeStateEvent evt)
           
 
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

model

protected INumberImage model

doubleValues

protected double[][] doubleValues

oldSelection

protected java.awt.Rectangle oldSelection

profileMode

protected int profileMode

showingMenu

protected boolean showingMenu

sigHistogram

protected boolean sigHistogram

isNegative

protected boolean isNegative

startHisto

protected int startHisto

gColor

protected Gradient gColor

gColormap

protected int[] gColormap

iSz

protected int iSz

listenerList

protected javax.swing.event.EventListenerList listenerList

noMargin

protected java.awt.Insets noMargin

autoZoom

protected boolean autoZoom

firstRefresh

protected boolean firstRefresh

userZoom

protected boolean userZoom

verticalExtent

protected int verticalExtent

lastConfig

protected java.lang.String lastConfig

isBestFit

protected boolean isBestFit

autoBestFit

protected boolean autoBestFit

bfMin

protected double bfMin

bfMax

protected double bfMax

autoBfMin

protected double autoBfMin

autoBfMax

protected double autoBfMax

bfa0

protected double bfa0

bfa1

protected double bfa1

curSelMin

protected double curSelMin

curSelMax

protected double curSelMax

imagePanel

protected JImageJ imagePanel

buttonPanel

protected javax.swing.JPanel buttonPanel

selectButton

protected javax.swing.JButton selectButton

selectMaxButton

protected javax.swing.JButton selectMaxButton

roiColorsButton

protected javax.swing.JButton roiColorsButton

roiColorsMenu

protected javax.swing.JPopupMenu roiColorsMenu

roiColorMenuItem

protected javax.swing.JMenuItem roiColorMenuItem

selectedRoiColorMenuItem

protected javax.swing.JMenuItem selectedRoiColorMenuItem

innerRoiColorMenuItem

protected javax.swing.JMenuItem innerRoiColorMenuItem

selectedInnerRoiColorMenuItem

protected javax.swing.JMenuItem selectedInnerRoiColorMenuItem

outerRoiColorMenuItem

protected javax.swing.JMenuItem outerRoiColorMenuItem

selectedOuterRoiColorMenuItem

protected javax.swing.JMenuItem selectedOuterRoiColorMenuItem

fileButton

protected javax.swing.JButton fileButton

zoomButton

protected javax.swing.JButton zoomButton

tableButton

protected javax.swing.JButton tableButton

profileButton

protected javax.swing.JButton profileButton

histoButton

protected javax.swing.JButton histoButton

settingsButton

protected javax.swing.JButton settingsButton

axisButton

protected javax.swing.JButton axisButton

loadButton

protected javax.swing.JButton loadButton

saveButton

protected javax.swing.JButton saveButton

printButton

protected javax.swing.JButton printButton

buttonView

protected javax.swing.JScrollPane buttonView

panelFont

protected java.awt.Font panelFont

cfgPanel

protected javax.swing.JPanel cfgPanel

statusLabel

protected javax.swing.JLabel statusLabel

rangeLabel

protected javax.swing.JLabel rangeLabel

avgLabel

protected javax.swing.JLabel avgLabel

selLabel

protected javax.swing.JLabel selLabel

selText

protected javax.swing.JTextField selText

imgMenu

protected javax.swing.JPopupMenu imgMenu

infoMenuItem

protected javax.swing.JMenuItem infoMenuItem

bestFitMenuItem

protected javax.swing.JCheckBoxMenuItem bestFitMenuItem

negativeMenuItem

protected javax.swing.JCheckBoxMenuItem negativeMenuItem

toolbarMenuItem

protected javax.swing.JCheckBoxMenuItem toolbarMenuItem

statusLineMenuItem

protected javax.swing.JCheckBoxMenuItem statusLineMenuItem

showGradMenuItem

protected javax.swing.JCheckBoxMenuItem showGradMenuItem

selectionMenuItem

protected javax.swing.JMenuItem selectionMenuItem

selectionMaxMenuItem

protected javax.swing.JMenuItem selectionMaxMenuItem

selectionColorMenuItem

protected javax.swing.JMenuItem selectionColorMenuItem

fileMenuItem

protected javax.swing.JMenuItem fileMenuItem

zoomMenuItem

protected javax.swing.JMenuItem zoomMenuItem

tableMenuItem

protected javax.swing.JMenuItem tableMenuItem

lineProfileMenuItem

protected javax.swing.JMenuItem lineProfileMenuItem

histogramMenuItem

protected javax.swing.JMenuItem histogramMenuItem

settingsMenuItem

protected javax.swing.JMenuItem settingsMenuItem

loadMenuItem

protected javax.swing.JMenuItem loadMenuItem

saveMenuItem

protected javax.swing.JMenuItem saveMenuItem

saveDataFileMenuItem

protected javax.swing.JMenuItem saveDataFileMenuItem

printMenuItem

protected javax.swing.JMenuItem printMenuItem

displayLogMenuItem

protected javax.swing.JCheckBoxMenuItem displayLogMenuItem

gradientTool

protected JGradientViewer gradientTool

lineProfiler

protected LineProfilerViewer lineProfiler

zoomDialog

protected javax.swing.JFrame zoomDialog

zoomPanel

protected javax.swing.JPanel zoomPanel

zoomView

protected javax.swing.JScrollPane zoomView

zoomImage

protected JImage zoomImage

zoomCfgPanel

protected javax.swing.JPanel zoomCfgPanel

zoomCombo

protected javax.swing.JComboBox zoomCombo

zoomFactor

protected int zoomFactor

zoomXOrg

protected int zoomXOrg

zoomYOrg

protected int zoomYOrg

zoomText

protected javax.swing.JLabel zoomText

settingsDialog

protected javax.swing.JDialog settingsDialog

settingsPanel

protected javax.swing.JPanel settingsPanel

attNameLabel

protected LabelViewer attNameLabel

propButton

protected javax.swing.JButton propButton

sigHistogramCheck

protected javax.swing.JCheckBox sigHistogramCheck

bestFitCheck

protected javax.swing.JCheckBox bestFitCheck

autoBestFitCheck

protected javax.swing.JCheckBox autoBestFitCheck

minBestFitLabel

protected javax.swing.JLabel minBestFitLabel

minBestFitText

protected javax.swing.JTextField minBestFitText

maxBestFitLabel

protected javax.swing.JLabel maxBestFitLabel

maxBestFitText

protected javax.swing.JTextField maxBestFitText

negativeCheck

protected javax.swing.JCheckBox negativeCheck

imageSizeCombo

protected javax.swing.JComboBox imageSizeCombo

imageSizeLabel

protected javax.swing.JLabel imageSizeLabel

gradViewer

protected JGradientEditor gradViewer

gradButton

protected javax.swing.JButton gradButton

gradLabel

protected javax.swing.JLabel gradLabel

okButton

protected javax.swing.JButton okButton

cancelButton

protected javax.swing.JButton cancelButton

axisDialog

protected javax.swing.JDialog axisDialog

tabPane

protected javax.swing.JTabbedPane tabPane

xAxisPanel

protected AxisPanel xAxisPanel

yAxisPanel

protected AxisPanel yAxisPanel

axisCloseButton

protected javax.swing.JButton axisCloseButton

tableDialog

protected javax.swing.JFrame tableDialog

tablePanel

protected JTableRow tablePanel

lastSnapshotLocation

protected java.lang.String lastSnapshotLocation

lastFileFilter

protected javax.swing.filechooser.FileFilter lastFileFilter

logValues

protected boolean logValues
Constructor Detail

NumberImageJViewer

public NumberImageJViewer()
Create a new NumberImageViewer

Method Detail

initImagePanel

protected void initImagePanel()

initButtonPanel

protected void initButtonPanel()

initGradient

protected void initGradient()

initStatusLine

protected void initStatusLine()

initPopupMenu

protected void initPopupMenu()

initForEditing

public void initForEditing()
Description copied from interface: JDrawable
Call after a component of a JDSwingObject is created, this give a default look and feel for editing.

Specified by:
initForEditing in interface JDrawable

getComponent

public javax.swing.JComponent getComponent()
Description copied from interface: JDrawable
Returns the JComponent that implements this interface.

Specified by:
getComponent in interface JDrawable

getDescription

public java.lang.String getDescription(java.lang.String name)
Description copied from interface: JDrawable
Get a description of this extensions.

Specified by:
getDescription in interface JDrawable
Parameters:
name - Extension name
Returns:
Empty string for no description.

getExtensionList

public java.lang.String[] getExtensionList()
Description copied from interface: JDrawable
Returns list of extension name for this objects (Empty array for none).

Specified by:
getExtensionList in interface JDrawable

setExtendedParam

public boolean setExtendedParam(java.lang.String name,
                                java.lang.String value,
                                boolean popupErr)
Description copied from interface: JDrawable
Sets the specified param.

Specified by:
setExtendedParam in interface JDrawable
Parameters:
name - Parameter name (Case unsensitive).
value - Parameter value.
popupErr - true when the JDrawable should display a popup if the parameter value is incorrect, false otherwise. Note that the JDrawable must not display an error message if the parameter does not exists even if popupAllowed is true.
Returns:
true if parameters has been succesfully applied, false otherwise.

getExtendedParam

public java.lang.String getExtendedParam(java.lang.String name)
Description copied from interface: JDrawable
Returns the specified parameter value.

Specified by:
getExtendedParam in interface JDrawable
Parameters:
name - Param name (Case unsensitive).
Returns:
Empty string if not exists, the value otherwise.

showJdrawError

protected void showJdrawError(boolean popup,
                              java.lang.String paramName,
                              java.lang.String message)

addRoiListener

public void addRoiListener(IRoiListener l)

removeRoiListener

public void removeRoiListener(IRoiListener l)

fireRoiChange

public void fireRoiChange()

setBestFit

public void setBestFit(boolean b)
Displays the image using the whole color range.

Parameters:
b - Best fit toggle

isBestFit

public boolean isBestFit()
Returns true when best fit is on

Returns:
Best fit state

setAutoBestFit

public void setAutoBestFit(boolean b)
Sets the auto Best fit mode. Computes maximum and minimum value of the image when enabled else uses the min and max best fit user values.

Parameters:
b - True to enable auto best fit

isAutoBestFit

public boolean isAutoBestFit()
Returns true when automatic best fit is enabled

Returns:
Auto best fit state

setBestFitMinMax

public void setBestFitMinMax(double min,
                             double max)
Sets the value of best fit min and max when automatic best fit is off.

Parameters:
min - Minimum value
max - Maximum value

getBestFitMin

public double getBestFitMin()
Returns current best fit min value (user value)

Returns:
Minimum value

getBestFitMax

public double getBestFitMax()
Returns current best fit max value (user value)

Returns:
Maximum value

setGradient

public void setGradient(Gradient g)
Sets the colormap

Parameters:
g - New gradient colormap

getGradient

public Gradient getGradient()
Returns current colormap

Returns:
Gradient object

setNegative

public void setNegative(boolean b)
Displays negative image when enabled

Parameters:
b - True for negtive image

isNegative

public boolean isNegative()
Returns true only if negative image is displayed

Returns:
True when negative

setToolbarVisible

public void setToolbarVisible(boolean b)
Displays or hides the toolbar.

Parameters:
b - True if toolbar is displayed

isToolbarVisible

public boolean isToolbarVisible()
Returns true when the toolbar is visible.

Returns:
Toolbar visible state

setStatusLineVisible

public void setStatusLineVisible(boolean b)
Displays or hides the status line (bottom panel).

Parameters:
b - True if status line is displayed

isStatusLineVisible

public boolean isStatusLineVisible()
Returns true when the status line is visible.

Returns:
Status line visible state

setGradientVisible

public void setGradientVisible(boolean b)
Displays or hides the gradient (right panel).

Parameters:
b - True if status line is displayed

isGradientVisible

public boolean isGradientVisible()
Returns true when the gradient is visible.


setShowingMenu

public void setShowingMenu(boolean b)
True to enable menu displayed when clicking on right mouse button.

Parameters:
b - True to enable the menu

setZoom

public void setZoom(int zoomIndex)
Sets the image zoom factor (does not affect the zoom dialog). If you want to start you viewer with a fixed zoom factor, you have to call setZoom() before setModel().
 Possible zoomIndex values are:
   0 : 800%
   1 : 400%
   2 : 200%
   3 : 100%
   4 : 50%
   5 : 25%
   6 : 12.5%
 

Parameters:
zoomIndex - ZoomFactor index (see description).

getZoom

public int getZoom()
Return the current zoom factor index.

See Also:
setZoom(int)

setAutoZoom

public void setAutoZoom(boolean auto)
Enables or disables the auto zoom. When enabled, the image size (zoom) is automatically adjusted according to the component size. The calcul of the size is triggered by a call to setData() or imageChange().

Parameters:
auto - AutoZoom flag

getAutoZoom

public boolean getAutoZoom()
Determines wheter this image viewer has auto zoom enabled.

See Also:
setAutoZoom(boolean)

isShowingMenu

public boolean isShowingMenu()
Returns true is the image viewer menu is displayed when clicking on the right mouse button.

Returns:
True is menu is enabled

getImageMargin

public java.awt.Insets getImageMargin()
Returns image margin.

Returns:
Mergin

setImageMargin

public void setImageMargin(java.awt.Insets i)
Sets the image margin.

Parameters:
i - Image margin

getCurrentImageSize

public java.awt.Dimension getCurrentImageSize()
Returns the current image size

Returns:
Current image size

setSelection

public void setSelection(java.awt.Rectangle r)
Sets the floating selection.

Parameters:
r - Rectangle to select

getSelection

public java.awt.Rectangle getSelection()
Return current floating rectangle selection

Returns:
Selection rectangle, Null is returned when nothing is selected.

setData

public void setData(double[][] v)
Sets data to display.

Parameters:
v - Handle to data

loadImage

public void loadImage(java.lang.String fileName)
               throws java.io.IOException
Load an image (gif,jpg or png) into the viewer. For color image the green field is taken.

Parameters:
fileName - File to be loaded
Throws:
java.io.IOException - Exception thrown in case of failure

getImagePanel

public JImageJ getImagePanel()
Returns:
the imagePanel

getXAxis

public JLAxis getXAxis()
Returns a handle to the x axis.


getYAxis

public JLAxis getYAxis()
Return a handle to the Y axis.


getGradientAxis

public JLAxis getGradientAxis()
Returna handle to the Gradient axis.


getImageXCoord

public int getImageXCoord(int x)
Converts the component horizontal coordinate to the image coordinate.

Parameters:
x - Component horizontal coordinate

getImageYCoord

public int getImageYCoord(int y)
Converts the component vertical coordinate to the image coordinate.

Parameters:
y - Component vertical coordinate

setVerticalExtent

public void setVerticalExtent(int ratio)
Extend verticaly the image.

Parameters:
ratio - Vertical extent ration

adjustToolbarSize

protected void adjustToolbarSize()

freePopup

protected void freePopup()

buildProfileData

protected double[] buildProfileData()

buildHistogramData

protected double[] buildHistogramData()

refreshLineProfile

protected void refreshLineProfile()

refreshSelectionMinMax

protected void refreshSelectionMinMax()

refreshComponents

protected void refreshComponents()

selectionChanged

protected void selectionChanged()

refreshStatusLine

protected void refreshStatusLine()

showZoom

protected void showZoom()

applySettings

protected void applySettings()

saveSetting

public void saveSetting(java.lang.String filename)
Save settings.

Parameters:
filename - file to be saved.

getSettings

public java.lang.String getSettings()
returns the configuration as string.

See Also:
saveSetting(java.lang.String)

loadSetting

public java.lang.String loadSetting(java.lang.String filename)
Load NumberImageViewer settings.

Parameters:
filename - file to be read
Returns:
An error string or An empty string when succes

applySettings

protected java.lang.String applySettings(CfFileReader f)

saveButtonActionPerformed

protected void saveButtonActionPerformed()

loadButtonActionPerformed

protected void loadButtonActionPerformed()

showAxisDialog

protected void showAxisDialog()

showSettings

protected void showSettings()

getData

public double[][] getData(ij.gui.Roi roi)

getData

public double[][] getData(ij.gui.Roi roi,
                          double[][] imageData,
                          boolean innerRoi)

buildTable

protected boolean buildTable()

showTable

protected void showTable()

showPropertyFrame

protected void showPropertyFrame()

showGradientEditor

protected void showGradientEditor()

constructLineProfiler

protected void constructLineProfiler()

constructTablePanel

protected void constructTablePanel()

constructZoomPanel

protected void constructZoomPanel()

constructSettingsPanel

protected void constructSettingsPanel()

getExtension

protected java.lang.String getExtension(java.io.File f)
getExtension returns the extension of a given file, that is the part after the last `.' in the filename.

Parameters:
f - a File value
Returns:
a String value

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent evt)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Specified by:
mouseExited in interface java.awt.event.MouseListener

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseWheelMoved

public void mouseWheelMoved(java.awt.event.MouseWheelEvent e)
Specified by:
mouseWheelMoved in interface java.awt.event.MouseWheelListener

keyPressed

public void keyPressed(java.awt.event.KeyEvent e)
Specified by:
keyPressed in interface java.awt.event.KeyListener

keyTyped

public void keyTyped(java.awt.event.KeyEvent e)
Specified by:
keyTyped in interface java.awt.event.KeyListener

keyReleased

public void keyReleased(java.awt.event.KeyEvent e)
Specified by:
keyReleased in interface java.awt.event.KeyListener

errorChange

public void errorChange(ErrorEvent errorEvent)
Specified by:
errorChange in interface IErrorListener

stateChange

public void stateChange(AttributeStateEvent evt)
Specified by:
stateChange in interface IAttributeStateListener

imageChange

public void imageChange(NumberImageEvent evt)
Specified by:
imageChange in interface IImageListener

setModel

public void setModel(INumberImage v)
setModel Set the model.

Parameters:
v - Value to assign to model. This image must have a height equals to 2.

getModel

public INumberImage getModel()

clearModel

public void clearModel()
Removes all listener belonging to the viewer.


saveEdf

protected void saveEdf(java.lang.String filename)

getLabelInfoString

protected java.lang.String getLabelInfoString()

computeVerticalExtent

protected void computeVerticalExtent()

computeAutoZoom

protected void computeAutoZoom()

preComputeBestFit

protected void preComputeBestFit()

bestFit

protected int bestFit(double v)

buildZoom

protected boolean buildZoom()

saveFile

protected void saveFile()

get8BitImage

protected java.awt.image.BufferedImage get8BitImage()

convertImage

protected void convertImage()

printImage

public void printImage()
Prints out this image.


isLogValues

public boolean isLogValues()
Returns:
the logValues

setLogValues

public void setLogValues(boolean logValues)
Parameters:
logValues - the logValues to set

computeLog

protected double[][] computeLog(double[][] values)

changeROIColor

protected void changeROIColor()

changeROISelectionColor

protected void changeROISelectionColor()

changeInteriorROIColor

protected void changeInteriorROIColor()

changeInteriorROISelectionColor

protected void changeInteriorROISelectionColor()

changeExteriorROIColor

protected void changeExteriorROIColor()

changeExteriorROISelectionColor

protected void changeExteriorROISelectionColor()

main

public static void main(java.lang.String[] args)