Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.

package com.codename1.graph

Graphs as data: nodes, the edges between them, the groups they belong to, and the arrangements that place them. What a com.codename1.ui.graph.NodeGraph shows.

Nothing here draws, and everything runs without a component, on a server too.

  • GraphModel is the graph. DefaultGraphModel keeps one in memory and accepts edits, each checked by a ConnectionValidator.
  • A GraphNode is a box in world units. Give it GraphPorts for a node editor, where edges join an output to an input of the same type; leave it without for a diagram, where edges join nodes.
  • A GraphGroup is a box drawn around its members, and can collapse.
  • com.codename1.graph.arrange places the nodes automatically.

The classes are not thread safe: use a model from one thread, which for a model shown by a component is the EDT.

Types

class AbstractGraphModelThe listener list, the lookups and the refusals every read-only model shares.
class ConnectionValidatorDecides whether an edge may be made.
class DefaultGraphModelAn editable graph kept in memory.
interface GraphChangeListenerTold when the nodes, edges or groups of a GraphModel change.
class GraphEdgeA connection from one node to another, optionally from a port to a port.
class GraphGroupA labeled box drawn around the nodes whose group id names it, such as the services of one subsystem.
interface GraphModelThe nodes, edges and groups a com.codename1.ui.graph.NodeGraph shows.
class GraphNodeA box in a graph: a position and a size in world units, a label, and optionally ports and a group.
class GraphPortA place on a GraphNode where edges attach, as in a node editor.