Package com.codename1.graph.arrange


package com.codename1.graph.arrange

Automatic placement of the nodes of a com.codename1.graph.GraphModel.

  • LayeredArrangement for flows and pipelines: edges point one way, layer to layer, with few crossings.
  • ForceArrangement for networks: an organic picture that can also run live, a step a frame, while the user drags.
  • TreeArrangement for hierarchies, and RadialArrangement for a tree on rings.

An arrangement returns an ArrangementResult and leaves the model alone; ArrangementResult.apply moves the nodes. A graph laid out by hand needs no arrangement at all.

  • Class
    Description
    Where an arrangement wants every node, and the bends it wants in the edges.
    An organic arrangement for networks: edges pull like springs and every node pushes every other away, until the graph settles.
    Places the nodes of a graph.
    An arrangement for flows: every edge points the same way, from one layer to the next, with as few crossings as it can find.
    A tree on rings: the root at the centre and each level on a circle around it, every subtree in a wedge as wide as its share of the leaves.
    An arrangement for hierarchies, such as an org chart or a file tree: every node below its parent, parents centred over their children, and no subtree overlapping another.