public class Graph
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
class |
Graph.StyleSheet |
Modifier and Type | Field and Description |
---|---|
float |
attractionForce
strength of the attraction force between connected elements
|
float |
collisionForce
strength of the collision force between the elements
|
boolean |
createRelations
allow the user to create new relations during runtime
|
boolean |
fixCaption
allow the user to change the caption of the nodes during runtime
|
boolean |
fixColor
allow the user to change the color of the nodes during runtime
|
boolean |
fixPosition
allow the user to move the nodes during runtime
|
boolean |
fixSize
allow the user to change the size of the nodes during runtime
|
boolean |
highLight |
boolean |
listView
toggle view mode
|
float |
relationsForce
strength of the attraction force between connected elements
|
boolean |
resize |
boolean |
runPhysics
toggle self organization
|
float |
scale
scale of the view
|
boolean |
shaded
shaded or filled
|
boolean |
showBoundingBox
show the bounding box (for mouse interaction)
|
boolean |
showCaption
visibility of the node caption
|
boolean |
showIcon
visibility of the node icon (PShape)
|
boolean |
showLabels |
boolean |
showSliders |
processing.core.PVector |
trans
translation of the view
|
static java.lang.String |
VERSION |
Constructor and Description |
---|
Graph(processing.core.PApplet pa)
create new
Graph |
Graph(processing.core.PApplet pa,
processing.core.PGraphics pg)
create new
Graph |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(java.lang.String nn)
check if the Graph contains a Node with a name nn
|
void |
deleteBoundingBox()
reset bounding box
|
void |
deleteSelectionBox()
reset bounding box (for Node selection)
|
java.io.File |
exportXML(java.lang.String fileName)
export as XML file
|
java.io.File |
exportZip(java.lang.String fileName)
export as ZIP file
|
Node |
get(java.lang.String nn)
get
Node by namereturns null when it doesn't contain a Node with this name |
Node[] |
getAll()
get all Nodes of the Graph
|
Node[] |
getGroup(java.lang.String nn)
get a Group of Nodes
|
Node[] |
getSelected()
get all selected Nodes as ArrayList
|
java.util.ArrayList<Node> |
getSelectedList()
get all selected Nodes as ArrayList
|
void |
importXML(java.lang.String fileName)
import XML file
|
void |
importZip(java.lang.String fileName)
import ZIP file
|
void |
keyEvent(processing.event.KeyEvent event)
key events
|
void |
mouseEvent(processing.event.MouseEvent event)
mouse events
|
void |
put(java.lang.String nn,
Node n)
add
Node |
void |
put(java.lang.String nn,
Node n,
java.lang.String... g)
add Node and put it in Group(s)
|
void |
registerCorrelationsEvent(java.lang.Object oo)
register a method to call at every correlations event
the method must look like this: correlationsEvent(CorrelationsEvent event) |
void |
render()
render everything
|
void |
setBoundingBox(float x1,
float y1,
float x2,
float y2)
set the bounding box
|
void |
setMouseBoundingBox(float x1,
float y1,
float x2,
float y2)
set the bounding box (for mouse interaction)
|
void |
setSelectionBox(float x1,
float y1,
float x2,
float y2)
set bounding box (for Node selection)
|
public boolean fixSize
public boolean fixColor
public boolean fixPosition
public boolean fixCaption
public boolean createRelations
public boolean showCaption
public boolean showIcon
public boolean shaded
public boolean showBoundingBox
public static final java.lang.String VERSION
public processing.core.PVector trans
public float scale
public boolean highLight
public boolean resize
public boolean showSliders
public boolean showLabels
public float collisionForce
public float attractionForce
public float relationsForce
public boolean runPhysics
public boolean listView
public Graph(processing.core.PApplet pa, processing.core.PGraphics pg)
Graph
PApplet
- paPGraphics
- pgpublic Graph(processing.core.PApplet pa)
Graph
PApplet
- papublic void registerCorrelationsEvent(java.lang.Object oo)
correlationsEvent(CorrelationsEvent event)
Object
- oo:public void render()
public void put(java.lang.String nn, Node n)
Node
String
- nn: name of the NodeNode
- n: the Nodepublic Node get(java.lang.String nn)
Node
by namenull
when it doesn't contain a Node with this nameString
- nn: name of the Nodepublic void put(java.lang.String nn, Node n, java.lang.String... g)
String
- nn: name of the NodeNode
- n: the NodeString...
- g: group name(s)public Node[] getAll()
public Node[] getGroup(java.lang.String nn)
String
- nn: name of the groupspublic boolean contains(java.lang.String nn)
String
- nn: name of the Nodepublic java.util.ArrayList<Node> getSelectedList()
public Node[] getSelected()
public void setBoundingBox(float x1, float y1, float x2, float y2)
float
- x1: top left coordinate of the boxfloat
- y1: top left coordinate of the boxfloat
- x2: bottom right coordinate of the boxfloat
- y2: bottom right coordinate of the boxpublic void setMouseBoundingBox(float x1, float y1, float x2, float y2)
public void deleteBoundingBox()
public void setSelectionBox(float x1, float y1, float x2, float y2)
public void deleteSelectionBox()
public void keyEvent(processing.event.KeyEvent event)
public void mouseEvent(processing.event.MouseEvent event)
public java.io.File exportXML(java.lang.String fileName)
public void importXML(java.lang.String fileName)
public java.io.File exportZip(java.lang.String fileName)
public void importZip(java.lang.String fileName)