Class powersoft.jcm.ui.MenuComponent
All Packages Class Hierarchy This Package Previous Next Index
Class powersoft.jcm.ui.MenuComponent
java.lang.Object
|
+----powersoft.jcm.ui.MenuComponent
- public class MenuComponent
- extends Object
A generic menu component.
-
_AWTComponent
-
-
_font
-
-
_text
-
-
MenuComponent()
- Menu components are not instantiated directly.
-
create()
- Creates a new menu component.
-
create(MenuContainer)
- Creates a new menu component.
-
create(MenuContainer, String)
- Creates a new menu component.
-
createAWTComponent(String)
- Creates the AWT menu component.
-
destroy()
-
-
findMenuComponent(MenuComponent, boolean)
-
-
getAWTMenuComponent()
- Gets the raw AWT menu component that is linked to this object.
-
getFont()
- Gets the font used by the component for drawing text.
-
getFont(boolean)
- Gets the font used by the component.
-
getName()
- Gets the name of the menu component.
-
getParent()
- Gets the parent of the component.
-
getText()
- Gets the text of the component.
-
getUserData()
-
-
makeComponent(MenuContainer, String)
- Create the component.
-
processAWTEvent(Event)
-
-
setFont(Font)
- Sets the font used by the component for drawing text.
-
setName(String)
- Sets the name of the menu component.
-
setParent(MenuContainer)
- Sets the parent of the component.
-
setText(String)
- Sets the text of the component.
-
setUserData(Object)
-
_AWTComponent
protected MenuComponent _AWTComponent
_text
protected String _text
_font
protected Font _font
MenuComponent
public MenuComponent()
- Menu components are not instantiated directly.
getAWTMenuComponent
public MenuComponent getAWTMenuComponent()
- Gets the raw AWT menu component that is linked to this object.
getFont
public Font getFont()
- Gets the font used by the component for drawing text.
If no font was set, searches up the parent tree until
one is found. If none was found, returns null.
- See Also:
- setFont
getFont
public Font getFont(boolean searchParents)
- Gets the font used by the component.
- Parameters:
- searchParents - If true, searches up the parent tree
until a font is found, or returns null.
If false, returns the font setting for
the component, which might be null.
setFont
public void setFont(Font font)
- Sets the font used by the component for drawing text.
- See Also:
- getFont
getName
public String getName()
- Gets the name of the menu component.
- See Also:
- setName
setName
public void setName(String name)
- Sets the name of the menu component.
- See Also:
- getName
getParent
public synchronized MenuContainer getParent()
- Gets the parent of the component.
setParent
public synchronized void setParent(MenuContainer parent)
- Sets the parent of the component. Automatically
calls the parent's addMenuComponent method, first removing
it from its old parent if necessary.
- Parameters:
- parent - the new parent container of the component
getText
public String getText()
- Gets the text of the component.
- See Also:
- setText
setText
public void setText(String text)
- Sets the text of the component.
- See Also:
- getText
getUserData
public Object getUserData()
setUserData
public void setUserData(Object userData)
create
public boolean create()
- Creates a new menu component.
- Returns:
-
true
if the menu component was successfully created;
false
otherwise
- See Also:
- destroy
create
public boolean create(MenuContainer parent)
- Creates a new menu component.
- Parameters:
- parent - Specifies the parent or owner of the menu component to be
created. It may be null.
- Returns:
-
true
if the menu component was successfully created;
false
otherwise
- See Also:
- destroy
create
public boolean create(MenuContainer parent,
String text)
- Creates a new menu component.
- Parameters:
- parent - Specifies the parent or owner of the menu component to be
created. It may be null.
- text - the title of the menu.
- Returns:
-
true
if the menu component was successfully created;
false
otherwise
- See Also:
- destroy
destroy
public synchronized boolean destroy()
findMenuComponent
public MenuComponent findMenuComponent(MenuComponent awtComp,
boolean recurse)
createAWTComponent
protected MenuComponent createAWTComponent(String text)
- Creates the AWT menu component.
makeComponent
protected boolean makeComponent(MenuContainer parent,
String text)
- Create the component. This method is called by the create
methods to actually do the work.
processAWTEvent
protected boolean processAWTEvent(Event event)
All Packages Class Hierarchy This Package Previous Next Index