|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Decorator
A generic layered painter interface.
A painter is a class which can take a Graphics2D and paint something within some rectangular bounds.
Method Summary | |
---|---|
int |
compareTo(java.lang.Object o)
Sorts according to layer index. |
void |
dispose()
Clean up and deregister listeners. |
void |
doPaint(java.awt.Graphics2D g2,
java.awt.Rectangle bounds)
Paint what should be painted. |
int |
getLayerIndex()
Returns a number to indicate the order in which to paint something. |
void |
processEvent(java.awt.AWTEvent e)
A callback method that lets this decorator intercept any AWTEvent (such and KeyEvent s and MouseEvent s). |
void |
setLayerIndex(int layerIndex)
Sets a number to indicate the order in which to paint something. |
Method Detail |
---|
void doPaint(java.awt.Graphics2D g2, java.awt.Rectangle bounds)
g2
- The graphics object to paint inbounds
- The bounds to stay within (a must). If width and/or height is 0 that dimension is not scaled to fit
and should be ignored.int getLayerIndex()
doPaint(java.awt.Graphics2D, java.awt.Rectangle)
.
void setLayerIndex(int layerIndex)
doPaint(java.awt.Graphics2D, java.awt.Rectangle)
.
layerIndex
- A number to indicate the order in which to paint something. Lower if painted before. I.e. under.void processEvent(java.awt.AWTEvent e)
AWTEvent
(such and KeyEvent
s and MouseEvent
s).
The target that this decorator is installed on will manually have to call this method though, but for instance DefaultDateArea
does so.
If only events that aren't consumed should be caught the normaly process of adding the appropriate listener to the target is adviced. This method is for catching the event before it is precessed by the target.
If the event is a InputEvent
and the 'consumed' flag is set to true
no more decorators are notified, neither is the
normal event handling dispatching for the target. A notable amount of events can come this way so processing should be very fast.
e
- The event.void dispose()
Decorator
isn't needed any more.
int compareTo(java.lang.Object o)
return getLayerIndex() - ((Decorator) o).getLayerIndex();
.
compareTo
in interface java.lang.Comparable
o
- Another Decorator
getLayerIndex() - ((Decorator) o).getLayerIndex()
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |