Package org.eclipse.gef.fx.swt.controls
Class FXSimpleLinearGradientPicker
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.gef.fx.swt.controls.FXSimpleLinearGradientPicker
- All Implemented Interfaces:
Drawable
The
FXSimpleLinearGradientPicker
allows the selection of two colors
from which a gradient is constructed.-
Property Summary
TypePropertyDescriptionjavafx.beans.property.Property<javafx.scene.paint.LinearGradient>
Returns a writable property for the simple linear gradient. -
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Property name used in change events related tosimpleLinearGradientProperty()
. -
Constructor Summary
ConstructorDescriptionFXSimpleLinearGradientPicker
(Composite parent, javafx.scene.paint.Color color1, javafx.scene.paint.Color color2) Constructs a newFXSimpleLinearGradientPicker
. -
Method Summary
Modifier and TypeMethodDescriptionstatic javafx.scene.paint.LinearGradient
createSimpleLinearGradient
(javafx.scene.paint.Color c1, javafx.scene.paint.Color c2) Creates a simple color gradient from the given start color to the given end color.javafx.scene.paint.LinearGradient
Returns the currently selected simple gradient.static boolean
isSimpleLinearGradient
(javafx.scene.paint.Paint paint) Returnstrue
if the givenPaint
is a "simple" gradient, i.e. it has exactly 2 stops.void
setSimpleLinearGradient
(javafx.scene.paint.LinearGradient simpleLinearGradient) Changes the currently selected gradient to the given value.javafx.beans.property.Property<javafx.scene.paint.LinearGradient>
Returns a writable property for the simple linear gradient.Methods inherited from class org.eclipse.swt.widgets.Composite
changed, checkSubclass, computeSize, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, redraw, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList, toString
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, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, requestLayout, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setFont, 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
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.eclipse.swt.graphics.Drawable
isAutoScalable
-
Property Details
-
simpleLinearGradient
public javafx.beans.property.Property<javafx.scene.paint.LinearGradient> simpleLinearGradientPropertyReturns a writable property for the simple linear gradient.
-
-
Field Details
-
SIMPLE_LINEAR_GRADIENT_PROPERTY
Property name used in change events related tosimpleLinearGradientProperty()
.- See Also:
-
-
Constructor Details
-
FXSimpleLinearGradientPicker
public FXSimpleLinearGradientPicker(Composite parent, javafx.scene.paint.Color color1, javafx.scene.paint.Color color2) Constructs a newFXSimpleLinearGradientPicker
.- Parameters:
parent
- The parentComposite
.color1
- The first color of the initial simpleLinearGradient
.color2
- The second color of the initial simpleLinearGradient
.
-
-
Method Details
-
createSimpleLinearGradient
public static javafx.scene.paint.LinearGradient createSimpleLinearGradient(javafx.scene.paint.Color c1, javafx.scene.paint.Color c2) Creates a simple color gradient from the given start color to the given end color.- Parameters:
c1
- The startColor
.c2
- The endColor
.- Returns:
- The resulting
LinearGradient
.
-
isSimpleLinearGradient
public static boolean isSimpleLinearGradient(javafx.scene.paint.Paint paint) Returnstrue
if the givenPaint
is a "simple" gradient, i.e. it has exactly 2 stops. Otherwise returnsfalse
.- Parameters:
paint
- ThePaint
in question.- Returns:
true
if the givenPaint
is a simple gradient, otherwisefalse
.
-
getSimpleLinearGradient
public javafx.scene.paint.LinearGradient getSimpleLinearGradient()Returns the currently selected simple gradient.- Returns:
- The currently selected simple gradient.
-
setSimpleLinearGradient
public void setSimpleLinearGradient(javafx.scene.paint.LinearGradient simpleLinearGradient) Changes the currently selected gradient to the given value.- Parameters:
simpleLinearGradient
- The new simpleLinearGradient
to select.
-
simpleLinearGradientProperty
public javafx.beans.property.Property<javafx.scene.paint.LinearGradient> simpleLinearGradientProperty()Returns a writable property for the simple linear gradient.
-