org.diamondspin
Class DSPopupMenuManager

java.lang.Object
  extended by org.diamondspin.DSPopupMenuManager

public class DSPopupMenuManager
extends Object

DSPopupMenuManager is a utility class for DSTabletopPane. It manages all the popup menus.

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.

created Sept 11, 2003

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

Constructor Summary
protected DSPopupMenuManager(DSTabletopPane dsTabletopPane_Arg)
          Constructor for the DSPopupMenuManager object
 
Method Summary
 int checkPopupAsEventTarget(MouseEvent MouseEvent_Arg)
          checks if an event(mouse, DT, any spatial event) is targetting a popup menu or not (-1)
 DSPopupMenu getDSPopupMenu(int Id)
          Gets the DSPopupMenu associated for a user (null if no popupMenu for him)
 boolean mousePressedPopup(MouseEvent MouseEvent_Arg, int Id, double d, double alpha)
          Description of the Method
 boolean mouseReleasedPopup(MouseEvent MouseEvent_Arg, int Id, double d, double alpha)
          Description of the Method
 void openPopupMenuElement(double d, double alpha, DSElement elem, int id)
          directly open a popup menu for an element at a given location
 void openPopupMenuGlobal(double d, double alpha, int Id)
          directly open a popup menu for an element at a given location
protected  void setDSPopupMenu(DSPopupMenu DSPopupMenu_Arg, int Id)
          Sets the DSPopupMenu associated for a user (null if no popupMenu for him)
 void unsetAllPopupMenus()
          discard all the popup menus ! usefull for switching views
 void unsetAllPopupMenusForElement(DSElement DSElement_Arg)
          Unset the popup menu for a given element (for instance if the element is deleted, modified, etc.)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DSPopupMenuManager

protected DSPopupMenuManager(DSTabletopPane dsTabletopPane_Arg)
Constructor for the DSPopupMenuManager object

Parameters:
dsTabletopPane_Arg - the DSTabletopPane with whom I'm working with
Method Detail

getDSPopupMenu

public DSPopupMenu getDSPopupMenu(int Id)
Gets the DSPopupMenu associated for a user (null if no popupMenu for him)

Parameters:
Id - ID of the user
Returns:
The DSPopupMenu for this user

setDSPopupMenu

protected void setDSPopupMenu(DSPopupMenu DSPopupMenu_Arg,
                              int Id)
Sets the DSPopupMenu associated for a user (null if no popupMenu for him)

Parameters:
Id - ID of the user
DSPopupMenu_Arg - The new DSPopupMenu for this user

unsetAllPopupMenusForElement

public void unsetAllPopupMenusForElement(DSElement DSElement_Arg)
Unset the popup menu for a given element (for instance if the element is deleted, modified, etc.)

Parameters:
DSElement_Arg - The element concerned by the operation

unsetAllPopupMenus

public void unsetAllPopupMenus()
discard all the popup menus ! usefull for switching views


checkPopupAsEventTarget

public int checkPopupAsEventTarget(MouseEvent MouseEvent_Arg)
checks if an event(mouse, DT, any spatial event) is targetting a popup menu or not (-1)

Parameters:
MouseEvent_Arg - Description of the Parameter
Returns:
Description of the Return Value

mousePressedPopup

public boolean mousePressedPopup(MouseEvent MouseEvent_Arg,
                                 int Id,
                                 double d,
                                 double alpha)
Description of the Method

Parameters:
MouseEvent_Arg - The mouseevent to propagate to the popup eventually
Id - The id of the user triggering this event
d - The Distance form the Center
alpha - The angle from the horizontal
Returns:
true if consumed

mouseReleasedPopup

public boolean mouseReleasedPopup(MouseEvent MouseEvent_Arg,
                                  int Id,
                                  double d,
                                  double alpha)
Description of the Method

Parameters:
MouseEvent_Arg - The mouseevent to propagate to the popup eventually
Id - The id of the user triggering this event
d - The Distance form the Center
alpha - The angle from the horizontal
Returns:
true if consumed

openPopupMenuElement

public void openPopupMenuElement(double d,
                                 double alpha,
                                 DSElement elem,
                                 int id)
directly open a popup menu for an element at a given location

Parameters:
elem - The element to open a ppup menu on
id - The id of the user triggering this event
d - The Distance form the Center
alpha - The angle from the horizontal

openPopupMenuGlobal

public void openPopupMenuGlobal(double d,
                                double alpha,
                                int Id)
directly open a popup menu for an element at a given location

Parameters:
Id - The id of the user triggering this event
d - The Distance form the Center
alpha - The angle from the horizontal


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