|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfr.inria.zvtm.widgets.Menu
public class Menu
Implementation of a linear menu.
| Field Summary | |
|---|---|
protected static double |
DEFAULT_ITEM_HEIGHT
|
protected static Color |
DEFAULT_MENU_BGCOLOR
|
protected static Color |
DEFAULT_MENU_HCOLOR
|
protected static Color |
DEFAULT_MENU_LBCOLOR
|
protected List<Glyph> |
elems
|
protected short |
LABEL_ANCHOR
|
protected Color |
MENU_BGCOLOR
|
protected static String |
MENU_BOX_TYPE
|
protected Color |
MENU_HCOLOR
|
protected Color |
MENU_LBCOLOR
|
protected VirtualSpace |
space
|
protected double |
width
|
| Constructor Summary | |
|---|---|
Menu(VirtualSpace space)
|
|
Menu(VirtualSpace space,
Color bgColor,
Color hColor,
Color lColor,
short labelAnchor)
|
|
| Method Summary | |
|---|---|
void |
clear()
Clears the menu |
MenuItem |
getItemForGlyph(Glyph glyph)
Returns the MenuItem associated to a given Glyph, if there is such an item. |
double |
getWidth()
Returns the width of the menu, in virtual space units. |
void |
hide()
Hides the menu |
protected VText |
makeLabel(MenuItem item,
double xpos,
double ypos)
Override this method if you need to customize menu labels (e.g. |
void |
onEnterGlyph(Glyph g)
Should be called from outside to highlight the menu items if needed. |
void |
onExitGlyph(Glyph g)
Should be called from outside to highlight the menu items if needed. |
void |
populate(List<MenuItem> items,
Point2D.Double coords)
Builds a menu from the given items. |
void |
setWidth(double width)
Sets the width of the menu. |
void |
show()
Shows the menu |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected double width
protected static final double DEFAULT_ITEM_HEIGHT
protected static final Color DEFAULT_MENU_BGCOLOR
protected static final Color DEFAULT_MENU_HCOLOR
protected static final Color DEFAULT_MENU_LBCOLOR
protected Color MENU_BGCOLOR
protected Color MENU_HCOLOR
protected Color MENU_LBCOLOR
protected short LABEL_ANCHOR
protected static final String MENU_BOX_TYPE
protected final VirtualSpace space
protected final List<Glyph> elems
| Constructor Detail |
|---|
public Menu(VirtualSpace space)
public Menu(VirtualSpace space,
Color bgColor,
Color hColor,
Color lColor,
short labelAnchor)
space - VirtualSpace in which to instantiate the menubgColor - background color of menu item boxeshighlight - color of menu item boxes (when cursor inside)lColor - menu item label colorlabel - alignment (one of VText.TEXT_ANCHOR_*)| Method Detail |
|---|
public void show()
public void hide()
public void clear()
public double getWidth()
public void setWidth(double width)
width - new width of the menu, in virtualspace units
IllegalArgumentException - if width is less than or equal to 0.
protected VText makeLabel(MenuItem item,
double xpos,
double ypos)
public void populate(List<MenuItem> items,
Point2D.Double coords)
coords - coordinates of the topmost menu item, in virtual space units.public MenuItem getItemForGlyph(Glyph glyph)
public void onEnterGlyph(Glyph g)
public void onExitGlyph(Glyph g)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||