|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.diamondspin.DSMenuBarManager
public class DSMenuBarManager
DSMenuBarManager is a utility class for DSTabletopPane. It manages all the menubars.
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.
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. |
Field Summary | |
---|---|
protected ArrayList<DSMenuBar> |
DSMenuBarList
There are multiple menubars. |
Constructor Summary | |
---|---|
protected |
DSMenuBarManager(DSTabletopPane dsTabletopPane_Arg)
Constructor for the DSPopupMenuManager object |
Method Summary | |
---|---|
void |
addDSMenuBar(DSMenuBar dsMenuBar)
add a menubar in the list |
int |
checkMenubarAsEventTarget(MouseEvent event)
checks if an event(mouse, DT, any spatial event) is targetting a menubar or not (-1) |
void |
collapseMenu(int id)
collapses the submenu from a menubar belonging to a certain owner |
DSMenuBar |
getDSMenuBar(int index)
|
int |
getDSMenuBarCount()
|
ArrayList<DSMenuBar> |
getDSMenuBarList()
|
double |
getMenuAngle(int id)
return the angle of someone's menubar or a default angle if they have no menubar |
boolean |
hasAMenuBar(int id)
check if someone owns a menubar |
boolean |
isDSMenuBarAt(double angle)
determine if there is a menubar at a given angle |
boolean |
isMenuBarNearUser(DSMenuBar Menu_Arg,
int id)
For oriented sharing mode for menus, since I don't know what angle determines a certain user outside of table mode, I will make an educated guess by assuming it is the angle of their personal menu bar if they have one |
boolean |
mouseClickedMenuBar(MouseEvent event,
int id)
Dispatch a mouse click event to the menubars to see it they are interested |
boolean |
mousePressedMenubar(MouseEvent event,
int id)
Dispatch a mouse release event to the menubars to see it they are interested |
boolean |
mouseReleasedMenuBar(MouseEvent event,
int id)
Dispatch a mouse release event to the menubars to see it they are interested |
protected void |
paintDSMenubars(Graphics2D Graphics_Arg,
boolean drawDragObject)
paint the menubars in their own layer. |
void |
pressMenubar(MouseEvent event,
int id,
DSMenuBar dsMenuBar)
send a mousePressed() event to a given menubar |
void |
removeAllDSMenuBars()
remove all menubar around the table |
void |
removeDSMenuBar(DSMenuBar dsMenuBar)
remove a menubar in the list |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected ArrayList<DSMenuBar> DSMenuBarList
Constructor Detail |
---|
protected DSMenuBarManager(DSTabletopPane dsTabletopPane_Arg)
dsTabletopPane_Arg
- the DSTabletopPane with whom I'm working withMethod Detail |
---|
public int getDSMenuBarCount()
public DSMenuBar getDSMenuBar(int index)
index
- the index of the menubar in the list of menubars
public ArrayList<DSMenuBar> getDSMenuBarList()
public void removeDSMenuBar(DSMenuBar dsMenuBar)
dsMenuBar
- the menubar to removepublic void removeAllDSMenuBars()
public void addDSMenuBar(DSMenuBar dsMenuBar)
dsMenuBar
- the menubar to addpublic boolean isDSMenuBarAt(double angle)
angle
- the angle we want to know if a menu is on it. 0 means the angle on the right
public boolean mousePressedMenubar(MouseEvent event, int id)
event
- the mouse event to dispatchid
- the id of the used
public boolean mouseReleasedMenuBar(MouseEvent event, int id)
event
- the mouse event to dispatchid
- the id of the used
public boolean mouseClickedMenuBar(MouseEvent event, int id)
event
- the mouse event to dispatchid
- the id of the used
public void pressMenubar(MouseEvent event, int id, DSMenuBar dsMenuBar)
event
- The event to give as argumentid
- the user id of the initiatordsMenuBar
- The target menubarprotected void paintDSMenubars(Graphics2D Graphics_Arg, boolean drawDragObject)
Graphics_Arg
- a graphic context on the general component = the back buffer of this componentpublic int checkMenubarAsEventTarget(MouseEvent event)
event
- the event to test
public boolean hasAMenuBar(int id)
id
- The user ID to check
public double getMenuAngle(int id)
id
- The user ID to check
public void collapseMenu(int id)
id
- menu ownerpublic boolean isMenuBarNearUser(DSMenuBar Menu_Arg, int id)
Menu_Arg
- The menubar to checkid
- The user ID to check
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |