@Override public Transferable clipboardCopy() throws IOException { return super.clipboardCopy(); }
@Override public Transferable clipboardCut() throws IOException { return super.clipboardCut(); }
@Override protected Node createNodeForKey(Object key) { if (key instanceof ProductNode) { return PNNode.create((ProductNode) key); } else { return new PNGroupNode((PNGroup) key); } } }
@Override public void nodeChanged(ProductNodeEvent event) { if (event.getSourceNode() == getProductNode()) { if (ProductNode.PROPERTY_NAME_NAME.equals(event.getPropertyName())) { setDisplayName(getProductNode().getName()); } if (ProductNode.PROPERTY_NAME_DESCRIPTION.equals(event.getPropertyName())) { setShortDescription(getProductNode().getDescription()); } } nodeSupport.nodeChanged(event); }
public PNNode(T productNode, PNGroupBase childFactory) { super(childFactory, Lookups.singleton(productNode)); this.productNode = productNode; setDisplayName(productNode.getName()); setShortDescription(productNode.getDescription()); nodeSupport = PNNodeSupport.create(this, childFactory); }
@Override public PropertySet[] getPropertySets() { Sheet.Set set = new Sheet.Set(); final TiePointGrid tpg = getProductNode(); set.setDisplayName("Tie-Point Grid Properties"); set.put(new UnitProperty(tpg)); set.put(new RasterSizeProperty(tpg)); set.put(new ValidPixelExpressionProperty(tpg)); set.put(new NoDataValueUsedProperty(tpg)); set.put(new NoDataValueProperty(tpg)); return Stream.concat(Stream.of(super.getPropertySets()), Stream.of(set)).toArray(PropertySet[]::new); }
@Override public Action[] getActions(boolean context) { ProductNode productNode1 = getProductNode(); return PNNodeSupport.getContextActions(productNode1); }
@Override public Action getPreferredAction() { //Define the action that will be invoked //when the user double-clicks on the node: return super.getPreferredAction(); }
private static <T extends ProductNode> void deleteProductNode(Product product, ProductNodeGroup<T> group, T productNode) { closeDocumentWindow(productNode); final int index = group.indexOf(productNode); group.remove(productNode); UndoRedo.Manager manager = SnapApp.getDefault().getUndoManager(product); if (manager != null) { manager.addEdit(new UndoableProductNodeDeletion<>(group, productNode, index)); } }
return Stream.concat(Stream.of(super.getPropertySets()), Stream.of(set)).toArray(PropertySet[]::new);
static boolean isDirectChild(Children children, ProductNode productNode) { return children != Children.LEAF && children.snapshot().stream() .filter(node -> node instanceof PNNode) .anyMatch(node -> ((PNNode) node).getProductNode() == productNode); }
includeAbstractedMetadata(set); return Stream.concat(Stream.of(super.getPropertySets()), Stream.of(set)).toArray(PropertySet[]::new);
return Stream.concat(Stream.of(super.getPropertySets()), Stream.of(set)).toArray(PropertySet[]::new);