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


Java TreeTableRow.getTreeItem方法代码示例

本文整理汇总了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;
}
 
开发者ID:ThomasDaheim,项目名称:GPXEditor,代码行数:20,代码来源:GPXTreeTableView.java

示例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;
}
 
开发者ID:andy-goryachev,项目名称:ReqTraq,代码行数:10,代码来源:TreeTableHandler.java

示例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);
            }
        }
    }
}
 
开发者ID:exalt-tech,项目名称:trex-stateless-gui,代码行数:32,代码来源:PacketHex.java


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