use of javafx.scene.effect.DropShadow in project Board-Instrumentation-Framework by intel.
the class RectangularGaugeSkin method initGraphics.
private void initGraphics() {
ticksAndSectionsCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT);
ticksAndSections = ticksAndSectionsCanvas.getGraphicsContext2D();
innerShadow = new InnerShadow(BlurType.TWO_PASS_BOX, Color.rgb(0, 0, 0, 0.65), 8, 0d, 0d, 0d);
glow = new DropShadow(BlurType.TWO_PASS_BOX, getSkinnable().getLedColor(), 20, 0d, 0d, 0d);
glow.setInput(innerShadow);
ledFrame = new Region();
ledFrame.getStyleClass().setAll("led-frame");
ledMain = new Region();
ledMain.getStyleClass().setAll("led-main");
ledMain.setStyle("-led-color: " + (colorToCss(getSkinnable().getLedColor())) + ";");
ledHl = new Region();
ledHl.getStyleClass().setAll("led-hl");
needle = new Region();
needle.getStyleClass().setAll(RectangularGauge.STYLE_CLASS_NEEDLE_STANDARD);
needleRotate = new Rotate(180 - getSkinnable().getStartAngle());
needleRotate.setAngle(needleRotate.getAngle() + (getSkinnable().getValue() - oldValue - getSkinnable().getMinValue()) * angleStep);
needle.getTransforms().setAll(needleRotate);
needleHighlight = new Region();
needleHighlight.setMouseTransparent(true);
needleHighlight.getStyleClass().setAll("needle-highlight");
needleHighlight.getTransforms().setAll(needleRotate);
dropShadow = new DropShadow();
dropShadow.setColor(Color.rgb(0, 0, 0, 0.25));
dropShadow.setBlurType(BlurType.TWO_PASS_BOX);
dropShadow.setRadius(0.015 * PREFERRED_WIDTH);
dropShadow.setOffsetY(0.015 * PREFERRED_WIDTH);
shadowGroup = new Group(needle, needleHighlight);
shadowGroup.setEffect(getSkinnable().isDropShadowEnabled() ? dropShadow : null);
titleText = new Text(getSkinnable().getTitle());
titleText.setTextOrigin(VPos.CENTER);
titleText.getStyleClass().setAll("title");
unitText = new Text(getSkinnable().getUnit());
unitText.setMouseTransparent(true);
unitText.setTextOrigin(VPos.CENTER);
unitText.getStyleClass().setAll("unit");
lcdText = new Label(String.format(Locale.US, "%." + getSkinnable().getDecimals() + "f", getSkinnable().getValue()));
lcdText.getStyleClass().setAll("lcd-text");
// Set initial value
angleStep = getSkinnable().getAngleRange() / (getSkinnable().getMaxValue() - getSkinnable().getMinValue());
double targetAngle = 180 - getSkinnable().getStartAngle() + (getSkinnable().getValue() - getSkinnable().getMinValue()) * angleStep;
targetAngle = clamp(180 - getSkinnable().getStartAngle(), 180 - getSkinnable().getStartAngle() + getSkinnable().getAngleRange(), targetAngle);
needleRotate.setAngle(targetAngle);
lightEffect = new InnerShadow(BlurType.TWO_PASS_BOX, Color.rgb(255, 255, 255, 0.65), 2, 0d, 0d, 2d);
foreground = new Region();
foreground.getStyleClass().setAll("foreground");
foreground.setEffect(lightEffect);
// Add all nodes
pane = new Pane();
pane.getChildren().setAll(ticksAndSectionsCanvas, ledFrame, ledMain, ledHl, unitText, lcdText, shadowGroup, foreground, titleText);
getChildren().setAll(pane);
}
use of javafx.scene.effect.DropShadow in project Board-Instrumentation-Framework by intel.
the class LedSkin method initGraphics.
private void initGraphics() {
frame = new Region();
frame.setOpacity(getSkinnable().isFrameVisible() ? 1 : 0);
led = new Region();
led.setStyle("-led-color: " + colorToCss((Color) getSkinnable().getLedColor()) + ";");
innerShadow = new InnerShadow(BlurType.TWO_PASS_BOX, Color.rgb(0, 0, 0, 0.65), 8, 0d, 0d, 0d);
glow = new DropShadow(BlurType.TWO_PASS_BOX, (Color) getSkinnable().getLedColor(), 20, 0d, 0d, 0d);
glow.setInput(innerShadow);
highlight = new Region();
// Set the appropriate style classes
changeStyle();
getChildren().setAll(frame, led, highlight);
}
use of javafx.scene.effect.DropShadow in project Board-Instrumentation-Framework by intel.
the class ValidationPane method initGraphics.
private void initGraphics() {
setMouseTransparent(true);
canvas = new Canvas(getPrefWidth(), getPrefHeight());
ctx = canvas.getGraphicsContext2D();
DropShadow shadow = new DropShadow();
shadow.setRadius(3);
shadow.setColor(Color.rgb(0, 0, 0, 0.3));
shadow.setBlurType(BlurType.TWO_PASS_BOX);
shadow.setOffsetY(1);
canvas.setEffect(shadow);
getChildren().setAll(canvas);
}
use of javafx.scene.effect.DropShadow in project Board-Instrumentation-Framework by intel.
the class MySplash method init.
public void init() {
if (false == _Show) {
return;
}
Image splashImg;
splashImg = getAlternateSplashImage();
if (null == splashImg) {
URL resource = MySplash.class.getResource("Logo.png");
splashImg = new Image(resource.toString());
}
ImageView splash = new ImageView(splashImg);
SPLASH_WIDTH = (int) splashImg.getWidth();
loadProgress = new ProgressBar();
loadProgress.setPrefWidth(SPLASH_WIDTH);
progressText = new Label(Version.getVersion());
progressText.setAlignment(Pos.CENTER);
progressText.setStyle("-fx-content-display:center");
splashLayout = new VBox();
((VBox) (splashLayout)).setAlignment(Pos.CENTER);
splashLayout.getChildren().addAll(splash, loadProgress, progressText);
splashLayout.setStyle("-fx-padding: 5; -fx-background-color: darkgray; -fx-border-width:5; -fx-border-color: darkslategray;");
splashLayout.setEffect(new DropShadow());
}
use of javafx.scene.effect.DropShadow in project FXGL by AlmasB.
the class ProgressBar method setFill.
public void setFill(Color color) {
innerBar.setFill(color);
DropShadow ds = new DropShadow(15, color);
ds.setInput(new Glow(0.5));
innerBar.setEffect(ds);
}
Aggregations