Enum ZoomType

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<ZoomType>

    public enum ZoomType
    extends java.lang.Enum<ZoomType>
    The type of zoom on XYGraph.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private org.eclipse.swt.graphics.Cursor cursorOnXAxis  
      private org.eclipse.swt.graphics.Cursor cursorOnYAxis  
      private org.eclipse.swt.graphics.Cursor defaultCursor  
      private java.lang.String description  
      private int flags  
      private org.eclipse.swt.graphics.Image iconImage  
      private boolean isZoom  
      private org.eclipse.swt.graphics.Cursor overrideCursor  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private ZoomType​(java.lang.String description, org.eclipse.swt.graphics.Image iconImage, org.eclipse.swt.graphics.Image cursorImage, org.eclipse.swt.graphics.Image cursorImageOnXAxis, org.eclipse.swt.graphics.Image cursorImageOnYAxis, int flags, int backUpSWTCursorType)  
      private ZoomType​(java.lang.String description, org.eclipse.swt.graphics.Image iconImage, org.eclipse.swt.graphics.Image cursorImage, org.eclipse.swt.graphics.Image cursorImageOnXAxis, org.eclipse.swt.graphics.Image cursorImageOnYAxis, int flags, int backUpSWTCursorType, boolean isZoom)
      Initialize
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      org.eclipse.swt.graphics.Cursor getCursor()  
      org.eclipse.swt.graphics.Cursor getCursorOnAxis​(boolean horizontalAxis)  
      java.lang.String getDescription()  
      org.eclipse.swt.graphics.Image getIconImage()  
      java.lang.String getId()
      Return the unique id for the enum.
      boolean isZoom()
      Some of the so-called ZoomTypes are not actually Zooms.
      void setCursor​(org.eclipse.swt.graphics.Cursor cursor)
      Deprecated.
      see Javadocs above for details
      java.lang.String toString()  
      boolean useWithFlags​(int flags)
      Check if this zoom mode should be offered when a graph was created with given flags
      static ZoomType valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static ZoomType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • RUBBERBAND_ZOOM

        public static final ZoomType RUBBERBAND_ZOOM
        Interactive Rubberband zoom
      • DYNAMIC_ZOOM

        public static final ZoomType DYNAMIC_ZOOM
        Interactive Dynamic zoom
      • HORIZONTAL_ZOOM

        public static final ZoomType HORIZONTAL_ZOOM
        Zoom via 'cursors' for horizontal start/end position
      • VERTICAL_ZOOM

        public static final ZoomType VERTICAL_ZOOM
        Zoom via 'cursors' for vertical start/end position
      • ZOOM_IN

        public static final ZoomType ZOOM_IN
        Zoom 'in' around mouse pointer
      • ZOOM_OUT

        public static final ZoomType ZOOM_OUT
        Zoom 'out' around mouse pointer
      • ZOOM_IN_HORIZONTALLY

        public static final ZoomType ZOOM_IN_HORIZONTALLY
        Zoom 'in' around mouse pointer along horizontal axis
      • ZOOM_OUT_HORIZONTALLY

        public static final ZoomType ZOOM_OUT_HORIZONTALLY
        Zoom 'out' around mouse pointer along horizontal axis
      • ZOOM_IN_VERTICALLY

        public static final ZoomType ZOOM_IN_VERTICALLY
        Zoom 'in' around mouse pointer along vertical axis
      • ZOOM_OUT_VERTICALLY

        public static final ZoomType ZOOM_OUT_VERTICALLY
        Zoom 'out' around mouse pointer along vertical axes
      • PANNING

        public static final ZoomType PANNING
        Zoom 'out' around mouse pointer
      • NONE

        public static final ZoomType NONE
        Disarm zoom behavior
    • Field Detail

      • iconImage

        private final org.eclipse.swt.graphics.Image iconImage
      • description

        private final java.lang.String description
      • overrideCursor

        private org.eclipse.swt.graphics.Cursor overrideCursor
        See Also:
        setCursor(Cursor)
      • defaultCursor

        private final org.eclipse.swt.graphics.Cursor defaultCursor
      • cursorOnXAxis

        private final org.eclipse.swt.graphics.Cursor cursorOnXAxis
      • cursorOnYAxis

        private final org.eclipse.swt.graphics.Cursor cursorOnYAxis
      • flags

        private final int flags
      • isZoom

        private final boolean isZoom
    • Constructor Detail

      • ZoomType

        private ZoomType​(java.lang.String description,
                         org.eclipse.swt.graphics.Image iconImage,
                         org.eclipse.swt.graphics.Image cursorImage,
                         org.eclipse.swt.graphics.Image cursorImageOnXAxis,
                         org.eclipse.swt.graphics.Image cursorImageOnYAxis,
                         int flags,
                         int backUpSWTCursorType)
      • ZoomType

        private ZoomType​(java.lang.String description,
                         org.eclipse.swt.graphics.Image iconImage,
                         org.eclipse.swt.graphics.Image cursorImage,
                         org.eclipse.swt.graphics.Image cursorImageOnXAxis,
                         org.eclipse.swt.graphics.Image cursorImageOnYAxis,
                         int flags,
                         int backUpSWTCursorType,
                         boolean isZoom)
        Initialize
        Parameters:
        description - Description used for tool tip
        iconImage - Button icon
        cursorImage - Cursor when zoom type is selected
        flags - Bitwise 'or' of flags that specify in which zoom configurations this zoom type should be included
        See Also:
        XYGraphFlags.COMBINED_ZOOM, XYGraphFlags.SEPARATE_ZOOM
    • Method Detail

      • values

        public static ZoomType[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (ZoomType c : ZoomType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static ZoomType valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getIconImage

        public org.eclipse.swt.graphics.Image getIconImage()
        Returns:
        the iconImageData
      • getDescription

        public java.lang.String getDescription()
        Returns:
        the description
      • getCursor

        public org.eclipse.swt.graphics.Cursor getCursor()
        Returns:
        the cursor
      • getCursorOnAxis

        public org.eclipse.swt.graphics.Cursor getCursorOnAxis​(boolean horizontalAxis)
        Returns:
        the cursor on axis.
      • useWithFlags

        public boolean useWithFlags​(int flags)
        Check if this zoom mode should be offered when a graph was created with given flags
        Parameters:
        flags - Flags of the XYGraph tool bar
        Returns:
        true if this zoom type applies
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Enum<ZoomType>
      • getId

        public java.lang.String getId()
        Return the unique id for the enum.
        Returns:
        class name . enum name
      • setCursor

        @Deprecated
        public void setCursor​(org.eclipse.swt.graphics.Cursor cursor)
        Deprecated.
        see Javadocs above for details
        XXX: Using this is a bad idea, it modifies global state and as a result does not fully work as intended. The overriding of the cursor *must* be done outside of the enum. The failing case is when more than one plot is open at the same time and each plot tries to set the override cursor. In that case the last one wins. Nowhere within the Nebula code base calls this method, it only exists to support clients that used this in the past and is therefore deprecated.

        Override the cursor for the given zoom type.

        Overriding the cursor is a normal operation for the NONE cursor as when the cursor is NONE it is deactivated, so external control has an effect on the cursor.

        When set to non-null value, getCursor() and getCursorOnAxis(boolean) will return the overridden cursor.

        Parameters:
        cursor - to use when overridden
      • isZoom

        public boolean isZoom()
        Some of the so-called ZoomTypes are not actually Zooms. The isZoom() returns true if the Zoom type is actually a zoom operation. Returns true for all items, except for NONE and .
        Returns:
        true if an actual zoom type