|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectswingwt.awt.Component
swingwt.awt.AWTSwingWrapper
Provides convenience functionality for implementing an AWT component by wrapping around the corresponding Swing version.
| Field Summary | |
protected JComponent |
swingPeer
|
| Fields inherited from interface swingwt.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
AWTSwingWrapper()
|
|
| Method Summary | |
void |
addActionListener(ActionListener l)
Add an ActionListener to this component |
void |
addComponentListener(ComponentListener l)
Add an ComponentListener to this component |
void |
addFocusListener(FocusListener l)
Add a KeyListener to this component |
void |
addInputMethodListener(InputMethodListener l)
Add an InputMethodListener to this component |
void |
addKeyListener(KeyListener l)
Add a KeyListener to this component |
void |
addMouseListener(MouseListener l)
Add a MouseListener to this component |
void |
addMouseMotionListener(MouseMotionListener l)
Add a MouseMotionListener to this component |
void |
addNotify()
|
protected Dimension |
calculatePreferredSize()
Override in subclasses to return the preferred size for a given (non-realised) component. |
void |
componentOnlyDispose()
Because dispose() can be overridden to do more, calling this routine guarantees that destruction of the component occurs (and nothing else). |
protected Dimension |
computePreferredSize()
This is called by getPreferredSize() when we want the peer to compute it's own size. |
boolean |
contains(int x,
int y)
|
Image |
createImage(int width,
int height)
Creates and returns an image |
VolatileImage |
createVolatileImage(int width,
int height)
Creates and returns a volatile image |
void |
dispatchEvent(AWTEvent awtEvent)
|
void |
dispose()
Destroys the component and stops all listeners |
AccessibleContext |
getAccessibleContext()
Returns the component's accessible context |
java.lang.String |
getActionCommand()
Returns the action command for this component |
float |
getAlignmentX()
NOT IMPLEMENTED |
float |
getAlignmentY()
NOT IMPLEMENTED |
Color |
getBackground()
Returns the background colour of the component |
Rectangle |
getBounds()
Returns the actual bounds of the component (or 0,0,0,0 if it isn't realised yet) |
ComponentOrientation |
getComponentOrientation()
|
Cursor |
getCursor()
Returns the components cursor |
Font |
getFont()
Returns the Font used on the component |
FontMetrics |
getFontMetrics(Font f)
Returns the font metrics for the given font |
Color |
getForeground()
Returns the foreground colour of the component |
Graphics |
getGraphics()
Return a graphics context for drawing on this object. |
GraphicsConfiguration |
getGraphicsConfiguration()
Gets the GraphicsConfiguration for this component |
int |
getHeight()
Returns the height of the component |
Point |
getLocation()
Returns the component's location on screen |
Point |
getLocationOnScreen()
FIXME: Bad algorithm here, but can't find appropriate routine. |
Dimension |
getMaximumSize()
Returns the maximum size of the component |
Dimension |
getMinimumSize()
Returns the minimum size of the component |
java.lang.String |
getName()
Returns the components name |
Container |
getParent()
Returns the component's parent |
ComponentPeer |
getPeer()
|
Dimension |
getPeerSize()
Returns the peers actual size, or 0,0 if it hasn't been created yet/is invisible |
Dimension |
getPreferredSize()
Returns the preferred size the component would like to be displayed at - very important for proper layout managers. |
Dimension |
getSize()
Returns the peers actual size. |
org.eclipse.swt.widgets.Control |
getSWTPeer()
Returns the SWT peer |
Toolkit |
getToolkit()
Gets the Toolkit for this component |
java.lang.String |
getToolTipText()
Returns the tooltip text used on the component |
java.lang.Object |
getTreeLock()
For compatibility with 3rd party layout managers - SwingWT doesn't need this as all laying out is marshalled onto a queued single thread |
int |
getWidth()
Returns the width of the component |
int |
getX()
Returns the component's X position in it's parent container |
int |
getY()
Returns the component's Y position in it's parent container |
void |
grabFocus()
Forces keyboard focus to the component |
boolean |
hasFocus()
Returns true if this component has the focus |
boolean |
hasSetFont()
Returns true if a calling process has set the font on this component. |
void |
hide()
Makes the component invisible |
boolean |
imageUpdate(Image img,
int infoflags,
int x,
int y,
int width,
int height)
Here for compatibility - I'm not sure what it's for. |
void |
invalidate()
Override in container classes to relayout child components - calls repaint here |
boolean |
isEnabled()
Returns true if the component is enabled |
boolean |
isFocusable()
Returns true if the component can receive the focus |
boolean |
isMinimumSizeSet()
|
boolean |
isShowing()
Returns true if the component is visible |
boolean |
isVisible()
Returns true if the component is visible |
Dimension |
minimumSize()
|
Dimension |
preferredSize()
|
void |
removeActionListener(ActionListener l)
Remove an ActionListener from the component |
void |
removeComponentListener(ComponentListener l)
Remove an ComponentListener from the component |
void |
removeFocusListener(FocusListener l)
Remove an KeyListener from the component |
void |
removeInputMethodListener(InputMethodListener l)
Remove an InputMethodListener to this component |
void |
removeKeyListener(KeyListener l)
Remove an KeyListener from the component |
void |
removeMouseListener(MouseListener l)
Remove an MouseListener from the component |
void |
removeMouseMotionListener(MouseMotionListener l)
Remove an MouseMotionListener from the component |
void |
removeNotify()
|
void |
repaint()
Redraws the component |
void |
repaint(int x,
int y,
int width,
int height)
|
void |
repaint(long tm,
int x,
int y,
int width,
int height)
|
void |
requestFocus()
Requests the component receives the focus |
void |
setActionCommand(java.lang.String command)
Sets the action command for this component |
void |
setAlignmentX(float val)
NOT IMPLEMENTED |
void |
setAlignmentY(float val)
NOT IMPLEMENTED |
void |
setBackground(Color c)
Sets the background colour of the component |
void |
setBounds(int x,
int y,
int width,
int height)
Sets the physical bounds of the component - used by layout managers |
void |
setBounds(Rectangle r)
Sets the physical bounds of the component |
void |
setComponentOrientation(ComponentOrientation o)
|
void |
setCursor(Cursor c)
Sets the components cursor |
void |
setEnabled(boolean b)
Change the enabled state of the component |
void |
setFocusable(boolean b)
Set whether the component can be focused |
void |
setFocusTraversalKeysEnabled(boolean b)
FIXME: NOT IMPLEMENTED |
void |
setFont(Font f)
Sets the font used by the component |
void |
setForeground(Color c)
Sets the foreground colour of the component |
void |
setHeight(int height)
Sets the height of the component. |
void |
setLocation(int x,
int y)
Sets the component's location in it's container |
void |
setLocation(Point p)
Sets the component's location in it's container |
void |
setMaximumSize(Dimension d)
Sets the maximum size of the component |
void |
setMinimumSize(Dimension d)
Sets the minimum size of the component |
void |
setName(java.lang.String newName)
Sets the components name |
void |
setPreferredSize(Dimension d)
Sets the preferred size of the object for layout purposes |
void |
setSize(Dimension d)
Sets the peer's actual size |
void |
setSize(int width,
int height)
Sets the peer's actual size |
void |
setSwingWTParent(Container parent)
Once a parent component receives an "add" call for a child, this being the child, this should be called to tell us to instantiate the peer and load in any cached properties. |
void |
setToolTipText(java.lang.String text)
Sets the tooltip text used on the component |
void |
setVisible(boolean b)
Change the visibility of the component |
void |
setWidth(int width)
Sets the width of the component. |
void |
show()
Makes the component visible |
void |
transferFocus()
Sets the focus to the next component as if tab was pressed |
void |
transferFocusBackward()
Sets the focus to the next component as if shift+tab was pressed |
void |
transferFocusUpCycle()
NOT IMPLEMENTED: FIXME - focusCycleRoot not done |
void |
validate()
NOT IMPLEMENTED |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected JComponent swingPeer
| Constructor Detail |
public AWTSwingWrapper()
| Method Detail |
public void setSwingWTParent(Container parent)
throws java.lang.Exception
Component
setSwingWTParent in class Componentjava.lang.Exceptionpublic org.eclipse.swt.widgets.Control getSWTPeer()
Component
getSWTPeer in class Componentpublic ComponentPeer getPeer()
getPeer in class Componentpublic void show()
Component
show in class Componentpublic void hide()
Component
hide in class Componentpublic void setVisible(boolean b)
Component
setVisible in class Componentpublic boolean isVisible()
Component
isVisible in class Componentpublic boolean isShowing()
Component
isShowing in class Componentpublic void setEnabled(boolean b)
Component
setEnabled in class Componentpublic boolean isEnabled()
Component
isEnabled in class Componentpublic void requestFocus()
Component
requestFocus in class Componentpublic void grabFocus()
Component
grabFocus in class Component
public void repaint(int x,
int y,
int width,
int height)
repaint in class Component
public void repaint(long tm,
int x,
int y,
int width,
int height)
repaint in class Componentpublic void repaint()
Component
repaint in class Componentpublic Color getBackground()
Component
getBackground in class Componentpublic void setBackground(Color c)
Component
setBackground in class Componentpublic Color getForeground()
Component
getForeground in class Componentpublic void setForeground(Color c)
Component
setForeground in class Componentpublic int getWidth()
Component
getWidth in class Componentpublic int getHeight()
Component
getHeight in class Componentpublic void setWidth(int width)
Component
setWidth in class Componentpublic void setHeight(int height)
Component
setHeight in class Componentpublic Graphics getGraphics()
Component
getGraphics in class Componentpublic Dimension getPreferredSize()
Component
getPreferredSize in class Componentprotected Dimension computePreferredSize()
Component
computePreferredSize in class Componentpublic void setPreferredSize(Dimension d)
Component
setPreferredSize in class Componentprotected Dimension calculatePreferredSize()
Component
calculatePreferredSize in class Componentpublic Dimension getMaximumSize()
Component
getMaximumSize in class Componentpublic void setMaximumSize(Dimension d)
Component
setMaximumSize in class Componentpublic Dimension getMinimumSize()
Component
getMinimumSize in class Componentpublic void setMinimumSize(Dimension d)
Component
setMinimumSize in class Componentpublic boolean isMinimumSizeSet()
isMinimumSizeSet in class Componentpublic Dimension minimumSize()
public Dimension preferredSize()
public void setSize(int width,
int height)
Component
setSize in class Componentpublic void setSize(Dimension d)
Component
setSize in class Componentpublic Dimension getSize()
Component
getSize in class Componentpublic Dimension getPeerSize()
Component
getPeerSize in class Componentpublic void setFocusTraversalKeysEnabled(boolean b)
Component
setFocusTraversalKeysEnabled in class Componentpublic Point getLocation()
Component
getLocation in class Componentpublic Point getLocationOnScreen()
Component
getLocationOnScreen in class Component
public Image createImage(int width,
int height)
Component
createImage in class Component
public VolatileImage createVolatileImage(int width,
int height)
Component
createVolatileImage in class Componentpublic FontMetrics getFontMetrics(Font f)
Component
getFontMetrics in class Componentpublic Font getFont()
Component
getFont in interface MenuContainergetFont in class Componentpublic void setFont(Font f)
Component
setFont in class Componentpublic boolean hasSetFont()
Component
hasSetFont in class Componentpublic java.lang.String getToolTipText()
Component
getToolTipText in class Componentpublic void setToolTipText(java.lang.String text)
Component
setToolTipText in class Component
public void setBounds(int x,
int y,
int width,
int height)
Component
setBounds in class Componentpublic void setBounds(Rectangle r)
Component
setBounds in class Componentpublic Rectangle getBounds()
Component
getBounds in class Componentpublic float getAlignmentX()
Component
getAlignmentX in class Componentpublic float getAlignmentY()
Component
getAlignmentY in class Componentpublic void setAlignmentX(float val)
Component
setAlignmentX in class Componentpublic void setAlignmentY(float val)
Component
setAlignmentY in class Componentpublic void transferFocus()
Component
transferFocus in class Componentpublic void transferFocusBackward()
Component
transferFocusBackward in class Componentpublic void transferFocusUpCycle()
Component
transferFocusUpCycle in class Component
public boolean contains(int x,
int y)
contains in class Componentpublic void invalidate()
Component
invalidate in class Componentpublic void validate()
Component
validate in class Componentpublic java.lang.String getActionCommand()
Component
getActionCommand in class Componentpublic void setActionCommand(java.lang.String command)
Component
setActionCommand in class Componentpublic void setLocation(Point p)
Component
setLocation in class Component
public void setLocation(int x,
int y)
Component
setLocation in class Componentpublic int getX()
Component
getX in class Componentpublic int getY()
Component
getY in class Componentpublic Container getParent()
Component
getParent in class Componentpublic java.lang.String getName()
Component
getName in class Componentpublic void setName(java.lang.String newName)
Component
setName in class Componentpublic void setCursor(Cursor c)
Component
setCursor in class Componentpublic boolean isFocusable()
Component
isFocusable in class Componentpublic void setFocusable(boolean b)
Component
setFocusable in class Componentpublic Cursor getCursor()
Component
getCursor in class Componentpublic Toolkit getToolkit()
Component
getToolkit in class Componentpublic GraphicsConfiguration getGraphicsConfiguration()
Component
getGraphicsConfiguration in class Componentpublic ComponentOrientation getComponentOrientation()
getComponentOrientation in class Componentpublic void setComponentOrientation(ComponentOrientation o)
setComponentOrientation in class Componentpublic void dispose()
Component
dispose in class Componentpublic void componentOnlyDispose()
Component
componentOnlyDispose in class Componentpublic void addActionListener(ActionListener l)
ComponentActionListener to this component
addActionListener in class Componentpublic void removeActionListener(ActionListener l)
ComponentActionListener from the component
removeActionListener in class Componentpublic void addComponentListener(ComponentListener l)
ComponentComponentListener to this component
addComponentListener in class Componentpublic void removeComponentListener(ComponentListener l)
ComponentComponentListener from the component
removeComponentListener in class Componentpublic void addMouseListener(MouseListener l)
ComponentMouseListener to this component
addMouseListener in class Componentpublic void removeMouseListener(MouseListener l)
ComponentMouseListener from the component
removeMouseListener in class Componentpublic void addMouseMotionListener(MouseMotionListener l)
ComponentMouseMotionListener to this component
addMouseMotionListener in class Componentpublic void removeMouseMotionListener(MouseMotionListener l)
ComponentMouseMotionListener from the component
removeMouseMotionListener in class Componentpublic void addKeyListener(KeyListener l)
ComponentKeyListener to this component
addKeyListener in class Componentpublic void removeKeyListener(KeyListener l)
ComponentKeyListener from the component
removeKeyListener in class Componentpublic void addFocusListener(FocusListener l)
ComponentKeyListener to this component
addFocusListener in class Componentpublic void removeFocusListener(FocusListener l)
ComponentKeyListener from the component
removeFocusListener in class Componentpublic void addInputMethodListener(InputMethodListener l)
ComponentInputMethodListener to this component
addInputMethodListener in class Componentpublic void removeInputMethodListener(InputMethodListener l)
ComponentInputMethodListener to this component
removeInputMethodListener in class Componentpublic void dispatchEvent(AWTEvent awtEvent)
dispatchEvent in class Componentpublic void addNotify()
addNotify in class Componentpublic void removeNotify()
removeNotify in class Component
public boolean imageUpdate(Image img,
int infoflags,
int x,
int y,
int width,
int height)
Component
imageUpdate in interface ImageObserverimageUpdate in class Componentpublic boolean hasFocus()
Component
hasFocus in class Componentpublic java.lang.Object getTreeLock()
Component
getTreeLock in class Componentpublic AccessibleContext getAccessibleContext()
Component
getAccessibleContext in class Component
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||