Package org.eclipse.gef.fx.swt.controls
Class FXColorPicker
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.FXColorPicker
- All Implemented Interfaces:
Drawable
An SWT control that can be used to select a JavaFX color (and indicates the
selected color via an image).
-
Property Summary
PropertiesTypePropertyDescriptionjavafx.beans.property.Property<javafx.scene.paint.Color>A writable property for the color controlled by thisFXColorPicker. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringProperty name used in change events related tocolorProperty(). -
Constructor Summary
ConstructorsConstructorDescriptionFXColorPicker(Composite parent, javafx.scene.paint.Color color) Constructs a newFXColorPicker. -
Method Summary
Modifier and TypeMethodDescriptionjavafx.beans.property.Property<javafx.scene.paint.Color>A writable property for the color controlled by thisFXColorPicker.javafx.scene.paint.ColorgetColor()Returns the currently selectedColor.protected static javafx.scene.paint.ColorOpens aColorDialogto let the user pick aColor.voidsetColor(javafx.scene.paint.Color color) Changes the currently selectedColorto the given value.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, toStringMethods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBarMethods 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, updateMethods 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, setDataMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.swt.graphics.Drawable
isAutoScalable
-
Property Details
-
color
public javafx.beans.property.Property<javafx.scene.paint.Color> colorPropertyA writable property for the color controlled by thisFXColorPicker.- See Also:
-
-
Field Details
-
COLOR_PROPERTY
Property name used in change events related tocolorProperty().- See Also:
-
-
Constructor Details
-
FXColorPicker
Constructs a newFXColorPicker.- Parameters:
parent- The parentComposite.color- The initialColorto set.
-
-
Method Details
-
pickColor
Opens aColorDialogto let the user pick aColor. Returns the pickedColor, ornullif no color was picked.- Parameters:
shell- TheShellwhich serves as the parent for theColorDialog.initial- The initialColorto display in theColorDialog.- Returns:
- The picked
Color, ornull.
-
colorProperty
public javafx.beans.property.Property<javafx.scene.paint.Color> colorProperty()A writable property for the color controlled by thisFXColorPicker.- See Also:
-
getColor
public javafx.scene.paint.Color getColor()Returns the currently selectedColor.- Returns:
- The currently selected
Color.
-
setColor
public void setColor(javafx.scene.paint.Color color) Changes the currently selectedColorto the given value.- Parameters:
color- The newly selectedColor.
-