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


Java TreeTableCell类代码示例

本文整理汇总了Java中javafx.scene.control.TreeTableCell的典型用法代码示例。如果您正苦于以下问题:Java TreeTableCell类的具体用法?Java TreeTableCell怎么用?Java TreeTableCell使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: getPoint

import javafx.scene.control.TreeTableCell; //导入依赖的package包/类
protected Point2D getPoint(TreeTableView<?> treeTableView, int rowIndex, int columnIndex) {
    Set<Node> treeTableRowCell = treeTableView.lookupAll(".tree-table-row-cell");
    TreeTableRow<?> row = null;
    for (Node tableRow : treeTableRowCell) {
        TreeTableRow<?> r = (TreeTableRow<?>) tableRow;
        if (r.getIndex() == rowIndex) {
            row = r;
            break;
        }
    }
    Set<Node> cells = row.lookupAll(".tree-table-cell");
    for (Node node : cells) {
        TreeTableCell<?, ?> cell = (TreeTableCell<?, ?>) node;
        if (treeTableView.getColumns().indexOf(cell.getTableColumn()) == columnIndex) {
            Bounds bounds = cell.getBoundsInParent();
            Point2D localToParent = cell.localToParent(bounds.getWidth() / 2, bounds.getHeight() / 2);
            Point2D rowLocal = row.localToScene(localToParent, true);
            return rowLocal;
        }
    }
    return null;
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:23,代码来源:RFXComponentTest.java

示例2: call

import javafx.scene.control.TreeTableCell; //导入依赖的package包/类
@Override
public TreeTableCell<ReferenceDescription, ReferenceDescription> call(TreeTableColumn<ReferenceDescription, ReferenceDescription> param) {
  return new TreeTableCell<ReferenceDescription, ReferenceDescription>() {

    @Override
    protected void updateItem(ReferenceDescription item, boolean empty) {
      super.updateItem(item, empty);
      if (!empty && item != null) {
        setText(item.getDisplayName().getText());
        setGraphic(createGraphicNode(item));
      } else {
        setText(null);
        setGraphic(null);
      }
    }
  };
}
 
开发者ID:comtel2000,项目名称:opc-ua-client,代码行数:18,代码来源:DataTreeNodeCellFactory.java

示例3: getVisibleRange

import javafx.scene.control.TreeTableCell; //导入依赖的package包/类
protected static Range getVisibleRange(final Wrap<? extends Control> testedControl) {
    int[] visibleIndices;

    if (testedControl.getControl() instanceof TableView) {
        visibleIndices = org.jemmy.fx.control.TableUtils.shown(
                testedControl.getEnvironment(),
                testedControl,
                new org.jemmy.fx.control.TableUtils.TableViewIndexInfoProvider((TableViewWrap) testedControl), TableCell.class);
    } else {
        visibleIndices = org.jemmy.fx.control.TableUtils.shown(
                testedControl.getEnvironment(),
                testedControl,
                new org.jemmy.fx.control.TableUtils.TreeTableViewIndexInfoProvider((TreeTableViewWrap) testedControl), TreeTableCell.class);
    }

    return new Range(visibleIndices[1], visibleIndices[3]);
}
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:18,代码来源:TestBaseCommon.java

示例4: check

import javafx.scene.control.TreeTableCell; //导入依赖的package包/类
@Override
public boolean check(IndexedCell control) {
    if (control.isVisible() && control.getOpacity() == 1.0) {
        if (isTreeViewTests) {
            if (control instanceof TreeCell) {
                if ((((TreeCell) control).getTreeItem() != null) && ((TreeCell) control).getTreeItem().equals(item)) {
                    return true;
                }
            }
        } else {
            if (control instanceof TreeTableCell) {
                if ((((TreeTableCell) control).getTreeTableRow().getTreeItem() != null) && ((TreeTableCell) control).getTreeTableRow().getTreeItem().equals(item)) {
                    return true;
                }
            }
        }
    }
    return false;
}
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:20,代码来源:TreeViewTest.java

示例5: call

import javafx.scene.control.TreeTableCell; //导入依赖的package包/类
@Override
public TreeTableCell<FeatureTableRow, Object> call(TreeTableColumn<FeatureTableRow, Object> p) {
  return new TreeTableCell<FeatureTableRow, Object>() {
    @Override
    public void updateItem(Object object, boolean empty) {
      super.updateItem(object, empty);
      setStyle("-fx-alignment: CENTER;"
          + "-fx-border-color: transparent -fx-table-cell-border-color -fx-table-cell-border-color transparent;");
      if (object == null) {
        setText(null);
      } else {
        NumberFormat formatter = MZmineCore.getConfiguration().getMZFormat();
        Double doubleValue = Double.parseDouble(object.toString());
        setText(formatter.format(doubleValue));
      }
    }
  };
}
 
开发者ID:mzmine,项目名称:mzmine3,代码行数:19,代码来源:MzRenderer.java

示例6: call

import javafx.scene.control.TreeTableCell; //导入依赖的package包/类
@Override
public TreeTableCell<FeatureTableRow, Object> call(TreeTableColumn<FeatureTableRow, Object> p) {
  return new TreeTableCell<FeatureTableRow, Object>() {
    @Override
    public void updateItem(Object object, boolean empty) {
      super.updateItem(object, empty);
      setStyle("-fx-alignment: CENTER;"
          + "-fx-border-color: transparent -fx-table-cell-border-color -fx-table-cell-border-color transparent;");
      if (object == null) {
        setText(null);
      } else {

        try {
          NumberFormat formatter = new DecimalFormat("#0.00");
          Double doubleValue = Double.parseDouble(object.toString());
          setText(formatter.format(doubleValue));
        } catch (NumberFormatException e) {
          setText(object.toString());
        }

      }
    }
  };
}
 
开发者ID:mzmine,项目名称:mzmine3,代码行数:25,代码来源:DefaultRenderer.java

示例7: call

import javafx.scene.control.TreeTableCell; //导入依赖的package包/类
@Override
public TreeTableCell<FeatureTableRow, Object> call(TreeTableColumn<FeatureTableRow, Object> p) {
  return new TreeTableCell<FeatureTableRow, Object>() {
    @Override
    public void updateItem(Object object, boolean empty) {
      super.updateItem(object, empty);
      setStyle("-fx-alignment: CENTER;"
          + "-fx-border-color: transparent -fx-table-cell-border-color -fx-table-cell-border-color transparent;");
      if (object == null) {
        setText(null);
      } else {
        Integer integerValue = Integer.parseInt(object.toString());
        setText(integerValue.toString());
      }
    }
  };
}
 
开发者ID:mzmine,项目名称:mzmine3,代码行数:18,代码来源:IntegerRenderer.java

示例8: call

import javafx.scene.control.TreeTableCell; //导入依赖的package包/类
@Override
public TreeTableCell<FeatureTableRow, Object> call(TreeTableColumn<FeatureTableRow, Object> p) {
  return new TreeTableCell<FeatureTableRow, Object>() {
    @Override
    public void updateItem(Object object, boolean empty) {
      super.updateItem(object, empty);
      setStyle("-fx-alignment: CENTER;"
          + "-fx-border-color: transparent -fx-table-cell-border-color -fx-table-cell-border-color transparent;");
      if (object == null) {
        setText(null);
      } else {
        Range rangeValue = (Range) object;
        NumberFormat formatter = MZmineCore.getConfiguration().getMZFormat();
        String value = formatter.format(rangeValue.lowerEndpoint()) + " - "
            + formatter.format(rangeValue.upperEndpoint());
        setText(value);
      }
    }
  };
}
 
开发者ID:mzmine,项目名称:mzmine3,代码行数:21,代码来源:RtRangeRenderer.java

示例9: call

import javafx.scene.control.TreeTableCell; //导入依赖的package包/类
@Override
public TreeTableCell<FeatureTableRow, Object> call(TreeTableColumn<FeatureTableRow, Object> p) {
  return new TreeTableCell<FeatureTableRow, Object>() {
    @Override
    public void updateItem(Object object, boolean empty) {
      super.updateItem(object, empty);
      setStyle("-fx-alignment: CENTER;"
          + "-fx-border-color: transparent -fx-table-cell-border-color -fx-table-cell-border-color transparent;");
      if (object == null) {
        setText(null);
      } else {
        Double doubleValue = Double.parseDouble(object.toString());
        NumberFormat formatter = MZmineCore.getConfiguration().getIntensityFormat();
        setText(formatter.format(doubleValue));
      }
    }
  };
}
 
开发者ID:mzmine,项目名称:mzmine3,代码行数:19,代码来源:IntensityRenderer.java

示例10: call

import javafx.scene.control.TreeTableCell; //导入依赖的package包/类
@Override
public TreeTableCell<FeatureTableRow, Object> call(TreeTableColumn<FeatureTableRow, Object> p) {
  return new TreeTableCell<FeatureTableRow, Object>() {
    @Override
    public void updateItem(Object object, boolean empty) {
      super.updateItem(object, empty);
      setStyle("-fx-alignment: CENTER;"
          + "-fx-border-color: transparent -fx-table-cell-border-color -fx-table-cell-border-color transparent;");
      if (object == null) {
        setText(null);
      } else {
        NumberFormat formatter = MZmineCore.getConfiguration().getRTFormat();
        Float floatValue = Float.parseFloat(object.toString());
        setText(formatter.format(floatValue));
      }
    }
  };
}
 
开发者ID:mzmine,项目名称:mzmine3,代码行数:19,代码来源:RtRenderer.java

示例11: call

import javafx.scene.control.TreeTableCell; //导入依赖的package包/类
@Override
public TreeTableCell<FeatureTableRow, Object> call(TreeTableColumn<FeatureTableRow, Object> p) {
  return new TreeTableCell<FeatureTableRow, Object>() {
    @Override
    public void updateItem(Object object, boolean empty) {
      super.updateItem(object, empty);
      setStyle("-fx-alignment: CENTER;"
          + "-fx-border-color: transparent -fx-table-cell-border-color -fx-table-cell-border-color transparent;");
      if (object == null) {
        setText(null);
      } else {
        // Default format to two decimals
        NumberFormat formatter = new DecimalFormat("#0.00");
        Double doubleValue = Double.parseDouble(object.toString());
        setText(formatter.format(doubleValue));
      }
    }
  };
}
 
开发者ID:mzmine,项目名称:mzmine3,代码行数:20,代码来源:DoubleRenderer.java

示例12: getTreeTableCell

import javafx.scene.control.TreeTableCell; //导入依赖的package包/类
private TreeTableCell<S, LocalDate> getTreeTableCell() {
    return new TreeTableCell<S, LocalDate>() {
        @Override
        protected void updateItem(LocalDate date, boolean empty) {
            super.updateItem(date, empty);
            this.setAlignment(Pos.CENTER);
            if (empty) {
                this.setText(null);
                this.setGraphic(null);
            } else {
                String dateFormatter = DateTimeFormatter.ofPattern("dd.MM.yyyy", Locale.getDefault()).format(date);
                this.setText(dateFormatter);
            }
        }
    };
}
 
开发者ID:khasang,项目名称:Cachoeira,代码行数:17,代码来源:TaskTableView.java

示例13: PgpKeyTreePane

import javafx.scene.control.TreeTableCell; //导入依赖的package包/类
public PgpKeyTreePane() {
	loadDynamicComponentFxml(PgpKeyTreePane.class, this);

	treeTableView.setShowRoot(false);
	treeTableView.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);

	nameTreeTableColumn.setCellFactory(new Callback<TreeTableColumn<PgpKeyTreeItem<?>,String>, TreeTableCell<PgpKeyTreeItem<?>,String>>() {
		@Override
		public TreeTableCell<PgpKeyTreeItem<?>, String> call(TreeTableColumn<PgpKeyTreeItem<?>, String> param) {
			return new NameCell();
		}
	});

	checkedTreeItems.addListener(new SetChangeListener<PgpKeyTreeItem<?>>() {
		@Override
		public void onChanged(SetChangeListener.Change<? extends PgpKeyTreeItem<?>> change) {
			final PgpKeyTreeItem<?> elementAdded = change.getElementAdded();
			if (elementAdded != null)
				elementAdded.setChecked(true);

			final PgpKeyTreeItem<?> elementRemoved = change.getElementRemoved();
			if (elementRemoved != null)
				elementRemoved.setChecked(false);
		}
	});
}
 
开发者ID:subshare,项目名称:subshare,代码行数:27,代码来源:PgpKeyTreePane.java

示例14: call

import javafx.scene.control.TreeTableCell; //导入依赖的package包/类
@Override
public TreeTableCell<FileTreeItem<?>, String> call(TreeTableColumn<FileTreeItem<?>, String> param) {
	return new TreeTableCell<FileTreeItem<?>, String>() {
		@Override
		protected void updateItem(String value, boolean empty) {
			super.updateItem(value, empty);

			final FileTreeItem<?> treeItem = getTreeTableRow().getItem();

			if (value == null || treeItem == null || empty) {
				setText(null);
				setGraphic(null);
			} else {
				setText(value);
				setGraphic(treeItem2CollisionIconImageView.get(treeItem));
				updateGraphicAsync(this, treeItem);
			}
		}

	};
}
 
开发者ID:subshare,项目名称:subshare,代码行数:22,代码来源:RepoAwareFileTreePane.java

示例15: getTreeTableCellAt

import javafx.scene.control.TreeTableCell; //导入依赖的package包/类
public TreeTableCell<?, ?> getTreeTableCellAt(TreeTableView<?> treeTableView, Point2D point) {
    point = treeTableView.localToScene(point);
    Set<Node> lookupAll = getTreeTableCells(treeTableView);
    TreeTableCell<?, ?> selected = null;
    for (Node cellNode : lookupAll) {
        Bounds boundsInScene = cellNode.localToScene(cellNode.getBoundsInLocal(), true);
        if (boundsInScene.contains(point)) {
            selected = (TreeTableCell<?, ?>) cellNode;
            break;
        }
    }
    return selected;
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:14,代码来源:JavaFXElementPropertyAccessor.java


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