Package org.dawnsci.plotting.services
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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreate(Class serviceInterface, org.eclipse.ui.services.IServiceLocator parentLocator, org.eclipse.ui.services.IServiceLocator locator) org.eclipse.january.dataset.IDatasetcreateDataset(BufferedImage bufferedImage) Create dataset from buffered imageorg.eclipse.swt.graphics.ImagecreateImage(BufferedImage image) Create image from buffered imageorg.eclipse.swt.graphics.ImagecreateImage(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.ImagecreateImageSWT(org.eclipse.january.dataset.IDataset thumbnail, ImageServiceBean bean) Modified from fableorg.eclipse.ui.services.IDisposablecreatePlotDisposable(String plotName) 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.ImagegetIconForFile(File file) Returns the icon to use for a given file, uses eclipse and OS icons, supports directories.org.eclipse.swt.graphics.ImagegetIconForFile(String path) Returns the icon to use for a given file, uses eclipse and OS icons, supports directories.org.eclipse.swt.graphics.ImagegetImage(PlotImageData data) Main method for thumbnails and other images of plots which must have a certain size.org.eclipse.january.dataset.DatasetgetThumbnail(org.eclipse.january.dataset.IDataset ds, int w, int h) Get a thumbnail Dataset of square shape.static boolean
-
Constructor Details
-
PlotImageService
public PlotImageService()
-
-
Method Details
-
createImage
Description copied from interface:IPlotImageServiceCreate a square image from a specified file, f of given side size, size in pixels.- Specified by:
createImagein interfaceIPlotImageService- 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:IPlotImageServiceGet a thumbnail Dataset of square shape.- Specified by:
getThumbnailin interfaceIPlotImageService- 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:
createin classorg.eclipse.ui.services.AbstractServiceFactory
-
getImage
Description copied from interface:IPlotImageServiceMain 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:
getImagein interfaceIPlotImageService- Returns:
- Throws:
Exception
-
createPlotDisposable
Description copied from interface:IPlotImageServiceCreates 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:
createPlotDisposablein interfaceIPlotImageService- Parameters:
plotName- to use to look up plotting system (can be null)- Returns:
- Throws:
Exception
-
getIconForFile
Description copied from interface:IFileIconServiceReturns the icon to use for a given file, uses eclipse and OS icons, supports directories.- Specified by:
getIconForFilein interfaceIFileIconService
-
createImage
Description copied from interface:IPlotImageServiceCreate image from buffered image- Specified by:
createImagein interfaceIPlotImageService- Parameters:
image-- Returns:
- image
-
createDataset
Description copied from interface:IPlotImageServiceCreate dataset from buffered image- Specified by:
createDatasetin interfaceIPlotImageService- Parameters:
bufferedImage-- Returns:
- dataset
-
isWindowsOS
public static boolean isWindowsOS()- Returns:
- true if windows
-
getIconForFile
Description copied from interface:IFileIconServiceReturns the icon to use for a given file, uses eclipse and OS icons, supports directories.- Specified by:
getIconForFilein interfaceIFileIconService
-