|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.Control
org.eclipse.swt.widgets.Scrollable
org.eclipse.swt.widgets.Composite
org.eclipse.swt.widgets.Canvas
com.tensegrity.gui.swt.control.widgets.ImageWidget
This Canvas can be used in order to display icons or labels.
Its advantage is that a border is drawn when the mouse cursor is over the
image. It is for instance used to display icons in the repository panel as
well as in the layout tools panel.
Note that the default background colors are SWT.COLOR_GRAY when
the widget is pressed, SWT.COLOR_WHITE otherwise.
It is possible to modify the background colors by means of the
and
setPressedColor(Color) methods.
setNotPressedColor(Color)
One should call the dispose() method in order to
free the operating system resources associated with
the ImageWidget instance when it is no longer necessary.
| Field Summary |
| Fields inherited from class org.eclipse.swt.widgets.Control |
handle |
| Constructor Summary | |
ImageWidget(org.eclipse.swt.widgets.Composite parent,
int style,
SwtIcon icon)
Initializes this Canvas.
|
|
ImageWidget(org.eclipse.swt.widgets.Composite parent,
SwtIcon icon)
Initializes this Canvas with a style SWT.NONE.
|
|
| Method Summary | |
void |
dispose()
|
void |
draw(org.eclipse.swt.graphics.GC gc)
This method is used in order to draw the internal VisualGraphObjectSwtIcon
representing this ImageWidget. |
void |
mouseDoubleClick(org.eclipse.swt.events.MouseEvent e)
|
void |
mouseDown(org.eclipse.swt.events.MouseEvent e)
|
void |
mouseEnter(org.eclipse.swt.events.MouseEvent e)
|
void |
mouseExit(org.eclipse.swt.events.MouseEvent e)
|
void |
mouseHover(org.eclipse.swt.events.MouseEvent e)
|
void |
mouseUp(org.eclipse.swt.events.MouseEvent e)
|
void |
setImage(SwtIcon icon)
Sets the image to display on this ImageWidget/code>.
|
void |
setNotPressedColor(org.eclipse.swt.graphics.Color notPressed)
Set the Color which will be used as background color
when the widget is not pressed.
|
void |
setPressedColor(org.eclipse.swt.graphics.Color pressed)
Sets the Color which will be used as background color
when the widget is pressed.
|
| Methods inherited from class org.eclipse.swt.widgets.Canvas |
getCaret, scroll, setCaret, setFont |
| Methods inherited from class org.eclipse.swt.widgets.Composite |
checkSubclass, computeSize, getChildren, getLayout, getTabList, layout, layout, setFocus, setLayout, setTabList |
| Methods inherited from class org.eclipse.swt.widgets.Scrollable |
computeTrim, getClientArea, getHorizontalBar, getVerticalBar |
| Methods inherited from class org.eclipse.swt.widgets.Control |
addControlListener, addFocusListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, addTraverseListener, computeSize, forceFocus, getAccessible, getBackground, getBorderWidth, getBounds, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, redraw, redraw, removeControlListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removePaintListener, removeTraverseListener, setBackground, setBounds, setBounds, setCapture, setCursor, setEnabled, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, update |
| Methods inherited from class org.eclipse.swt.widgets.Widget |
addDisposeListener, addListener, checkWidget, getData, getData, getDisplay, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public ImageWidget(org.eclipse.swt.widgets.Composite parent,
SwtIcon icon)
Initializes this Canvas with a style SWT.NONE.
parent - a composite control which will be the parent of the new instance (cannot be null)icon - the SwtIcon to display within this Canvas
public ImageWidget(org.eclipse.swt.widgets.Composite parent,
int style,
SwtIcon icon)
Initializes this Canvas.
parent - a composite control which will be the parent of the new instance (cannot be null)style - the style of control to constructicon - the SwtIcon to display within this Canvas| Method Detail |
public void mouseEnter(org.eclipse.swt.events.MouseEvent e)
mouseEnter in interface org.eclipse.swt.events.MouseTrackListenerpublic void mouseExit(org.eclipse.swt.events.MouseEvent e)
mouseExit in interface org.eclipse.swt.events.MouseTrackListenerpublic void mouseHover(org.eclipse.swt.events.MouseEvent e)
mouseHover in interface org.eclipse.swt.events.MouseTrackListenerpublic void draw(org.eclipse.swt.graphics.GC gc)
This method is used in order to draw the internal VisualGraphObjectSwtIcon
representing this ImageWidget. The background color
and the border vary depending on the mouse position and state.
gc - the graphics context used for the drawingpublic void dispose()
public void setImage(SwtIcon icon)
Sets the image to display on this ImageWidget/code>.
icon - the image to display within this ImageWidgetpublic void mouseDoubleClick(org.eclipse.swt.events.MouseEvent e)
mouseDoubleClick in interface org.eclipse.swt.events.MouseListenerpublic void mouseDown(org.eclipse.swt.events.MouseEvent e)
mouseDown in interface org.eclipse.swt.events.MouseListenerpublic void mouseUp(org.eclipse.swt.events.MouseEvent e)
mouseUp in interface org.eclipse.swt.events.MouseListenerpublic void setNotPressedColor(org.eclipse.swt.graphics.Color notPressed)
Set the Color which will be used as background color
when the widget is not pressed.
notPressed - the Color which will be used as background color
when the widget is not pressedpublic void setPressedColor(org.eclipse.swt.graphics.Color pressed)
Sets the Color which will be used as background color
when the widget is pressed.
pressed - the Color which will be used as background color
when the widget is pressed
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||