Class ViewerState


  • @Deprecated
    public class ViewerState
    extends Object
    Deprecated.
    Description of everything required to render the current image, such as the current timepoint, the visible and current sources and groups respectively, the viewer transformation, etc.
    Author:
    Tobias Pietzsch
    • Constructor Detail

      • ViewerState

        public ViewerState​(List<SourceAndConverter<?>> sources,
                           List<SourceGroup> sourceGroups,
                           int numTimePoints)
        Deprecated.
        Parameters:
        sources - the sources to display.
        numTimePoints - number of available timepoints.
      • ViewerState

        protected ViewerState​(ViewerState s)
        Deprecated.
        copy constructor
        Parameters:
        s -
    • Method Detail

      • getCurrentSource

        public int getCurrentSource()
        Deprecated.
        Get the index of the current source.
      • setCurrentSource

        public void setCurrentSource​(int index)
        Deprecated.
        Make the source with the given index current.
      • setCurrentSource

        public void setCurrentSource​(Source<?> source)
        Deprecated.
        Make the given source current.
      • getCurrentGroup

        public int getCurrentGroup()
        Deprecated.
        Get the index of the current group.
      • setCurrentGroup

        public void setCurrentGroup​(int index)
        Deprecated.
        Make the group with the given index current.
      • setCurrentGroup

        public void setCurrentGroup​(SourceGroup group)
        Deprecated.
        Make the given group current.
      • getInterpolation

        public Interpolation getInterpolation()
        Deprecated.
        Get the interpolation method.
        Returns:
        interpolation method.
      • setInterpolation

        public void setInterpolation​(Interpolation method)
        Deprecated.
        Set the interpolation method.
        Parameters:
        method - interpolation method.
      • isSingleSourceMode

        @Deprecated
        public boolean isSingleSourceMode()
        Deprecated.
        replaced by getDisplayMode()
        Is the display mode single-source? In single-source mode, only the current source (SPIM angle). Otherwise, in fused mode, all active sources are blended.
        Returns:
        whether the display mode is single-source.
      • setSingleSourceMode

        @Deprecated
        public void setSingleSourceMode​(boolean singleSourceMode)
        Deprecated.
        Set the display mode to single-source (true) or fused (false). In single-source mode, only the current source (SPIM angle) is shown. In fused mode, all active sources are blended.
        Parameters:
        singleSourceMode - If true, set single-source mode. If false, set fused mode.
      • setDisplayMode

        public void setDisplayMode​(DisplayMode mode)
        Deprecated.
        Set the DisplayMode.
        • In single-source mode, only the current source (SPIM angle) is shown.
        • In fused mode, all active sources are blended.
        • In single-group mode, all sources of the current group are blended.
        • In fused group mode, all sources of all active groups are blended.
        Parameters:
        mode - the display mode
      • getDisplayMode

        public DisplayMode getDisplayMode()
        Deprecated.
        Get the current DisplayMode.
        • In single-source mode, only the current source (SPIM angle) is shown.
        • In fused mode, all active sources are blended.
        • In single-group mode, all sources of the current group are blended.
        • In fused group mode, all sources of all active groups are blended.
        Returns:
        the current display mode
      • getCurrentTimepoint

        public int getCurrentTimepoint()
        Deprecated.
        Get the timepoint index that is currently displayed.
        Returns:
        current timepoint index
      • setCurrentTimepoint

        public void setCurrentTimepoint​(int timepoint)
        Deprecated.
        Set the current timepoint index.
        Parameters:
        timepoint - timepoint index.
      • getSources

        public List<SourceState<?>> getSources()
        Deprecated.
        Returns a list of all sources.
        Returns:
        list of all sources.
      • numSources

        public int numSources()
        Deprecated.
        Returns the number of sources.
        Returns:
        number of sources.
      • getSourceGroups

        public List<SourceGroup> getSourceGroups()
        Deprecated.
        Returns a list of all source groups.
        Returns:
        list of all source groups.
      • numSourceGroups

        public int numSourceGroups()
        Deprecated.
        Returns the number of source groups.
        Returns:
        number of source groups.
      • removeSource

        public void removeSource​(Source<?> source)
        Deprecated.
      • removeSource

        protected void removeSource​(int index)
        Deprecated.
      • addGroup

        public void addGroup​(SourceGroup group)
        Deprecated.
      • removeGroup

        public void removeGroup​(SourceGroup group)
        Deprecated.
      • removeGroup

        protected void removeGroup​(int index)
        Deprecated.
      • isSourceVisible

        public boolean isSourceVisible​(int index)
        Deprecated.
      • getVisibleSourceIndices

        public List<Integer> getVisibleSourceIndices()
        Deprecated.
        Returns a list of the indices of all currently visible sources.
        Returns:
        indices of all currently visible sources.
      • getBestMipMapLevel

        public int getBestMipMapLevel​(net.imglib2.realtransform.AffineTransform3D screenScaleTransform,
                                      int sourceIndex)
        Deprecated.
        Get the mipmap level that best matches the given screen scale for the given source.
        Parameters:
        screenScaleTransform - screen scale, transforms screen coordinates to viewer coordinates.
        Returns:
        mipmap level
      • getBestMipMapLevel

        public int getBestMipMapLevel​(net.imglib2.realtransform.AffineTransform3D screenScaleTransform,
                                      Source<?> source)
        Deprecated.
        Get the mipmap level that best matches the given screen scale for the given source.
        Parameters:
        screenScaleTransform - screen scale, transforms screen coordinates to viewer coordinates.
        Returns:
        mipmap level
      • getNumTimepoints

        public int getNumTimepoints()
        Deprecated.
        Get the number of timepoints.
        Returns:
        the number of timepoints.
      • setNumTimepoints

        public void setNumTimepoints​(int numTimepoints)
        Deprecated.
        Set the number of timepoints.
        Parameters:
        numTimepoints - the number of timepoints.
      • kill

        public void kill()
        Deprecated.
        DON'T USE THIS.

        This is a work around for JDK bug https://bugs.openjdk.java.net/browse/JDK-8029147 which leads to ViewerPanel not being garbage-collected when ViewerFrame is closed. So instead we need to manually let go of resources...