Package com.codename1.ui.graph


package com.codename1.ui.graph

NodeGraph: a pannable, zoomable view of a com.codename1.graph.GraphModel where nodes are dragged, connected and grouped.

It serves two kinds of picture with one component. A diagram of a system, where boxes stand for services or ideas and edges join them, is made of nodes without ports; a node editor, where data flows from outputs to inputs of a matching type, is made of nodes with GraphPorts. Both can be laid out by hand or by a com.codename1.graph.arrange.GraphArrangement.

Nodes and edges are painted, with no component behind each, so a graph of thousands of nodes costs what is on screen. A node that needs a real control gets one from a NodeComponentFactory. Colours and fonts come from the NodeGraph* UIIDs.

For a flow chart, a node takes an outline from the GraphShapeRegistry and a com.codename1.graph.GraphGroup made as a lane is a swimlane. A GraphPalette beside the graph creates nodes from templates, a PortEditorFactory edits the value of an unconnected input, and with a com.codename1.util.UndoHistory every edit can be undone.

  • Class
    Description
    Paints an edge as a line with an arrowhead on a directed edge and its label in a pill at the middle.
    Paints a node as a rounded card: a coloured strip on the leading edge, the label, the description under it, and the ports on the sides with their labels inside the card.
    A GraphListener that refuses nothing and ignores everything; override what you need.
    Paints an edge along the path the graph computed for it.
    What a NodeGraph tells an application about.
    Paints a node.
    The kinds of node a NodeGraph can be given, as a strip of items to drag onto it: the shapes of a flow chart, or the node types of a node editor.
    The outline of a node: what GraphNode.setShape names.
    The outlines behind the names of GraphShapes, and the place to add outlines of your own.
    Makes a real component for a node's body, such as a slider in a node editor.
    A pannable, zoomable view of a GraphModel where nodes are dragged, connected and grouped: a system diagram, a mind map, or a node editor.
    Makes the small component beside an input port in which its value is typed while nothing is connected to it, as node editors do.