Search in sources :

Example 1 with ReadOnlyStringWrapper

use of javafx.beans.property.ReadOnlyStringWrapper in project Smartcity-Smarthouse by TechnionYP5777.

the class SensorListViewController method initialize.

@Override
public void initialize(final URL location, final ResourceBundle __) {
    // TODO Auto-generated method stub
    NameColumn.setCellValueFactory(cellData -> new ReadOnlyStringWrapper(cellData.getValue().getName()));
    locationColumn.setCellValueFactory(cellData -> new ReadOnlyStringWrapper(cellData.getValue().getLocation().getFieldDescription()));
    sensorTable.setEditable(false);
    sensorTable.getSelectionModel().selectedItemProperty().addListener((observable, oldValue, newValue) -> enterSensorConfig(newValue));
}
Also used : ReadOnlyStringWrapper(javafx.beans.property.ReadOnlyStringWrapper)

Example 2 with ReadOnlyStringWrapper

use of javafx.beans.property.ReadOnlyStringWrapper in project loinc2hpo by monarch-initiative.

the class CurrentAnnotationController method initTableStructure.

private void initTableStructure() {
    codeInternalTableview.setSortable(true);
    codeInternalTableview.setCellValueFactory(cdf -> new ReadOnlyStringWrapper(cdf.getValue().getCode().getCode()));
    hpoInternalTableview.setCellValueFactory(cdf -> new ReadOnlyStringWrapper(cdf.getValue().getHpoTermId4LoincTest().getHpoTerm().getName()));
    inversedInternalTableview.setCellValueFactory(cdf -> new ReadOnlyBooleanWrapper(cdf.getValue().getHpoTermId4LoincTest().isNegated()));
    internalTableview.setItems(internalCodeAnnotations);
    systemExternalTableview.setSortable(true);
    systemExternalTableview.setCellValueFactory(cdf -> new ReadOnlyStringWrapper(cdf.getValue().getCode().getSystem()));
    codeExternalTableview.setSortable(true);
    codeExternalTableview.setCellValueFactory(cdf -> new ReadOnlyStringWrapper(cdf.getValue().getCode().getCode()));
    hpoExternalTableview.setCellValueFactory(cdf -> new ReadOnlyStringWrapper(cdf.getValue().getHpoTermId4LoincTest().getHpoTerm().getName()));
    inversedExternalTableview.setCellValueFactory(cdf -> new ReadOnlyBooleanWrapper(cdf.getValue().getHpoTermId4LoincTest().isNegated()));
    externalTableview.setItems(externalCodeAnnotations);
    systemInterpretTableview.setSortable(true);
    systemInterpretTableview.setCellValueFactory(cdf -> new ReadOnlyStringWrapper(cdf.getValue().getCode().getSystem()));
    codeInterpretTableview.setSortable(true);
    codeInterpretTableview.setCellValueFactory(cdf -> new ReadOnlyStringWrapper(cdf.getValue().getCode().getCode()));
    hpoInterpretTableview.setCellValueFactory(cdf -> new ReadOnlyStringWrapper(cdf.getValue().getHpoTermId4LoincTest().getHpoTerm().getName()));
    inversedInterpretTableview.setCellValueFactory(cdf -> new ReadOnlyBooleanWrapper(cdf.getValue().getHpoTermId4LoincTest().isNegated()));
    interpretationTableview.setItems(interpretationCodeAnnotations);
}
Also used : ReadOnlyStringWrapper(javafx.beans.property.ReadOnlyStringWrapper) ReadOnlyBooleanWrapper(javafx.beans.property.ReadOnlyBooleanWrapper)

Example 3 with ReadOnlyStringWrapper

use of javafx.beans.property.ReadOnlyStringWrapper in project org.csstudio.display.builder by kasemir.

the class WidgetInfoDialog method createProperties.

private Tab createProperties(final Widget widget) {
    // Use text field to allow copying the name (for use in scripts)
    // and value, but not the localized description and category
    // which are just for information
    final TableColumn<WidgetProperty<?>, String> cat = new TableColumn<>(Messages.WidgetInfoDialog_Category);
    cat.setCellValueFactory(param -> new ReadOnlyStringWrapper(param.getValue().getCategory().getDescription()));
    final TableColumn<WidgetProperty<?>, String> descr = new TableColumn<>(Messages.WidgetInfoDialog_Property);
    descr.setCellValueFactory(param -> new ReadOnlyStringWrapper(param.getValue().getDescription()));
    final TableColumn<WidgetProperty<?>, String> name = new TableColumn<>(Messages.WidgetInfoDialog_Name);
    name.setCellFactory(TextFieldTableCell.forTableColumn());
    name.setCellValueFactory(param -> new ReadOnlyStringWrapper(param.getValue().getName()));
    final TableColumn<WidgetProperty<?>, String> value = new TableColumn<>(Messages.WidgetInfoDialog_Value);
    value.setCellFactory(TextFieldTableCell.forTableColumn());
    value.setCellValueFactory(param -> new ReadOnlyStringWrapper(Objects.toString(param.getValue().getValue())));
    final TableView<WidgetProperty<?>> table = new TableView<>(FXCollections.observableArrayList(widget.getProperties()));
    table.getColumns().add(cat);
    table.getColumns().add(descr);
    table.getColumns().add(name);
    table.getColumns().add(value);
    table.setEditable(true);
    table.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
    return new Tab(Messages.WidgetInfoDialog_TabProperties, table);
}
Also used : WidgetProperty(org.csstudio.display.builder.model.WidgetProperty) Tab(javafx.scene.control.Tab) ReadOnlyStringWrapper(javafx.beans.property.ReadOnlyStringWrapper) TableColumn(javafx.scene.control.TableColumn) TableView(javafx.scene.control.TableView)

Example 4 with ReadOnlyStringWrapper

use of javafx.beans.property.ReadOnlyStringWrapper in project org.csstudio.display.builder by kasemir.

the class WidgetInfoDialog method createPVs.

private Tab createPVs(final Collection<NameStateValue> pvs) {
    // Use text field to allow users to copy the name, value to clipboard
    final TableColumn<NameStateValue, String> name = new TableColumn<>(Messages.WidgetInfoDialog_Name);
    name.setCellFactory(TextFieldTableCell.forTableColumn());
    name.setCellValueFactory(param -> new ReadOnlyStringWrapper(param.getValue().name));
    final TableColumn<NameStateValue, String> state = new TableColumn<>(Messages.WidgetInfoDialog_State);
    state.setCellFactory(TextFieldTableCell.forTableColumn());
    state.setCellValueFactory(param -> new ReadOnlyStringWrapper(param.getValue().state));
    final TableColumn<NameStateValue, String> value = new TableColumn<>(Messages.WidgetInfoDialog_Value);
    value.setCellFactory(TextFieldTableCell.forTableColumn());
    value.setCellValueFactory(param -> {
        String text;
        final VType vtype = param.getValue().value;
        if (vtype == null)
            text = Messages.WidgetInfoDialog_Disconnected;
        else {
            // so only show the basic type info
            if (vtype instanceof VNumberArray)
                text = vtype.toString();
            else
                text = VTypeUtil.getValueString(vtype, true);
            if (vtype instanceof Alarm) {
                final Alarm alarm = (Alarm) vtype;
                if (alarm.getAlarmSeverity() != AlarmSeverity.NONE)
                    text = text + " [" + alarm.getAlarmSeverity().toString() + ", " + alarm.getAlarmName() + "]";
            }
        }
        return new ReadOnlyStringWrapper(text);
    });
    final ObservableList<NameStateValue> pv_data = FXCollections.observableArrayList(pvs);
    pv_data.sort((a, b) -> a.name.compareTo(b.name));
    final TableView<NameStateValue> table = new TableView<>(pv_data);
    table.getColumns().add(name);
    table.getColumns().add(state);
    table.getColumns().add(value);
    table.setEditable(true);
    table.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
    return new Tab(Messages.WidgetInfoDialog_TabPVs, table);
}
Also used : VNumberArray(org.diirt.vtype.VNumberArray) VType(org.diirt.vtype.VType) Tab(javafx.scene.control.Tab) ReadOnlyStringWrapper(javafx.beans.property.ReadOnlyStringWrapper) Alarm(org.diirt.vtype.Alarm) TableColumn(javafx.scene.control.TableColumn) TableView(javafx.scene.control.TableView)

Example 5 with ReadOnlyStringWrapper

use of javafx.beans.property.ReadOnlyStringWrapper in project honest-profiler by jvm-profiling-tools.

the class TreeDiffViewController method initializeTable.

/**
 * Initializes the {@link TreeTableView} which displays the {@link TreeDiff} {@link Aggregation}.
 */
@Override
protected void initializeTable() {
    methodColumn.setCellValueFactory(data -> new ReadOnlyStringWrapper(data.getValue() == null ? null : data.getValue().getValue().getKey()));
    methodColumn.setCellFactory(col -> new MethodNameTreeTableCell<>(appCtx()));
    // The column configuration methods should (for now) be called in the same order as the columns are declared in
    // the FXML.
    // The only reason is the column view context menu, which collects its menu items in the order of these
    // declarations. If the order is out of sync, the column view context menu will not have its items in the
    // correct order.
    // This will probably, eventually, be remedied by reordering but for now this comment will have to do.
    cfgPctCol(baseSelfCntPct, "baseSelfCntPct", baseCtx(), getText(COLUMN_SELF_CNT_PCT));
    cfgPctCol(newSelfCntPct, "newSelfCntPct", newCtx(), getText(COLUMN_SELF_CNT_PCT));
    cfgPctDiffCol(selfCntPctDiff, "selfCntPctDiff", getText(COLUMN_SELF_CNT_PCT_DIFF));
    cfgPctCol(baseTotalCntPct, "baseTotalCntPct", baseCtx(), getText(COLUMN_TOTAL_CNT_PCT));
    cfgPctCol(newTotalCntPct, "newTotalCntPct", newCtx(), getText(COLUMN_TOTAL_CNT_PCT));
    cfgPctDiffCol(totalCntPctDiff, "totalCntPctDiff", getText(COLUMN_TOTAL_CNT_PCT_DIFF));
    cfgNrCol(baseSelfCnt, "baseSelfCnt", baseCtx(), getText(COLUMN_SELF_CNT));
    cfgNrCol(newSelfCnt, "newSelfCnt", newCtx(), getText(COLUMN_SELF_CNT));
    cfgNrDiffCol(selfCntDiff, "selfCntDiff", getText(COLUMN_SELF_CNT_DIFF));
    cfgNrCol(baseTotalCnt, "baseTotalCnt", baseCtx(), getText(COLUMN_TOTAL_CNT));
    cfgNrCol(newTotalCnt, "newTotalCnt", newCtx(), getText(COLUMN_TOTAL_CNT));
    cfgNrDiffCol(totalCntDiff, "totalCntDiff", getText(COLUMN_TOTAL_CNT_DIFF));
    cfgPctCol(baseSelfTimePct, "baseSelfTimePct", baseCtx(), getText(COLUMN_SELF_TIME_PCT));
    cfgPctCol(newSelfTimePct, "newSelfTimePct", newCtx(), getText(COLUMN_SELF_TIME_PCT));
    cfgPctDiffCol(selfTimePctDiff, "selfTimePctDiff", getText(COLUMN_SELF_TIME_PCT_DIFF));
    cfgPctCol(baseTotalTimePct, "baseTotalTimePct", baseCtx(), getText(COLUMN_TOTAL_TIME_PCT));
    cfgPctCol(newTotalTimePct, "newTotalTimePct", newCtx(), getText(COLUMN_TOTAL_TIME_PCT));
    cfgPctDiffCol(totalTimePctDiff, "totalTimePctDiff", getText(COLUMN_TOTAL_TIME_PCT_DIFF));
    cfgTimeCol(baseSelfTime, "baseSelfTime", baseCtx(), getText(COLUMN_SELF_TIME));
    cfgTimeCol(newSelfTime, "newSelfTime", newCtx(), getText(COLUMN_SELF_TIME));
    cfgTimeDiffCol(selfTimeDiff, "selfTimeDiff", getText(COLUMN_SELF_TIME_DIFF));
    cfgTimeCol(baseTotalTime, "baseTotalTime", baseCtx(), getText(COLUMN_TOTAL_TIME));
    cfgTimeCol(newTotalTime, "newTotalTime", newCtx(), getText(COLUMN_TOTAL_TIME));
    cfgTimeDiffCol(totalTimeDiff, "totalTimeDiff", getText(COLUMN_TOTAL_TIME_DIFF));
}
Also used : ReadOnlyStringWrapper(javafx.beans.property.ReadOnlyStringWrapper)

Aggregations

ReadOnlyStringWrapper (javafx.beans.property.ReadOnlyStringWrapper)20 TableColumn (javafx.scene.control.TableColumn)7 TableView (javafx.scene.control.TableView)5 SimpleBooleanProperty (javafx.beans.property.SimpleBooleanProperty)4 ObservableList (javafx.collections.ObservableList)3 Tab (javafx.scene.control.Tab)3 SimpleObjectProperty (javafx.beans.property.SimpleObjectProperty)2 FXCollections (javafx.collections.FXCollections)2 ActionEvent (javafx.event.ActionEvent)2 FXML (javafx.fxml.FXML)2 Pos (javafx.geometry.Pos)2 Button (javafx.scene.control.Button)2 TreeItem (javafx.scene.control.TreeItem)2 TreeTableColumn (javafx.scene.control.TreeTableColumn)2 CellDataFeatures (javafx.scene.control.TreeTableColumn.CellDataFeatures)2 VBox (javafx.scene.layout.VBox)2 DiffEntry (com.insightfullogic.honest_profiler.core.aggregation.result.diff.DiffEntry)1 GuiController (il.ac.technion.cs.smarthouse.gui_controller.GuiController)1 GenericSensor (il.ac.technion.cs.smarthouse.sensors.simulator.GenericSensor)1 SensorsSimulator (il.ac.technion.cs.smarthouse.sensors.simulator.SensorsSimulator)1