public class SComposite
extends org.eclipse.swt.widgets.Canvas
implements org.eclipse.swt.widgets.Listener
NOTE: THIS WIDGET AND ITS API ARE STILL UNDER DEVELOPMENT. THIS IS A PRE-RELEASE ALPHA VERSION. USERS SHOULD EXPECT API CHANGES IN FUTURE VERSIONS.
Modifier and Type | Field and Description |
---|---|
static int |
BORDER
Style setting indicating that a Border should be drawn
|
static int |
FLAT
Style setting indicating that the Border should be drawn with a Flat appearance,
otherwise the border will have a subtle raised appearance.
|
static int |
NONE
Style setting indicating that Border should NOT be drawn
|
static int |
SQUARE
Style setting indicating that the Border should be drawn with Square corners,
otherwise the corners will be rounded.
|
Constructor and Description |
---|
SComposite(org.eclipse.swt.widgets.Composite parent)
styles:
default is a Raised Rounded Corner border
SWT.FLAT - flat
SWT.SIMPLE - rectangular corners
|
SComposite(org.eclipse.swt.widgets.Composite parent,
int style) |
Modifier and Type | Method and Description |
---|---|
int |
getBorderStyle() |
int |
getBorderWidth() |
void |
handleEvent(org.eclipse.swt.widgets.Event event) |
void |
setBackground(org.eclipse.swt.graphics.Color color)
The setBackground method of an SComposite does not actually set its own
background color, as a typical Composite does, but rather the color of its border.
|
void |
setBorder(int style,
int width)
Convenience method; simply calls setBorderStyle(style) and then setBorderWidth(width).
|
void |
setBorderStyle(int style)
Set the style of border to be drawn.
If turning the border OFF after it has been ON, the margins may need to be reset. Valid Styles: NONE (default) BORDER FLAT SQUARE |
void |
setBorderWidth(int width)
Set the line width of the border to be drawn.
|
void |
setLayout(org.eclipse.swt.widgets.Layout layout)
Sets the layout ONLY if layout is a GridLayout
and makes sure that there is room for the borders by setting the margins as
shown below:
BORDER: (borderWidth+1) pixels all around (arc gets cut otherwise)
BORDER | FLAT: (borderWidth+1) pixels all around
BORDER | SQUARE: (borderWidth+1) pixels left & top, borderWidth pixels right & bottom
BORDER | SQUARE | FLAT: borderWidth pixels all around
|
void |
setMargins(int width,
int height)
Set the margin for the layout.
|
void |
setNormalBorderColor(org.eclipse.swt.graphics.Color color)
Set the color of the border to be drawn when the cell is NOT selected.
|
void |
updateBackground()
This method to sets the actual background of this SComposite
to match that of its parent.
|
drawBackground, getCaret, getIME, scroll, setCaret, setFont, setIME
changed, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayoutDeferred, setTabList
computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar
addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, computeSize, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, getTextDirection, getToolTipText, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, requestLayout, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString
public static int NONE
public static int BORDER
public static int FLAT
public static int SQUARE
public SComposite(org.eclipse.swt.widgets.Composite parent)
parent
- style
- public SComposite(org.eclipse.swt.widgets.Composite parent, int style)
public int getBorderStyle()
public int getBorderWidth()
getBorderWidth
in class org.eclipse.swt.widgets.Control
public void handleEvent(org.eclipse.swt.widgets.Event event)
handleEvent
in interface org.eclipse.swt.widgets.Listener
public void setBackground(org.eclipse.swt.graphics.Color color)
((Control) child).setBackground(color)
, and have the
SComposite do its job of drawing a color coordinated border.updateBackground
method.setBackground
in class org.eclipse.swt.widgets.Control
{@inheritDoc}
public void setBorder(int style, int width)
style
- width
- setBorderStyle(int)
,
setBorderWidth(int)
public void setBorderStyle(int style)
style
- setMargins(int, int)
public void setBorderWidth(int width)
width
- public void setLayout(org.eclipse.swt.widgets.Layout layout)
setLayout
in class org.eclipse.swt.widgets.Composite
public void setMargins(int width, int height)
width
- height
- setLayout(Layout)
public void setNormalBorderColor(org.eclipse.swt.graphics.Color color)
color
- public void updateBackground()