Documentation of 'de.erichseifert.gral.navigation.Navigator' Java class
Navigator
de.erichseifert.gral.navigation

Interface Navigator

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method and Description
      void addNavigationListener(NavigationListener l)
      Adds the specified listener object that gets notified on changes to navigation information like panning or zooming.
      void connect(Navigator navigator)
      Couples the actions of the current and the specified navigator.
      void disconnect(Navigator navigator)
      Decouples the actions of the current and the connected specified navigator.
      PointND<? extends java.lang.Number> getCenter()
      Returns the current center point.
      NavigationDirection getDirection()
      Returns the current direction of the components that will be taken into account for zooming and panning.
      double getZoom()
      Returns the current zoom level of the associated object.
      double getZoomFactor()
      Returns the factor which is used to change the zoom level on zoom in/out actions.
      double getZoomMax()
      Returns the minimal zoom factor.
      double getZoomMin()
      Returns the minimal zoom factor.
      boolean isPannable()
      Returns whether the associated object can be panned.
      boolean isZoomable()
      Returns whether the associated object can be zoomed.
      void pan(PointND<? extends java.lang.Number> deltas)
      Moves the center by the relative values of the specified point.
      void removeNavigationListener(NavigationListener l)
      Removes the specified listener object, i.e.
      void reset()
      Sets the object's position and zoom level to the default state.
      void setCenter(PointND<? extends java.lang.Number> center)
      Sets a new center point.
      void setDefaultState()
      Sets the current state as the default state of the object.
      void setDirection(NavigationDirection direction)
      Sets the direction of the components that will be taken into account for zooming and panning.
      void setPannable(boolean pannable)
      Sets whether the associated object can be panned.
      void setZoom(double zoom)
      Sets the zoom level of the associated object to the specified value.
      void setZoomable(boolean zoomable)
      Sets whether the associated object can be zoomed.
      void setZoomFactor(double factor)
      Sets the factor which should be used to change the zoom level on zoom in/out actions.
      void setZoomMax(double max)
      Sets the maximal zoom factor.
      void setZoomMin(double min)
      Sets the minimal zoom factor.
      void zoomAt(double zoom, PointND<? extends java.lang.Number> zoomPoint)
      Scale the associated object at the specified point.
      void zoomIn()
      Increases the current zoom level by the specified zoom factor.
      void zoomInAt(PointND<? extends java.lang.Number> zoomPoint)
      Increases the current zoom level by the specified zoom factor and scales the associated object at the specified point.
      void zoomOut()
      Decreases the current zoom level by the specified zoom factor.
      void zoomOutAt(PointND<? extends java.lang.Number> zoomPoint)
      Decreases the current zoom level by the specified zoom factor and scales the associated object at the specified point.
    • Method Detail

      • isZoomable

        boolean isZoomable()
        Returns whether the associated object can be zoomed.
        Returns:
        true if the object can be zoomed, false otherwise.
      • setZoomable

        void setZoomable(boolean zoomable)
        Sets whether the associated object can be zoomed.
        Parameters:
        zoomable - A value that tells whether it should be possible to zoom the associated object.
      • getZoom

        double getZoom()
        Returns the current zoom level of the associated object.
        Returns:
        Current zoom level.
      • setZoom

        void setZoom(double zoom)
        Sets the zoom level of the associated object to the specified value.
        Parameters:
        zoom - New zoom level.
      • zoomIn

        void zoomIn()
        Increases the current zoom level by the specified zoom factor. The zoom will only be changed if the navigator is zoomable.
        See Also:
        isZoomable(), setZoomable(boolean)
      • zoomOut

        void zoomOut()
        Decreases the current zoom level by the specified zoom factor. The zoom will only be changed if the navigator is zoomable.
        See Also:
        isZoomable(), setZoomable(boolean)
      • zoomAt

        void zoomAt(double zoom,
                    PointND<? extends java.lang.Number> zoomPoint)
        Scale the associated object at the specified point. If zooming is disabled nothing will be done. If panning is disabled zooming will be applied around the current center.
        Parameters:
        zoom - New zoom level.
        zoomPoint - Center point for zooming in world units.
      • zoomInAt

        void zoomInAt(PointND<? extends java.lang.Number> zoomPoint)
        Increases the current zoom level by the specified zoom factor and scales the associated object at the specified point.
        Parameters:
        zoomPoint - Center point for zooming in world units.
      • zoomOutAt

        void zoomOutAt(PointND<? extends java.lang.Number> zoomPoint)
        Decreases the current zoom level by the specified zoom factor and scales the associated object at the specified point.
        Parameters:
        zoomPoint - Center point for zooming in world units.
      • isPannable

        boolean isPannable()
        Returns whether the associated object can be panned.
        Returns:
        true if the object can be panned, false otherwise.
      • setPannable

        void setPannable(boolean pannable)
        Sets whether the associated object can be panned.
        Parameters:
        pannable - A value that tells whether it should be possible to pan the associated object.
      • getCenter

        PointND<? extends java.lang.Number> getCenter()
        Returns the current center point. The returned point contains value in world units.
        Returns:
        Center point in world units.
      • setCenter

        void setCenter(PointND<? extends java.lang.Number> center)
        Sets a new center point. The values of the point are in world units. The center point will only be changed if the navigator is pannable.
        Parameters:
        center - New center point in world units.
        See Also:
        isPannable(), setPannable(boolean)
      • pan

        void pan(PointND<? extends java.lang.Number> deltas)
        Moves the center by the relative values of the specified point. The values of the point are in screen units. The center point will only be changed if the navigator is pannable.
        Parameters:
        deltas - Relative values to use for panning.
        See Also:
        isPannable(), setPannable(boolean)
      • setDefaultState

        void setDefaultState()
        Sets the current state as the default state of the object. Resetting the navigator will then return to the default state.
      • reset

        void reset()
        Sets the object's position and zoom level to the default state.
      • getZoomFactor

        double getZoomFactor()
        Returns the factor which is used to change the zoom level on zoom in/out actions.
        Returns:
        The current zoom factor.
      • setZoomFactor

        void setZoomFactor(double factor)
        Sets the factor which should be used to change the zoom level on zoom in/out actions.
        Parameters:
        factor - The new zoom factor.
      • getZoomMin

        double getZoomMin()
        Returns the minimal zoom factor.
        Returns:
        Minimal zoom factor.
      • setZoomMin

        void setZoomMin(double min)
        Sets the minimal zoom factor.
        Parameters:
        min - New minimal zoom factor.
      • getZoomMax

        double getZoomMax()
        Returns the minimal zoom factor.
        Returns:
        Maximal zoom factor.
      • setZoomMax

        void setZoomMax(double max)
        Sets the maximal zoom factor.
        Parameters:
        max - New maximal zoom factor.
      • addNavigationListener

        void addNavigationListener(NavigationListener l)
        Adds the specified listener object that gets notified on changes to navigation information like panning or zooming.
        Parameters:
        l - Listener object
      • removeNavigationListener

        void removeNavigationListener(NavigationListener l)
        Removes the specified listener object, i.e. it doesn't get notified on changes to navigation information like panning or zooming.
        Parameters:
        l - Listener object
      • getDirection

        NavigationDirection getDirection()
        Returns the current direction of the components that will be taken into account for zooming and panning.
        Returns:
        Direction.
      • setDirection

        void setDirection(NavigationDirection direction)
        Sets the direction of the components that will be taken into account for zooming and panning.
        Parameters:
        direction - Direction.
      • connect

        void connect(Navigator navigator)
        Couples the actions of the current and the specified navigator. All actions applied to this navigator will be also applied to the specified navigator and vice versa.
        Parameters:
        navigator - Navigator which should be bound to this instance.
      • disconnect

        void disconnect(Navigator navigator)
        Decouples the actions of the current and the connected specified navigator. All actions will be applied separately to each navigator.
        Parameters:
        navigator - Navigator to be unbound from this instance.

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.