The JUNG 2 alpha 2 is available at sourceforge.net. It has more features and more capabilities than previous versions and a better design. The samples along with the source provide a way to implement most of them. Notable features are:
· We can create our own vertex and edge types and can provide distinct colours and labels to them. The customized vertices and edges are supported everywhere(layout, visualizationviewer etc.)
· Zoom is available. Also there is Satellite view.
· Support for expand/collapse trees and vertices.(The collapsed vertex is a forest and is represented by a single vertex.).
· Tree layout, Spring layout, Balloon Layout etc. are supported. (We need tree layout to work with expand/collapse. If a node has more than one parent, expansion will not display the two edges.)
· VertexLabelRenderer:edu\uci\ics\jung\visualization\renderers package has VertexLabelRenderer which can be added to the renderer of the VisualizationViewer. It has the methods setPositioner and setPosition to position the vertices. The arguments to these methods are instances of classes available in the same package.
· Transformer:We can use the Transformer to apply any attribute(colour, stroke etc.) to the vertices and edges of the graph. Create a Transformer object and add this as a parameter to the setVertexStrokeTransformer method, for example, which is applied to the RenderContext of VisualizationViewer. This helps in providing different colour, stroke etc. to vertices and edges depending on their nature.
· Rendering vertices as icons:We can use the vertexIconTransformer and vertexIconShapeTransformer of VertexImageShaperDemo. The idea is that we should have an icon for the vertexIconTransformer and a shape of the icon obtained from FourPassImageShaper for the vertexIconShapeTransformer. Also a LayeredIcon is provided in order that we may use more than one icon at a time to render one vertex to indicate different details.
1 comment:
Hey,
I have been trying out Jung 2 for a couple of days now, and I am stuck. I am trying to make an applet, so that the user can CHOOSE the icons for the vertex (through buttons) before he/she creates it. I am using my own class (which implements Tranformer) and overwriting the tranform function. It is working fine, EXCEPT when I CHOOSE to change the icon, and create a new vertex, ALL the previous vertexs also change!!
Thanks for you Help!!
Post a Comment