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.");
}
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();
}
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;
}
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());
}
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);
}
Aggregations