Rules

In chapter Graph Basics, we discussed modeling rules from an API perspective. This section shows you how to achieve the same programming results using XML files to configure the attributes of named Rule objects.

Rules can be stored in xml or other external data formats. This data is loaded and parsed into a RuleRegistry instance which represents a set of rules that can be associated with one or more visual graph elements.

GraphObjectRule

The attributes supported by the GraphObjectRule are listed below. You can find detailed information about each attribute afterwards.

  • Selectable

  • Movable

  • Resizable

  • Deletable

  • Copyable

  • Cutable

NodeRule

The attributes supported by the NodeRule are listed below. You can find detailed information about each attribute afterwards.

  • IndegreeMinimum

  • IndegreeMaximum

  • OutdegreeMinimum

  • OutdegreeMaximum

  • InstanceMinimum

  • InstanceMaximum

  • DrawPorts

  • DetachOnMove

  • Cascade1To1NodeDelete

  • CascadeDeleteEdges

  • ProhibitEdgeSplit

  • DisallowedEdgeSplitNodes

  • AcceptLooseNodesIfSubgraph

  • LegalSubgraphs

  • NodeOverlayEdgeCreation

  • NodeOverlayIndicationHandler

  • NodeDropHandler

  • SubgraphRemoveHandler

  • NodeMovedInSubgraphHandler

EdgeRule

The attributes supported by the EdgeRule are listed below. You can find detailed information about each attribute afterwards.

  • DetachableSource

  • DetachableTarget

  • EdgeInsertMode

  • SnapToPortDistance

GraphRule

The attributes supported by the GraphRule are listed below. You can find detailed information about each attribute afterwards.

  • AutoSpaceMode

  • AcceptLooseObjects

  • EdgeSplitTolerance

  • EdgeInsertSinglePosition

  • NodeDropHandler