本文整理汇总了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;
}
示例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);
}
}
};
}
示例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]);
}
示例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;
}
示例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));
}
}
};
}
示例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());
}
}
}
};
}
示例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());
}
}
};
}
示例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);
}
}
};
}
示例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));
}
}
};
}
示例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));
}
}
};
}
示例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));
}
}
};
}
示例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);
}
}
};
}
示例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);
}
});
}
示例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);
}
}
};
}
示例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;
}