Search in sources :

Example 1 with SwingNode

use of javafx.embed.swing.SwingNode in project Gargoyle by callakrsos.

the class DesignerFx method createSymbolTableResultPanel.

private javafx.scene.Node createSymbolTableResultPanel() {
    symbolTableTreeWidget.setCellRenderer(createNoImageTreeCellRenderer());
    SwingNode swingNode = new SwingNode();
    JScrollPane jScrollPane = new JScrollPane(symbolTableTreeWidget);
    createSwingContent(swingNode, jScrollPane);
    return swingNode;
}
Also used : JScrollPane(javax.swing.JScrollPane) SwingNode(javafx.embed.swing.SwingNode)

Example 2 with SwingNode

use of javafx.embed.swing.SwingNode in project Gargoyle by callakrsos.

the class DesignerFx method createASTPanel.

private javafx.scene.Node createASTPanel() {
    astTreeWidget.setCellRenderer(createNoImageTreeCellRenderer());
    TreeSelectionModel model = astTreeWidget.getSelectionModel();
    model.setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
    model.addTreeSelectionListener(new SymbolTableListener());
    model.addTreeSelectionListener(new CodeHighlightListener());
    SwingNode swingNode = new SwingNode();
    createSwingContent(swingNode, new JScrollPane(astTreeWidget));
    return swingNode;
}
Also used : JScrollPane(javax.swing.JScrollPane) TreeSelectionModel(javax.swing.tree.TreeSelectionModel) SwingNode(javafx.embed.swing.SwingNode)

Example 3 with SwingNode

use of javafx.embed.swing.SwingNode in project blue by kunstmusik.

the class BlueJFXControlsApplication method setTablesTest.

private void setTablesTest(TabPane root) {
    TableView<Person> jfxTable = new TableView<>();
    ObservableList<Person> people = FXCollections.observableArrayList();
    for (int i = 0; i < 20; i++) {
        Person p = new Person();
        p.setFirstName("test");
        p.setLastName(Integer.toString(i));
        people.add(p);
    }
    TableColumn<Person, String> firstNameCol = new TableColumn<Person, String>("First Name");
    firstNameCol.setCellValueFactory(new PropertyValueFactory("firstName"));
    TableColumn<Person, String> lastNameCol = new TableColumn<Person, String>("Last Name");
    lastNameCol.setCellValueFactory(new PropertyValueFactory("lastName"));
    jfxTable.getColumns().addAll(firstNameCol, lastNameCol);
    jfxTable.setItems(people);
    SwingNode swingNode = new SwingNode();
    Vector v = new Vector();
    for (int i = 0; i < 20; i++) {
        Vector t = new Vector();
        t.add("test");
        t.add(Integer.toString(i));
        v.add(t);
    }
    Vector labels = new Vector();
    labels.add("First Name");
    labels.add("Last Name");
    SwingUtilities.invokeLater(() -> {
        DefaultTableModel tm = new DefaultTableModel(v, labels);
        JTable table = new JTable(tm);
        table.updateUI();
        JScrollPane scrollPane = new JScrollPane(table);
        scrollPane.setBorder(BorderFactory.createEmptyBorder());
        swingNode.setContent(scrollPane);
    });
    root.getTabs().add(new Tab("Tables", new SplitPane(jfxTable, swingNode)));
}
Also used : JScrollPane(javax.swing.JScrollPane) DefaultTableModel(javax.swing.table.DefaultTableModel) PropertyValueFactory(javafx.scene.control.cell.PropertyValueFactory) SplitPane(javafx.scene.control.SplitPane) TableColumn(javafx.scene.control.TableColumn) SwingNode(javafx.embed.swing.SwingNode) Tab(javafx.scene.control.Tab) JTable(javax.swing.JTable) Vector(java.util.Vector) TableView(javafx.scene.control.TableView)

Example 4 with SwingNode

use of javafx.embed.swing.SwingNode in project blue by kunstmusik.

the class BlueJFXControlsApplication method setupTextFieldsTest.

private void setupTextFieldsTest(TabPane root) {
    SwingNode swingNode = new SwingNode();
    SwingUtilities.invokeLater(() -> swingNode.setContent(new JTextField("Text 2")));
    GridPane gp = new GridPane();
    gp.addRow(0, new Label("JavaFX"), new TextField("Text 1"));
    gp.addRow(1, new Label("Swing"), swingNode);
    gp.setVgap(5.0);
    gp.setHgap(5.0);
    gp.setPadding(new Insets(5, 5, 5, 5));
    root.getTabs().add(new Tab("Text Fields", new BorderPane(gp)));
}
Also used : BorderPane(javafx.scene.layout.BorderPane) GridPane(javafx.scene.layout.GridPane) Insets(javafx.geometry.Insets) Tab(javafx.scene.control.Tab) Label(javafx.scene.control.Label) JTextField(javax.swing.JTextField) TextField(javafx.scene.control.TextField) JTextField(javax.swing.JTextField) SwingNode(javafx.embed.swing.SwingNode)

Example 5 with SwingNode

use of javafx.embed.swing.SwingNode in project dwoss by gg-net.

the class BuilderUtil method createSwingNode.

/**
 * Call from Platform: creates a SwingNode in a BorderPane and sets the pane on in
 *
 * @param in the uiparameter
 * @return the modified uiparameter
 */
static UiParameter createSwingNode(UiParameter in) {
    SwingNode sn = new SwingNode();
    BorderPane p = new BorderPane(sn);
    return in.withPane(p);
}
Also used : BorderPane(javafx.scene.layout.BorderPane) SwingNode(javafx.embed.swing.SwingNode)

Aggregations

SwingNode (javafx.embed.swing.SwingNode)13 BorderPane (javafx.scene.layout.BorderPane)6 Scene (javafx.scene.Scene)4 JScrollPane (javax.swing.JScrollPane)4 Button (javafx.scene.control.Button)3 Label (javafx.scene.control.Label)3 Tab (javafx.scene.control.Tab)3 IOException (java.io.IOException)2 Insets (javafx.geometry.Insets)2 eu.ggnet.saft (eu.ggnet.saft)1 FxController (eu.ggnet.saft.api.ui.FxController)1 ResultProducer (eu.ggnet.saft.api.ui.ResultProducer)1 eu.ggnet.saft.core.ui (eu.ggnet.saft.core.ui)1 FxSaft.loadView (eu.ggnet.saft.core.ui.FxSaft.loadView)1 Type (eu.ggnet.saft.core.ui.builder.UiWorkflowBreak.Type)1 Layer (fractal.Layer)1 Palette (fractal.Palette)1 RenderManager (fractal.RenderManager)1 java.awt (java.awt)1 AWTException (java.awt.AWTException)1