Class SwitchButton
- java.lang.Object
-
- org.eclipse.swt.widgets.Widget
-
- org.eclipse.swt.widgets.Control
-
- org.eclipse.swt.widgets.Scrollable
-
- org.eclipse.swt.widgets.Composite
-
- org.eclipse.swt.widgets.Canvas
-
- org.eclipse.nebula.widgets.opal.switchbutton.SwitchButton
-
- All Implemented Interfaces:
org.eclipse.swt.graphics.Drawable
public class SwitchButton extends org.eclipse.swt.widgets.CanvasInstances of this class are simple switch button.- Styles:
- (none)
- Events:
- Selection
-
-
Field Summary
Fields Modifier and Type Field Description private intarcArc of rounded rectangles (default is 3)private org.eclipse.swt.graphics.ColorborderColorif not null, displays a rectangle (or a round rectangle) around the whole widget.private org.eclipse.swt.graphics.ColorbuttonBackgroundColor1Colors for the buttonprivate org.eclipse.swt.graphics.ColorbuttonBackgroundColor2Colors for the buttonprivate org.eclipse.swt.graphics.ColorbuttonBorderColorColors for the buttonprivate org.eclipse.swt.graphics.ColorfocusColorif not null, displays a glow effect when the mouse is over the widget.private intgapGap between the button and the text (default value is 5)private org.eclipse.swt.graphics.GCgcGraphical context for this buttonprivate intinsideMarginXMargin inside the button (default is 5)private intinsideMarginYMargin inside the button (default is 5)private java.util.List<org.eclipse.swt.events.SelectionListener>listOfSelectionListenersList of selection listenersprivate booleanmouseInsideTrue when the mouse entered the widgetprivate booleanroundIf true, display round rectangles instead of rectangles (default value is true)private org.eclipse.swt.graphics.ColorselectedBackgroundColorColors when the button is selectedprivate org.eclipse.swt.graphics.ColorselectedForegroundColorColors when the button is selectedprivate booleanselectionSelectionprivate java.lang.StringtextText corresponding to the button (default is "")private java.lang.StringtextForSelectText displayed for the selected value (default = "On")private java.lang.StringtextForUnselectText displayed for the unselected value (default = "Off")private org.eclipse.swt.graphics.ColorunselectedBackgroundColorColors when the button is not selectedprivate org.eclipse.swt.graphics.ColorunselectedForegroundColorColors when the button is not selected
-
Constructor Summary
Constructors Constructor Description SwitchButton(org.eclipse.swt.widgets.Composite parent, int style)Constructs a new instance of this class given its parent and a style value describing its behavior and appearance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSelectionListener(org.eclipse.swt.events.SelectionListener listener)Adds the listener to the collection of listeners who will be notified when the control is selected by the user, by sending it one of the messages defined in theSelectionListenerinterface.private org.eclipse.swt.graphics.PointcomputeButtonSize()org.eclipse.swt.graphics.PointcomputeSize(int wHint, int hHint, boolean changed)private voiddrawBorder()Draw (eventually) the border around the buttonprivate voiddrawLeftPart(org.eclipse.swt.graphics.Point buttonSize)Draw the left part of the buttonprivate voiddrawRightPart(org.eclipse.swt.graphics.Point buttonSize)Draw the right part of the buttonprivate voiddrawSwitchButton(org.eclipse.swt.graphics.Point buttonSize)Draw the switch buttonprivate voiddrawText(org.eclipse.swt.graphics.Point buttonSize)Draws the text besides the buttonprivate voiddrawToggleButton(org.eclipse.swt.graphics.Point buttonSize)Draw the toggle buttonprivate booleanfireSelectionListeners(org.eclipse.swt.widgets.Event e)Fire the selection listenersintgetArc()org.eclipse.swt.graphics.ColorgetBorderColor()org.eclipse.swt.graphics.ColorgetButtonBackgroundColor1()org.eclipse.swt.graphics.ColorgetButtonBackgroundColor2()org.eclipse.swt.graphics.ColorgetButtonBorderColor()org.eclipse.swt.graphics.ColorgetFocusColor()intgetGap()org.eclipse.swt.graphics.PointgetInsideMargin()org.eclipse.swt.graphics.ColorgetSelectedBackgroundColor()org.eclipse.swt.graphics.ColorgetSelectedForegroundColor()booleangetSelection()java.lang.StringgetText()java.lang.StringgetTextForSelect()java.lang.StringgetTextForUnselect()org.eclipse.swt.graphics.ColorgetUnselectedBackgroundColor()org.eclipse.swt.graphics.ColorgetUnselectedForegroundColor()booleanisRound()private voidonPaint(org.eclipse.swt.events.PaintEvent event)Paint the widgetvoidremoveSelectionListener(org.eclipse.swt.events.SelectionListener listener)Removes the listener from the collection of listeners who will be notified when the control is selected by the user.voidsetArc(int arc)voidsetBorderColor(org.eclipse.swt.graphics.Color borderColor)voidsetButtonBackgroundColor1(org.eclipse.swt.graphics.Color buttonBackgroundColor1)voidsetButtonBackgroundColor2(org.eclipse.swt.graphics.Color buttonBackgroundColor2)voidsetButtonBorderColor(org.eclipse.swt.graphics.Color buttonBorderColor)voidsetFocusColor(org.eclipse.swt.graphics.Color focusColor)voidsetGap(int gap)voidsetInsideMargin(int insideMarginX, int insideMarginY)voidsetInsideMargin(org.eclipse.swt.graphics.Point insideMargin)voidsetRound(boolean round)voidsetSelectedBackgroundColor(org.eclipse.swt.graphics.Color selectedBackgroundColor)voidsetSelectedForegroundColor(org.eclipse.swt.graphics.Color selectedForegroundColor)voidsetSelection(boolean selection)voidsetText(java.lang.String text)voidsetTextForSelect(java.lang.String textForSelect)voidsetTextForUnselect(java.lang.String textForUnselect)voidsetUnselectedBackgroundColor(org.eclipse.swt.graphics.Color unselectedBackgroundColor)voidsetUnselectedForegroundColor(org.eclipse.swt.graphics.Color unselectedForegroundColor)-
Methods inherited from class org.eclipse.swt.widgets.Canvas
drawBackground, getCaret, getIME, scroll, setCaret, setFont, setIME
-
Methods inherited from class org.eclipse.swt.widgets.Composite
changed, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList
-
Methods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar
-
Methods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, 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, isAutoScalable, 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, setBackground, 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
-
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString
-
-
-
-
Field Detail
-
selection
private boolean selection
Selection
-
textForSelect
private java.lang.String textForSelect
Text displayed for the selected value (default = "On")
-
textForUnselect
private java.lang.String textForUnselect
Text displayed for the unselected value (default = "Off")
-
text
private java.lang.String text
Text corresponding to the button (default is "")
-
round
private boolean round
If true, display round rectangles instead of rectangles (default value is true)
-
borderColor
private org.eclipse.swt.graphics.Color borderColor
if not null, displays a rectangle (or a round rectangle) around the whole widget. Default value is null.
-
focusColor
private org.eclipse.swt.graphics.Color focusColor
if not null, displays a glow effect when the mouse is over the widget. Default value is null.
-
selectedForegroundColor
private org.eclipse.swt.graphics.Color selectedForegroundColor
Colors when the button is selected
-
selectedBackgroundColor
private org.eclipse.swt.graphics.Color selectedBackgroundColor
Colors when the button is selected
-
unselectedForegroundColor
private org.eclipse.swt.graphics.Color unselectedForegroundColor
Colors when the button is not selected
-
unselectedBackgroundColor
private org.eclipse.swt.graphics.Color unselectedBackgroundColor
Colors when the button is not selected
-
buttonBorderColor
private org.eclipse.swt.graphics.Color buttonBorderColor
Colors for the button
-
buttonBackgroundColor1
private org.eclipse.swt.graphics.Color buttonBackgroundColor1
Colors for the button
-
buttonBackgroundColor2
private org.eclipse.swt.graphics.Color buttonBackgroundColor2
Colors for the button
-
gap
private int gap
Gap between the button and the text (default value is 5)
-
insideMarginX
private int insideMarginX
Margin inside the button (default is 5)
-
insideMarginY
private int insideMarginY
Margin inside the button (default is 5)
-
arc
private int arc
Arc of rounded rectangles (default is 3)
-
gc
private org.eclipse.swt.graphics.GC gc
Graphical context for this button
-
listOfSelectionListeners
private final java.util.List<org.eclipse.swt.events.SelectionListener> listOfSelectionListeners
List of selection listeners
-
mouseInside
private boolean mouseInside
True when the mouse entered the widget
-
-
Constructor Detail
-
SwitchButton
public SwitchButton(org.eclipse.swt.widgets.Composite parent, int style)Constructs a new instance of this class given its parent and a style value describing its behavior and appearance.The style value is either one of the style constants defined in class
SWTwhich is applicable to instances of this class, or must be built by bitwise OR'ing together (that is, using theint"|" operator) two or more of thoseSWTstyle constants. The class description lists the style constants that are applicable to the class. Style bits are also inherited from superclasses.- Parameters:
parent- a composite control which will be the parent of the new instance (cannot be null)style- the style of control to construct- Throws:
java.lang.IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the parent is null
org.eclipse.swt.SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent
-
-
Method Detail
-
onPaint
private void onPaint(org.eclipse.swt.events.PaintEvent event)
Paint the widget- Parameters:
event- paint event
-
drawSwitchButton
private void drawSwitchButton(org.eclipse.swt.graphics.Point buttonSize)
Draw the switch button- Parameters:
buttonSize- size of the button
-
drawRightPart
private void drawRightPart(org.eclipse.swt.graphics.Point buttonSize)
Draw the right part of the button- Parameters:
buttonSize- size of the button
-
drawLeftPart
private void drawLeftPart(org.eclipse.swt.graphics.Point buttonSize)
Draw the left part of the button- Parameters:
buttonSize- size of the button
-
drawToggleButton
private void drawToggleButton(org.eclipse.swt.graphics.Point buttonSize)
Draw the toggle button- Parameters:
buttonSize- size of the button
-
computeButtonSize
private org.eclipse.swt.graphics.Point computeButtonSize()
- Returns:
- the button size
-
drawText
private void drawText(org.eclipse.swt.graphics.Point buttonSize)
Draws the text besides the button- Parameters:
buttonSize- whole size of the button
-
drawBorder
private void drawBorder()
Draw (eventually) the border around the button
-
fireSelectionListeners
private boolean fireSelectionListeners(org.eclipse.swt.widgets.Event e)
Fire the selection listeners- Parameters:
e- mouse event- Returns:
- true if the selection could be changed, false otherwise
-
addSelectionListener
public void addSelectionListener(org.eclipse.swt.events.SelectionListener listener)
Adds the listener to the collection of listeners who will be notified when the control is selected by the user, by sending it one of the messages defined in theSelectionListenerinterface.widgetSelectedis called when the control is selected by the user.widgetDefaultSelectedis not called.- Parameters:
listener- the listener which should be notified- Throws:
java.lang.IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
org.eclipse.swt.SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
SelectionListener,removeSelectionListener(org.eclipse.swt.events.SelectionListener),SelectionEvent
-
removeSelectionListener
public void removeSelectionListener(org.eclipse.swt.events.SelectionListener listener)
Removes the listener from the collection of listeners who will be notified when the control is selected by the user.- Parameters:
listener- the listener which should no longer be notified- Throws:
java.lang.IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
org.eclipse.swt.SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
SelectionListener,addSelectionListener(org.eclipse.swt.events.SelectionListener)
-
computeSize
public org.eclipse.swt.graphics.Point computeSize(int wHint, int hHint, boolean changed)- Overrides:
computeSizein classorg.eclipse.swt.widgets.Control- See Also:
Control.computeSize(int, int, boolean)
-
getSelection
public boolean getSelection()
- Returns:
- the selection state of the button
- Throws:
org.eclipse.swt.SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setSelection
public void setSelection(boolean selection)
- Parameters:
selection- the selection state of the button- Throws:
org.eclipse.swt.SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getTextForSelect
public java.lang.String getTextForSelect()
- Returns:
- the text used to display the selection
- Throws:
org.eclipse.swt.SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setTextForSelect
public void setTextForSelect(java.lang.String textForSelect)
- Parameters:
textForSelect- the text used to display the selection- Throws:
org.eclipse.swt.SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getTextForUnselect
public java.lang.String getTextForUnselect()
- Returns:
- the text used to display the unselected option
- Throws:
org.eclipse.swt.SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setTextForUnselect
public void setTextForUnselect(java.lang.String textForUnselect)
- Parameters:
textForUnselect- the text used to display the unselected option- Throws:
org.eclipse.swt.SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getText
public java.lang.String getText()
- Returns:
- the text displayed in the widget
- Throws:
org.eclipse.swt.SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setText
public void setText(java.lang.String text)
- Parameters:
the- text displayed in the widget- Throws:
org.eclipse.swt.SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
isRound
public boolean isRound()
- Returns:
- the round flag
- Throws:
org.eclipse.swt.SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setRound
public void setRound(boolean round)
- Parameters:
round- the round flag to set. If true, the widget is composed of round rectangle instead of rectangles- Throws:
org.eclipse.swt.SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getBorderColor
public org.eclipse.swt.graphics.Color getBorderColor()
- Returns:
- the border's color. If null, no border is displayed
- Throws:
org.eclipse.swt.SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setBorderColor
public void setBorderColor(org.eclipse.swt.graphics.Color borderColor)
- Parameters:
borderColor- the border's color. If null, no border is displayed.- Throws:
org.eclipse.swt.SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getFocusColor
public org.eclipse.swt.graphics.Color getFocusColor()
- Returns:
- the focus color. If null, no focus effect is displayed.
- Throws:
org.eclipse.swt.SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setFocusColor
public void setFocusColor(org.eclipse.swt.graphics.Color focusColor)
- Parameters:
focusColor- the focus color to set. If null, no focus effect is displayed.- Throws:
org.eclipse.swt.SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getSelectedForegroundColor
public org.eclipse.swt.graphics.Color getSelectedForegroundColor()
- Returns:
- the foreground color of the left part of the widget (selection is on)
- Throws:
org.eclipse.swt.SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setSelectedForegroundColor
public void setSelectedForegroundColor(org.eclipse.swt.graphics.Color selectedForegroundColor)
- Parameters:
the- foreground color of the left part of the widget (selection is on)- Throws:
org.eclipse.swt.SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getSelectedBackgroundColor
public org.eclipse.swt.graphics.Color getSelectedBackgroundColor()
- Returns:
- the background color of the left part of the widget (selection is on)
- Throws:
org.eclipse.swt.SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setSelectedBackgroundColor
public void setSelectedBackgroundColor(org.eclipse.swt.graphics.Color selectedBackgroundColor)
- Parameters:
the- background color of the left part of the widget (selection is on)
-
getUnselectedForegroundColor
public org.eclipse.swt.graphics.Color getUnselectedForegroundColor()
- Returns:
- the foreground color of the left part of the widget (selection is on)
- Throws:
org.eclipse.swt.SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setUnselectedForegroundColor
public void setUnselectedForegroundColor(org.eclipse.swt.graphics.Color unselectedForegroundColor)
- Parameters:
unselectedForegroundColor- the foreground color of the left part of the widget (selection is on)- Throws:
org.eclipse.swt.SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getUnselectedBackgroundColor
public org.eclipse.swt.graphics.Color getUnselectedBackgroundColor()
- Returns:
- the background color of the left part of the widget (selection is on)
- Throws:
org.eclipse.swt.SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setUnselectedBackgroundColor
public void setUnselectedBackgroundColor(org.eclipse.swt.graphics.Color unselectedBackgroundColor)
- Parameters:
unselectedBackgroundColor- the background color of the left part of the widget (selection is on)- Throws:
org.eclipse.swt.SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getButtonBorderColor
public org.eclipse.swt.graphics.Color getButtonBorderColor()
- Returns:
- the border color of the switch button
- Throws:
org.eclipse.swt.SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setButtonBorderColor
public void setButtonBorderColor(org.eclipse.swt.graphics.Color buttonBorderColor)
- Parameters:
buttonBorderColor- the border color of the switch button- Throws:
org.eclipse.swt.SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getButtonBackgroundColor1
public org.eclipse.swt.graphics.Color getButtonBackgroundColor1()
- Returns:
- the first color of the toggle button
- Throws:
org.eclipse.swt.SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setButtonBackgroundColor1
public void setButtonBackgroundColor1(org.eclipse.swt.graphics.Color buttonBackgroundColor1)
- Parameters:
buttonBackgroundColor1- the first color of the toggle button- Throws:
org.eclipse.swt.SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getButtonBackgroundColor2
public org.eclipse.swt.graphics.Color getButtonBackgroundColor2()
- Returns:
- the second color of the toggle button
- Throws:
org.eclipse.swt.SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setButtonBackgroundColor2
public void setButtonBackgroundColor2(org.eclipse.swt.graphics.Color buttonBackgroundColor2)
- Parameters:
buttonBackgroundColor2- the second color of the toggle button- Throws:
org.eclipse.swt.SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getGap
public int getGap()
- Returns:
- the gap value
- Throws:
org.eclipse.swt.SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setGap
public void setGap(int gap)
- Parameters:
gap- the gap value to set- Throws:
org.eclipse.swt.SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getInsideMargin
public org.eclipse.swt.graphics.Point getInsideMargin()
- Returns:
- the margin value
- Throws:
org.eclipse.swt.SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setInsideMargin
public void setInsideMargin(int insideMarginX, int insideMarginY)- Parameters:
insideMarginX- the new margin value (horizontal)insideMarginY- the new margin value (vertical)- Throws:
org.eclipse.swt.SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setInsideMargin
public void setInsideMargin(org.eclipse.swt.graphics.Point insideMargin)
- Parameters:
insideMargin- the new margin value- Throws:
org.eclipse.swt.SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getArc
public int getArc()
- Returns:
- the arc value
- Throws:
org.eclipse.swt.SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setArc
public void setArc(int arc)
- Parameters:
arc- the arc value to set- Throws:
org.eclipse.swt.SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
-