org.diamondspin
Class DSDefaultView

java.lang.Object
  extended by org.diamondspin.DSView
      extended by org.diamondspin.DSDefaultView
All Implemented Interfaces:
MouseListener, MouseMotionListener, EventListener, DSConstants

public class DSDefaultView
extends DSView
implements DSConstants

DSDefaultView is a generic object with all the common functionnalities like annotation, element list, etc..

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 : 12 may 2003

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

Field Summary
static int ANNOTATE_MODE
           
static int DEMOTE_MODE
           
static int DRAG_MODE
           
protected  int[] dragMode
          mode of what happen when an user hits the background of the view and start moving ...
static int DRAW_MODE
           
protected  List<DSElement> elemList
          list of the elements present in the view
static int ERASE_MODE
           
static int LASSO_MODE
           
static int NOTHING_MODE
           
static int PAN_BCKGRND_MODE
           
static int PAN_MODE
           
static int PAN_VIEW_MODE
           
protected  boolean pilableDSFrames
           
static int RECT_MODE
           
static int ROTATE_BCKGRND_MODE
           
static int ROTATE_MODE
           
static int ROTATE_VIEW_MODE
           
static int ZOOM_BCKGRND_MODE
           
static int ZOOM_MODE
           
static int ZOOM_VIEW_MODE
           
 
Fields inherited from class org.diamondspin.DSView
backgroundAngle, backgroundCenter, backgroundImage, backgroundMarginX, backgroundMarginY, backgroundPaint, backgroundZoom, dsTabletopPane, FOLDED_HEIGHT_PERCENTAGE, FOLDED_WIDTH_PERCENTAGE, foldedHeightPercentage, foldedWidthPercentage, oldBackgroundAngle, oldBackgroundCenter, oldBackgroundZoom, resizedBackground, viewListeners
 
Fields inherited from interface org.diamondspin.DSConstants
COLLAGE_TOP_COLOR, COLLAGE_TOP_THICKNESS, DRAW_COLLAGE_TOP
 
Constructor Summary
DSDefaultView(DSTabletopPane dsTabletopPane)
          Construct the view for the specified number of users.
 
Method Summary
 void addDSElement(DSElement elem)
          add an element under everything
 void addDSElement(int pos, DSElement elem)
          insert an element exactly where you want in the list of elements
 void addDSViewContentListener(DSViewContentListener l)
          a view listen for all its element and can forward event to listeners registered to view
 void clear()
          remove ALL the elements from this view
 boolean containsDSElement(DSElement elem)
           
 void demoteAllElementsToTable()
          demote all drag element in the view
 void demoteElementToTable(DSElement elem)
          take the drag element of DSTabletopPane and put it in my list
 void fireElementAdded(DSElement el)
          a view listen for all its element and can forward event to listeners registered to view
 void fireElementDrawn(DSElement el)
           
 void fireElementPiled(DSElement el)
           
 void fireElementRemoved(DSElement el)
           
 void fireMoveAll()
           
 int getDragMode()
           
 int getDragMode(int userID)
           
 List<DSElement> getElementList()
           
 boolean isPilableDSFrames()
           
 void mouseClicked(MouseEvent event)
          handle click on element
 void mouseDragged(MouseEvent event)
          mouseDragged callback
 void mousePressed(MouseEvent event)
          see if clicked on one element
 void mousePressedBehindElements(MouseEvent event)
           
 void mouseReleased(MouseEvent event)
          handle click on element
 void openPopupMenuElement(double d, double alpha, DSElement DSElement_Arg, int Id)
          open the popup menu for a given element
 void paint(Graphics2D Graphics_Arg)
          paint the elements
 void promoteElementToTable(DSElement element, int id)
          take the drag element in the list and promote it as dragobject of the DSTabletopPane
 void removeElement(DSElement el)
          remove an element of the view
 void removeViewContentListener(DSViewContentListener l)
           
 void resetAllBeta()
          reset all beta angles of element to zero
 void setDragMode(int dragMode)
           
 void setDragMode(int userID, int dragMode)
           
 void setPilableDSFrames(boolean pilableDSFrames)
           
protected  DSElement strokeAt(double x, double y, DSStroke stroke)
          Take a stroke and see if it can apply to an element here.
protected  boolean strokeOn(double x, double y, DSStroke stroke, DSElement el)
          Take a stroke and see if it can apply to an element here.
 void switchDSElements(int pos0, int pos1)
          insert an element exactly where you want in the list of elements
 String toString()
           
 
Methods inherited from class org.diamondspin.DSView
addDSGestureListener, addDSViewListener, fireBackgroundRotated, fireBackgroundTranslated, fireBackgroundUpdated, fireBackgroundZoomed, fireGestureProgress, fireGestureStart, fireGestureStop, fireViewGrabbed, fireViewReleased, fireViewRotated, fireViewTranslated, fireViewZoomed, getBackground, getBackgroundAngle, getBackgroundCenter, getBackgroundPaint, getBackgroundZoom, getFoldedHeightPercentage, getFoldedWidthPercentage, getFullBackground, getTabletopPane, incrBackgroundX, incrBackgroundY, mouseEntered, mouseExited, mouseMoved, openPopupMenuGlobal, removeDSGestureListener, removeViewListener, setBackground, setBackgroundAngle, setBackgroundCenter, setBackgroundPaint, setBackgroundZoom, setFoldedHeightPercentage, setFoldedWidthPercentage, setSnapToAngle, updateBackground
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

elemList

protected final List<DSElement> elemList
list of the elements present in the view


pilableDSFrames

protected boolean pilableDSFrames

dragMode

protected int[] dragMode
mode of what happen when an user hits the background of the view and start moving ...


NOTHING_MODE

public static final int NOTHING_MODE
See Also:
Constant Field Values

ROTATE_MODE

public static final int ROTATE_MODE
See Also:
Constant Field Values

DRAG_MODE

public static final int DRAG_MODE
See Also:
Constant Field Values

PAN_BCKGRND_MODE

public static final int PAN_BCKGRND_MODE
See Also:
Constant Field Values

ROTATE_BCKGRND_MODE

public static final int ROTATE_BCKGRND_MODE
See Also:
Constant Field Values

ZOOM_BCKGRND_MODE

public static final int ZOOM_BCKGRND_MODE
See Also:
Constant Field Values

DEMOTE_MODE

public static final int DEMOTE_MODE
See Also:
Constant Field Values

PAN_VIEW_MODE

public static final int PAN_VIEW_MODE
See Also:
Constant Field Values

ROTATE_VIEW_MODE

public static final int ROTATE_VIEW_MODE
See Also:
Constant Field Values

ZOOM_VIEW_MODE

public static final int ZOOM_VIEW_MODE
See Also:
Constant Field Values

PAN_MODE

public static final int PAN_MODE
See Also:
Constant Field Values

DRAW_MODE

public static final int DRAW_MODE
See Also:
Constant Field Values

ZOOM_MODE

public static final int ZOOM_MODE
See Also:
Constant Field Values

ANNOTATE_MODE

public static final int ANNOTATE_MODE
See Also:
Constant Field Values

ERASE_MODE

public static final int ERASE_MODE
See Also:
Constant Field Values

LASSO_MODE

public static final int LASSO_MODE
See Also:
Constant Field Values

RECT_MODE

public static final int RECT_MODE
See Also:
Constant Field Values
Constructor Detail

DSDefaultView

public DSDefaultView(DSTabletopPane dsTabletopPane)
Construct the view for the specified number of users.

Parameters:
dsTabletopPane - Description of the Parameter
Method Detail

openPopupMenuElement

public void openPopupMenuElement(double d,
                                 double alpha,
                                 DSElement DSElement_Arg,
                                 int Id)
open the popup menu for a given element

Parameters:
d - the Alpha the popup should have
alpha - the D the popup should have
DSElement_Arg - the element the popup should be on
Id - the user initializing the popup

demoteAllElementsToTable

public void demoteAllElementsToTable()
demote all drag element in the view


containsDSElement

public boolean containsDSElement(DSElement elem)
Parameters:
elem - the element to test
Returns:
true is the view contqins this element in its list of elements

promoteElementToTable

public void promoteElementToTable(DSElement element,
                                  int id)
take the drag element in the list and promote it as dragobject of the DSTabletopPane

Parameters:
element - the element to be promoted

demoteElementToTable

public void demoteElementToTable(DSElement elem)
take the drag element of DSTabletopPane and put it in my list

Parameters:
elem - the element (suposely a dragobject handled directly by the pane) to drop in the view

paint

public void paint(Graphics2D Graphics_Arg)
paint the elements

Overrides:
paint in class DSView
Parameters:
Graphics_Arg - Description of the Parameter

mousePressed

public void mousePressed(MouseEvent event)
see if clicked on one element

Specified by:
mousePressed in interface MouseListener
Overrides:
mousePressed in class DSView
Parameters:
event - Description of the Parameter

mousePressedBehindElements

public void mousePressedBehindElements(MouseEvent event)

mouseDragged

public void mouseDragged(MouseEvent event)
mouseDragged callback

Specified by:
mouseDragged in interface MouseMotionListener
Overrides:
mouseDragged in class DSView
Parameters:
event - the callback event object

mouseReleased

public void mouseReleased(MouseEvent event)
handle click on element

Specified by:
mouseReleased in interface MouseListener
Overrides:
mouseReleased in class DSView
Parameters:
event - Description of the Parameter

mouseClicked

public void mouseClicked(MouseEvent event)
handle click on element

Specified by:
mouseClicked in interface MouseListener
Overrides:
mouseClicked in class DSView
Parameters:
event - Description of the Parameter

resetAllBeta

public void resetAllBeta()
reset all beta angles of element to zero


addDSElement

public void addDSElement(DSElement elem)
add an element under everything

Parameters:
elem - The feature to be added to the Element attribute

switchDSElements

public void switchDSElements(int pos0,
                             int pos1)
insert an element exactly where you want in the list of elements

Parameters:
pos0 - the position in the list of the first element to switch
pos1 - the position in the list of the second element to switch

addDSElement

public void addDSElement(int pos,
                         DSElement elem)
insert an element exactly where you want in the list of elements

Parameters:
elem - The feature to be added to the Element attribute

clear

public void clear()
remove ALL the elements from this view


removeElement

public void removeElement(DSElement el)
remove an element of the view

Parameters:
el - the element to remove from the element list

strokeAt

protected DSElement strokeAt(double x,
                             double y,
                             DSStroke stroke)
Take a stroke and see if it can apply to an element here. Returned the concerned element if pertinent.

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

strokeOn

protected boolean strokeOn(double x,
                           double y,
                           DSStroke stroke,
                           DSElement el)
Take a stroke and see if it can apply to an element here. Returned the concerned element if pertinent.

Parameters:
x - the location to look at (x)
y - the location to look at (y)
stroke - the stroke around the point suposely mening something
el - the dselement under the point x,y
Returns:
return if the stroke do something or must be propagated farther

getElementList

public List<DSElement> getElementList()

getDragMode

public int getDragMode()

setDragMode

public void setDragMode(int dragMode)

getDragMode

public int getDragMode(int userID)

setDragMode

public void setDragMode(int userID,
                        int dragMode)

isPilableDSFrames

public boolean isPilableDSFrames()

setPilableDSFrames

public void setPilableDSFrames(boolean pilableDSFrames)

addDSViewContentListener

public void addDSViewContentListener(DSViewContentListener l)
a view listen for all its element and can forward event to listeners registered to view


removeViewContentListener

public void removeViewContentListener(DSViewContentListener l)

fireMoveAll

public void fireMoveAll()

fireElementAdded

public void fireElementAdded(DSElement el)
a view listen for all its element and can forward event to listeners registered to view


fireElementRemoved

public void fireElementRemoved(DSElement el)

fireElementPiled

public void fireElementPiled(DSElement el)

fireElementDrawn

public void fireElementDrawn(DSElement el)

toString

public String toString()
Overrides:
toString in class Object


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