|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.yospace.yae.yogi.ComponentUI
An adapter-style base class for YoGI UI classes.
| Field Summary | |
static int |
KEY_PRESSED
The constant for a key pressed event. |
static int |
KEY_RELEASED
The constant for a key released event. |
static int |
KEY_REPEATED
The constant for a key repeated event. |
static int |
POINTER_DRAGGED
The constant for a pointer dragged event. |
static int |
POINTER_PRESSED
The constant for a pointer pressed event. |
static int |
POINTER_RELEASED
The constant for a pointer released event. |
| Constructor Summary | |
ComponentUI()
|
|
| Method Summary | |
boolean |
contains(YogiComponent c,
int x,
int y)
Detects whether the specified location is within the component's bounds. |
abstract int |
getDefaultBorderStyle(YogiComponent c)
This method is called by the component where the application writer has not explicitly set the border style, either from within the XML or programmatically at a later stage. |
abstract int |
getDefaultColor(int index)
This method is called by the component where the application writer has not explicitly set any of the colors in the color array, either from within the XML or programmatically at a later stage. |
abstract Font |
getDefaultFont(YogiComponent c)
This method is called by the component where the application writer has not explicitly set the font, either from within the XML or programmatically at a later stage. |
abstract int |
getDefaultHeight(YogiComponent c)
This method is called by the component where the application writer has not explicitly set the height, either from within the XML or programmatically at a later stage. |
abstract int |
getDefaultWidth(YogiComponent c)
This method is called by the component where the application writer has not explicitly set the width, either from within the XML or programmatically at a later stage. |
abstract int |
getDefaultXInset(YogiComponent c)
This method is called by the component where the application writer has not explicitly set the x inset, either from within the XML or programmatically at a later stage. |
abstract int |
getDefaultYInset(YogiComponent c)
This method is called by the component where the application writer has not explicitly set the y inset, either from within the XML or programmatically at a later stage. |
ComponentUI |
getInstance()
Used by the YoGI engine when a new component requires a default UI delegate. |
boolean |
isDefaultFocusTraversable(YogiComponent c)
This method is called by a component when the component has its focus-traversability set to FOCUS_DEFAULT. |
void |
paintBackground(Graphics g,
YogiComponent c)
Default method. |
void |
paintBorder(Graphics g,
YogiComponent c,
int borderStyle,
int strokeStyle,
int borderColor)
Default method. |
void |
paintForeground(Graphics g,
YogiComponent c)
Default method. |
void |
performDefaultAction(YogiComponent c)
Default template method for performing hotkey actions. |
boolean |
processKeyEvent(YogiComponent c,
int keyCode,
int eventType)
Default method for handling incoming keypad events. |
boolean |
processPointerEvent(YogiComponent c,
int x,
int y,
int eventType)
Default method for handling incoming pointer events. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int KEY_PRESSED
public static final int KEY_REPEATED
public static final int KEY_RELEASED
public static final int POINTER_PRESSED
public static final int POINTER_DRAGGED
public static final int POINTER_RELEASED
| Constructor Detail |
public ComponentUI()
| Method Detail |
public void paintForeground(Graphics g,
YogiComponent c)
g - the (clipped) graphics object to use.c - the component to repaint.
public void paintBackground(Graphics g,
YogiComponent c)
g - the (clipped) graphics object to use.c - the component to repaint.
public void paintBorder(Graphics g,
YogiComponent c,
int borderStyle,
int strokeStyle,
int borderColor)
borderStyle,
with the specified borderColor and strokeStyle.
Note that this method operates using the style and color values supplied, rather than
requesting them from the YogiComponent, so that subclasses can
modify the border behavior without having to modify the border-style.g - the graphics object to use.c - the component whose border needs to be painted.borderStyle - the style of border to use, one of
BORDER_NONE,
BORDER_PLAIN,
BORDER_SOLID,
BORDER_DOTTED,
BORDER_ROUNDED.strokeStyle - the border's pen style, one of
SOLID or
DOTTED.borderColor - the color of the border
public boolean processPointerEvent(YogiComponent c,
int x,
int y,
int eventType)
c - the owner component which is to handle the eventx - the x coord of the pointer (where the top left of the component is at (0,0)).y - the y coord of the pointer (where the top left of the component is at (0,0)).eventType - an indication of whether the pointer has been pressed, dragged or released:
one of POINTER_PRESSED, POINTER_DRAGGED, or POINTER_RELEASED.
public boolean processKeyEvent(YogiComponent c,
int keyCode,
int eventType)
c - the owner component which is to handle the eventkeyCode - the character code of the key - see CanvaseventType - an indication of whether the pointer has been pressed, dragged or released:
one of POINTER_PRESSED, POINTER_DRAGGED, or POINTER_RELEASED.public void performDefaultAction(YogiComponent c)
The ComponentUI version fires the
action performed notification
(which only does anything if there is a ActionListener attached). This means
that it does the right thing for "action" components like YogiButton and
inactive components like YogiLabel and YogiPanel. It generally needs
overriding for stateful components like YogiCheckBox and for "penetrable" components
like YogiSpin.
c - the component which has been triggered.
public boolean contains(YogiComponent c,
int x,
int y)
c - the component that is being tested.x - the x coordinate of the point being tested.y - the y coordinate of the point being tested.public ComponentUI getInstance()
public abstract int getDefaultWidth(YogiComponent c)
XxxComponentUI delegate should implement this method so
that a plaf-set specific default width can be established. This method might return
a width based on other characteristics of the component, and therefore is takes as a parameter
the caller component.public abstract int getDefaultHeight(YogiComponent c)
XxxComponentUI delegate should implement this method so
that a plaf-set specific default height can be established. This method might return
a height based on other characteristics of the component, and therefore is takes as a parameter
the caller component.public abstract int getDefaultXInset(YogiComponent c)
XxxComponentUI delegate should implement this method so
that a plaf-set specific default x inset can be established. This method might return
an x inset based on other characteristics of the component, and therefore is takes as a parameter
the caller component.public abstract int getDefaultYInset(YogiComponent c)
XxxComponentUI delegate should implement this method so
that a plaf-set specific default y inset can be established. This method might return
a y inset based on other characteristics of the component, and therefore is takes as a parameter
the caller component.public abstract Font getDefaultFont(YogiComponent c)
XxxComponentUI delegate should implement this method so
that a plaf-set specific default font can be established. This method might return
a font based on other characteristics of the component, and therefore is takes as a parameter
the caller component.public abstract int getDefaultBorderStyle(YogiComponent c)
XxxComponentUI delegate should implement this method so
that a plaf-set specific default border style can be established. This method might return
a border style based on other characteristics of the component, and therefore is takes as a parameter
the caller component.public abstract int getDefaultColor(int index)
XxxComponentUI delegate should implement this method so
that a plaf-set specific default color can be established. This method might return
a color based on other characteristics of the component, and therefore is takes as a parameter
the caller component.public boolean isDefaultFocusTraversable(YogiComponent c)
FOCUS_DEFAULT.c - the component that is being checked
|
Copyright 2002 Yospace Holdings Ltd. All Rights Reserved. | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||