org.diamondspin
Class DSSideHandler

java.lang.Object
  extended by org.diamondspin.DSSideHandler
All Implemented Interfaces:
Cloneable, DSElement

public class DSSideHandler
extends Object
implements DSElement


Field Summary
protected  DSFrame frame
           
protected  int idOwner
           
protected  boolean side
           
 
Fields inherited from interface org.diamondspin.DSElement
HIGH_QUALITY, LOW_QUALITY
 
Constructor Summary
DSSideHandler(DSFrame f, boolean side)
           
 
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
 Object clone()
           
 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
 DSFrame getFrame()
           
 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 e)
          tell whether a mouse click is within a certain element without actually selecting that element
 boolean isSide()
           
 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 g)
          the default paint method.
 void paint(Graphics2D g, int q)
          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
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

frame

protected DSFrame frame

side

protected boolean side

idOwner

protected int idOwner
Constructor Detail

DSSideHandler

public DSSideHandler(DSFrame f,
                     boolean side)
Parameters:
side - tells if this handler handles the front side
Method Detail

setVisible

public void setVisible(boolean visible_Arg)
Description copied from interface: DSElement
say if the component is visible

Specified by:
setVisible in interface DSElement
Parameters:
visible_Arg - The new visibility value

setActive

public void setActive(boolean Active_Arg)
Description copied from interface: DSElement
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.

Specified by:
setActive in interface DSElement
Parameters:
Active_Arg - The new active value

isMouseTarget

public boolean isMouseTarget(MouseEvent e)
Description copied from interface: DSElement
tell whether a mouse click is within a certain element without actually selecting that element

Specified by:
isMouseTarget in interface DSElement
Parameters:
e - Description of the Parameter
Returns:
The mouseTarget value

mouseClicked

public void mouseClicked(MouseEvent MouseEvent_Arg)
Description copied from interface: DSElement
mouse callbacks the DSTabletopPane or the view will call

Specified by:
mouseClicked in interface DSElement
Parameters:
MouseEvent_Arg - Description of the Parameter

mouseDragged

public void mouseDragged(MouseEvent MouseEvent_Arg)
Description copied from interface: DSElement
mouse callbacks the DSTabletopPane or the view will call

Specified by:
mouseDragged in interface DSElement
Parameters:
MouseEvent_Arg - Description of the Parameter

mouseMoved

public void mouseMoved(MouseEvent MouseEvent_Arg)
Description copied from interface: DSElement
mouse callbacks the DSTabletopPane or the view will call

Specified by:
mouseMoved in interface DSElement
Parameters:
MouseEvent_Arg - Description of the Parameter

mousePressed

public void mousePressed(MouseEvent MouseEvent_Arg)
Description copied from interface: DSElement
mouse callbacks the DSTabletopPane or the view will call

Specified by:
mousePressed in interface DSElement
Parameters:
MouseEvent_Arg - Description of the Parameter

mouseReleased

public void mouseReleased(MouseEvent MouseEvent_Arg)
Description copied from interface: DSElement
mouse callbacks the DSTabletopPane or the view will call

Specified by:
mouseReleased in interface DSElement
Parameters:
MouseEvent_Arg - Description of the Parameter

paint

public void paint(Graphics2D g,
                  int q)
Description copied from interface: DSElement
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.

Specified by:
paint in interface DSElement
Parameters:
g - Description of the Parameter
q - Description of the Parameter

setScale

public void setScale(double scale)
Description copied from interface: DSElement
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

Specified by:
setScale in interface DSElement
Parameters:
scale - The new scale value

setD

public void setD(double d)
Description copied from interface: DSElement
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

Specified by:
setD in interface DSElement
Parameters:
d - The new d value

setBeta

public void setBeta(double alpha)
Description copied from interface: DSElement
The angle around its center

Specified by:
setBeta in interface DSElement
Parameters:
alpha - The new beta value

setAlpha

public void setAlpha(double alpha)
Description copied from interface: DSElement
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

Specified by:
setAlpha in interface DSElement
Parameters:
alpha - The new alpha value

paint

public void paint(Graphics g)
Description copied from interface: DSElement
the default paint method. should be hight quality then

Specified by:
paint in interface DSElement
Parameters:
g - Description of the Parameter

removeDSElementListener

public void removeDSElementListener(DSElementListener DSElementListener_Arg)
Description copied from interface: DSElement
remove a listener

Specified by:
removeDSElementListener in interface DSElement
Parameters:
DSElementListener_Arg - Description of the Parameter

addDSElementListener

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

Specified by:
addDSElementListener in interface DSElement
Parameters:
DSElementListener_Arg - The feature to be added to the DSElementListener attribute

setIDOwner

public void setIDOwner(int id)
Description copied from interface: DSElement
elements can have an owner associated with them -1 means no owner

Specified by:
setIDOwner in interface DSElement
Parameters:
id - The new iDOwner value

acceptSlavery

public boolean acceptSlavery(DSElement dsElement)
Description copied from interface: DSElement
tells if this dselement accept to be slave of an other one.

Specified by:
acceptSlavery in interface DSElement

acceptSlaveryRelease

public boolean acceptSlaveryRelease()
Description copied from interface: DSElement
tells if I accept to be released

Specified by:
acceptSlaveryRelease in interface DSElement

getTransform

public AffineTransform getTransform()
Description copied from interface: DSElement
The matrix decribing how this element is transformed before rendering

Specified by:
getTransform in interface DSElement

moveElementCenterTo

public void moveElementCenterTo(Point2D.Double touchPoint)
Description copied from interface: DSElement
MERRIE???

Specified by:
moveElementCenterTo in interface DSElement
Parameters:
touchPoint - Description of the Parameter

setSize

public void setSize(int Width_Arg,
                    int Height_Arg)
Description copied from interface: DSElement
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

Specified by:
setSize in interface DSElement
Parameters:
Width_Arg - The new size value
Height_Arg - The new size value

getWidth

public int getWidth()
Description copied from interface: DSElement
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

Specified by:
getWidth in interface DSElement
Returns:
The width value

getScale

public double getScale()
Description copied from interface: DSElement
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

Specified by:
getScale in interface DSElement
Returns:
The scale value

getIDOwner

public int getIDOwner()
Description copied from interface: DSElement
Gets the iDOwner attribute of the DSElement object

Specified by:
getIDOwner in interface DSElement
Returns:
The iDOwner value

getHeight

public int getHeight()
Description copied from interface: DSElement
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

Specified by:
getHeight in interface DSElement
Returns:
The height value

getD

public double getD()
Description copied from interface: DSElement
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

Specified by:
getD in interface DSElement
Returns:
The d value

getBeta

public double getBeta()
Description copied from interface: DSElement
The angle around its center

Specified by:
getBeta in interface DSElement
Returns:
The beta value

isBetaAbs

public boolean isBetaAbs()
Description copied from interface: DSElement
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

Specified by:
isBetaAbs in interface DSElement

setBetaAbs

public void setBetaAbs(boolean betaAbs)
Description copied from interface: DSElement
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

Specified by:
setBetaAbs in interface DSElement

getAlpha

public double getAlpha()
Description copied from interface: DSElement
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

Specified by:
getAlpha in interface DSElement
Returns:
The alpha value

getAbsoluteScale

public double getAbsoluteScale()
Description copied from interface: DSElement
Gets the Absolute Scale attribute of the DSElement object

Specified by:
getAbsoluteScale in interface DSElement
Returns:
The absScale value

doesContain

public boolean doesContain(double x,
                           double y)
Description copied from interface: DSElement
Description of the Method

Specified by:
doesContain in interface DSElement
Parameters:
x - Description of the Parameter
y - Description of the Parameter
Returns:
Description of the Return Value

grabElement

public boolean grabElement(int DX_Arg,
                           int DY_Arg)
Description copied from interface: DSElement
Simulate the element has been dragged. uses the coordinates given as grab point in the local coordinate system

Specified by:
grabElement in interface DSElement
Parameters:
DX_Arg - Description of the Parameter
DY_Arg - Description of the Parameter

isActive

public boolean isActive()
Description copied from interface: DSElement
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.

Specified by:
isActive in interface DSElement
Returns:
The active value

isVisible

public boolean isVisible()
Specified by:
isVisible in interface DSElement
Returns:
if this element is visible

clone

public Object clone()
             throws CloneNotSupportedException
Overrides:
clone in class Object
Throws:
CloneNotSupportedException

getFrame

public DSFrame getFrame()

isSide

public boolean isSide()


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