org.diamondspin
Class DSDefaultEngine

java.lang.Object
  extended by org.diamondspin.DSDefaultEngine
All Implemented Interfaces:
DSEngine

public class DSDefaultEngine
extends Object
implements DSEngine

DSDefaultEngine implements a default transformation engine. Support panning through connection with the view


Copyright 2002-2009 DiamondSpin project. All Rights Reserved.

Permission to use, copy, modify and distribute this software and its documentation for educational, research and non-profit purposes, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and the following three paragraphs appear in all copies.

To request Permission to incorporate this software into commercial products contact one of the authors of the project.
  • Frederic Vernier (frederic.vernier@limsi.fr)
  • Chia Shen (chia_shen@harvard.edu)
  • Guillaume Besacier (guillaume.besacier@limsi.fr)
  • Daniel Wigdor (dwigdor@microsoft.com)

IN NO EVENT SHALL THE AUTHORS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE AUTHORS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

THE AUTHORS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE AUTHORS HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

Creation :06/03/2003

Version:
: 1.0
Author:
: Frederic vernier, (frederic.vernier@gmail.com) under Chia Shen supervision (chia_shen@harvard.edu).

Field Summary
protected  DSTabletopPane dsTabletopPane
           
 
Fields inherited from interface org.diamondspin.DSEngine
BETA_ABS, DRAG_ELEMENT, ELEMENT, MENUBAR, POPUPMENU, STROKE
 
Constructor Summary
DSDefaultEngine(DSTabletopPane dsTabletopPane)
           
 
Method Summary
static double getScale(double d, double alpha, double scale, DSTabletopPane dsTabletopPane)
          This could be seen as part of the transformTable() method but it is better to separate it so element can call it to know which scale factro was really used by the matrix.
 boolean isMenubarCircular()
          tells to DSMenubar which policy to choose to draw the border of the menubar
 AffineTransform transformTable(double d, double alpha, double beta, double scale, double tangle, double tzoom, int elType, int userid)
          Return an AffineTransform object to apply to a Graphics2D before drawing an element.
protected static AffineTransform transformTable(double d, double alpha, double beta, double scale, double tangle, double tzoom, int elType, int userid, DSTabletopPane dsTabletopPane)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dsTabletopPane

protected DSTabletopPane dsTabletopPane
Constructor Detail

DSDefaultEngine

public DSDefaultEngine(DSTabletopPane dsTabletopPane)
Method Detail

isMenubarCircular

public boolean isMenubarCircular()
Description copied from interface: DSEngine
tells to DSMenubar which policy to choose to draw the border of the menubar

Specified by:
isMenubarCircular in interface DSEngine

transformTable

public AffineTransform transformTable(double d,
                                      double alpha,
                                      double beta,
                                      double scale,
                                      double tangle,
                                      double tzoom,
                                      int elType,
                                      int userid)
Description copied from interface: DSEngine
Return an AffineTransform object to apply to a Graphics2D before drawing an element.

Specified by:
transformTable in interface DSEngine
Parameters:
d - the distance from the center of the table to the center of the element. 0.5 means between the center and the border
alpha - the angle of the element. Angle around the center of the table (trigonometric system)
beta - angle around the center of the element
scale - the scale factor. may be modified by a blackhole or fisheye technique
tangle - the angle of the whole table to add it to Alpha. 0 when dragged and = angle of the view otherwise
tzoom - the scale of the whole table
elType - element type tells if the element is metalic or not then subject to magnetization !
userid - user id of the owner of element to transform
Returns:
a transformation matrix decribing the element rotations, scale, translation according to the parameter values

transformTable

protected static AffineTransform transformTable(double d,
                                                double alpha,
                                                double beta,
                                                double scale,
                                                double tangle,
                                                double tzoom,
                                                int elType,
                                                int userid,
                                                DSTabletopPane dsTabletopPane)

getScale

public static double getScale(double d,
                              double alpha,
                              double scale,
                              DSTabletopPane dsTabletopPane)
This could be seen as part of the transformTable() method but it is better to separate it so element can call it to know which scale factro was really used by the matrix.

Parameters:
d - the distance from the center of the table to the center of the element
alpha - the angle of the element
scale - the scale factor. may be modified by the DSTabletopPane.BLACKHOLE or central focus
dsTabletopPane - Description of the Parameter
Returns:
the scale to use in this polar coordinate system according to the deformation


Copyright © 2006 Frederic Vernier(LIMSI) Chia Shen(MERL) Guillaume Besacier(LIMSI). All Rights Reserved.