Class PlotImageService

java.lang.Object
org.eclipse.ui.services.AbstractServiceFactory
org.dawnsci.plotting.services.PlotImageService
All Implemented Interfaces:
IFileIconService, IPlotImageService

public class PlotImageService extends org.eclipse.ui.services.AbstractServiceFactory implements IPlotImageService
A service to provide SWT Image objects for 2D data.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    protected static class 
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    create(Class serviceInterface, org.eclipse.ui.services.IServiceLocator parentLocator, org.eclipse.ui.services.IServiceLocator locator)
     
    org.eclipse.january.dataset.IDataset
    Create dataset from buffered image
    org.eclipse.swt.graphics.Image
    Create image from buffered image
    org.eclipse.swt.graphics.Image
    createImage(File f, int width, int height)
    Create a square image from a specified file, f of given side size, size in pixels.
    org.eclipse.swt.graphics.Image
    createImageSWT(org.eclipse.january.dataset.IDataset thumbnail, ImageServiceBean bean)
    Modified from fable
    org.eclipse.ui.services.IDisposable
    Creates an object which may be used to cache the plotting system when looping over a stack and getting many images.
    org.eclipse.swt.graphics.Image
    Returns the icon to use for a given file, uses eclipse and OS icons, supports directories.
    org.eclipse.swt.graphics.Image
    Returns the icon to use for a given file, uses eclipse and OS icons, supports directories.
    org.eclipse.swt.graphics.Image
    Main method for thumbnails and other images of plots which must have a certain size.
    org.eclipse.january.dataset.Dataset
    getThumbnail(org.eclipse.january.dataset.IDataset ds, int w, int h)
    Get a thumbnail Dataset of square shape.
    static boolean
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PlotImageService

      public PlotImageService()
  • Method Details

    • createImage

      public org.eclipse.swt.graphics.Image createImage(File f, int width, int height)
      Description copied from interface: IPlotImageService
      Create a square image from a specified file, f of given side size, size in pixels.
      Specified by:
      createImage in interface IPlotImageService
      Parameters:
      f -
      Returns:
    • getThumbnail

      public org.eclipse.january.dataset.Dataset getThumbnail(org.eclipse.january.dataset.IDataset ds, int w, int h)
      Description copied from interface: IPlotImageService
      Get a thumbnail Dataset of square shape.
      Specified by:
      getThumbnail in interface IPlotImageService
      Parameters:
      ds - - must be 2D set
      Returns:
    • createImageSWT

      public org.eclipse.swt.graphics.Image createImageSWT(org.eclipse.january.dataset.IDataset thumbnail, ImageServiceBean bean) throws Exception
      Modified from fable
      Parameters:
      thumbnail -
      Returns:
      Throws:
      Exception
    • create

      public Object create(Class serviceInterface, org.eclipse.ui.services.IServiceLocator parentLocator, org.eclipse.ui.services.IServiceLocator locator)
      Specified by:
      create in class org.eclipse.ui.services.AbstractServiceFactory
    • getImage

      public org.eclipse.swt.graphics.Image getImage(PlotImageData data) throws Exception
      Description copied from interface: IPlotImageService
      Main method for thumbnails and other images of plots which must have a certain size. Deals with 1D and 2D, including surfaces. THREAD SAFE
      Specified by:
      getImage in interface IPlotImageService
      Returns:
      Throws:
      Exception
    • createPlotDisposable

      public org.eclipse.ui.services.IDisposable createPlotDisposable(String plotName) throws Exception
      Description copied from interface: IPlotImageService
      Creates an object which may be used to cache the plotting system when looping over a stack and getting many images. For instance when exporting surface or 1D plots. This IDisposable is then set in the call to PlotImageData to make it more efficient. THREAD SAFE
      Specified by:
      createPlotDisposable in interface IPlotImageService
      Parameters:
      plotName - to use to look up plotting system (can be null)
      Returns:
      Throws:
      Exception
    • getIconForFile

      public org.eclipse.swt.graphics.Image getIconForFile(File file)
      Description copied from interface: IFileIconService
      Returns the icon to use for a given file, uses eclipse and OS icons, supports directories.
      Specified by:
      getIconForFile in interface IFileIconService
    • createImage

      public org.eclipse.swt.graphics.Image createImage(BufferedImage image)
      Description copied from interface: IPlotImageService
      Create image from buffered image
      Specified by:
      createImage in interface IPlotImageService
      Parameters:
      image -
      Returns:
      image
    • createDataset

      public org.eclipse.january.dataset.IDataset createDataset(BufferedImage bufferedImage)
      Description copied from interface: IPlotImageService
      Create dataset from buffered image
      Specified by:
      createDataset in interface IPlotImageService
      Parameters:
      bufferedImage -
      Returns:
      dataset
    • isWindowsOS

      public static boolean isWindowsOS()
      Returns:
      true if windows
    • getIconForFile

      public org.eclipse.swt.graphics.Image getIconForFile(String path)
      Description copied from interface: IFileIconService
      Returns the icon to use for a given file, uses eclipse and OS icons, supports directories.
      Specified by:
      getIconForFile in interface IFileIconService