Search in sources :

Example 31 with ImageView

use of javafx.scene.image.ImageView in project Gargoyle by callakrsos.

the class FxControlsTreeItem method getImage.

/**
	 * resources패키지로부터 image를 가져오는 처리
	 * 
	 * @param name
	 * @return
	 */
ImageView getImage(String name) {
    try {
        String name2 = "images/nodeicons/" + name + ".png";
        URL resource = this.getClass().getClassLoader().getResource(name2);
        if (resource != null) {
            File file = new File(resource.toURI());
            if (file.exists())
                return new ImageView(new Image(resource.openStream()));
        }
    } catch (Exception e) {
    // not important...
    }
    return new ImageView();
}
Also used : ImageView(javafx.scene.image.ImageView) Image(javafx.scene.image.Image) File(java.io.File) URL(java.net.URL)

Example 32 with ImageView

use of javafx.scene.image.ImageView in project Gargoyle by callakrsos.

the class SpecExample method start.

@Override
public void start(Stage primaryStage) throws Exception {
    String projectDir = System.getProperty("user.dir");
    File file = new File(projectDir, "src/main/java/com/kyj/fx/voeditor/visual/example/SpecExample.java");
    SpecResource specResource = new SpecResource(new File(projectDir), file);
    SpecTabPane center = new SpecTabPane(specResource);
    Button btnCapture = new Button("SnapShot");
    ImageView ivOrigin = new ImageView();
    btnCapture.setOnAction(ev -> {
        FxUtil.snapShot(center, new File("example.png"));
        FxUtil.printJob(primaryStage, center);
    });
    Text text1 = new Text("Big italic red text");
    text1.setFill(Color.RED);
    text1.setFont(Font.font("Helvetica", FontPosture.ITALIC, 40));
    Text text2 = new Text(" little bold blue text");
    text2.setFill(Color.BLUE);
    text2.setFont(Font.font("Helvetica", FontWeight.BOLD, 10));
    TextFlow textFlow = new TextFlow(text1, text2);
    BorderPane root = new BorderPane(center);
    root.setTop(new HBox(textFlow, btnCapture));
    root.setBottom(ivOrigin);
    root.setPrefSize(800, 600);
    Scene value = new Scene(root, 800, 600);
    primaryStage.setScene(value);
    primaryStage.show();
}
Also used : BorderPane(javafx.scene.layout.BorderPane) HBox(javafx.scene.layout.HBox) SpecResource(com.kyj.fx.voeditor.visual.words.spec.auto.msword.ui.model.SpecResource) SpecTabPane(com.kyj.fx.voeditor.visual.words.spec.auto.msword.ui.tabs.SpecTabPane) Button(javafx.scene.control.Button) Text(javafx.scene.text.Text) TextFlow(javafx.scene.text.TextFlow) ImageView(javafx.scene.image.ImageView) Scene(javafx.scene.Scene) File(java.io.File)

Example 33 with ImageView

use of javafx.scene.image.ImageView in project bitsquare by bitsquare.

the class ImageUtil method getImageViewById.

public static ImageView getImageViewById(String id) {
    ImageView imageView = new ImageView();
    imageView.setId(id);
    return imageView;
}
Also used : ImageView(javafx.scene.image.ImageView)

Example 34 with ImageView

use of javafx.scene.image.ImageView in project BoofCV by lessthanoptimal.

the class ExampleFxShowImage method start.

@Override
public void start(Stage stage) throws Exception {
    Image image = new Image("file://" + UtilIO.pathExample("standard/lena512.jpg"));
    ImageView imageView = new ImageView();
    imageView.setImage(image);
    StackPane root = new StackPane();
    root.getChildren().add(imageView);
    Scene scene = new Scene(root);
    stage.setTitle("Show Image Example");
    stage.setScene(scene);
    stage.show();
}
Also used : ImageView(javafx.scene.image.ImageView) Image(javafx.scene.image.Image) Scene(javafx.scene.Scene) StackPane(javafx.scene.layout.StackPane)

Example 35 with ImageView

use of javafx.scene.image.ImageView in project mybatis-generator-gui by zouzg.

the class MainUIController method loadLeftDBTree.

void loadLeftDBTree() {
    TreeItem rootTreeItem = leftDBTree.getRoot();
    rootTreeItem.getChildren().clear();
    try {
        List<DatabaseConfig> dbConfigs = ConfigHelper.loadDatabaseConfig();
        for (DatabaseConfig dbConfig : dbConfigs) {
            TreeItem<String> treeItem = new TreeItem<>();
            treeItem.setValue(dbConfig.getName());
            ImageView dbImage = new ImageView("icons/computer.png");
            dbImage.setFitHeight(16);
            dbImage.setFitWidth(16);
            dbImage.setUserData(dbConfig);
            treeItem.setGraphic(dbImage);
            rootTreeItem.getChildren().add(treeItem);
        }
    } catch (Exception e) {
        _LOG.error("connect db failed, reason: {}", e);
        AlertUtil.showErrorAlert(e.getMessage() + "\n" + ExceptionUtils.getStackTrace(e));
    }
}
Also used : ImageView(javafx.scene.image.ImageView) SQLRecoverableException(java.sql.SQLRecoverableException) DatabaseConfig(com.zzg.mybatis.generator.model.DatabaseConfig)

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