|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectswingwt.awt.Component
Tag class for AWT compatibility - subclass JSWTComponent has all the good stuff.
Field Summary | |
protected AccessibleContext |
accessibleContext
The accessible context |
protected java.lang.String |
actionCommand
Action command |
protected java.util.Vector |
actionListeners
Action Listener objects |
static float |
BOTTOM_ALIGNMENT
|
static float |
CENTER_ALIGNMENT
|
protected java.util.Vector |
componentListeners
Component Listener objects |
protected java.lang.String |
componentName
The name of this component |
protected boolean |
consumeAvailableHeight
Used with TableLayout to determine whether this component should use up extra height |
protected boolean |
consumeAvailableWidth
Used with TableLayout to determine whether this component should use up extra width |
protected boolean |
focusable
Whether this component can get the focus |
protected java.util.Vector |
focusListeners
Focus Listener objects |
protected static GraphicsConfiguration |
graphicsConfig
The graphics configuration |
protected java.util.Vector |
inputMethodListeners
Input Method Listeners objects |
protected boolean |
isUserSetFont
Whether a calling program has set the font for this component |
protected java.util.Vector |
keyListeners
Keyboard Listener objects |
java.lang.Object |
layoutModifier
Used when caching objects with layouts |
static float |
LEFT_ALIGNMENT
|
protected java.lang.Object |
LOCK
For compatibility with 3rd party layout managers - SwingWT doesn't need this as all laying out is marshalled onto a queued single thread |
protected java.util.Vector |
mouseListeners
Mouse Listener objects |
protected java.util.Vector |
mouseMotionListeners
Mouse Motion Listener objects |
protected java.util.Vector |
mouseWheelListeners
Mouse Wheel Listener objects |
protected Container |
parent
The parent container |
protected Color |
pBackground
Cache value |
protected Cursor |
pCursor
Cache value |
protected boolean |
pDoubleBuffered
Whether paint events give direct access to component or use an image buffer and render in one go |
org.eclipse.swt.widgets.Control |
peer
The SWT peer this component is representing |
protected boolean |
pEnabled
Cache value |
protected Font |
pFont
Cache value |
protected Color |
pForeground
Cache value |
protected java.lang.Object |
pLayoutData
Cache value |
protected Point |
pLocation
Cache value |
protected Dimension |
pMaxSize
Cache value |
protected Dimension |
pMinSize
Cache value |
protected org.eclipse.swt.widgets.Composite |
ppeer
If a default instance of Component is used, then we map a paintable composite canvas as AWT does |
protected Dimension |
pPrefSize
Cache value |
protected Dimension |
pSize
Cache value |
protected java.lang.String |
pToolTipText
Cache value |
protected boolean |
pVisible
Cache value |
static float |
RIGHT_ALIGNMENT
|
protected org.eclipse.swt.events.MouseListener |
swingWTDefaultActionEventAdapter
Default adapter for Action Events |
protected swingwt.awt.Component.SWTEventAdapter |
swingWTEventAdapter
All-in-one event adapter for components |
static float |
TOP_ALIGNMENT
Constants |
Fields inherited from interface swingwt.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
Component()
|
Method Summary | |
void |
add(PopupMenu popupMenu)
|
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 |
addMouseWheelListener(MouseWheelListener l)
Add a MouseWheelListener 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)
|
boolean |
contains(Point point)
|
Image |
createImage(int width,
int height)
Creates and returns an image |
protected EventListener[] |
createListenerArrayFromVector(java.util.Vector listeners)
|
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 |
EventListener[] |
getListeners(java.lang.Class listenerType)
|
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. |
Dimension |
getSize(Dimension rv)
Overloaded version of getSize() that uses the passed in dimension to put the size in to prevent allocation of another on the heap. |
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. |
boolean |
inside(int x,
int y)
|
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 |
void |
paint(Graphics g)
Override in subclasses to paint on the component |
protected void |
paintComponent(Graphics g)
Not normally in Component - member of JComponent, implemented here to save a load of class casting around and to call into paint(Graphics) - this is the first point of call for repainting.. |
void |
processActionEvent(int id)
Sends action events to listeners |
void |
processComponentEvent(ComponentEvent e)
|
void |
processFocusEvent(FocusEvent e)
Sends Focus Events to component listeners |
void |
processInputMethodEvent(InputMethodEvent e)
Sends Input Method Events to component listeners |
void |
processKeyEvent(KeyEvent e)
Sends KeyEvents to component listeners |
void |
processMouseEvent(MouseEvent e)
Sends mouse events to component listeners |
void |
processMouseMotionEvent(MouseEvent e)
Sends mouse motion events to component listeners |
protected void |
processMouseWheelEvent(MouseWheelEvent e)
Sends mouse wheel events to component listeners |
protected void |
processTraverseEvent(org.eclipse.swt.events.TraverseEvent e)
Called when a traversal key is pressed by the user. |
protected void |
registerActionEvents()
|
protected void |
registerComponentEvents()
|
void |
registerEvents()
When the component has been added to a container, this routine gets called to tell it to set up SWT listeners for all its events. |
protected void |
registerExtendedModifyEvents()
Same as above, but for ExtendedModifyEvents |
protected void |
registerFocusEvents()
|
protected void |
registerKeyEvents()
|
protected void |
registerModifyEvents()
Handle ModifyEvents (maps to ImputMethodEvents) by checking the final derivation of this Component. |
protected void |
registerMouseEvents()
|
protected void |
registerPaintEvents()
|
protected void |
registerTraversalEvents()
|
void |
remove(MenuComponent menuComponent)
|
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 |
removeMouseWheelListener(MouseWheelListener l)
Remove a MouseWheelListener to this 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 |
setCachedProperties()
If the component has just been added to a container, but properties were set in the meantime, this routine gets called by JSWTComposite to set the cached properties. |
void |
setComponentOrientation(ComponentOrientation o)
|
protected void |
setComponentRemoved()
When a container removes a component, it calls this method. |
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 |
public org.eclipse.swt.widgets.Control peer
protected org.eclipse.swt.widgets.Composite ppeer
protected java.lang.String componentName
protected static GraphicsConfiguration graphicsConfig
protected Container parent
public java.lang.Object layoutModifier
protected boolean pVisible
protected boolean pEnabled
protected java.lang.String pToolTipText
protected Color pBackground
protected Color pForeground
protected Dimension pSize
protected Dimension pPrefSize
protected Dimension pMinSize
protected Dimension pMaxSize
protected Point pLocation
protected Font pFont
protected java.lang.Object pLayoutData
protected Cursor pCursor
protected boolean pDoubleBuffered
protected java.util.Vector actionListeners
protected java.util.Vector mouseListeners
protected java.util.Vector mouseWheelListeners
protected java.util.Vector mouseMotionListeners
protected java.util.Vector keyListeners
protected java.util.Vector focusListeners
protected java.util.Vector componentListeners
protected java.util.Vector inputMethodListeners
protected boolean consumeAvailableWidth
protected boolean consumeAvailableHeight
protected java.lang.String actionCommand
protected boolean isUserSetFont
protected boolean focusable
protected org.eclipse.swt.events.MouseListener swingWTDefaultActionEventAdapter
protected swingwt.awt.Component.SWTEventAdapter swingWTEventAdapter
protected AccessibleContext accessibleContext
public static final float TOP_ALIGNMENT
public static final float CENTER_ALIGNMENT
public static final float BOTTOM_ALIGNMENT
public static final float LEFT_ALIGNMENT
public static final float RIGHT_ALIGNMENT
protected java.lang.Object LOCK
Constructor Detail |
public Component()
Method Detail |
public void paint(Graphics g)
protected void paintComponent(Graphics g)
public void setSwingWTParent(Container parent) throws java.lang.Exception
java.lang.Exception
public org.eclipse.swt.widgets.Control getSWTPeer()
public ComponentPeer getPeer()
public void add(PopupMenu popupMenu)
public void remove(MenuComponent menuComponent)
remove
in interface MenuContainer
public void show()
public void hide()
public void setVisible(boolean b)
public boolean isVisible()
public boolean isShowing()
public void setEnabled(boolean b)
public boolean isEnabled()
public void requestFocus()
public void grabFocus()
public void repaint(int x, int y, int width, int height)
public void repaint(long tm, int x, int y, int width, int height)
public void repaint()
public Color getBackground()
public void setBackground(Color c)
public Color getForeground()
public void setForeground(Color c)
public int getWidth()
public int getHeight()
public void setWidth(int width)
public void setHeight(int height)
public Graphics getGraphics()
public Dimension getPreferredSize()
protected Dimension computePreferredSize()
public void setPreferredSize(Dimension d)
protected Dimension calculatePreferredSize()
public Dimension getMaximumSize()
public void setMaximumSize(Dimension d)
public Dimension getMinimumSize()
public void setMinimumSize(Dimension d)
public boolean isMinimumSizeSet()
public void setSize(int width, int height)
public void setSize(Dimension d)
public boolean contains(int x, int y)
public boolean contains(Point point)
public boolean inside(int x, int y)
public Dimension getSize()
public Dimension getSize(Dimension rv)
public Dimension getPeerSize()
public void setFocusTraversalKeysEnabled(boolean b)
public Point getLocation()
public Point getLocationOnScreen()
public Image createImage(int width, int height)
public VolatileImage createVolatileImage(int width, int height)
public FontMetrics getFontMetrics(Font f)
public Font getFont()
getFont
in interface MenuContainer
public void setFont(Font f)
public boolean hasSetFont()
public java.lang.String getToolTipText()
public void setToolTipText(java.lang.String text)
public void setBounds(int x, int y, int width, int height)
public void setBounds(Rectangle r)
public Rectangle getBounds()
public float getAlignmentX()
public float getAlignmentY()
public void setAlignmentX(float val)
public void setAlignmentY(float val)
public void transferFocus()
public void transferFocusBackward()
public void transferFocusUpCycle()
public void invalidate()
public void validate()
public java.lang.String getActionCommand()
public void setActionCommand(java.lang.String command)
public void setLocation(Point p)
public void setLocation(int x, int y)
public int getX()
public int getY()
public Container getParent()
public java.lang.String getName()
public void setName(java.lang.String newName)
public void setCursor(Cursor c)
public boolean isFocusable()
public void setFocusable(boolean b)
public Cursor getCursor()
public Toolkit getToolkit()
public GraphicsConfiguration getGraphicsConfiguration()
public ComponentOrientation getComponentOrientation()
public void setComponentOrientation(ComponentOrientation o)
public void dispose()
public void componentOnlyDispose()
public void addActionListener(ActionListener l)
ActionListener
to this component
public void removeActionListener(ActionListener l)
ActionListener
from the component
public void addComponentListener(ComponentListener l)
ComponentListener
to this component
public void removeComponentListener(ComponentListener l)
ComponentListener
from the component
public void addMouseListener(MouseListener l)
MouseListener
to this component
public void removeMouseListener(MouseListener l)
MouseListener
from the component
public void addMouseWheelListener(MouseWheelListener l)
MouseWheelListener
to this component
public void removeMouseWheelListener(MouseWheelListener l)
MouseWheelListener
to this component
public void addMouseMotionListener(MouseMotionListener l)
MouseMotionListener
to this component
public void removeMouseMotionListener(MouseMotionListener l)
MouseMotionListener
from the component
public void addKeyListener(KeyListener l)
KeyListener
to this component
public void removeKeyListener(KeyListener l)
KeyListener
from the component
public void addFocusListener(FocusListener l)
KeyListener
to this component
public void removeFocusListener(FocusListener l)
KeyListener
from the component
public void addInputMethodListener(InputMethodListener l)
InputMethodListener
to this component
public void removeInputMethodListener(InputMethodListener l)
InputMethodListener
to this component
public void dispatchEvent(AWTEvent awtEvent)
public void addNotify()
public void removeNotify()
public EventListener[] getListeners(java.lang.Class listenerType)
protected EventListener[] createListenerArrayFromVector(java.util.Vector listeners)
public void processActionEvent(int id)
public void processComponentEvent(ComponentEvent e)
public void processMouseEvent(MouseEvent e)
public void processMouseMotionEvent(MouseEvent e)
protected void processMouseWheelEvent(MouseWheelEvent e)
public void processKeyEvent(KeyEvent e)
public void processFocusEvent(FocusEvent e)
public void processInputMethodEvent(InputMethodEvent e)
public void setCachedProperties()
public void registerEvents()
protected void registerPaintEvents()
protected void registerTraversalEvents()
protected void registerFocusEvents()
protected void registerComponentEvents()
protected void registerMouseEvents()
protected void registerKeyEvents()
protected void registerActionEvents()
protected void registerModifyEvents()
protected void registerExtendedModifyEvents()
protected void processTraverseEvent(org.eclipse.swt.events.TraverseEvent e)
protected void setComponentRemoved()
public boolean imageUpdate(Image img, int infoflags, int x, int y, int width, int height)
imageUpdate
in interface ImageObserver
public boolean hasFocus()
public java.lang.Object getTreeLock()
public AccessibleContext getAccessibleContext()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |