Class IntensityGraphFigure

java.lang.Object
org.eclipse.draw2d.Figure
org.csstudio.swt.widgets.figures.IntensityGraphFigure
All Implemented Interfaces:
Introspectable, org.eclipse.draw2d.IFigure

public class IntensityGraphFigure extends org.eclipse.draw2d.Figure implements Introspectable
An intensity graph figure.
  • Constructor Details

    • IntensityGraphFigure

      public IntensityGraphFigure()
    • IntensityGraphFigure

      public IntensityGraphFigure(boolean runMode)
  • Method Details

    • addProfileDataListener

      public void addProfileDataListener(IntensityGraphFigure.IProfileDataChangeLisenter listener)
    • addPixelInfoListener

      public void addPixelInfoListener(IntensityGraphFigure.IPixelInfoListener listener)
    • addPixelInfoProvider

      public void addPixelInfoProvider(IntensityGraphFigure.IPixelInfoProvider pixelInfoProvider)
    • addCroppedDataSizeListener

      public void addCroppedDataSizeListener(IntensityGraphFigure.ICroppedDataSizeListener listener)
    • 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

      public void removeROI(String name)
    • setROIVisible

      public void setROIVisible(String name, boolean visible)
    • dispose

      public void dispose()
    • calcRGBPixel

      protected int calcRGBPixel(IPrimaryArrayWrapper dataArray, double max, double min, int index)
    • getColorMap

      public ColorMap 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

      public IntensityGraphFigure.GraphArea 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:
      layout in class org.eclipse.draw2d.Figure
    • setColorMap

      public void setColorMap(ColorMap colorMap)
    • 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

      public void setDataArray(IPrimaryArrayWrapper dataWrapper)
      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

      public void setFont(Font f)
      Specified by:
      setFont in interface org.eclipse.draw2d.IFigure
      Overrides:
      setFont in class org.eclipse.draw2d.Figure
    • setMin

      public void setMin(double min)
    • setROIColor

      public void setROIColor(Color roiColor)
      Set color of ROI figures.
    • getRoiColor

      public Color getRoiColor()
    • setROIDataBounds

      public void setROIDataBounds(String name, int xIndex, int yIndex, int width, int height)
    • getROI

      public ROIFigure getROI(String name)
    • setRunMode

      public void setRunMode(boolean runMode)
    • setShowRamp

      public void setShowRamp(boolean show)
    • getBeanInfo

      public BeanInfo getBeanInfo() throws IntrospectionException
      Specified by:
      getBeanInfo in interface Introspectable
      Throws:
      IntrospectionException
    • getColorDepth

      public IntensityGraphFigure.ColorDepth getColorDepth()
      Returns:
      the colorDepth
    • setColorDepth

      public void setColorDepth(IntensityGraphFigure.ColorDepth colorDepth)
      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()