|
Multivalent API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmultivalent.VObject
multivalent.Node
multivalent.INode
multivalent.IScrollPane
multivalent.gui.VMenu
Pure Multivalent menu widget. Like IVBox + IScrollPane. Connect to VMenuButton for pulldown or popup, invoke post()/unpost() externally for popup anywhere, or embed in document for List-type widget.
As children you can have any kind of node: VButton/VCheckButton/VRadioButton, IHBox for HTML OPTIONs, or VMenuButton for cascaded menus. In other words, there is no need for a separate group of MenuItem widgets. As mentioned on the package-wide description, since Multivalent widgets can have arbitrary content, having, say, a menu item with a image and text is easy.
If selected item has VScript in "script" attribute, it's executed upon selection.
Field Summary | |
---|---|
static java.lang.String |
CATEGORY_MEDIUM
Menu category ( medium ) for medium-specific options (where medium is PDF, HTML, DirectoryLocal, ...). |
static int |
Maxsize
Maximum number of items to show at once (more uses scrolling). |
static java.lang.String |
MSG_CREATE_ANNO
Construct Anno menu by passing around to behaviors and letting them add (or delete) entiries. |
static java.lang.String |
MSG_CREATE_BOOKMARK
Construct Bookmark menu by passing around to behaviors and letting them add (or delete) entiries. |
static java.lang.String |
MSG_CREATE_EDIT
Construct Edit menu by passing around to behaviors and letting them add (or delete) entiries. |
static java.lang.String |
MSG_CREATE_FILE
Construct File menu by passing around to behaviors and letting them add (or delete) entiries. |
static java.lang.String |
MSG_CREATE_GO
Construct Go menu by passing around to behaviors and letting them add (or delete) entiries. |
static java.lang.String |
MSG_CREATE_HELP
Construct Help menu by passing around to behaviors and letting them add (or delete) entiries. |
static java.lang.String |
MSG_CREATE_LENS
Construct Lens menu by passing around to behaviors and letting them add (or delete) entiries. |
static java.lang.String |
MSG_CREATE_STYLE
Construct Style menu by passing around to behaviors and letting them add (or delete) entiries. |
static java.lang.String |
MSG_CREATE_VIEW
Construct View menu by passing around to behaviors and letting them add (or delete) entiries. |
static java.lang.String |
VAR_MENUSTACK
Key into Root's globals to get ordered List<> of menus currently posted. |
Fields inherited from class multivalent.IScrollPane |
---|
editable, hchars_, ibbox, MSG_FORMATTED, MSG_SCROLL_TO, wchars_ |
Fields inherited from class multivalent.INode |
---|
border, INSETS, INSETS_ZERO, margin, padding |
Fields inherited from class multivalent.Node |
---|
align, ALIGN_INVALID, ATTR_ID, ATTR_SCRIPT, baseline, BASELINE, bbox, BOTH, BOTTOM, CENTER, CHAR, FILL, floats, INHERIT, JUSTIFY, LEFT, MAXNONSTRUCTDEPTH, MIDDLE, name_, NONE, observers_, parent_, PROBEWIDTH, RIGHT, sticky_, stickycnt_, TOP, valid_, valign |
Fields inherited from class multivalent.VObject |
---|
attr_ |
Constructor Summary | |
---|---|
VMenu(java.lang.String name,
java.util.Map<java.lang.String,java.lang.Object> attr,
INode parent)
|
Method Summary | |
---|---|
Node |
addCategory(Node n,
java.lang.String category)
Immediate subtrees of menu are categories: named VSeparator's used to cluster items from disparate behaviors. |
void |
event(java.awt.AWTEvent e)
Posted with grab, |
boolean |
eventBeforeAfter(java.awt.AWTEvent e,
java.awt.Point rel)
Lets events pass through so disable behavior works. |
boolean |
formatNode(int width,
int height,
Context cx)
Like a IVBox, except is max of children (which are menitems). |
Node |
getSelected()
|
void |
invoke()
Execute active item's script, if any. |
void |
paintNode(java.awt.Rectangle docclip,
Context cx)
Paints contents in scrolled, clipped Graphics2D . |
void |
post(int x,
int y,
Browser br)
Show on screen by disconnecting from (old) parent and adding to root (which is in absolutely positioned space). |
void |
repaint(long ms,
int x,
int y,
int w,
int h)
Redraw portion of node within ms milliseconds. |
void |
setSelected(Node n)
Use invoke() to execute any associated script. |
void |
unpost()
Unshow by removing from root and reconnecting to old parent (if any). |
Methods inherited from class multivalent.IScrollPane |
---|
checkRep, dump, dx, dy, eventNode, getHsb, getIScrollPane, getVsb, paintBeforeAfter, scrollBy, scrollTo, scrollTo, setScrollbarShowPolicy, setSizeChars |
Methods inherited from class multivalent.INode |
---|
appendChild, breakAfter, breakBefore, childAt, childNum, clipboardNode, clone, contains, findDFS, formatBeforeAfter, getElementById, getFirstChild, getFirstLeaf, getLastChild, getLastLeaf, getNextSibling, getPreviousSibling, insertChildAt, isStruct, markDirtySubtreeDown, removeAllChildren, removeChild, removeChildAt, setChildAt, setName, size, structChildAt, structChildNum, structsize |
Methods inherited from class multivalent.Node |
---|
addObserver, addSticky, addSticky, childNum, clipboardBeforeAfter, cmp, commonAncestor, commonAncestor, contains, deleteObserver, dump, dump, findBFS, findBFS, findBFS, findDFS, findDFS, findDFS, getAbsLocation, getActivesAt, getActivesAt, getActivesAt, getBbox, getBrowser, getDocument, getName, getNextLeaf, getNextNode, getNodeName, getObservers, getParentNode, getPrevLeaf, getPrevNode, getRelLocation, getRoot, getSticky, indexSticky, intersects, isLeaf, isValid, markDirty, markDirtySubtree, markDirtyTo, morphInto, reformat, remove, removeSticky, removeSticky, removeTidy, repaint, repaint, repaint, scrollTo, scrollTo, setParentNode, setValid, sizeSticky, spanChunky, spanChunky, structChildNum, toString |
Methods inherited from class multivalent.VObject |
---|
attrEntrySetIterator, attrKeysIterator, clearAttributes, getAttr, getAttr, getAttributes, getGlobal, getValue, hasAttributes, putAttr, removeAttr, setAttributes |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String MSG_CREATE_FILE
"createWidget/File": out= VMenu
instance-under-construction.
public static final java.lang.String MSG_CREATE_EDIT
"createWidget/Edit": out= VMenu
instance-under-construction.
public static final java.lang.String MSG_CREATE_GO
"createWidget/Go": out= VMenu
instance-under-construction.
public static final java.lang.String MSG_CREATE_BOOKMARK
"createWidget/Bookmark": out= VMenu
instance-under-construction.
public static final java.lang.String MSG_CREATE_LENS
"createWidget/Lens": out= VMenu
instance-under-construction.
public static final java.lang.String MSG_CREATE_STYLE
"createWidget/Style": out= VMenu
instance-under-construction.
public static final java.lang.String MSG_CREATE_ANNO
"createWidget/Anno": out= VMenu
instance-under-construction.
public static final java.lang.String MSG_CREATE_VIEW
"createWidget/View": out= VMenu
instance-under-construction.
public static final java.lang.String MSG_CREATE_HELP
"createWidget/Help": out= VMenu
instance-under-construction.
public static final java.lang.String CATEGORY_MEDIUM
medium
) for medium-specific options (where medium is PDF, HTML, DirectoryLocal, ...).
public static final java.lang.String VAR_MENUSTACK
public static int Maxsize
Constructor Detail |
---|
public VMenu(java.lang.String name, java.util.Map<java.lang.String,java.lang.Object> attr, INode parent)
Method Detail |
---|
public Node addCategory(Node n, java.lang.String category)
addCategory
in class INode
public Node getSelected()
public void setSelected(Node n)
public boolean formatNode(int width, int height, Context cx)
formatNode
in class IScrollPane
FixedI
public void paintNode(java.awt.Rectangle docclip, Context cx)
IScrollPane
Graphics2D
.
paintNode
in class IScrollPane
public void post(int x, int y, Browser br)
ForwardBack
,
Bookmark
public void unpost()
public boolean eventBeforeAfter(java.awt.AWTEvent e, java.awt.Point rel)
eventBeforeAfter
in class INode
public void event(java.awt.AWTEvent e)
event
in interface EventListener
public void invoke()
public void repaint(long ms, int x, int y, int w, int h)
Node
repaint
in class Node
|
Multivalent API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |