Search in sources :

Example 81 with FXML

use of javafx.fxml.FXML in project trex-stateless-gui by cisco-system-traffic-generator.

the class PacketBuilderHomeController method handleCloseDialog.

@FXML
public void handleCloseDialog(final MouseEvent event) {
    Node node = (Node) event.getSource();
    Stage stage = (Stage) node.getScene().getWindow();
    stage.hide();
}
Also used : Node(javafx.scene.Node) Stage(javafx.stage.Stage) FXML(javafx.fxml.FXML)

Example 82 with FXML

use of javafx.fxml.FXML in project trex-stateless-gui by cisco-system-traffic-generator.

the class PacketBuilderHomeController method saveProfileBtnClicked.

@FXML
public void saveProfileBtnClicked(ActionEvent event) {
    if (saveStream()) {
        // close the dialog
        Node node = (Node) event.getSource();
        Stage stage = (Stage) node.getScene().getWindow();
        stage.hide();
    }
}
Also used : Node(javafx.scene.Node) Stage(javafx.stage.Stage) FXML(javafx.fxml.FXML)

Example 83 with FXML

use of javafx.fxml.FXML in project trex-stateless-gui by cisco-system-traffic-generator.

the class MainViewController method handleAboutTreeItemClicked.

/**
     * Handle About tree item clicked
     *
     * @param event
     * @throws java.lang.Exception
     */
@FXML
public void handleAboutTreeItemClicked(ActionEvent event) throws Exception {
    DialogWindow statsWindow = new DialogWindow("AboutWindowView.fxml", "TRex", 200, 100, false, TrexApp.getPrimaryStage());
    statsWindow.show(true);
}
Also used : DialogWindow(com.exalttech.trex.ui.dialog.DialogWindow) FXML(javafx.fxml.FXML)

Example 84 with FXML

use of javafx.fxml.FXML in project trex-stateless-gui by cisco-system-traffic-generator.

the class ConnectDialogController method handleConnectButton.

/**
     * Handle connect button clicking
     *
     * @param event
     */
@FXML
public void handleConnectButton(ActionEvent event) {
    Node node = (Node) event.getSource();
    Stage stage = (Stage) node.getScene().getWindow();
    doConnect(stage);
}
Also used : Node(javafx.scene.Node) Stage(javafx.stage.Stage) FXML(javafx.fxml.FXML)

Example 85 with FXML

use of javafx.fxml.FXML in project Gargoyle by callakrsos.

the class AntRunConfigView method initialize.

@FXML
public void initialize() {
    c = new AntJavaCompiler(this.buildFile.getParentFile(), this.buildFile) {

        @Override
        protected BuildListener getBuildListener() {
            return progressListener;
        }
    };
    c.parse();
    this.txtBuildFileLocation.setText(this.buildFile.getAbsolutePath());
    this.txtProjectName.setText(c.getProjectName());
    //		tcTargetName.setCellFactory(value);
    tcChkTarget.setCellFactory(CheckBoxTableCell.forTableColumn(tcChkTarget));
    tcChkTarget.setCellValueFactory(param -> param.getValue().chkProperty());
    tcTargetName.setCellFactory(TextFieldTableCell.forTableColumn());
    tcTargetName.setCellValueFactory(param -> param.getValue().targetNameProperty());
    tcTargetDesc.setCellFactory(TextFieldTableCell.forTableColumn());
    tcTargetDesc.setCellValueFactory(param -> param.getValue().targetDescProperty());
    List<AntRunConfigItem> collect = c.getTargets().entrySet().stream().map(ent -> {
        String key = ent.getKey();
        if (ValueUtil.isEmpty(key))
            return null;
        String desc = ent.getValue().getDescription() == null ? "" : ent.getValue().getDescription();
        AntRunConfigItem item = new AntRunConfigItem(key, desc);
        item.chkProperty().addListener(new ChangeListenerImpl(item));
        boolean equals = key.equals(c.getDefaultTarget());
        item.setChk(equals);
        if (equals)
            item.setTargetDesc("[default]  ".concat(desc));
        return item;
    }).filter(v -> v != null).collect(Collectors.toList());
    tbTargets.getItems().addAll(collect);
    tbTargets.setEditable(true);
    tcChkTarget.setEditable(true);
    tcTargetName.setEditable(false);
    tcTargetDesc.setEditable(false);
//		Platform.runLater(()->{
//
//		});
}
Also used : Button(javafx.scene.control.Button) TextArea(javafx.scene.control.TextArea) LoggerFactory(org.slf4j.LoggerFactory) AntJavaCompiler(com.kyj.fx.voeditor.visual.framework.jdt.compiler.AntJavaCompiler) FXCollections(javafx.collections.FXCollections) TextFieldTableCell(javafx.scene.control.cell.TextFieldTableCell) TableColumn(javafx.scene.control.TableColumn) HashSet(java.util.HashSet) Task(javafx.concurrent.Task) TabPane(javafx.scene.control.TabPane) FileUtil(com.kyj.fx.voeditor.visual.util.FileUtil) TableView(javafx.scene.control.TableView) OutputStream(java.io.OutputStream) ObservableSet(javafx.collections.ObservableSet) TextField(javafx.scene.control.TextField) Logger(org.slf4j.Logger) BuildListener(org.apache.tools.ant.BuildListener) BuildEvent(org.apache.tools.ant.BuildEvent) ByteArrayOutputStream(org.apache.commons.io.output.ByteArrayOutputStream) FXMLController(com.kyj.fx.voeditor.visual.framework.annotation.FXMLController) IOException(java.io.IOException) ValueUtil(com.kyj.fx.voeditor.visual.util.ValueUtil) Collectors(java.util.stream.Collectors) File(java.io.File) FxPostInitialize(com.kyj.fx.voeditor.visual.framework.annotation.FxPostInitialize) Platform(javafx.application.Platform) FXML(javafx.fxml.FXML) FxUtil(com.kyj.fx.voeditor.visual.util.FxUtil) List(java.util.List) SystemConsole(com.kyj.fx.voeditor.visual.component.console.SystemConsole) Stage(javafx.stage.Stage) Tab(javafx.scene.control.Tab) CheckBoxTableCell(javafx.scene.control.cell.CheckBoxTableCell) ObservableValue(javafx.beans.value.ObservableValue) AntRunConfigItem(com.kyj.fx.voeditor.visual.component.config.model.AntRunConfigItem) BorderPane(javafx.scene.layout.BorderPane) ChangeListener(javafx.beans.value.ChangeListener) InputStream(java.io.InputStream) AntJavaCompiler(com.kyj.fx.voeditor.visual.framework.jdt.compiler.AntJavaCompiler) BuildListener(org.apache.tools.ant.BuildListener) AntRunConfigItem(com.kyj.fx.voeditor.visual.component.config.model.AntRunConfigItem) FXML(javafx.fxml.FXML)

Aggregations

FXML (javafx.fxml.FXML)280 Engine (jgnash.engine.Engine)46 InjectFXML (jgnash.uifx.util.InjectFXML)43 File (java.io.File)40 IOException (java.io.IOException)37 Stage (javafx.stage.Stage)32 List (java.util.List)23 ArrayList (java.util.ArrayList)22 Preferences (java.util.prefs.Preferences)18 SimpleObjectProperty (javafx.beans.property.SimpleObjectProperty)18 ResourceBundle (java.util.ResourceBundle)17 Scene (javafx.scene.Scene)17 Button (javafx.scene.control.Button)17 FXCollections (javafx.collections.FXCollections)16 LocalDate (java.time.LocalDate)15 BigDecimal (java.math.BigDecimal)14 ObjectProperty (javafx.beans.property.ObjectProperty)14 ObservableList (javafx.collections.ObservableList)14 FXMLLoader (javafx.fxml.FXMLLoader)14 ChangeListener (javafx.beans.value.ChangeListener)13