Search in sources :

Example 41 with ImageView

use of javafx.scene.image.ImageView in project Krothium-Launcher by DarkLBP.

the class MainFX method loadIcons.

/**
 * Loads the profile icons
 */
private void loadIcons() {
    console.print("Loading icons...");
    ObservableList<ImageView> icons = FXCollections.observableArrayList();
    for (ProfileIcon p : ProfileIcon.values()) {
        if (p != ProfileIcon.CRAFTING_TABLE && p != ProfileIcon.GRASS) {
            ImageView imv = new ImageView(kernel.getProfileIcon(p));
            imv.setFitHeight(68);
            imv.setFitWidth(68);
            imv.setId(p.name());
            icons.add(imv);
        }
    }
    iconList.setItems(icons);
    console.print("Icons loaded.");
}
Also used : ProfileIcon(kml.game.profile.ProfileIcon) ImageView(javafx.scene.image.ImageView)

Example 42 with ImageView

use of javafx.scene.image.ImageView in project Board-Instrumentation-Framework by intel.

the class LcdClockSkin method initGraphics.

private void initGraphics() {
    main = new Region();
    main.getStyleClass().setAll("main");
    main.setOpacity(getSkinnable().isBackgroundVisible() ? 1 : 0);
    mainInnerShadow0 = new InnerShadow();
    mainInnerShadow0.setOffsetX(0.0);
    mainInnerShadow0.setOffsetY(0.0);
    mainInnerShadow0.setRadius(3.0 / 132.0 * PREFERRED_WIDTH);
    mainInnerShadow0.setColor(Color.web("0xffffff80"));
    mainInnerShadow0.setBlurType(BlurType.TWO_PASS_BOX);
    mainInnerShadow1 = new InnerShadow();
    mainInnerShadow1.setOffsetX(0.0);
    mainInnerShadow1.setOffsetY(1.0);
    mainInnerShadow1.setRadius(2.0 / 132.0 * PREFERRED_WIDTH);
    mainInnerShadow1.setColor(Color.web("0x000000a6"));
    mainInnerShadow1.setBlurType(BlurType.TWO_PASS_BOX);
    mainInnerShadow1.setInput(mainInnerShadow0);
    main.setEffect(getSkinnable().isMainInnerShadowVisible() ? mainInnerShadow1 : null);
    crystalClip = new Rectangle(0, 0, PREFERRED_WIDTH, PREFERRED_HEIGHT);
    crystalClip.setArcWidth(5);
    crystalClip.setArcHeight(5);
    crystalImage = createNoiseImage(PREFERRED_WIDTH, PREFERRED_HEIGHT, DARK_NOISE_COLOR, BRIGHT_NOISE_COLOR, 8);
    crystalOverlay = new ImageView(crystalImage);
    crystalOverlay.setClip(this.crystalClip);
    crystalOverlay.setOpacity(getSkinnable().isCrystalOverlayVisible() ? 1 : 0);
    alarm = new Region();
    alarm.getStyleClass().setAll("alarm");
    alarm.setOpacity(getSkinnable().getAlarms().isEmpty() || allAlarmsInactive() ? 0 : 1);
    backgroundTimeText = new Text("");
    backgroundTimeText.getStyleClass().setAll("fg-trsp");
    backgroundTimeText.setOpacity((LcdClock.LcdFont.LCD == getSkinnable().getTimeFont() || LcdClock.LcdFont.ELEKTRA == getSkinnable().getTimeFont()) ? 1 : 0);
    timeText = new Text("");
    timeText.getStyleClass().setAll("fg");
    backgroundSecondText = new Text("");
    backgroundSecondText.getStyleClass().setAll("fg-trsp");
    backgroundSecondText.setOpacity((LcdClock.LcdFont.LCD == getSkinnable().getTimeFont() || LcdClock.LcdFont.ELEKTRA == getSkinnable().getTimeFont()) ? 1 : 0);
    secondText = new Text("");
    secondText.getStyleClass().setAll("fg");
    title = new Text(getSkinnable().getTitle());
    title.getStyleClass().setAll("fg");
    dateText = new Text(getSkinnable().getTime().getMonthValue() + "/" + getSkinnable().getTime().getDayOfMonth() + "/" + getSkinnable().getTime().getYear());
    dateText.getStyleClass().setAll("fg");
    dayOfWeekText = new Text("");
    dayOfWeekText.getStyleClass().setAll("fg");
    shadowGroup = new Group();
    shadowGroup.setEffect(getSkinnable().isForegroundShadowVisible() ? FOREGROUND_SHADOW : null);
    shadowGroup.getChildren().setAll(alarm, timeText, secondText, title, dateText, dayOfWeekText);
    pane = new Pane();
    pane.getChildren().setAll(main, crystalOverlay, backgroundTimeText, backgroundSecondText, shadowGroup);
    getChildren().setAll(pane);
    resize();
    updateLcd();
}
Also used : Group(javafx.scene.Group) InnerShadow(javafx.scene.effect.InnerShadow) Rectangle(javafx.scene.shape.Rectangle) Region(javafx.scene.layout.Region) Text(javafx.scene.text.Text) ImageView(javafx.scene.image.ImageView) Pane(javafx.scene.layout.Pane)

Example 43 with ImageView

use of javafx.scene.image.ImageView in project Board-Instrumentation-Framework by intel.

the class DynamicImageWidget method setupImages.

private boolean setupImages() {
    for (String key : _ImageFilenames.keySet()) {
        ImageView objImageView = new ImageView(_ImageFilenames.get(key));
        objImageView.setPreserveRatio(getPreserveRatio());
        objImageView.setSmooth(true);
        objImageView.setPickOnBounds(!GetClickThroughTransparentRegion());
        objImageView.setVisible(false);
        _ImageViewMap.put(key, objImageView);
    }
    if (_CurrentKey == null) {
        LOGGER.severe("No Initial Image setup for Dynamic Image Widget.");
        return false;
    } else if (_ImageFilenames.containsKey(_CurrentKey)) {
        _ActiveView = _ImageViewMap.get(_CurrentKey);
        _ActiveView.setVisible(true);
    } else {
        LOGGER.severe("Initial key not valid for dynamic image widget: " + _CurrentKey);
        return false;
    }
    ConfigureDimentions();
    return true;
}
Also used : ImageView(javafx.scene.image.ImageView)

Example 44 with ImageView

use of javafx.scene.image.ImageView 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());
}
Also used : Label(javafx.scene.control.Label) ImageView(javafx.scene.image.ImageView) Image(javafx.scene.image.Image) ProgressBar(javafx.scene.control.ProgressBar) VBox(javafx.scene.layout.VBox) URL(java.net.URL) DropShadow(javafx.scene.effect.DropShadow)

Example 45 with ImageView

use of javafx.scene.image.ImageView in project tokentool by RPTools.

the class ImageUtil method scaleImage.

/*
	 * Resize the overall image width/height scaled to the target width/height
	 */
public static Image scaleImage(Image source, double targetWidth, double targetHeight, boolean preserveRatio) {
    ImageView imageView = new ImageView(source);
    imageView.setPreserveRatio(preserveRatio);
    imageView.setFitWidth(targetWidth);
    imageView.setFitHeight(targetHeight);
    return imageView.snapshot(null, null);
}
Also used : ImageView(javafx.scene.image.ImageView)

Aggregations

ImageView (javafx.scene.image.ImageView)201 Image (javafx.scene.image.Image)90 Button (javafx.scene.control.Button)45 Label (javafx.scene.control.Label)41 Insets (javafx.geometry.Insets)35 Tooltip (javafx.scene.control.Tooltip)32 VBox (javafx.scene.layout.VBox)29 Scene (javafx.scene.Scene)25 File (java.io.File)24 ChangeListener (javafx.beans.value.ChangeListener)24 AutoTooltipLabel (bisq.desktop.components.AutoTooltipLabel)20 Node (javafx.scene.Node)20 AnchorPane (javafx.scene.layout.AnchorPane)20 Callback (javafx.util.Callback)20 Pane (javafx.scene.layout.Pane)18 GridPane (javafx.scene.layout.GridPane)17 HBox (javafx.scene.layout.HBox)17 StackPane (javafx.scene.layout.StackPane)17 Inject (javax.inject.Inject)17 List (java.util.List)16