Search in sources :

Example 6 with CheckBox

use of javafx.scene.control.CheckBox in project Gargoyle by callakrsos.

the class CrudBaseColumnMapper method checkBox.

private CheckBoxTableCell<T, Object> checkBox(TableColumn<T, ?> column) {
    CheckBox columnheaderCheckbox = new CheckBox();
    // columnheaderCheckbox.setStyle("-fx-background-color:white;
    // -fx-border-color :black; -fx-border-width:1;");
    column.setGraphic(columnheaderCheckbox);
    column.setSortable(false);
    columnheaderCheckbox.addEventHandler(ActionEvent.ACTION, event -> {
        if (columnheaderCheckbox.isSelected()) {
            setSelectAll(column, true);
        } else {
            setSelectAll(column, false);
        }
    });
    return new CheckBoxTableCell<T, Object>() {

        @Override
        public void updateItem(Object item, boolean empty) {
            super.updateItem(item, empty);
        }

        @Override
        public void startEdit() {
            //TODO 추가 작업 예상됨. 현재는 기본컬럼으로 CheckBox형태가 나올것같지않음.
            super.startEdit();
        }
    };
}
Also used : CheckBox(javafx.scene.control.CheckBox) CheckBoxTableCell(javafx.scene.control.cell.CheckBoxTableCell)

Example 7 with CheckBox

use of javafx.scene.control.CheckBox in project trex-stateless-gui by cisco-system-traffic-generator.

the class EthernetProtocolView method buildCustomProtocolView.

/**
     * Build custom view
     */
@Override
protected void buildCustomProtocolView() {
    AnchorPane container = new AnchorPane();
    type = new CheckBox("Ethernet Type");
    addCheckBox(type, 20, 10);
    typeField = new TextField();
    addInput(typeField, 20, 165, 220);
    typeField.disableProperty().bind(type.selectedProperty().not());
    setContent(container);
}
Also used : CheckBox(javafx.scene.control.CheckBox) TextField(javafx.scene.control.TextField) AnchorPane(javafx.scene.layout.AnchorPane)

Example 8 with CheckBox

use of javafx.scene.control.CheckBox in project trex-stateless-gui by cisco-system-traffic-generator.

the class TCPProtocolView method buildCustomProtocolView.

/**
     * Build custom view
     */
@Override
protected void buildCustomProtocolView() {
    // source port
    srcPortCB = new CheckBox("Override source port");
    addCheckBox(srcPortCB, 8, 15);
    srcPort = new TextField();
    addInput(srcPort, 5, 220, 170);
    srcPort.disableProperty().bind(srcPortCB.selectedProperty().not());
    // Dst port
    dstPortCB = new CheckBox("Override destination port");
    addCheckBox(dstPortCB, 43, 15);
    dstPort = new TextField();
    addInput(dstPort, 40, 220, 170);
    dstPort.disableProperty().bind(dstPortCB.selectedProperty().not());
    // add seq number
    addLabel("Sequence number", 78, 38);
    seqNumber = new TextField();
    addInput(seqNumber, 75, 220, 170);
    // add ack number
    addLabel("Acknowledge number", 113, 38);
    ackNumber = new TextField();
    addInput(ackNumber, 110, 220, 170);
    // add window
    addLabel("Window", 148, 38);
    window = new TextField();
    addInput(window, 145, 220, 170);
    // add header length
    headerLengthCB = new CheckBox("Override header length(x4)");
    headerLength = new TextField();
    headerLength.disableProperty().bind(headerLengthCB.selectedProperty().not());
    // add checksum
    checkSumCB = new CheckBox("Override checksum");
    addCheckBox(checkSumCB, 8, 500);
    checksum = new TextField();
    addInput(checksum, 5, 660, 170);
    checksum.disableProperty().bind(checkSumCB.selectedProperty().not());
    // add urgent pointer
    addLabel("Urgent pointer", 43, 520);
    urgentPointer = new TextField();
    addInput(urgentPointer, 40, 660, 170);
    addSeparator(80, 490, 350);
    addLabel("Flags", 95, 500);
    urg = new CheckBox("URG");
    addCheckBox(urg, 125, 500);
    ack = new CheckBox("ACK");
    addCheckBox(ack, 125, 575);
    psh = new CheckBox("PSH");
    addCheckBox(psh, 125, 650);
    rst = new CheckBox("RST");
    addCheckBox(rst, 160, 500);
    syn = new CheckBox("SYN");
    addCheckBox(syn, 160, 575);
    fin = new CheckBox("FIN");
    addCheckBox(fin, 160, 650);
}
Also used : CheckBox(javafx.scene.control.CheckBox) TextField(javafx.scene.control.TextField)

Example 9 with CheckBox

use of javafx.scene.control.CheckBox in project trex-stateless-gui by cisco-system-traffic-generator.

the class CheckBoxTableViewCell method call.

/**
     *
     * @param p
     * @return
     */
@Override
public TableCell call(TableColumn p) {
    return new TableCell<Object, Boolean>() {

        private final CheckBox checkBox;

        {
            checkBox = new CheckBox();
            checkBox.selectedProperty().addListener((ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue) -> {
                if (checkboxChangeHandler != null) {
                    checkboxChangeHandler.stateChanged(getTableRow().getIndex(), newValue);
                }
            });
            this.setGraphic(checkBox);
            this.setContentDisplay(ContentDisplay.GRAPHIC_ONLY);
            this.setEditable(true);
        }

        @Override
        public void updateItem(Boolean item, boolean empty) {
            super.updateItem(item, empty);
            if (!empty) {
                checkBox.setSelected(item);
                setGraphic(checkBox);
            } else {
                this.setGraphic(null);
            }
        }
    };
}
Also used : TableCell(javafx.scene.control.TableCell) CheckBox(javafx.scene.control.CheckBox) ObservableValue(javafx.beans.value.ObservableValue)

Example 10 with CheckBox

use of javafx.scene.control.CheckBox in project trex-stateless-gui by cisco-system-traffic-generator.

the class ImportedPacketTableView method initTableRowsColumns.

/**
     * Initialize table rows and columns
     */
private void initTableRowsColumns() {
    selectedColumn.setCellValueFactory(new PropertyValueFactory<>("selected"));
    selectedColumn.setCellFactory(CheckBoxTableCell.forTableColumn(selectedColumn));
    selectAll = new CheckBox();
    selectAll.getStyleClass().add("selectAll");
    selectAll.setSelected(true);
    selectAll.selectedProperty().addListener((ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue) -> {
        selectAllRows();
    });
    selectedColumn.setGraphic(selectAll);
    nameColumn.setCellValueFactory(new PropertyValueFactory<>("name"));
    nameColumn.setCellFactory(new TextFieldTableViewCell());
    packetNumColumn.setCellValueFactory(new PropertyValueFactory<>("index"));
    lengthColumn.setCellValueFactory(new PropertyValueFactory<>("length"));
    macSrcColumn.setCellValueFactory(new PropertyValueFactory<>("macSrc"));
    macDstColumn.setCellValueFactory(new PropertyValueFactory<>("macDst"));
    ipSrcColumn.setCellValueFactory(new PropertyValueFactory<>("ipSrc"));
    ipDstColumn.setCellValueFactory(new PropertyValueFactory<>("ipDst"));
    packetTypeColumn.setCellValueFactory(new PropertyValueFactory<>("packetType"));
    importedStreamTable.setRowFactory(highlightedRowFactory);
}
Also used : TextFieldTableViewCell(com.exalttech.trex.ui.components.TextFieldTableViewCell) CheckBox(javafx.scene.control.CheckBox) ObservableValue(javafx.beans.value.ObservableValue)

Aggregations

CheckBox (javafx.scene.control.CheckBox)19 Label (javafx.scene.control.Label)5 TextField (javafx.scene.control.TextField)5 Insets (javafx.geometry.Insets)4 JFXCheckBox (com.jfoenix.controls.JFXCheckBox)3 Button (javafx.scene.control.Button)3 TextArea (javafx.scene.control.TextArea)3 ObservableValue (javafx.beans.value.ObservableValue)2 Scene (javafx.scene.Scene)2 Slider (javafx.scene.control.Slider)2 AnchorPane (javafx.scene.layout.AnchorPane)2 FlowPane (javafx.scene.layout.FlowPane)2 HBox (javafx.scene.layout.HBox)2 MultiplierType (com.exalttech.trex.ui.MultiplierType)1 MultiplierOption (com.exalttech.trex.ui.components.MultiplierOption)1 TextFieldTableViewCell (com.exalttech.trex.ui.components.TextFieldTableViewCell)1 Alert (io.bitsquare.alert.Alert)1 InputTextField (io.bitsquare.gui.components.InputTextField)1 Popup (io.bitsquare.gui.main.overlays.popups.Popup)1 FormBuilder.addCheckBox (io.bitsquare.gui.util.FormBuilder.addCheckBox)1