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