public class ComponentWrapper extends WidgetWrapper implements IComponent
Constructor and Description |
---|
ComponentWrapper(IComponent widget) |
Modifier and Type | Method and Description |
---|---|
void |
addComponentListener(IComponentListener componentListener)
Adds a component listener
|
void |
addFocusListener(IFocusListener listener)
Adds a focus listener
|
void |
addKeyListener(IKeyListener listener)
Adds a key listener
|
void |
addMouseListener(IMouseListener mouseListener)
Adds a mouse listener
|
void |
addMouseMotionListener(IMouseMotionListener listener)
Adds a mouse motion listener
|
void |
addPopupDetectionListener(IPopupDetectionListener listener)
Adds a popup detection listener
|
void |
addShowingStateListener(IShowingStateListener listener)
Adds a showing state listener
|
IPopupMenu |
createPopupMenu()
Creates a popup menu as a child of this component
|
Position |
fromComponent(IComponentCommon component,
Position componentPosition)
Transforms a position from another components coordinate system to
this components coordinate system
|
IColorConstant |
getBackgroundColor()
Gets the background color
|
Rectangle |
getBounds()
Gets the bounds of the component
|
IColorConstant |
getForegroundColor()
Gets the foreground color
|
Position |
getPosition()
Gets the position of the component
|
Dimension |
getSize()
Gets the current size of the component.
|
protected IComponent |
getWidget() |
boolean |
hasFocus()
Gets the input focus state of the component.
|
boolean |
isReparentable()
Gets the information if the component is reparentable
|
boolean |
isShowing()
A root component is showing if it is visible.
|
boolean |
isVisible()
Gets the visibility state.
|
void |
redraw()
Marks the widget that a redraw is necessary
|
void |
removeComponentListener(IComponentListener componentListener)
Removes a component listener
|
void |
removeFocusListener(IFocusListener listener)
Removes a focus listener
|
void |
removeKeyListener(IKeyListener listener)
Removes a key listener
|
void |
removeMouseListener(IMouseListener mouseListener)
Removes a mouse listener
|
void |
removeMouseMotionListener(IMouseMotionListener mouseListener)
Removes a mouse motion listener
|
void |
removePopupDetectionListener(IPopupDetectionListener listener)
Removes a popup detection listener
|
void |
removeShowingStateListener(IShowingStateListener listener)
Removes a showing state listener
|
boolean |
requestFocus()
Try's to get the focus for the component.
|
void |
setBackgroundColor(IColorConstant colorValue)
Sets the background color.
|
void |
setBounds(Rectangle bounds)
The the bounds of the component
|
void |
setCursor(Cursor cursor)
Sets the cursor
|
void |
setForegroundColor(IColorConstant colorValue)
Sets the foreground color.
|
void |
setPopupMenu(IMenuModel menuModel)
Sets a popup menu for this component defined by a model.
|
void |
setPosition(int x,
int y)
Sets the position of the component defined by the x-coordinate and the y-coordinate
|
void |
setPosition(Position position)
Sets the position of the component
|
void |
setRedrawEnabled(boolean enabled)
Enables or disabled the redraw of a component and its children.
|
void |
setSize(Dimension size)
Sets the size of the component.
|
void |
setSize(int width,
int height)
Sets the size of the component defined by width and height
|
void |
setVisible(boolean visible)
Sets the components visibility state.
|
Position |
toComponent(Position componentPosition,
IComponentCommon component)
Transforms a position from this components coordinate system to another components
coordinate system
|
Position |
toLocal(Position screenPosition)
Transforms a position in the screen coordinate system to this components coordinate system
|
Position |
toScreen(Position localPosition)
Transforms a position in the coordinate system of this component to the screen coordinate system
|
addDisposeListener, dispose, getParent, getRoot, getUiReference, isDisposed, isEnabled, removeDisposeListener, setEnabled
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
dispose, getParent, getRoot, isDisposed
addDisposeListener, removeDisposeListener
getUiReference, isEnabled, setEnabled
public ComponentWrapper(IComponent widget)
protected IComponent getWidget()
getWidget
in class WidgetWrapper
public void redraw()
IComponentCommon
redraw
in interface IComponentCommon
public void setRedrawEnabled(boolean enabled)
IComponentCommon
setRedrawEnabled
in interface IComponentCommon
enabled
- The enabled statepublic void setForegroundColor(IColorConstant colorValue)
IComponentCommon
setForegroundColor
in interface IComponentCommon
colorValue
- The color to set, may be nullpublic void setBackgroundColor(IColorConstant colorValue)
IComponentCommon
setBackgroundColor
in interface IComponentCommon
colorValue
- The color to set, may be nullpublic IColorConstant getForegroundColor()
IComponentCommon
getForegroundColor
in interface IComponentCommon
public IColorConstant getBackgroundColor()
IComponentCommon
getBackgroundColor
in interface IComponentCommon
public void setCursor(Cursor cursor)
IComponentCommon
setCursor
in interface IComponentCommon
cursor
- The cursor to setpublic void setVisible(boolean visible)
IComponentCommon
setVisible
in interface IComponentCommon
visible
- The visibility state to setpublic boolean isVisible()
IComponentCommon
isVisible
in interface IComponentCommon
public boolean isShowing()
IComponent
isShowing
in interface IComponent
public Dimension getSize()
IComponentCommon
getSize
in interface IComponentCommon
public void setSize(Dimension size)
IComponentCommon
setSize
in interface IComponentCommon
size
- The size to set, must not be nullpublic void setSize(int width, int height)
IComponent
setSize
in interface IComponent
width
- The widthheight
- The heightpublic void setPosition(int x, int y)
IComponent
setPosition
in interface IComponent
x
- The x coordinatey
- The y coordinatepublic Position getPosition()
IComponentCommon
getPosition
in interface IComponentCommon
public void setPosition(Position position)
IComponentCommon
setPosition
in interface IComponentCommon
position
- The position of the component, must not be nullpublic Rectangle getBounds()
IComponent
getBounds
in interface IComponent
public void setBounds(Rectangle bounds)
IComponent
setBounds
in interface IComponent
bounds
- The bounds to set, never nullpublic Position toScreen(Position localPosition)
IComponent
toScreen
in interface IComponent
localPosition
- The local position, must not be nullpublic Position toLocal(Position screenPosition)
IComponent
toLocal
in interface IComponent
screenPosition
- The screen position to transform, must not ne nullpublic Position fromComponent(IComponentCommon component, Position componentPosition)
IComponent
fromComponent
in interface IComponent
component
- Component, which the position is relative to, must not be nullcomponentPosition
- Position The position to transform, must not be nullpublic Position toComponent(Position componentPosition, IComponentCommon component)
IComponent
toComponent
in interface IComponent
componentPosition
- The position in this coordinate systemcomponent
- Component, in what coordinate system the position is transformed topublic boolean isReparentable()
IComponent
isReparentable
in interface IComponent
public boolean requestFocus()
IComponentCommon
requestFocus
in interface IComponentCommon
public boolean hasFocus()
IComponent
hasFocus
in interface IComponent
public void addKeyListener(IKeyListener listener)
IKeyObservable
addKeyListener
in interface IKeyObservable
listener
- The listener to addpublic void removeKeyListener(IKeyListener listener)
IKeyObservable
removeKeyListener
in interface IKeyObservable
listener
- The listener to removepublic void addMouseListener(IMouseListener mouseListener)
IMouseObservable
addMouseListener
in interface IMouseObservable
mouseListener
- The listener to addpublic void removeMouseListener(IMouseListener mouseListener)
IMouseObservable
removeMouseListener
in interface IMouseObservable
mouseListener
- The listener to removepublic void addMouseMotionListener(IMouseMotionListener listener)
IMouseMotionObservable
addMouseMotionListener
in interface IMouseMotionObservable
listener
- The listener to addpublic void removeMouseMotionListener(IMouseMotionListener mouseListener)
IMouseMotionObservable
removeMouseMotionListener
in interface IMouseMotionObservable
mouseListener
- The listener to removepublic void addComponentListener(IComponentListener componentListener)
IComponentObservable
addComponentListener
in interface IComponentObservable
componentListener
- The listener to addpublic void removeComponentListener(IComponentListener componentListener)
IComponentObservable
removeComponentListener
in interface IComponentObservable
componentListener
- The listener to removepublic void addFocusListener(IFocusListener listener)
IFocusObservable
addFocusListener
in interface IFocusObservable
listener
- The listener to addpublic void removeFocusListener(IFocusListener listener)
IFocusObservable
removeFocusListener
in interface IFocusObservable
listener
- The listener to removepublic void addPopupDetectionListener(IPopupDetectionListener listener)
IPopupDetectionObservable
addPopupDetectionListener
in interface IPopupDetectionObservable
listener
- The listener to addpublic void removePopupDetectionListener(IPopupDetectionListener listener)
IPopupDetectionObservable
removePopupDetectionListener
in interface IPopupDetectionObservable
listener
- The listener to removepublic void addShowingStateListener(IShowingStateListener listener)
IShowingStateObservable
addShowingStateListener
in interface IShowingStateObservable
listener
- The listener to addpublic void removeShowingStateListener(IShowingStateListener listener)
IShowingStateObservable
removeShowingStateListener
in interface IShowingStateObservable
listener
- The listener to removepublic IPopupMenu createPopupMenu()
IComponent
createPopupMenu
in interface IComponent
public void setPopupMenu(IMenuModel menuModel)
IComponent
setPopupMenu
in interface IComponent
Siehe auch Jowidgets Nutzerhandbuch