org.malai.properties
Interface Zoomable

All Known Subinterfaces:
ICanvas
All Known Implementing Classes:
LCanvas

public interface Zoomable

Defines an interface to zoomable objects.

This file is part of Malai.
Copyright (c) 2009-2012 Arnaud BLOUIN

Malai is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
Malai is distributed without any warranty; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

05/11/2010

Since:
0.1
Version:
0.1
Author:
Arnaud BLOUIN

Field Summary
static double MAX_ZOOM
          The biggest zoom we can do (4.5)
static double MIN_ZOOM
          The smallest zoom we can do (0.25) .
static double ZOOM_INCREMENT
          The increment of a zooming (0.25).
 
Method Summary
 double getZoom()
           
 java.awt.geom.Point2D getZoomedPoint(double x, double y)
          Transforms the given point in a point which coordinates have been modified to take account of the zoom level.
 java.awt.geom.Point2D getZoomedPoint(java.awt.Point pt)
          Transforms the given point in a point which coordinates have been modified to take account of the zoom level.
 void setZoom(double x, double y, double zoomingLevel)
          Zooms in the zoomable object.
 

Field Detail

ZOOM_INCREMENT

static final double ZOOM_INCREMENT
The increment of a zooming (0.25).

See Also:
Constant Field Values

MAX_ZOOM

static final double MAX_ZOOM
The biggest zoom we can do (4.5)

See Also:
Constant Field Values

MIN_ZOOM

static final double MIN_ZOOM
The smallest zoom we can do (0.25) .

See Also:
Constant Field Values
Method Detail

getZoom

double getZoom()
Returns:
The zoom level.
Since:
0.1

setZoom

void setZoom(double x,
             double y,
             double zoomingLevel)
Zooms in the zoomable object.

Parameters:
zoomingLevel - The zooming level.
x - The X-coordinate of the location to zoom.
y - The Y-coordinate of the location to zoom.
Since:
0.1

getZoomedPoint

java.awt.geom.Point2D getZoomedPoint(double x,
                                     double y)
Transforms the given point in a point which coordinates have been modified to take account of the zoom level.

Parameters:
x - The X-coordinate of the point to modify.
y - The Y-coordinate of the point to modify.
Returns:
The transformed point.
Since:
0.2

getZoomedPoint

java.awt.geom.Point2D getZoomedPoint(java.awt.Point pt)
Transforms the given point in a point which coordinates have been modified to take account of the zoom level.

Parameters:
pt - The point to transform.
Returns:
The transformed point. Returns (0,0) if the given point is null.
Since:
0.2