Search this API

y.layout
Class LayoutGraphCopyFactory.HierarchicGraphCopyFactory

java.lang.Object
  extended by y.util.GraphCopier.GraphDataCopyFactory
      extended by y.layout.LayoutGraphCopyFactory.HierarchicGraphCopyFactory
All Implemented Interfaces:
GraphCopier.CopyFactory
Enclosing class:
LayoutGraphCopyFactory

public static class LayoutGraphCopyFactory.HierarchicGraphCopyFactory
extends GraphCopier.GraphDataCopyFactory

An implementation of the copy factory interface used by GraphCopier that can be used by implementations of LayoutGraph that are hierarchically grouped using GroupingKeys.

 

Constructor Summary
LayoutGraphCopyFactory.HierarchicGraphCopyFactory()
          Creates new LayoutGraphCopyFactory.HierarchicGraphCopyFactory instance with default settings.
LayoutGraphCopyFactory.HierarchicGraphCopyFactory(GraphCopier.CopyFactory delegatingFactory)
          Creates new LayoutGraphCopyFactory.HierarchicGraphCopyFactory instance that delegates to the passed factory.
 
Method Summary
protected  void copyData(Node src, Node dst)
          Empty stub to be overwritten by subclass implementations.
protected  java.lang.Object createNodeId(java.lang.Object srcId, Node dst)
          Creates an ID for the given node.
protected  void postCopyData(Graph src, Graph dst, java.util.Map nodeMap, java.util.Map edgeMap)
          Empty stub to be overwritten by subclass implementations.
protected  void preCopyData(Graph src, Graph dst)
          Empty stub to be overwritten by subclass implementations.
 
Methods inherited from class y.util.GraphCopier.GraphDataCopyFactory
copyData, copyEdge, copyNode, createGraph, postCopyGraphData, preCopyGraphData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LayoutGraphCopyFactory.HierarchicGraphCopyFactory

public LayoutGraphCopyFactory.HierarchicGraphCopyFactory()
Creates new LayoutGraphCopyFactory.HierarchicGraphCopyFactory instance with default settings.


LayoutGraphCopyFactory.HierarchicGraphCopyFactory

public LayoutGraphCopyFactory.HierarchicGraphCopyFactory(GraphCopier.CopyFactory delegatingFactory)
Creates new LayoutGraphCopyFactory.HierarchicGraphCopyFactory instance that delegates to the passed factory.

Parameters:
delegatingFactory - the factory
Method Detail

preCopyData

protected void preCopyData(Graph src,
                           Graph dst)
Description copied from class: GraphCopier.GraphDataCopyFactory
Empty stub to be overwritten by subclass implementations.

Overrides:
preCopyData in class GraphCopier.GraphDataCopyFactory

postCopyData

protected void postCopyData(Graph src,
                            Graph dst,
                            java.util.Map nodeMap,
                            java.util.Map edgeMap)
Description copied from class: GraphCopier.GraphDataCopyFactory
Empty stub to be overwritten by subclass implementations.

Overrides:
postCopyData in class GraphCopier.GraphDataCopyFactory
nodeMap - a Map that maps old node instances to their new copies
edgeMap - a Map that maps old edge instances to their new copies

copyData

protected void copyData(Node src,
                        Node dst)
Description copied from class: GraphCopier.GraphDataCopyFactory
Empty stub to be overwritten by subclass implementations.

Overrides:
copyData in class GraphCopier.GraphDataCopyFactory
Parameters:
src - the old entity
dst - the new entity

createNodeId

protected java.lang.Object createNodeId(java.lang.Object srcId,
                                        Node dst)
Creates an ID for the given node.

This implementation uses the destination node itself as the ID for the node.

The method is called by copyData(Node, Node) and may be overridden to assign custom unique IDs.

Parameters:
srcId - the ID of the original node
dst - the copy of the original node
Returns:
the node ID which is the destination node itself

© Copyright 2000-2021,
yWorks GmbH.
All rights reserved.