Package org.dawnsci.slicing.component
Class SliceSystemImpl
java.lang.Object
org.eclipse.dawnsci.slicing.api.AbstractSliceSystem
org.dawnsci.slicing.component.SliceSystemImpl
- All Implemented Interfaces:
ISliceSystem
Dialog to slice multi-dimensional data to images and 1D plots.
Copied from nexus tree viewer but in a simpler to use UI.
-
Field Summary
Fields inherited from class org.eclipse.dawnsci.slicing.api.AbstractSliceSystem
advanced, dimsDataList, plottingSystem, rangeMode, sliceObject, sliceReceiverId, sliceToolbar, sliceTools, sliceType -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.eclipse.swt.widgets.ControlcreatePartControl(org.eclipse.swt.widgets.Composite parent) Please call setPlottingSystem(...) before createPartControl(...) if you would like the part to show controls for images.protected org.eclipse.jface.action.IToolBarManagerCreates the actions forvoiddispose()The slicer should be disposed when finished with and once this is called it will no longer be usable.voidvoidThe names (nexus path to axis normally) of the axis by dimension number.getData()org.eclipse.january.dataset.ILazyDatasetorg.eclipse.jface.viewers.ISelectionProviderMay be nullA name describing the current slicebooleanbooleantrue if enabledbooleanprotected booleanstatic voidUtility method used to save out 3D datasets as double[][][]voidrefresh()Refresh the widget showing the slice setup.protected voidMay be implemented to save the current slice set up.voidsetActionActive(String actionId) protected voidsetAdvanced(boolean advanced) protected voidsetAdvancedColumnsVisible(boolean isVis) voidsetAxesVisible(boolean isVis) Sets wether the slice component should show axes or not.voidsetData(SliceSource source) Call this method to show the slice dialog.voidsetDimsDataList(DimsDataList dimsDataList) Set the way that the slicing should be set up in the slice system.voidsetEnabled(boolean enabled) Greys out the table and actions.voidSets a string to be used as explaination text somewhere in the system depending on implementation.voidsetSliceIndex(int dimension, int index, boolean doSlice) To change the slice value by data index and optionally replot a slice call this method.voidsetSliceMetadata(org.eclipse.january.metadata.IMetadata sliceMeta) The metadata of the current slice, if anyvoidsetSliceObject(SliceObject sliceObject) voidsetSliceTypeInfo(String label, org.eclipse.jface.resource.ImageDescriptor icon) Does nothing by default.voidsetSlicingEnabled(boolean enabled) Sets if slicing is allowed in the slice widget.voidsetToolbarVisible(boolean vis) Turn the toolbar on or off.voidsetVisible(boolean vis) Throws exception if GUI disposed.protected voidslice(boolean force) Does slice in monitored jobprotected booleansynchronizeSliceData(DimsData data) Method ensures that one x and on y are defined.voidupdate(boolean disable) Call to reprocess a slice where the slice system is slicing using a standard tool like line or image.protected voidUpdate slicevoidMethods inherited from class org.eclipse.dawnsci.slicing.api.AbstractSliceSystem
addAxisChoiceListener, addCustomAction, addDimensionalListener, checkErrors, checkToolDimenionsOk, createCustomActions, createSliceTools, getActionByPlotType, getActiveTool, getCurrentSlice, getDimensions, getPlottingSystem, getRangeMode, getSlice, getSliceMetadata, getSliceType, is3D, isAdvanced, militarize, openGallery, removeAxisChoiceListener, removeDimensionalListener, setPlottingSystem, setRangeMode, setSlice, setSliceActionEnabled, setSliceActionsEnabled, setSliceGalleryId, setSliceType
-
Constructor Details
-
SliceSystemImpl
public SliceSystemImpl()
-
-
Method Details
-
getSliceName
Description copied from interface:ISliceSystemA name describing the current slice- Returns:
-
createPartControl
public org.eclipse.swt.widgets.Control createPartControl(org.eclipse.swt.widgets.Composite parent) Please call setPlottingSystem(...) before createPartControl(...) if you would like the part to show controls for images.- Parameters:
parent-- Returns:
-
setToolbarVisible
public void setToolbarVisible(boolean vis) Description copied from interface:ISliceSystemTurn the toolbar on or off.- Parameters:
vis-
-
getSelectionProvider
public org.eclipse.jface.viewers.ISelectionProvider getSelectionProvider()Description copied from interface:ISliceSystemMay be null- Returns:
-
setSliceMetadata
public void setSliceMetadata(org.eclipse.january.metadata.IMetadata sliceMeta) Description copied from class:AbstractSliceSystemThe metadata of the current slice, if any- Specified by:
setSliceMetadatain interfaceISliceSystem- Overrides:
setSliceMetadatain classAbstractSliceSystem
-
setSliceTypeInfo
Description copied from class:AbstractSliceSystemDoes nothing by default.- Specified by:
setSliceTypeInfoin interfaceISliceSystem- Overrides:
setSliceTypeInfoin classAbstractSliceSystem- Parameters:
label-icon- - may be null, if null and sliceType!=null the image descriptor of the action for this sliceType will be used.
-
setAxesVisible
public void setAxesVisible(boolean isVis) Description copied from interface:ISliceSystemSets wether the slice component should show axes or not. -
isAxesVisible
public boolean isAxesVisible() -
setActionActive
- Parameters:
actionId-
-
createSliceTools
protected org.eclipse.jface.action.IToolBarManager createSliceTools()Creates the actions for- Overrides:
createSliceToolsin classAbstractSliceSystem- Returns:
-
saveSliceSettings
protected void saveSliceSettings()Description copied from class:AbstractSliceSystemMay be implemented to save the current slice set up.- Specified by:
saveSliceSettingsin classAbstractSliceSystem
-
update
public void update(boolean disable) Description copied from interface:ISliceSystemCall to reprocess a slice where the slice system is slicing using a standard tool like line or image.- Parameters:
disable- - true to grey out the slicing while it changes mode.
-
fireDimensionalListeners
public void fireDimensionalListeners()- Overrides:
fireDimensionalListenersin classAbstractSliceSystem
-
fireAxisChoiceListeners
- Overrides:
fireAxisChoiceListenersin classAbstractSliceSystem
-
synchronizeSliceData
Method ensures that one x and on y are defined.- Parameters:
data-- Returns:
- true if no error
-
setAdvancedColumnsVisible
protected void setAdvancedColumnsVisible(boolean isVis) -
setAdvanced
protected void setAdvanced(boolean advanced) - Overrides:
setAdvancedin classAbstractSliceSystem
-
update
Update slice- Parameters:
data-enabled- - can be set to false to grey out table during slice.
-
getData
- Returns:
- the current data which we are slicing.
-
setData
Call this method to show the slice dialog. This non-modal dialog allows the user to slice data out of n-D data sets into a 2D plot. This method is not thread safe, please call in the UI thread.- Parameters:
source-
-
setLabel
Description copied from interface:ISliceSystemSets a string to be used as explaination text somewhere in the system depending on implementation.- Parameters:
text-
-
isReversedImage
protected boolean isReversedImage() -
slice
protected void slice(boolean force) Does slice in monitored job -
dispose
public void dispose()Description copied from interface:ISliceSystemThe slicer should be disposed when finished with and once this is called it will no longer be usable.- Specified by:
disposein interfaceISliceSystem- Overrides:
disposein classAbstractSliceSystem
-
setSliceObject
-
setVisible
public void setVisible(boolean vis) Throws exception if GUI disposed.- Parameters:
vis-
-
setSliceIndex
public void setSliceIndex(int dimension, int index, boolean doSlice) Description copied from interface:ISliceSystemTo change the slice value by data index and optionally replot a slice call this method.- Parameters:
dimension- to slice (if slicing it already)index-doSlice- - true to replot the slice straight away.
-
getDimsDataList
- Specified by:
getDimsDataListin interfaceISliceSystem- Overrides:
getDimsDataListin classAbstractSliceSystem- Returns:
- an object which provides information about how the user set up the slice in the UI.
-
getAxesNames
Description copied from interface:ISliceSystemThe names (nexus path to axis normally) of the axis by dimension number.- Returns:
- map of axes.
-
setDimsDataList
Description copied from interface:ISliceSystemSet the way that the slicing should be set up in the slice system.- Specified by:
setDimsDataListin interfaceISliceSystem- Overrides:
setDimsDataListin classAbstractSliceSystem
-
refresh
public void refresh()Description copied from interface:ISliceSystemRefresh the widget showing the slice setup. Can be used after editing the dimensional data list to define the slice. -
getLazyDataset
public org.eclipse.january.dataset.ILazyDataset getLazyDataset() -
setSlicingEnabled
public void setSlicingEnabled(boolean enabled) Description copied from interface:ISliceSystemSets if slicing is allowed in the slice widget. If set to false the slice widget (e.g. a table) will become deactivated.- Parameters:
enabled-
-
isErrorVisible
public boolean isErrorVisible() -
updateAxesChoices
public void updateAxesChoices() -
setEnabled
public void setEnabled(boolean enabled) Description copied from interface:ISliceSystemGreys out the table and actions. Should normally be called within a try finally.- Parameters:
enabled-
-
isEnabled
public boolean isEnabled()Description copied from interface:ISliceSystemtrue if enabled- Returns:
-
main
Utility method used to save out 3D datasets as double[][][]
-