本文整理汇总了Java中javafx.scene.control.TreeTableRow.getTreeItem方法的典型用法代码示例。如果您正苦于以下问题:Java TreeTableRow.getTreeItem方法的具体用法?Java TreeTableRow.getTreeItem怎么用?Java TreeTableRow.getTreeItem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.control.TreeTableRow
的用法示例。
在下文中一共展示了TreeTableRow.getTreeItem方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: acceptable
import javafx.scene.control.TreeTableRow; //导入方法依赖的package包/类
private boolean acceptable(final Dragboard db, final TreeTableRow<GPXLineItem> row) {
boolean result = false;
if (db.hasContent(SERIALIZED_MIME_TYPE)) {
final int index = (Integer) db.getContent(SERIALIZED_MIME_TYPE);
//System.out.println("index: " + index + ", row index:" + row.getIndex());
if (!row.isEmpty() && (row.getIndex() != index)) {
final TreeItem<GPXLineItem> target = row.getTreeItem();
final GPXLineItem.GPXLineItemType targetType = target.getValue().getType();
final TreeItem<GPXLineItem> item = myTreeTableView.getTreeItem(index);
final GPXLineItem.GPXLineItemType itemType = item.getValue().getType();
// don't create loops and only insert on same level or drop on direct parent type
result = !isParent(item, target) &&
(GPXLineItem.GPXLineItemType.isSameTypeAs(targetType, itemType) || GPXLineItem.GPXLineItemType.isParentTypeOf(targetType, itemType));
}
}
return result;
}
示例2: getTarget
import javafx.scene.control.TreeTableRow; //导入方法依赖的package包/类
protected TreeItem getTarget(TreeTableRow<T> row)
{
TreeItem target = tree.getRoot();
if(!row.isEmpty())
{
target = row.getTreeItem();
}
return target;
}
示例3: handleMouseClickedEvent
import javafx.scene.control.TreeTableRow; //导入方法依赖的package包/类
/**
* Handle mouse clicked event
*/
private void handleMouseClickedEvent() {
TreeTableRow<HexData> selectedRow = (TreeTableRow<HexData>) textField.getParent().getParent();
if (!selectedRow.getTreeItem().getValue().getOffset().contains("-")) {
String originalLine = textField.getText();
String selectedHex = textField.getSelectedText().trim();
String replacedHex = showDialog(selectedHex);
if (replacedHex != null) {
try {
textField.replaceSelection(replacedHex.toUpperCase());
String payLoad = hexToASCII(textField.getText());
TreeTableRow<HexData> hexTable = (TreeTableRow<HexData>) textField.getParent().getParent();
TreeItem<HexData> selectedItem = hexTable.getTreeItem();
selectedItem.setValue(new HexData(selectedItem.getValue().getOffset(), textField.getText(), packetParser.formatPayLoad(payLoad)));
String originalHex = getPacketHexFromList();
if (selectedItem.getValue().getOffset().contains("-")) {
originalHex = originalHex.replaceAll(originalLine.replaceAll(" ", "").replaceAll("\n", ""), textField.getText().replaceAll(" ", "").replaceAll("\n", ""));
}
byte[] rawdata = DatatypeConverter.parseHexBinary(originalHex);
EthernetPacket p = EthernetPacket.newPacket(rawdata, 0, rawdata.length);
packetParser.parsePacket(p, packetInfo);
treeRoot.getChildren().clear();
setData(packetInfo);
} catch (IllegalRawDataException ex) {
java.util.logging.Logger.getLogger(PacketHex.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
}