Methods Summary |
---|
java.lang.String | autoName()Auto name.
String name = getClass().getName();
if (name.indexOf("$") != -1) { //$NON-NLS-1$
return null;
}
// ???AWT: int number = toolkit.autoNumber.nextMenuComponent++;
int number = 0;
name = name.substring(name.lastIndexOf(".") + 1) + Integer.toString(number); //$NON-NLS-1$
return name;
|
public final void | dispatchEvent(java.awt.AWTEvent event)Dispatches AWT event.
toolkit.lockAWT();
try {
processEvent(event);
if (deprecatedEventHandler) {
postDeprecatedEvent(event);
}
} finally {
toolkit.unlockAWT();
}
|
void | endMenu()Hide all menu hierarchy.
// ???AWT: toolkit.dispatcher.popupDispatcher.deactivateAll();
|
public java.awt.Font | getFont()Gets the font of the MenuComponent object.
toolkit.lockAWT();
try {
if (font == null && hasDefaultFont()) {
return toolkit.getDefaultFont();
}
if (font == null && parent != null) {
return parent.getFont();
}
return font;
} finally {
toolkit.unlockAWT();
}
|
java.awt.Graphics | getGraphics(org.apache.harmony.awt.gl.MultiRectArea clip)Creates the Graphics object for the pop-up box of this menu component.
// to be overridden
return null;
|
int | getHeight()Gets the height.
// to be overridden
return 1;
|
java.awt.Rectangle | getItemRect(int index)
// to be overridden
return null;
|
java.awt.Point | getLocation()Gets the location.
// to be overridden
return new Point(0, 0);
|
public java.lang.String | getName()Gets the name of the MenuComponent object.
toolkit.lockAWT();
try {
return name;
} finally {
toolkit.unlockAWT();
}
|
public java.awt.MenuContainer | getParent()Gets the parent menu container.
toolkit.lockAWT();
try {
return parent;
} finally {
toolkit.unlockAWT();
}
|
public java.awt.peer.MenuComponentPeer | getPeer()Gets the peer of the MenuComponent; an application must not use this
method directly.
toolkit.lockAWT();
try {
} finally {
toolkit.unlockAWT();
}
if (true) {
throw new RuntimeException("Method is not implemented"); //TODO: implement //$NON-NLS-1$
}
return null;
|
int | getSelectedItemIndex()Gets the selected item index.
return selectedItemIndex;
|
java.awt.Point | getSubmenuLocation(int index)Gets the submenu location.
// to be overridden
return new Point(0, 0);
|
protected final java.lang.Object | getTreeLock()Gets the locking object of this MenuComponent.
return toolkit.awtTreeLock;
|
final org.apache.harmony.awt.gl.MultiRectArea | getUpdateClip(int index1, int index2)Determine the clip region when menu selection is changed from index1 to
index2.
MultiRectArea clip = new MultiRectArea();
if (index1 >= 0) {
clip.add(getItemRect(index1));
}
if (index2 >= 0) {
clip.add(getItemRect(index2));
}
return clip;
|
int | getWidth()Gets the width.
// to be overridden
return 1;
|
boolean | hasDefaultFont()Checks for default font.
return false;
|
void | hide()Hide.
selectedItemIndex = -1;
if (parent instanceof MenuComponent) {
((MenuComponent)parent).itemHidden(this);
}
|
boolean | isActive()Checks if is active.
return true;
|
boolean | isFontSet()Checks if is font set.
return font != null
|| ((parent instanceof MenuComponent) && ((MenuComponent)parent).isFontSet());
|
boolean | isVisible()Checks if is visible.
return true;
|
void | itemHidden(java.awt.MenuComponent mc)Item hidden.
// to be overridden
|
void | itemSelected(long when, int modifiers)Handle the mouse click or Enter key event on a menu's item.
endMenu();
|
void | onKeyEvent(int eventId, int vKey, long when, int modifiers)Keyboard event handler.
// to be overridden
|
void | onMouseEvent(int eventId, java.awt.Point where, int mouseButton, long when, int modifiers)Mouse events handler.
// to be overridden
|
void | paint(java.awt.Graphics gr)Recursively find the menu item for a menu shortcut.
gr.setColor(Color.LIGHT_GRAY);
gr.fillRect(0, 0, getWidth(), getHeight());
gr.setColor(Color.BLACK);
|
protected java.lang.String | paramString()Returns the string representation of the MenuComponent state.
toolkit.lockAWT();
try {
return getName();
} finally {
toolkit.unlockAWT();
}
|
void | postDeprecatedEvent(java.awt.AWTEvent event)Post deprecated event.
Event evt = event.getEvent();
if (evt != null) {
postEvent(evt);
}
|
public boolean | postEvent(java.awt.Event e)Posts the Event to the MenuComponent.
toolkit.lockAWT();
try {
if (parent != null) {
return parent.postEvent(e);
}
return false;
} finally {
toolkit.unlockAWT();
}
|
protected void | processEvent(java.awt.AWTEvent event)Processes an AWTEevent on this menu component.
toolkit.lockAWT();
try {
// do nothing
} finally {
toolkit.unlockAWT();
}
|
public void | removeNotify()Removes the peer of the MenuComponent.
toolkit.lockAWT();
try {
} finally {
toolkit.unlockAWT();
}
|
public void | setFont(java.awt.Font font)Sets the Font for this MenuComponent object.
toolkit.lockAWT();
try {
this.font = font;
} finally {
toolkit.unlockAWT();
}
|
public void | setName(java.lang.String name)Sets the name of the MenuComponent to the specified string.
toolkit.lockAWT();
try {
this.name = name;
} finally {
toolkit.unlockAWT();
}
|
void | setParent(java.awt.MenuContainer parent)Sets the parent.
this.parent = parent;
|
public java.lang.String | toString()Returns a String representation of the MenuComponent object.
toolkit.lockAWT();
try {
return getClass().getName() + "[" + paramString() + "]"; //$NON-NLS-1$ //$NON-NLS-2$
} finally {
toolkit.unlockAWT();
}
|