org.diamondspin
Interface DSElement

All Superinterfaces:
Cloneable
All Known Implementing Classes:
DS3dContentFrame, DSFrame, DSImage, DSMenuBar, DSPile, DSPopupMenu, DSSideHandler, DSSlot, DSStroke, DSWebFrame

public interface DSElement
extends Cloneable

A DSElement is the interface every element present on the table must implement.

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 date : April the 2nd, 2002

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

Field Summary
static int HIGH_QUALITY
          According to the repaint speed of rotated element it can be interesting to distinguish when a high quality repaint is necessary and when a low quality repaint is enough.
static int LOW_QUALITY
          According to the repaint speed of rotated element it can be interesting to distinguish when a high quality repaint is necessary and when a low quality repaint is enough.
 
Method Summary
 boolean acceptSlavery(DSElement dsElement)
          tells if this dselement accept to be slave of an other one.
 boolean acceptSlaveryRelease()
          tells if I accept to be released
 void addDSElementListener(DSElementListener DSElementListener_Arg)
          I'm a element so I can dispatch DSElement events to the listener which suscribe through this method
 boolean doesContain(double x, double y)
          Description of the Method
 double getAbsoluteScale()
          Gets the Absolute Scale attribute of the DSElement object
 double getAlpha()
          The degrees of freedom of the DSElements are their distance to the center, their angle comparing to the right direction (from center to the ful right), a scale (for zooming features) and
 double getBeta()
          The angle around its center
 double getD()
          The degrees of freedom of the DSElements are their distance to the center, their angle comparing to the right direction (from center to the ful right), a scale (for zooming features) and
 int getHeight()
          Elements are displayed around their center (not around their top left corner) Width and Height are the amount of space used by the repaint.
 int getIDOwner()
          Gets the iDOwner attribute of the DSElement object
 double getScale()
          The degrees of freedom of the DSElements are their distance to the center, their angle comparing to the right direction (from center to the ful right), a scale (for zooming features) and
 AffineTransform getTransform()
          The matrix decribing how this element is transformed before rendering
 int getWidth()
          Elements are displayed around their center (not around their top left corner) Width and Height are the amount of space used by the repaint.
 boolean grabElement(int DX_Arg, int DY_Arg)
          Simulate the element has been dragged.
 boolean isActive()
          in the centralized architecture we have some elements are in the views and one or few element are handled directly by the DSTabletopPane as drag&dropped elements.
 boolean isBetaAbs()
          indicate how to use beta.
 boolean isMouseTarget(MouseEvent MouseEvent_Arg)
          tell whether a mouse click is within a certain element without actually selecting that element
 boolean isVisible()
           
 void mouseClicked(MouseEvent MouseEvent_Arg)
          mouse callbacks the DSTabletopPane or the view will call
 void mouseDragged(MouseEvent MouseEvent_Arg)
          mouse callbacks the DSTabletopPane or the view will call
 void mouseMoved(MouseEvent MouseEvent_Arg)
          mouse callbacks the DSTabletopPane or the view will call
 void mousePressed(MouseEvent MouseEvent_Arg)
          mouse callbacks the DSTabletopPane or the view will call
 void mouseReleased(MouseEvent MouseEvent_Arg)
          mouse callbacks the DSTabletopPane or the view will call
 void moveElementCenterTo(Point2D.Double touchPoint)
          MERRIE???
 void paint(Graphics Graphics_Arg)
          the default paint method.
 void paint(Graphics2D Graphics_Arg, int Quality)
          According to the repaint speed of rotated element it can be interesting to distinguish when a high quality repaint is necessary and when a low quality repaint is enough.
 void removeDSElementListener(DSElementListener DSElementListener_Arg)
          remove a listener
 void setActive(boolean Active_Arg)
          in the centralized architecture we have some elements are in the views and one or few element are handled directly by the DSTabletopPane as drag&dropped elements.
 void setAlpha(double alpha)
          The degrees of freedom of the DSElements are their distance to the center, their angle comparing to the right direction (from center to the ful right), a scale (for zooming features) and
 void setBeta(double alpha)
          The angle around its center
 void setBetaAbs(boolean betaAbs)
          change how to use beta.
 void setD(double d)
          The degrees of freedom of the DSElements are their distance to the center, their angle comparing to the right direction (from center to the ful right), a scale (for zooming features) and
 void setIDOwner(int Id)
          elements can have an owner associated with them -1 means no owner
 void setScale(double scale)
          The degrees of freedom of the DSElements are their distance to the center, their angle comparing to the right direction (from center to the ful right), a scale (for zooming features) and
 void setSize(int Width_Arg, int Height_Arg)
          Elements are displayed around their center (not around their top left corner) Width and Height are the amount of space used by the repaint.
 void setVisible(boolean visible_Arg)
          say if the component is visible
 

Field Detail

LOW_QUALITY

static final int LOW_QUALITY
According to the repaint speed of rotated element it can be interesting to distinguish when a high quality repaint is necessary and when a low quality repaint is enough.

See Also:
Constant Field Values

HIGH_QUALITY

static final int HIGH_QUALITY
According to the repaint speed of rotated element it can be interesting to distinguish when a high quality repaint is necessary and when a low quality repaint is enough.

See Also:
Constant Field Values
Method Detail

getD

double getD()
The degrees of freedom of the DSElements are their distance to the center, their angle comparing to the right direction (from center to the ful right), a scale (for zooming features) and

Returns:
The d value

setD

void setD(double d)
The degrees of freedom of the DSElements are their distance to the center, their angle comparing to the right direction (from center to the ful right), a scale (for zooming features) and

Parameters:
d - The new d value

getAlpha

double getAlpha()
The degrees of freedom of the DSElements are their distance to the center, their angle comparing to the right direction (from center to the ful right), a scale (for zooming features) and

Returns:
The alpha value

setAlpha

void setAlpha(double alpha)
The degrees of freedom of the DSElements are their distance to the center, their angle comparing to the right direction (from center to the ful right), a scale (for zooming features) and

Parameters:
alpha - The new alpha value

getBeta

double getBeta()
The angle around its center

Returns:
The beta value

setBeta

void setBeta(double alpha)
The angle around its center

Parameters:
alpha - The new beta value

isBetaAbs

boolean isBetaAbs()
indicate how to use beta. if false beta is used as an extra angle around the element center. if true, beta is used to achieve such absolute angle for the top of the document


setBetaAbs

void setBetaAbs(boolean betaAbs)
change how to use beta. if false beta is used as an extra angle around the element center. if true, beta is used to achieve such absolute angle for the top of the document


getScale

double getScale()
The degrees of freedom of the DSElements are their distance to the center, their angle comparing to the right direction (from center to the ful right), a scale (for zooming features) and

Returns:
The scale value

setScale

void setScale(double scale)
The degrees of freedom of the DSElements are their distance to the center, their angle comparing to the right direction (from center to the ful right), a scale (for zooming features) and

Parameters:
scale - The new scale value

getTransform

AffineTransform getTransform()
The matrix decribing how this element is transformed before rendering


setActive

void setActive(boolean Active_Arg)
in the centralized architecture we have some elements are in the views and one or few element are handled directly by the DSTabletopPane as drag&dropped elements. the element have to know if they are selected (or active) to repaint differently. We didn't choose the word selected which can also be implemented independently in a view to select elements.

Parameters:
Active_Arg - The new active value

isActive

boolean isActive()
in the centralized architecture we have some elements are in the views and one or few element are handled directly by the DSTabletopPane as drag&dropped elements. the element have to know if they are selected (or active) to repaint differently. We didn't choose the word selected which can also be implemented independently in a view to select elements.

Returns:
The active value

getWidth

int getWidth()
Elements are displayed around their center (not around their top left corner) Width and Height are the amount of space used by the repaint. some pixels can be transparent anyway

Returns:
The width value

getHeight

int getHeight()
Elements are displayed around their center (not around their top left corner) Width and Height are the amount of space used by the repaint. some pixels can be transparent anyway

Returns:
The height value

setSize

void setSize(int Width_Arg,
             int Height_Arg)
Elements are displayed around their center (not around their top left corner) Width and Height are the amount of space used by the repaint. some pixels can be transparent anyway

Parameters:
Width_Arg - The new size value
Height_Arg - The new size value

paint

void paint(Graphics2D Graphics_Arg,
           int Quality)
According to the repaint speed of rotated element it can be interesting to distinguish when a high quality repaint is necessary and when a low quality repaint is enough.

Parameters:
Graphics_Arg - Description of the Parameter
Quality - Description of the Parameter

paint

void paint(Graphics Graphics_Arg)
the default paint method. should be hight quality then

Parameters:
Graphics_Arg - Description of the Parameter

addDSElementListener

void addDSElementListener(DSElementListener DSElementListener_Arg)
I'm a element so I can dispatch DSElement events to the listener which suscribe through this method

Parameters:
DSElementListener_Arg - The feature to be added to the DSElementListener attribute

removeDSElementListener

void removeDSElementListener(DSElementListener DSElementListener_Arg)
remove a listener

Parameters:
DSElementListener_Arg - Description of the Parameter

mouseDragged

void mouseDragged(MouseEvent MouseEvent_Arg)
mouse callbacks the DSTabletopPane or the view will call

Parameters:
MouseEvent_Arg - Description of the Parameter

mouseReleased

void mouseReleased(MouseEvent MouseEvent_Arg)
mouse callbacks the DSTabletopPane or the view will call

Parameters:
MouseEvent_Arg - Description of the Parameter

mouseClicked

void mouseClicked(MouseEvent MouseEvent_Arg)
mouse callbacks the DSTabletopPane or the view will call

Parameters:
MouseEvent_Arg - Description of the Parameter

mouseMoved

void mouseMoved(MouseEvent MouseEvent_Arg)
mouse callbacks the DSTabletopPane or the view will call

Parameters:
MouseEvent_Arg - Description of the Parameter

mousePressed

void mousePressed(MouseEvent MouseEvent_Arg)
mouse callbacks the DSTabletopPane or the view will call

Parameters:
MouseEvent_Arg - Description of the Parameter

grabElement

boolean grabElement(int DX_Arg,
                    int DY_Arg)
Simulate the element has been dragged. uses the coordinates given as grab point in the local coordinate system

Parameters:
DX_Arg - Description of the Parameter
DY_Arg - Description of the Parameter

isMouseTarget

boolean isMouseTarget(MouseEvent MouseEvent_Arg)
tell whether a mouse click is within a certain element without actually selecting that element

Parameters:
MouseEvent_Arg - Description of the Parameter
Returns:
The mouseTarget value

doesContain

boolean doesContain(double x,
                    double y)
Description of the Method

Parameters:
x - Description of the Parameter
y - Description of the Parameter
Returns:
Description of the Return Value

setIDOwner

void setIDOwner(int Id)
elements can have an owner associated with them -1 means no owner

Parameters:
Id - The new iDOwner value

getIDOwner

int getIDOwner()
Gets the iDOwner attribute of the DSElement object

Returns:
The iDOwner value

setVisible

void setVisible(boolean visible_Arg)
say if the component is visible

Parameters:
visible_Arg - The new visibility value

isVisible

boolean isVisible()
Returns:
if this element is visible

getAbsoluteScale

double getAbsoluteScale()
Gets the Absolute Scale attribute of the DSElement object

Returns:
The absScale value

moveElementCenterTo

void moveElementCenterTo(Point2D.Double touchPoint)
MERRIE???

Parameters:
touchPoint - Description of the Parameter

acceptSlavery

boolean acceptSlavery(DSElement dsElement)
tells if this dselement accept to be slave of an other one.

To do:
: make a slave listener mechanism

acceptSlaveryRelease

boolean acceptSlaveryRelease()
tells if I accept to be released



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