|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectch.claudio.pen.Menu
public class Menu
One way to present multi level menu in just one rectangle. Let's say the main menu is A. B. C, and A has a submenu Aa, Ab, Ac and Ac has a submenu Ac1, Ac2, Ac3, Ac4. The first menu presents the items A, B, C all with a bright background (e.g. white). If the user selects A the menu is replaced with a new one containing A, Aa, Ab, Ac where A has a darker background (e.g. light grey) while Aa, Ab and Ac have the bright background. The user can click on A and will get back to the main menu, or click on Ac to get one submen down. In that case the menu will contain A, Ac, Ac1, Ac2, Ac3 and Ac4 where A and Ac have a darker and Ac1, Ac2, Ac3 and Ac4 a bright background. This scheme assumes, that a node is either an action node or contains a submenu.
Copyright (C) 2006 Claudio Nieder <private@claudio.ch>, CH-8610 Uster
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Constructor Summary | |
---|---|
Menu(MenuItem[] itemsArg)
Create |
Method Summary | |
---|---|
void |
displayAt(java.awt.Graphics g,
int x,
int y)
|
void |
higlight(java.awt.Component c,
int x,
int y)
Call repaint if the cursor position needs higlighting another menu item. |
static void |
main(java.lang.String[] args)
Print license. |
void |
select(int x,
int y)
Execute the action below the cursor position |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Menu(MenuItem[] itemsArg)
itemsArg
- Method Detail |
---|
public void displayAt(java.awt.Graphics g, int x, int y)
g
- x
- y
- public void higlight(java.awt.Component c, int x, int y)
c
- x
- y
- public void select(int x, int y)
x
- currently ignoredy
- position of cursorpublic static void main(java.lang.String[] args)
args
- ignored
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |