-
- 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.
-
-
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
-
-
Method Detail
-
center
final void center()
Points the center of the view on the center of the environment.
-
getEnvPoint
P getEnvPoint(Point viewPoint)
{@inheritDoc}
-
getViewPoint
Point getViewPoint(P envPoint)
{@inheritDoc}
-
getViewPosition
Point getViewPosition()
{@inheritDoc}
-
getViewSize
final Dimension2D getViewSize()
Gets the view's size.
-
isInsideView
final boolean isInsideView(Point viewPoint)
Check if a point of the view-space is "visible", i.e. it is inside the view.
- Parameters:
viewPoint
- is the Point to check
-
optimalZoom
void optimalZoom()
{@inheritDoc}
-
rotateAroundPoint
void rotateAroundPoint(Point p, double a)
{@inheritDoc}
-
setEnvPosition
void setEnvPosition(P pos)
{@inheritDoc}
-
setRotation
void setRotation(double rad)
{@inheritDoc}
-
setViewPosition
void setViewPosition(Point point)
{@inheritDoc}
-
zoomOnPoint
void zoomOnPoint(Point p, double z)
{@inheritDoc}
-
getMode
final IWormhole2D.Mode getMode()
Gets the rendering mode.
-
getZoom
final double getZoom()
Gets the zoom factor.
-
setMode
void setMode(IWormhole2D.Mode mode)
Allows child-classes to modify the mode field.
- Parameters:
mode
- is the new mode
-
setZoom
void setZoom(double value)
{@inheritDoc}
-
-
-
-