Package com.codename1.graph
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.
GraphModelis the graph.DefaultGraphModelkeeps one in memory and accepts edits, each checked by aConnectionValidator.- A
GraphNodeis a box in world units. Give itGraphPorts 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
GraphGroupis a box drawn around its members, and can collapse. - A node's shape is a name from
GraphShapes, and a group made withGraphGroup.laneis a swimlane with bounds of its own. - A
GraphNodeTemplatemakes nodes of one kind, for a palette. GraphJsonwrites a model as JSON text and reads it back.com.codename1.graph.arrangeplaces 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.
-
ClassDescriptionThe listener list, the lookups and the refusals every read-only model shares.Decides whether an edge may be made.An editable graph kept in memory.Told when the nodes, edges or groups of a
GraphModelchange.A connection from one node to another, optionally from a port to a port.A labeled box drawn around the nodes whose group id names it, such as the services of one subsystem.Writes a graph as JSON and reads it back, to save a diagram or send it.Turns the application'sgetUserDataobjects into JSON values and back.The nodes, edges and groups acom.codename1.ui.graph.NodeGraphshows.A box in a graph: a position and a size in world units, a label, and optionally ports and a group.A kind of node a user can add: what acom.codename1.ui.graph.GraphPalettelists, and what a node editor calls a node type.A place on aGraphNodewhere edges attach, as in a node editor.The names of the outlines a view knows how to draw, forGraphNode.setShape.