use of javafx.scene.effect.Effect in project jphp by jphp-compiler.
the class UXNode method setAnchorFlags.
@Setter
public void setAnchorFlags(ArrayMemory value) {
Parent parent = getWrappedObject().getParent();
Bounds parentBounds = parent == null ? null : parent.getLayoutBounds();
if (parent == null) {
return;
}
Effect effect = getWrappedObject().getEffect();
getWrappedObject().setEffect(null);
Bounds bounds = getBoundsInParent();
Border border = parent instanceof Region ? ((Region) parent).getBorder() : null;
Insets borderInsets = border == null ? Insets.EMPTY : border.getInsets();
if (value.containsKey("left")) {
boolean left = value.valueOfIndex("left").toBoolean();
if (left) {
setLeftAnchor(DoubleMemory.valueOf(bounds.getMinX() - borderInsets.getLeft()));
} else {
setLeftAnchor(Memory.NULL);
}
}
if (value.containsKey("top")) {
boolean top = value.valueOfIndex("top").toBoolean();
if (top) {
setTopAnchor(DoubleMemory.valueOf(bounds.getMinY() - borderInsets.getTop()));
} else {
setTopAnchor(Memory.NULL);
}
}
if (value.containsKey("right")) {
boolean right = value.valueOfIndex("right").toBoolean();
if (right) {
setRightAnchor(DoubleMemory.valueOf(parentBounds.getWidth() - bounds.getMaxX() - borderInsets.getRight()));
} else {
setRightAnchor(Memory.NULL);
}
}
if (value.containsKey("bottom")) {
boolean bottom = value.valueOfIndex("bottom").toBoolean();
if (bottom) {
setBottomAnchor(DoubleMemory.valueOf(parentBounds.getHeight() - bounds.getMaxY() - borderInsets.getBottom()));
} else {
setBottomAnchor(Memory.NULL);
}
}
getWrappedObject().setEffect(effect);
}
use of javafx.scene.effect.Effect in project fxexperience2 by EricCanull.
the class MainController method setIconBinding.
// Adjusts the color of the toogle icons upon selection
private void setIconBinding(ToggleButton toggle) {
ImageView icon = (ImageView) toggle.getGraphic();
icon.effectProperty().bind(new ObjectBinding<Effect>() {
{
bind(toggle.selectedProperty());
}
@Override
protected Effect computeValue() {
return toggle.isSelected() ? null : new ColorAdjust(0, -1, 0, 0);
}
});
}