Java graph interface
Welcome to the bipartite graph interface by Ari Trachtenberg (firstname.lastname@example.org).
Feel free to change this program source in any way, as long as I am
referenced, and your name as a modifier is clearly stated. If you make nice
modifications, please send me a copy to see.
- To download:
- To compile:
- type "javac bipartiteGraph.java"
- ignore deprecation errors
- To run:
- type "java bipartiteGraph"
- I'm not sure why there are sometimes event exceptions; you can ignore them.
- To use:
- This is an input-driven interface, meaning that you type in commands which
are interpreted and then performed. Thus, you can also pipe output from a different
program (e.g. C or Java) to this Java drawing program. You can make a
basic (non-bipartite) graph by using init->a->0. Also note that the mouse
can be used to reposition vertices.
Interface options are: (-> indicates a carriage return)
NOTE: these commands affect only the interface
init->a->b initializes a bipartite graph with left nodes
and right nodes
nodeName->n->name the 'th node gets name
edgeName->n->name the 'th edge gets name
moveNode->n->x->y the 'th node is moved to coordiates (x%,y%)
of the screen size (0<=x,y<=1)
addEdge->a->b adds an edge from the 'th to th nodes
minCrossings move nodes in order to heuristically minimize
the number of crossings
numCrossings returns the number of edge crossings in the graph
makePretty moves nodes to make the graph heuristically prettier
squarePack packs the nodes into a square lattice and tries to
diamondPack packs the nodes into a diamond lattice and tries to
lightNode->n highlights the th node
unlightNode->n unhighlights the th node
messageNode->n->s prints message
directly below the th node
changeInfo->n->s changes text of the th message to
lstatus->s prints status message on the bottom left of the screen
rstatus->s prints status message on the bottom right of the screen
addMessage->s->a->b (use with care!) adds a message with (horiz,vert)
changeMessage->n->s->a->b (use with care!) changes 'th message to
at displacement (a,b)
repaint repaint the screen
data prints subsequent lines until another string is found
help displays this help information
quit signals termination of the program