当前位置: 首页>>代码示例>>Java>>正文


Java TreeTablePosition.getRow方法代码示例

本文整理汇总了Java中javafx.scene.control.TreeTablePosition.getRow方法的典型用法代码示例。如果您正苦于以下问题:Java TreeTablePosition.getRow方法的具体用法?Java TreeTablePosition.getRow怎么用?Java TreeTablePosition.getRow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javafx.scene.control.TreeTablePosition的用法示例。


在下文中一共展示了TreeTablePosition.getRow方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getTreeTableSelection

import javafx.scene.control.TreeTablePosition; //导入方法依赖的package包/类
public String getTreeTableSelection(TreeTableView<?> treeTableView) {
    TreeTableViewSelectionModel<?> selectionModel = treeTableView.getSelectionModel();
    ObservableList<Integer> selectedIndices = selectionModel.getSelectedIndices();
    ObservableList<?> selectedCells = selectionModel.getSelectedCells();
    int rowCount = treeTableView.getExpandedItemCount();
    int columnCount = treeTableView.getColumns().size();
    if (selectedIndices.size() == 0 || selectedCells.size() == 0) {
        return "";
    } else if (!selectionModel.isCellSelectionEnabled() && selectedIndices.size() == treeTableView.getExpandedItemCount()
            || selectionModel.isCellSelectionEnabled() && selectedCells.size() == rowCount * columnCount) {
        return "all";
    } else if (!selectionModel.isCellSelectionEnabled()) {
        return getTreeTableRowSelectionText(treeTableView, selectionModel.getSelectedItems());
    } else {
        int[] rows = new int[selectedCells.size()];
        int[] columns = new int[selectedCells.size()];
        JSONObject cells = new JSONObject();
        JSONArray value = new JSONArray();
        for (int i = 0; i < selectedCells.size(); i++) {
            TreeTablePosition<?, ?> cell = (TreeTablePosition<?, ?>) selectedCells.get(i);
            rows[i] = cell.getRow();
            columns[i] = cell.getColumn();
            List<String> cellValue = new ArrayList<>();
            cellValue.add(getTreeTableNodePath(treeTableView, selectionModel.getModelItem(cell.getRow())));
            cellValue.add(getTreeTableColumnName(treeTableView, cell.getColumn()));
            value.put(cellValue);
        }
        cells.put("cells", value);
        return cells.toString();
    }
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:32,代码来源:JavaFXElementPropertyAccessor.java

示例2: RFXTreeTableView

import javafx.scene.control.TreeTablePosition; //导入方法依赖的package包/类
public RFXTreeTableView(Node source, JSONOMapConfig omapConfig, Point2D point, IJSONRecorder recorder) {
    super(source, omapConfig, point, recorder);
    TreeTableView<?> treeTableView = (TreeTableView<?>) source;
    if (source == null) {
        return;
    }
    if (treeTableView.getEditingCell() != null) {
        TreeTablePosition<?, ?> editingCell = treeTableView.getEditingCell();
        row = editingCell.getRow();
        column = editingCell.getColumn();
    } else {
        if (point != null) {
            column = getTreeTableColumnAt(treeTableView, point);
            row = getTreeTableRowAt(treeTableView, point);
        } else {
            ObservableList<?> selectedCells = treeTableView.getSelectionModel().getSelectedCells();
            for (Object cell : selectedCells) {
                TreeTablePosition<?, ?> tablePosition = (TreeTablePosition<?, ?>) cell;
                column = tablePosition.getColumn();
                row = tablePosition.getRow();
            }
        }
    }
    cellInfo = getTreeTableCellText(treeTableView, row, column);
    if (row == -1 || column == -1) {
        row = column = -1;
    }
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:29,代码来源:RFXTreeTableView.java


注:本文中的javafx.scene.control.TreeTablePosition.getRow方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。