Class SliceSystemImpl

java.lang.Object
org.eclipse.dawnsci.slicing.api.AbstractSliceSystem
org.dawnsci.slicing.component.SliceSystemImpl
All Implemented Interfaces:
ISliceSystem

public class SliceSystemImpl extends AbstractSliceSystem
Dialog to slice multi-dimensional data to images and 1D plots. Copied from nexus tree viewer but in a simpler to use UI.
  • Constructor Details

    • SliceSystemImpl

      public SliceSystemImpl()
  • Method Details

    • getSliceName

      public String getSliceName()
      Description copied from interface: ISliceSystem
      A 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: ISliceSystem
      Turn the toolbar on or off.
      Parameters:
      vis -
    • getSelectionProvider

      public org.eclipse.jface.viewers.ISelectionProvider getSelectionProvider()
      Description copied from interface: ISliceSystem
      May be null
      Returns:
    • setSliceMetadata

      public void setSliceMetadata(org.eclipse.january.metadata.IMetadata sliceMeta)
      Description copied from class: AbstractSliceSystem
      The metadata of the current slice, if any
      Specified by:
      setSliceMetadata in interface ISliceSystem
      Overrides:
      setSliceMetadata in class AbstractSliceSystem
    • setSliceTypeInfo

      public void setSliceTypeInfo(String label, org.eclipse.jface.resource.ImageDescriptor icon)
      Description copied from class: AbstractSliceSystem
      Does nothing by default.
      Specified by:
      setSliceTypeInfo in interface ISliceSystem
      Overrides:
      setSliceTypeInfo in class AbstractSliceSystem
      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: ISliceSystem
      Sets wether the slice component should show axes or not.
    • isAxesVisible

      public boolean isAxesVisible()
    • setActionActive

      public void setActionActive(String actionId)
      Parameters:
      actionId -
    • createSliceTools

      protected org.eclipse.jface.action.IToolBarManager createSliceTools()
      Creates the actions for
      Overrides:
      createSliceTools in class AbstractSliceSystem
      Returns:
    • saveSliceSettings

      protected void saveSliceSettings()
      Description copied from class: AbstractSliceSystem
      May be implemented to save the current slice set up.
      Specified by:
      saveSliceSettings in class AbstractSliceSystem
    • update

      public void update(boolean disable)
      Description copied from interface: ISliceSystem
      Call 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:
      fireDimensionalListeners in class AbstractSliceSystem
    • fireAxisChoiceListeners

      public void fireAxisChoiceListeners(AxisChoiceEvent evt)
      Overrides:
      fireAxisChoiceListeners in class AbstractSliceSystem
    • synchronizeSliceData

      protected boolean synchronizeSliceData(DimsData data)
      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:
      setAdvanced in class AbstractSliceSystem
    • update

      protected void update(DimsData data, boolean enabled)
      Update slice
      Parameters:
      data -
      enabled - - can be set to false to grey out table during slice.
    • getData

      public SliceSource getData()
      Returns:
      the current data which we are slicing.
    • setData

      public void setData(SliceSource source)
      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

      public void setLabel(String text)
      Description copied from interface: ISliceSystem
      Sets 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: ISliceSystem
      The slicer should be disposed when finished with and once this is called it will no longer be usable.
      Specified by:
      dispose in interface ISliceSystem
      Overrides:
      dispose in class AbstractSliceSystem
    • setSliceObject

      public void setSliceObject(SliceObject sliceObject)
    • 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: ISliceSystem
      To 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

      public DimsDataList getDimsDataList()
      Specified by:
      getDimsDataList in interface ISliceSystem
      Overrides:
      getDimsDataList in class AbstractSliceSystem
      Returns:
      an object which provides information about how the user set up the slice in the UI.
    • getAxesNames

      public Map<Integer,String> getAxesNames()
      Description copied from interface: ISliceSystem
      The names (nexus path to axis normally) of the axis by dimension number.
      Returns:
      map of axes.
    • setDimsDataList

      public void setDimsDataList(DimsDataList dimsDataList)
      Description copied from interface: ISliceSystem
      Set the way that the slicing should be set up in the slice system.
      Specified by:
      setDimsDataList in interface ISliceSystem
      Overrides:
      setDimsDataList in class AbstractSliceSystem
    • refresh

      public void refresh()
      Description copied from interface: ISliceSystem
      Refresh 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: ISliceSystem
      Sets 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: ISliceSystem
      Greys out the table and actions. Should normally be called within a try finally.
      Parameters:
      enabled -
    • isEnabled

      public boolean isEnabled()
      Description copied from interface: ISliceSystem
      true if enabled
      Returns:
    • main

      public static void main(String[] args) throws Throwable
      Utility method used to save out 3D datasets as double[][][]
      Parameters:
      args -
      Throws:
      Exception
      Throwable