Skip to end of metadata
Go to start of metadata

Description

JUNG — the Java Universal Network/Graph Framework--is a software library that provides a common and extendible language for the modeling, analysis, and visualization of data that can be represented as a graph or network.

Installation

The current version of griffon-jung-plugin is 0.4
To install just issue the following command

Usage

The following nodes will become available on a View script upon installing this plugin

Node

Property

Type

Default

Required

Bindable

Notes

basicVisualizationViewer
[BasicVisualizationViewer]

graph

Graph

 

(tick)

(error)

either set a value for this property or set a value for the node

 

graphLayout

Layout

 

(error)

(error)

either set a value for this property or set a value for the node

visualizationViewer
[VisualizationViewer]

graph

Graph

 

(tick)

(error)

either set a value for this property or set a value for the node

 

graphLayout

Layout

 

(error)

(error)

either set a value for this property or set a value for the node

balloonLayout
[BalloonLayout]

graph

Forest

 

(tick)

(error)

either set a value for this property or set a value for the node

circleLayout
[CircleLayout]

graph

Graph

 

(tick)

(error)

either set a value for this property or set a value for the node

dagLayout
[BalloonLayout]

graph

Graph

 

(tick)

(error)

either set a value for this property or set a value for the node

frLayout
[FRLayout]

graph

Graph

 

(tick)

(error)

either set a value for this property or set a value for the node

frLayout2
[FRLayout2]

graph

Graph

 

(tick)

(error)

either set a value for this property or set a value for the node

isomLayout
[ISOMLayout]

graph

Graph

 

(tick)

(error)

either set a value for this property or set a value for the node

kkLayout
[KKLayout]

graph

Graph

 

(tick)

(error)

either set a value for this property or set a value for the node

radialTreeLayout
[RadialTreeLayout]

graph

Forest

 

(tick)

(error)

either set a value for this property or set a value for the node

springLayout
[SpringLayout]

graph

Graph

 

(tick)

(error)

either set a value for this property or set a value for the node

springLayout2
[SpringLayout2]

graph

Graph

 

(tick)

(error)

either set a value for this property or set a value for the node

staticLayout2
[StaticLayout]

graph

Graph

 

(tick)

(error)

either set a value for this property or set a value for the node

treeLayout
[RadialTreeLayout]

graph

Forest

 

(tick)

(error)

either set a value for this property or set a value for the node

defaultModalGraphMouse
[DefaultModalGraphMouse]

 

 

 

 

 

nest it inside a visualizationViewer

You can set a Graph value or graph: property on each layout node, if not specified it will use its parent's graph.
This plugin includes a few vertex decorators that will allow you to tweak a vertex's shape:

griffon.jung.visualization.decorators.BasicVertexShapeTransformer
Constructor signatures are:

  • BasicVertexShapeTransformer(groovy.lang.Closure shapeTransformer, boolean cacheShapes = true)
  • BasicVertexShapeTransformer(Transformer<V,Shape> shapeTransformer, boolean cacheShapes = true)
  • BasicVertexShapeTransformer(Transformer vsf<V,Integer>, Transformer<V,Float> varf, groovy.lang.Closure shapeTransformer, boolean cacheShapes = true)
  • BasicVertexShapeTransformer(Transformer vsf<V,Integer>, Transformer<V,Float> varf, Transformer<V,Shape> shapeTransformer, boolean cacheShapes = true)

Either set a Closure or a Transformer<V,Shape> that hols the logic of computing a vertex's (v) shape. This decorator will cache all generated shapes by default.

griffon.jung.visualization.decorators.TemplateVertexShapeTransformer
Constructor signatures are:

  • TemplateVertexShapeTransformer(Shape template = new Rectangle2D.Double(0d,0d,1d,1d))
  • TemplateVertexShapeTransformer(Transformer vsf<V,Integer>, Transformer<V,Float> varf, Shape template = new Rectangle2D.Double(0d,0d,1d,1d))

You just need to set a template Shape. All shapes will be cached.

Simplified Transitive Properties

Icon

Both basicVisualizationViewer and visualizationViewer will attempt setting properties on their respective RenderContext and Renderer. This simplifies greatly the amount of code you'd had to write otherwise. The following example demonstrates this feature.

Here is an example graph visualization that uses TemplateVertexShapeTransformer coupled with jSilhouette's Star shape, it also attaches a few decorators and helpers.

For more information consult JUNG's Documentation page, the tutorial is quite good!

History

Version

Date

Notes

0.4

02-24-11

Release sync with Griffon 0.9.2

0.3

07-22-10

Release sync with Griffon 0.9

0.2

03-01-10

Upgraded to Griffon 0.3

0.1.1

11-16-09

fixed a typo on the plugin's descriptor that prevent it from being installed correctly

0.1

09-25-09

first release

  • No labels

1 Comment

  1. JUNG lib dependencies declared in the pom.xml file changed so when you add this plugin you only get the jung api libraries. To get the implementation libraries add 'net.sf.jung:jung-graph-impl:2.0'.

    Also, for the example above, JSilhouette changed package names from org.kordamp to org.codehaus.griffon.