|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--sdl.test.gui.GUIComponent
for gui demo - unfinished, Minimal Component implememntation for awt-like gui that uses SDL graphics and events. TODO. move SDLRuntime to graphics implement Hierarchy change event. notify of parent. implement container
Field Summary | |
protected java.util.HashSet |
componentListeners
|
protected GUIComponent |
parent
|
protected java.util.HashSet |
subComponents
|
Constructor Summary | |
GUIComponent()
|
Method Summary | |
void |
addComponentListener(sdl.event.EventListener cl)
TODO create component listner |
boolean |
contains(int x,
int y)
Checks whether this component "contains" the specified point, where x and y are defined to be relative to the coordinate system of this component. |
void |
dispatchEvent(GUIComponentEvent ce)
TODO must implement subcomponents and events. |
java.awt.Color |
getBackground()
|
java.awt.Rectangle |
getBounds()
Gets the bounds of this component in the form of a Rectangle object. |
GUIComponent |
getComponentAt(int x,
int y)
TODO must implement subcomponents |
GUIGraphics |
getGraphics()
TODO must implement subcomponents and must make this graphics relative to the context of this component This is pretty inefficient. |
java.awt.Point |
getLocation()
Gets the location of this component in the form of a point specifying the component's top-left corner. |
java.awt.Point |
getLocationOnScreen()
|
GUIComponent |
getParent()
|
java.awt.Dimension |
getSize()
|
boolean |
incomingEvents(sdl.event.SDLCustomEvent ce)
Called wrapper by SDLEvent dispatcher for native SDL events and by processEvent() for our custom GUI events |
void |
paint(GUIGraphics g)
|
void |
paintAll(GUIGraphics g)
TODO implement subcomponent paint |
protected void |
processEvent(GUIComponentEvent ce)
Calls incomingEvents(). |
void |
setBackground(java.awt.Color color)
|
void |
setBounds(int x,
int y,
int width,
int height)
|
void |
setBounds(java.awt.Rectangle bounds)
|
void |
setLocation(int x,
int y)
|
void |
setSize(int x,
int y)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected GUIComponent parent
protected java.util.HashSet componentListeners
protected java.util.HashSet subComponents
Constructor Detail |
public GUIComponent()
Method Detail |
public void addComponentListener(sdl.event.EventListener cl)
public boolean contains(int x, int y)
public java.awt.Color getBackground()
public void setBackground(java.awt.Color color)
public java.awt.Rectangle getBounds()
public void setBounds(java.awt.Rectangle bounds)
public void setBounds(int x, int y, int width, int height)
public GUIComponent getComponentAt(int x, int y)
public GUIGraphics getGraphics()
public java.awt.Point getLocation()
public void setLocation(int x, int y)
public java.awt.Point getLocationOnScreen()
public GUIComponent getParent()
public java.awt.Dimension getSize()
public void setSize(int x, int y)
public void paint(GUIGraphics g)
public void paintAll(GUIGraphics g)
public final void dispatchEvent(GUIComponentEvent ce)
protected void processEvent(GUIComponentEvent ce)
public boolean incomingEvents(sdl.event.SDLCustomEvent ce) throws sdl.event.SDLEventException
incomingEvents
in interface sdl.event.EventListener
sdl.event.SDLEventException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |