javafx.beans.value.ObservableDoubleValue Java Examples

The following examples show how to use javafx.beans.value.ObservableDoubleValue. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DisplayTransformUpdateOnResize.java    From paintera with GNU General Public License v2.0 6 votes vote down vote up
public DisplayTransformUpdateOnResize(
		final AffineTransformWithListeners displayTransformUpdater,
		final ObservableDoubleValue width,
		final ObservableDoubleValue height,
		final Object lock)
{
	super();
	this.displayTransformUpdater = displayTransformUpdater;
	this.width = width;
	this.height = height;
	this.lock = lock;

	this.onResize = (obs, oldv, newv) -> {
		synchronized (lock)
		{
			setCanvasSize(this.width.doubleValue(), this.height.doubleValue(), true);
		}
	};

	listen();

	setCanvasSize(width.get(), height.get(), false);

}
 
Example #2
Source File: ViewArrow.java    From latexdraw with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void createArc(final double cx, final double cy, final double rx, final double ry, final double angle, final double length,
					final ObservableValue<Color> strokeProp, final ObservableDoubleValue strokeWidthProp) {
	arc.setCenterX(cx);
	arc.setCenterY(cy);
	arc.setRadiusX(rx);
	arc.setRadiusY(ry);
	arc.setStartAngle(angle);
	arc.setLength(length);
	arc.strokeProperty().unbind();
	arc.strokeProperty().bind(strokeProp);
	arc.strokeWidthProperty().unbind();
	arc.strokeWidthProperty().bind(strokeWidthProp);
	arc.setFill(null);
	enableShape(false, true, false);
}
 
Example #3
Source File: SVGArrow.java    From latexdraw with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void setPathStrokeWidth(final ObservableDoubleValue widthProp) {
	createPathElement();
	if(currentPathElt != null) {
		currentPathElt.setAttribute(SVGAttributes.SVG_STROKE_WIDTH, MathUtils.INST.format.format(widthProp.get()));
	}
}
 
Example #4
Source File: SVGArrow.java    From latexdraw with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void createArc(final double cx, final double cy, final double rx, final double ry, final double angle, final double length, final
						ObservableValue<Color> strokeProp, final ObservableDoubleValue strokeWidthProp) {
	final boolean sweepFlag = angle < 0d ^ arrow.isInverted() ^ !arrow.isLeftArrow();
	createPath();
	currentPath.add(new SVGPathSegMoveto(cx + rx * Math.cos(Math.toRadians(angle)), cy - ry * Math.sin(Math.toRadians(angle)), false));
	currentPath.add(new SVGPathSegArc(cx + rx * Math.cos(Math.toRadians(angle + length)),
		cy - ry * Math.sin(Math.toRadians(angle + length)), rx, ry, 0, false, sweepFlag, false));
	setPathStroke(strokeProp);
	setPathStrokeWidth(strokeWidthProp);
	setPathFill(null);
}
 
Example #5
Source File: NotificationBarPane.java    From GreenBits with GNU General Public License v3.0 4 votes vote down vote up
public Item(String label, @Nullable ObservableDoubleValue progress) {
    this.label = new SimpleStringProperty(label);
    this.progress = progress;
}
 
Example #6
Source File: ViewArrow.java    From latexdraw with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void setPathStrokeWidth(final ObservableDoubleValue widthProp) {
	path.strokeWidthProperty().unbind();
	path.strokeWidthProperty().bind(widthProp);
}
 
Example #7
Source File: NotificationBarPane.java    From thundernetwork with GNU Affero General Public License v3.0 4 votes vote down vote up
public Item pushItem(String string, @Nullable ObservableDoubleValue progress) {
    Item i = new Item(string, progress);
    items.add(i);
    return i;
}
 
Example #8
Source File: NotificationBarPane.java    From thundernetwork with GNU Affero General Public License v3.0 4 votes vote down vote up
public Item(String label, @Nullable ObservableDoubleValue progress) {
    this.label = new SimpleStringProperty(label);
    this.progress = progress;
}
 
Example #9
Source File: NotificationBarPane.java    From devcoretalk with GNU General Public License v2.0 4 votes vote down vote up
public Item pushItem(String string, @Nullable ObservableDoubleValue progress) {
    Item i = new Item(string, progress);
    items.add(i);
    return i;
}
 
Example #10
Source File: NotificationBarPane.java    From devcoretalk with GNU General Public License v2.0 4 votes vote down vote up
public Item(String label, @Nullable ObservableDoubleValue progress) {
    this.label = new SimpleStringProperty(label);
    this.progress = progress;
}
 
Example #11
Source File: NotificationBarPane.java    From GreenBits with GNU General Public License v3.0 4 votes vote down vote up
public Item pushItem(String string, @Nullable ObservableDoubleValue progress) {
    Item i = new Item(string, progress);
    items.add(i);
    return i;
}
 
Example #12
Source File: NotificationBarPane.java    From thunder with GNU Affero General Public License v3.0 4 votes vote down vote up
public Item pushItem (String string, @Nullable ObservableDoubleValue progress) {
    Item i = new Item(string, progress);
    items.add(i);
    return i;
}
 
Example #13
Source File: NotificationBarPane.java    From thunder with GNU Affero General Public License v3.0 4 votes vote down vote up
public Item (String label, @Nullable ObservableDoubleValue progress) {
    this.label = new SimpleStringProperty(label);
    this.progress = progress;
}
 
Example #14
Source File: NotificationBarPane.java    From green_android with GNU General Public License v3.0 4 votes vote down vote up
public Item pushItem(String string, @Nullable ObservableDoubleValue progress) {
    Item i = new Item(string, progress);
    items.add(i);
    return i;
}
 
Example #15
Source File: NotificationBarPane.java    From green_android with GNU General Public License v3.0 4 votes vote down vote up
public Item(String label, @Nullable ObservableDoubleValue progress) {
    this.label = new SimpleStringProperty(label);
    this.progress = progress;
}
 
Example #16
Source File: ThresholdingSourceState.java    From paintera with GNU General Public License v2.0 4 votes vote down vote up
public ObservableDoubleValue maxValue()
{
	return this.maxSupplier;
}
 
Example #17
Source File: ThresholdingSourceState.java    From paintera with GNU General Public License v2.0 4 votes vote down vote up
public ObservableDoubleValue minValue()
{
	return this.minSupplier;
}
 
Example #18
Source File: BrushOverlay.java    From paintera with GNU General Public License v2.0 4 votes vote down vote up
public ObservableDoubleValue viewerRadiusProperty()
{
	return this.viewerRadius;
}
 
Example #19
Source File: GenericViewArrow.java    From latexdraw with GNU General Public License v3.0 4 votes vote down vote up
void createArc(final double cx, final double cy, final double rx, final double ry, final double angle, final double length,
ObservableValue<Color> strokeProp, ObservableDoubleValue strokeWidthProp);
 
Example #20
Source File: UtilitiesBindings.java    From JavaFXSmartGraph with MIT License 2 votes vote down vote up
/**
 * Binding for {@link java.lang.Math#toDegrees(double)}
 *
 * @param   angrad   an angle, in radians
 * @return  the measurement of the angle {@code angrad}
 *          in degrees.
 */
public static DoubleBinding toDegrees(final ObservableDoubleValue angrad) {
    return createDoubleBinding(() -> Math.toDegrees(angrad.get()), angrad);
}
 
Example #21
Source File: UtilitiesBindings.java    From JavaFXSmartGraph with MIT License 2 votes vote down vote up
/**
 * Binding for {@link java.lang.Math#atan2(double, double)}
 *
 * @param   y   the ordinate coordinate
 * @param   x   the abscissa coordinate
 * @return  the <i>theta</i> component of the point
 *          (<i>r</i>,&nbsp;<i>theta</i>)
 *          in polar coordinates that corresponds to the point
 *          (<i>x</i>,&nbsp;<i>y</i>) in Cartesian coordinates.
 */
public static DoubleBinding atan2(final ObservableDoubleValue y, final ObservableDoubleValue x) {
    return createDoubleBinding(() -> Math.atan2(y.get(), x.get()), y, x);
}
 
Example #22
Source File: GenericViewArrow.java    From latexdraw with GNU General Public License v3.0 votes vote down vote up
void setPathStrokeWidth(final ObservableDoubleValue widthProp);