Package 

Class Wormhole2D

  • All Implemented Interfaces:
    it.unibo.alchemist.boundary.wormhole.interfaces.IWormhole2D

    
    public class Wormhole2D<P extends Position2D<Out P>>
     implements IWormhole2D<P>
                        

    Partial implementation for the interface IWormhole2D . I am considering the particular case of the view as an entity into the screen-space: the y-axis grows on the bottom side of the screen.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private IWormhole2D.Mode mode
      private double zoom
    • Constructor Summary

      Constructors 
      Constructor Description
      Wormhole2D(Environment<Out Object, P> env, Component comp) Initializes a new instance directly setting the size of both view and environment, and the offset too.
    • Method Summary

      Modifier and Type Method Description
      final void center() Points the center of the view on the center of the environment.
      P getEnvPoint(Point viewPoint) {@inheritDoc}
      Point getViewPoint(P envPoint) {@inheritDoc}
      Point getViewPosition() {@inheritDoc}
      final Dimension2D getViewSize() Gets the view's size.
      final boolean isInsideView(Point viewPoint) Check if a point of the view-space is "visible", i.e.
      void optimalZoom() {@inheritDoc}
      void rotateAroundPoint(Point p, double a) {@inheritDoc}
      void setEnvPosition(P pos) {@inheritDoc}
      void setRotation(double rad) {@inheritDoc}
      void setViewPosition(Point point) {@inheritDoc}
      void zoomOnPoint(Point p, double z) {@inheritDoc}
      final IWormhole2D.Mode getMode() Gets the rendering mode.
      final double getZoom() Gets the zoom factor.
      void setMode(IWormhole2D.Mode mode) Allows child-classes to modify the mode field.
      void setZoom(double value) {@inheritDoc}
      • Methods inherited from class it.unibo.alchemist.boundary.wormhole.interfaces.IWormhole2D

        getEnvPoint, getViewPoint, isInsideView, rotateAroundPoint, setEnvPosition, setRotation, setViewPosition, setZoom, zoomOnPoint
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Wormhole2D

        Wormhole2D(Environment<Out Object, P> env, Component comp)
        Initializes a new instance directly setting the size of both view and environment, and the offset too.
        Parameters:
        env - the Environment
        comp - the controlled Component