Public Types | |
enum | ComponentDepth { NORMAL = 8, NORMAL_MODAL = 4, POPUP = 2, POPUP_MODAL = 1 } |
enum | CONSTANTS { LEFT, RIGHT, CENTER } |
Public Member Functions | |
Component () | |
Component (const Component &rhs) | |
Component & | operator= (const Component &rhs) |
virtual | ~Component () |
void | swap (Component &rhs) throw () |
virtual void | setEnabled (bool enable) |
bool | isEnabled () const |
void | setVisible (bool visible) |
bool | isVisible () const |
virtual void | invalidate () |
virtual void | validate () |
bool | isValid () const |
void | setParent (Component *parent) |
Component * | getParent () const |
void | paint (Graphics &g) |
const util::Paint * | getForeground () const |
void | setForeground (util::Paint *c) |
const util::Paint * | getBackground () const |
void | setBackground (util::Paint *c) |
void | setTheme (theme::ThemeComponent *theme) |
void | resetTheme () |
void | setThemeName (const std::string &name) |
const std::string & | getThemeName () const |
const theme::ThemeComponent * | getTheme () const |
void | setLocation (int x, int y) |
void | setLocation (const util::Point &p) |
const util::Point | getLocation () const |
const util::Point | getLocationOnScreen () const |
void | setBounds (int x, int y, int width, int height) |
void | setBounds (const util::Rectangle &rhs) |
const util::Rectangle & | getBounds () const |
virtual const util::Dimension & | getPreferredSize () const |
void | setPreferredSize (const util::Dimension &d) |
void | setSize (int width, int height) |
void | setSize (const util::Dimension &rhs) |
void | setDepth (int type) |
int | getDepth () const |
virtual bool | isContainer () const |
virtual bool | isRootContainer () const |
const ComponentList & | getChildren () const |
void | setBorderPainted (bool enable) |
bool | isBorderPainted () const |
bool | hasBorder () const |
void | setBorder (border::Border *b) |
border::Border * | getBorder () const |
void | setInsets (const util::Insets &i) |
const util::Insets & | getInsets () const |
void | setFont (Font *font) |
Font * | getFont () const |
void | processMouseEvent (const event::MouseEvent &e) |
bool | hasMouseListener () const |
void | addMouseListener (event::MouseListener *l) |
void | removeMouseListener (event::MouseListener *l) |
void | removeMouseListeners () |
bool | hasFocus () const |
void | setFocus (bool enable) |
void | processFocusEvent (const event::FocusEvent &e) |
void | addFocusListener (event::FocusListener *l) |
void | removeFocusListener (event::FocusListener *l) |
void | removeFocusListeners () |
const event::FocusListenerList | getFocusListeners () const |
bool | hasFocusListener () const |
virtual bool | canHoldPermanentFocus () const |
void | addKeyListener (event::KeyListener *l) |
void | removeKeyListener (event::KeyListener *l) |
void | removeKeyListeners () |
const event::KeyListenerList | getKeyListeners () const |
bool | hasKeyListener () const |
void | processKeyEvent (const event::KeyEvent &e) |
void | processPropertyEvent (const event::PropertyEvent &e) |
void | addPropertyListener (event::PropertyListener *l) |
void | removePropertyListener (event::PropertyListener *l) |
void | removePropertyListeners () |
const event::PropertyListenerList | getPropertyListeners () const |
bool | hasPropertyListener () const |
virtual void | updateComponent (float deltaTime) |
void | addInterpolator (util::Interpolator *i) |
void | removeInterpolator (util::Interpolator *i) |
void | removeInterpolators () |
void | setTransparency (float f) |
float | getTransparency () const |
void | setRotation (float r) |
float | getRotation () const |
Protected Member Functions | |
virtual void | paintComponent (Graphics &g) |
virtual void | paintChildren (Graphics &g) |
void | paintBorder (Graphics &g) |
virtual void | paintSelectionComponent (Graphics &g) |
virtual void | validateTree () |
Protected Attributes | |
float | depth |
ComponentList | componentList |
util::Dimension | preferredSize |
|
Component depth values. The actual float depth is 1/ComponentDepth. |
|
Constants for general use in Components. |
|
Default constructor |
|
Copy constructor. |
|
Destructor. This constructor is virtual so classes inheriting from Component can correctly free their memory. |
|
Assignment operator.
|
|
Swaps two Components. Guaranteed not to throw. |
|
Enables or disables this Component. Disabling the Component makes this Component ignore any user input (that is, mouse and key events generated by a user). Reimplemented in ui::Container. |
|
Returns whether or not this Component is enabled. |
|
Renders the Component invisible or visible. Default value for Components is visible, except the Frame.
|
|
Method that returns the current visibility state of the current Component.
|
|
Invalidates this Component. This forces the Component and it's parent to do a layout call. |
|
Validates this Component. Reimplemented in ui::Container. |
|
Returns whether or not this Component is valid. If this returns true, that means all of it's children (in case it's an Container) are also valid.
|
|
Sets the parent for this Component. Can be NULL (0) if no parent is present.
|
|
Returns the parent for this Component.
|
|
Paint method called by the Component's parent. Do not call this method manually, as it's used by the Component to paint itself (together with the look and feel manager - which is currently not implemented)
|
|
Custom Component painting. Overload to implement custom drawing.
Reimplemented in ui::Container. |
|
Paint this Components children.
Reimplemented in ui::Container, and ui::Window. |
|
Paints this Components border, if one is present.
|
|
This method paints a unique colored rectangle to the screen for use by the picking engine. You can override this method to do custom selection rendering, for example for pictures.
Reimplemented in ui::GLCanvas. |
|
Validate the Component tree. This validates this Components and all of it's children. Most likely by invoking their LayoutManagers. |
|
Returns the current foreground color for this Component.
|
|
Sets the Component's foreground color.
|
|
Returns the current background color for this Component.
|
|
Sets the Component's background color.
|
|
Sets the theme for this Component. The theme can be viewed as the View in MVC. It decides how this particular component is rendered.
|
|
Reset all theme values by calling deinstallTheme and installTheme in succession. |
|
Sets the theme name, this is the identifier used to decide which ThemeComponent to choose when requesting a theme. This is for internal use only, or if you're writing your own custom Components. |
|
Returns the theme name. |
|
Returns the active theme. |
|
Sets the Components location without modifying it's height and width. |
|
Sets the Components relative location without modifying it's height and width. The relative location is the location inside the Components Container (it's parent).
|
|
Returns the current location as a Point.
|
|
Returns the Component location in screen coordinates.
|
|
Set all the Components Rectangle properties. |
|
Set the new bounds for this Component.
|
|
Returns the current Rectangle from this Component.
|
|
Returns the Components preferred size.
Reimplemented in ui::Container. |
|
Sets the preferred size. The prefferedSize is a hint to the layoutmanager, which might or might not respect this hint.
|
|
Sets the Components width and height without modifying it's location. |
|
Sets the Components width and height without modifying it's location.
|
|
Sets the depth for this Component. Different depths are used to paint popup menus and such. This allows us to use the normal Component hierarchy and still be able to do special painting for Components.
|
|
Retreives the current Component depth.
|
|
Wether the Component is a Container.
Reimplemented in ui::Container. |
|
Returns wether this Component is a Root level container.
Reimplemented in ui::Container, and ui::Window. |
|
Returns the Components children as a stl list object.
|
|
Enable or disable drawing of the Components border, if any.
|
|
Returns true if the border is painted.
|
|
Check to see if the Component has a border.
|
|
Replaces the Components border with the specified border. This also replaces the Components Insets with the borders Insets.
|
|
Returns the active border. |
|
Sets the Insets for the Component.
|
|
Returns the current Components Insets.
|
|
Sets the Font for this Component.
|
|
|
Receives a MouseEvent for this Component and forwards it to all registered MouseListeners.
|
|
Check wether the Component has a MouseListener.
|
|
Add a event::MouseListener to the Component.
|
|
Remove the selected MouseListener.
|
|
Removes all MouseListeners for this Component. |
|
Check to see if the Component has focus.
|
|
Set the focus to the Component.
|
|
Process the focus event and forward it to the specified component.
|
|
Add a event::FocusListener to the Component.
|
|
Remove the selected FocusListener
|
|
Removes all FocusListeners from this Component. |
|
Returns all FocusListeners registered by this Component.
|
|
Check wether the Component has a FocusListener.
|
|
Returns wether or not this Component can be a permanent focus owner. This is true by default, except for things like MenuItems, where a menu is the permanent focus owner and a menuitem merely a focus owner. Reimplemented in ui::Menu, and ui::MenuItem. |
|
Add a event::KeyListener to the Component.
|
|
Remove the selected KeyListener
|
|
Removes all KeyListeners from this Component. |
|
Returns all KeyListeners registered by this Component.
|
|
Check wether the Component has a KeyListener.
|
|
Forward the KeyEvent to all registered Listeners.
|
|
Forward the PropertyEvent to all registered Listeners.
|
|
Add a event::PropertyListener to the Component.
|
|
Remove the selected PropertyListener
|
|
Removes all KeyListeners from this Component. |
|
Returns all PropertyListeners registered by this Component.
|
|
Check wether the Component has a PropertyListener.
|
|
Update, for time based motion.
Reimplemented in ui::Container, and ui::Window. |
|
Add an interpolator to this Component.
|
|
Remove a specified interpolator from this Component.
|
|
Remove all interpolators from this Component. |
|
Sets the transparency for this Component and it's children. Note that the transparency can range from 0.0 to 1.0.
|
|
Returns the current transparency level for this Component and it's children.
|
|
Sets the rotation for this Component in degrees. Rotation is clockwise.
|
|
Returns the rotation for this Component in degrees.
|
|
Depth value for this Component. |
|
A container containing Components. we already declare this here, so it's available to every Component. |
|
Cache values for the Dimension so we do not have to recalculate it at every frame (although that works fine too). This variable is made mutable so we can change it in const members. As preferredSize is a cache value, it does not affect the object state towards the user. |