Package org.csstudio.swt.widgets.figures
Class IntensityGraphFigure
java.lang.Object
org.eclipse.draw2d.Figure
org.csstudio.swt.widgets.figures.IntensityGraphFigure
- All Implemented Interfaces:
Introspectable,org.eclipse.draw2d.IFigure
An intensity graph figure.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumColor depth of the image data in RGB1 mode, since SWT only support 8 bit color depth, it has to convert all data to [0,255].classstatic interfacestatic interfaceInterface for notifications about a 'Pixel'static interfacestatic interfacestatic interfaceProvides info to be displayed on ROI label.static interfaceROI listener which will be notified whenever ROI moved.classInformation about one 'Pixel' in the graphNested classes/interfaces inherited from class org.eclipse.draw2d.Figure
org.eclipse.draw2d.Figure.FigureIterator, org.eclipse.draw2d.Figure.IdentitySearch, org.eclipse.draw2d.Figure.ReverseFigureChildrenIteratorNested classes/interfaces inherited from interface org.eclipse.draw2d.IFigure
org.eclipse.draw2d.IFigure.NoInsets -
Field Summary
Fields inherited from class org.eclipse.draw2d.Figure
bgColor, border, bounds, fgColor, flags, font, MAX_FLAG, maxSize, minSize, NO_MANAGER, prefSize, toolTipFields inherited from interface org.eclipse.draw2d.IFigure
MAX_DIMENSION, MIN_DIMENSION, NO_INSETS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidaddPixelInfoProvider(IntensityGraphFigure.IPixelInfoProvider pixelInfoProvider) voidvoidaddROI(String name, IntensityGraphFigure.IROIListener roiListener, IntensityGraphFigure.IROIInfoProvider roiInfoProvider) Add a new ROI to the graph.protected intcalcRGBPixel(IPrimaryArrayWrapper dataArray, double max, double min, int index) voiddispose()intintintintdouble[]intintorg.eclipse.draw2d.geometry.DimensiondoublegetMax()doublegetMin()getPixelInfo(int xIndex, int yIndex, double xCoordinate, double yCoordinate, double pixelValue) final org.eclipse.nebula.visualization.xygraph.figures.AxisgetXAxis()final org.eclipse.nebula.visualization.xygraph.figures.AxisgetYAxis()booleanbooleanbooleanbooleanIf it is profiling on single pixel.protected voidlayout()voidvoidsetColorDepth(IntensityGraphFigure.ColorDepth colorDepth) Set Color depth of the image.voidsetColorMap(ColorMap colorMap) voidsetCropBottom(int cropBottom) voidsetCropLeft(int cropLeft) voidsetCropRight(int cropRight) voidsetCropTop(int cropTop) voidsetDataArray(byte[] data) Set the byte[] data array for the intensity graph.voidsetDataArray(double[] data) Set the double[] data array for the intensity graph.voidsetDataArray(float[] data) Set the float[] data array for the intensity graph.voidsetDataArray(int[] data) Set the int[] data array for the intensity graph.voidsetDataArray(long[] data) Set the long[] data array for the intensity graph.voidsetDataArray(short[] data) Set the short[] data array for the intensity graph.voidsetDataArray(IPrimaryArrayWrapper dataWrapper) Set the data array wrapper for the intensity graph.voidsetDataHeight(int dataHeight) voidsetDataWidth(int dataWidth) voidvoidsetInRGBMode(boolean inRGBMode) Set if the input data is in RGB mode.voidsetMax(double max) voidsetMin(double min) voidsetROIColor(Color roiColor) Set color of ROI figures.voidsetROIDataBounds(String name, int xIndex, int yIndex, int width, int height) voidsetROIVisible(String name, boolean visible) voidsetRunMode(boolean runMode) voidsetShowRamp(boolean show) voidsetSingleLineProfiling(boolean isSingleLineProfiling) Profile on single pixel.protected voidMethods inherited from class org.eclipse.draw2d.Figure
add, add, add, add, addAncestorListener, addCoordinateListener, addFigureListener, addFocusListener, addKeyListener, addLayoutListener, addListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, containsPoint, containsPoint, erase, findDescendantAtExcluding, findFigureAt, findFigureAt, findFigureAt, findFigureAtExcluding, findMouseEventTargetAt, findMouseEventTargetInDescendantsAt, fireCoordinateSystemChanged, fireFigureMoved, fireMoved, firePropertyChange, firePropertyChange, firePropertyChange, getBackgroundColor, getBorder, getBounds, getChildren, getChildrenRevIterable, getClientArea, getClientArea, getClippingStrategy, getCursor, getFlag, getFont, getForegroundColor, getInsets, getLayoutManager, getListeners, getListenersIterable, getLocalBackgroundColor, getLocalFont, getLocalForegroundColor, getLocation, getMaximumSize, getMinimumSize, getMinimumSize, getParent, getPreferredSize, getPreferredSize, getSize, getToolTip, getUpdateManager, handleFocusGained, handleFocusLost, handleKeyPressed, handleKeyReleased, handleMouseDoubleClicked, handleMouseDragged, handleMouseEntered, handleMouseExited, handleMouseHover, handleMouseMoved, handleMousePressed, handleMouseReleased, hasFocus, internalGetEventDispatcher, intersects, invalidate, invalidateTree, isCoordinateSystem, isEnabled, isFocusTraversable, isMirrored, isMouseEventTarget, isOpaque, isRequestFocusEnabled, isShowing, isValid, isValidationRoot, isVisible, optimizeClip, paint, paintBorder, paintChildren, paintClientArea, paintFigure, primTranslate, remove, removeAll, removeAncestorListener, removeCoordinateListener, removeFigureListener, removeFocusListener, removeKeyListener, removeLayoutListener, removeListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, revalidate, setBackgroundColor, setBorder, setBounds, setChildrenDirection, setChildrenEnabled, setChildrenOrientation, setClippingStrategy, setConstraint, setCursor, setEnabled, setFlag, setFocusTraversable, setForegroundColor, setLayoutManager, setLocation, setMaximumSize, setMinimumSize, setOpaque, setParent, setPreferredSize, setPreferredSize, setRequestFocusEnabled, setSize, setSize, setToolTip, setValid, setVisible, translate, translateFromParent, translateToAbsolute, translateToParent, translateToRelative, useLocalCoordinates, validate
-
Constructor Details
-
IntensityGraphFigure
public IntensityGraphFigure() -
IntensityGraphFigure
public IntensityGraphFigure(boolean runMode)
-
-
Method Details
-
addProfileDataListener
-
addPixelInfoListener
-
addPixelInfoProvider
-
addCroppedDataSizeListener
-
addROI
public void addROI(String name, IntensityGraphFigure.IROIListener roiListener, IntensityGraphFigure.IROIInfoProvider roiInfoProvider) Add a new ROI to the graph.- Parameters:
name- name of the ROI. It must be unique for this graph.roiListener- listener on ROI updates. Can be null.roiInfoProvider- provides information for the ROI. Can be null.
-
removeROI
-
setROIVisible
-
dispose
public void dispose() -
calcRGBPixel
-
getColorMap
-
getCropBottom
public int getCropBottom() -
getCropLeft
public int getCropLeft() -
getCropRight
public int getCropRight() -
getCropTop
public int getCropTop() -
getDataArray
public double[] getDataArray() -
getDataHeight
public int getDataHeight() -
getDataWidth
public int getDataWidth() -
getGraphArea
-
getGraphAreaInsets
public org.eclipse.draw2d.geometry.Dimension getGraphAreaInsets()- Returns:
- the two dimension insets (cropped_width, cropped_height) of graph area
-
getMax
public double getMax() -
getMin
public double getMin() -
getXAxis
public final org.eclipse.nebula.visualization.xygraph.figures.Axis getXAxis() -
getYAxis
public final org.eclipse.nebula.visualization.xygraph.figures.Axis getYAxis() -
isInRGBMode
public boolean isInRGBMode()- Returns:
- true if the input data is in RGB mode. For example, the input data is a 1D array of [RGBRGBRGBRGB...]
-
isRunMode
public boolean isRunMode() -
isShowRamp
public boolean isShowRamp() -
layout
protected void layout()- Overrides:
layoutin classorg.eclipse.draw2d.Figure
-
setColorMap
-
setCropBottom
public void setCropBottom(int cropBottom) -
setCropLeft
public void setCropLeft(int cropLeft) -
setCropRight
public void setCropRight(int cropRight) -
setCropTop
public void setCropTop(int cropTop) -
setDataArray
public void setDataArray(double[] data) Set the double[] data array for the intensity graph. It must be called in UI thread. Warning: for big image for example 1024*768, it may takes several milliseconds (10-50ms) to paint the image. If this is called too fast that exceeds the painting capability, it may cause memory leaking.- Parameters:
data- the dataArray to set
-
setDataArray
public void setDataArray(short[] data) Set the short[] data array for the intensity graph. It must be called in UI thread. Warning: for big image for example 1024*768, it may takes several milliseconds (10-50ms) to paint the image. If this is called too fast that exceeds the painting capability, it may cause memory leaking.- Parameters:
data- the dataArray to set
-
setDataArray
public void setDataArray(byte[] data) Set the byte[] data array for the intensity graph. It must be called in UI thread. Warning: for big image for example 1024*768, it may takes several milliseconds (10-50ms) to paint the image. If this is called too fast that exceeds the painting capability, it may cause memory leaking.- Parameters:
data- the dataArray to set
-
setDataArray
public void setDataArray(int[] data) Set the int[] data array for the intensity graph. It must be called in UI thread. Warning: for big image for example 1024*768, it may takes several milliseconds (10-50ms) to paint the image. If this is called too fast that exceeds the painting capability, it may cause memory leaking.- Parameters:
data- the dataArray to set
-
setDataArray
public void setDataArray(long[] data) Set the long[] data array for the intensity graph. It must be called in UI thread. Warning: for big image for example 1024*768, it may takes several milliseconds (10-50ms) to paint the image. If this is called too fast that exceeds the painting capability, it may cause memory leaking.- Parameters:
data- the dataArray to set
-
setDataArray
public void setDataArray(float[] data) Set the float[] data array for the intensity graph. It must be called in UI thread. Warning: for big image for example 1024*768, it may takes several milliseconds (10-50ms) to paint the image. If this is called too fast that exceeds the painting capability, it may cause memory leaking.- Parameters:
data- the dataArray to set
-
setDataArray
Set the data array wrapper for the intensity graph. It must be called in UI thread. Warning: for big image for example 1024*768, it may takes several milliseconds (10-50ms) to paint the image. If this is called too fast that exceeds the painting capability, it may cause memory leaking. -
setDataHeight
public void setDataHeight(int dataHeight) - Parameters:
dataHeight- the dataHeight to set
-
setDataWidth
public void setDataWidth(int dataWidth) -
setInRGBMode
public void setInRGBMode(boolean inRGBMode) Set if the input data is in RGB mode. For example, the input data is a 1D array of [RGBRGBRGBRGB...]. If it is true, the color of the pixel will come from the data directly and the color map will be ignored.- Parameters:
inRGBMode- true if the input data in RGB mode.
-
setMax
public void setMax(double max) - Parameters:
max- the max to set
-
setFont
- Specified by:
setFontin interfaceorg.eclipse.draw2d.IFigure- Overrides:
setFontin classorg.eclipse.draw2d.Figure
-
setMin
public void setMin(double min) -
setROIColor
Set color of ROI figures. -
getRoiColor
-
setROIDataBounds
-
getROI
-
setRunMode
public void setRunMode(boolean runMode) -
setShowRamp
public void setShowRamp(boolean show) -
getBeanInfo
- Specified by:
getBeanInfoin interfaceIntrospectable- Throws:
IntrospectionException
-
getColorDepth
- Returns:
- the colorDepth
-
setColorDepth
Set Color depth of the image. See http://en.wikipedia.org/wiki/Color_depth- Parameters:
colorDepth- the colorDepth to set
-
isSingleLineProfiling
public boolean isSingleLineProfiling()If it is profiling on single pixel.- Returns:
- the isSinglePixelProfiling
-
setSingleLineProfiling
public void setSingleLineProfiling(boolean isSingleLineProfiling) Profile on single pixel.- Parameters:
isSingleLineProfiling- the isSinglePixelProfiling to set
-
getPixelInfo
public String getPixelInfo(int xIndex, int yIndex, double xCoordinate, double yCoordinate, double pixelValue) -
updateCroppedDataSize
protected void updateCroppedDataSize()
-