Search in sources :

Example 1 with ISOMLayout

use of edu.uci.ics.jung.algorithms.layout.ISOMLayout in project fql by CategoricalData.

the class Query method lowerComp2.

public static JPanel lowerComp2(@SuppressWarnings("unused") FqlEnvironment env) {
    Layout<String, String> layout = new ISOMLayout<>(legend());
    layout.setSize(new Dimension(500, 100));
    VisualizationViewer<String, String> vv = new VisualizationViewer<>(layout);
    vv.setPreferredSize(new Dimension(500, 100));
    DefaultModalGraphMouse<String, String> gm = new DefaultModalGraphMouse<>();
    gm.setMode(Mode.TRANSFORMING);
    vv.setGraphMouse(gm);
    gm.setMode(Mode.PICKING);
    vv.getRenderContext().setEdgeLabelTransformer(new ToStringLabeller());
    vv.getRenderContext().setVertexLabelTransformer(new ToStringLabeller());
    return vv;
}
Also used : DefaultModalGraphMouse(edu.uci.ics.jung.visualization.control.DefaultModalGraphMouse) VisualizationViewer(edu.uci.ics.jung.visualization.VisualizationViewer) Dimension(java.awt.Dimension) ToStringLabeller(edu.uci.ics.jung.visualization.decorators.ToStringLabeller) ISOMLayout(edu.uci.ics.jung.algorithms.layout.ISOMLayout)

Aggregations

ISOMLayout (edu.uci.ics.jung.algorithms.layout.ISOMLayout)1 VisualizationViewer (edu.uci.ics.jung.visualization.VisualizationViewer)1 DefaultModalGraphMouse (edu.uci.ics.jung.visualization.control.DefaultModalGraphMouse)1 ToStringLabeller (edu.uci.ics.jung.visualization.decorators.ToStringLabeller)1 Dimension (java.awt.Dimension)1