本文整理汇总了Java中edu.uci.ics.jung.algorithms.layout.ISOMLayout类的典型用法代码示例。如果您正苦于以下问题:Java ISOMLayout类的具体用法?Java ISOMLayout怎么用?Java ISOMLayout使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ISOMLayout类属于edu.uci.ics.jung.algorithms.layout包,在下文中一共展示了ISOMLayout类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getLayout
import edu.uci.ics.jung.algorithms.layout.ISOMLayout; //导入依赖的package包/类
private static AbstractLayout<Vertex, Edge> getLayout(GraphJung<Graph> graph, String layoutName) {
switch (layoutName) {
case "KKLayout":
return new KKLayout<>(graph);
case "CircleLayout":
return new CircleLayout<>(graph);
case "FRLayout":
return new FRLayout<>(graph);
case "FRLayout2":
return new FRLayout2<>(graph);
case "ISOMLayout":
return new ISOMLayout<>(graph);
case "SpringLayout":
return new SpringLayout<>(graph);
default:
return new KKLayout<>(graph);
}
}
开发者ID:SciGraph,项目名称:SciGraph,代码行数:19,代码来源:ImageWriter.java
示例2: initLayoutBox
import edu.uci.ics.jung.algorithms.layout.ISOMLayout; //导入依赖的package包/类
/**
* Initializes combobox for layout
*/
private void initLayoutBox(){
layoutBox.addItem("CircleLayout");
layoutBox.addItem("FRLayout");
layoutBox.addItem("FRLayout2");
layoutBox.addItem("ISOMLayout");
layoutBox.addItem("KKLayout");
layoutBox.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent a) {
JComboBox<String> lBox = (JComboBox<String>) a.getSource();
String name = (String) lBox.getSelectedItem();
for (EGPanel e : egPanels){
ExplanationGraph eg = e.getEG();
switch(name){
case "CircleLayout": layout = new CircleLayout<EGVertex, EGEdge>(eg); break;
case "FRLayout": layout = new FRLayout<EGVertex, EGEdge>(eg); break;
case "FRLayout2": layout = new FRLayout<EGVertex, EGEdge>(eg); break;
case "KKLayout": layout = new KKLayout<EGVertex, EGEdge>(eg); break;
default : layout = new ISOMLayout<EGVertex, EGEdge>(eg); break;
}
e.setLayout(layout);
}
}});
}
开发者ID:Angerona,项目名称:angerona-framework,代码行数:28,代码来源:EGView.java
示例3: initLayoutBox
import edu.uci.ics.jung.algorithms.layout.ISOMLayout; //导入依赖的package包/类
private void initLayoutBox(){
layoutBox.addItem("CircleLayout");
layoutBox.addItem("FRLayout");
layoutBox.addItem("FRLayout2");
layoutBox.addItem("ISOMLayout");
layoutBox.addItem("KKLayout");
layoutBox.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent a) {
JComboBox<String> lBox = (JComboBox<String>) a.getSource();
String name = (String) lBox.getSelectedItem();
switch(name){
case "CircleLayout": l = new CircleLayout<EDGVertex, EDGEdge>(edg); break;
case "FRLayout": l = new FRLayout<EDGVertex, EDGEdge>(edg); break;
case "FRLayout2": l = new FRLayout<EDGVertex, EDGEdge>(edg); break;
case "KKLayout": l = new KKLayout<EDGVertex, EDGEdge>(edg); break;
default : l = new ISOMLayout<EDGVertex, EDGEdge>(edg); break;
}
l.setSize(new Dimension(780,400));
visServer.setGraphLayout(l);
visServer.doLayout();
}
});
}
开发者ID:Angerona,项目名称:angerona-framework,代码行数:25,代码来源:EDGView.java
示例4: LayoutSelection
import edu.uci.ics.jung.algorithms.layout.ISOMLayout; //导入依赖的package包/类
public LayoutSelection(GraphViewer<V, E> graphViewer, Graph<V, E> graph) {
super();
this.graphViewer = graphViewer;
this.graph = graph;
this.layout = new ISOMLayout<V, E>(graph);
layoutMap = new java.util.LinkedHashMap<String, Class>();
if (graph instanceof Forest) {
layoutMap.put("Tree", ShapeBasedTreeLayout.class);
layoutMap.put("Tree (Tight)", TreeLayout.class);
layoutMap.put("Radial", RadialTreeLayout.class);
layoutMap.put("Balloon", BalloonLayout.class);
}
layoutMap.put("ISOM", ISOMLayout.class);
layoutMap.put("KKLayout", KKLayout.class);
layoutMap.put("FRLayout", FRLayout2.class);
layoutMap.put("Circle", CircleLayout.class);
layoutMap.put("Spring", SpringLayout2.class);
Iterator<String> it = layoutMap.keySet().iterator();
while (it.hasNext()) {
addItem(it.next());
}
addActionListener(this);
}
开发者ID:transwarpio,项目名称:rapidminer,代码行数:29,代码来源:LayoutSelection.java
示例5: LayoutSelection
import edu.uci.ics.jung.algorithms.layout.ISOMLayout; //导入依赖的package包/类
public LayoutSelection(GraphViewer<V, E> graphViewer, Graph<V, E> graph) {
super();
this.graphViewer = graphViewer;
this.graph = graph;
this.layout = new ISOMLayout<V, E>(graph);
layoutMap = new LinkedHashMap<>();
if (graph instanceof Forest) {
layoutMap.put("Tree", ShapeBasedTreeLayout.class);
layoutMap.put("Tree (Tight)", TreeLayout.class);
layoutMap.put("Radial", RadialTreeLayout.class);
layoutMap.put("Balloon", BalloonLayout.class);
}
layoutMap.put("ISOM", ISOMLayout.class);
layoutMap.put("KKLayout", KKLayout.class);
layoutMap.put("FRLayout", FRLayout2.class);
layoutMap.put("Circle", CircleLayout.class);
layoutMap.put("Spring", SpringLayout2.class);
Iterator<String> it = layoutMap.keySet().iterator();
while (it.hasNext()) {
addItem(it.next());
}
addActionListener(this);
}
开发者ID:rapidminer,项目名称:rapidminer-studio,代码行数:29,代码来源:LayoutSelection.java
示例6: getCombos
import edu.uci.ics.jung.algorithms.layout.ISOMLayout; //导入依赖的package包/类
/**
* @return
*/
@SuppressWarnings("unchecked")
private Class<? extends Layout>[] getCombos()
{
List<Class<? extends Layout>> layouts = new ArrayList<Class<? extends Layout>>();
layouts.add(KKLayout.class);
layouts.add(FRLayout.class);
layouts.add(CircleLayout.class);
layouts.add(SpringLayout.class);
layouts.add(SpringLayout2.class);
layouts.add(ISOMLayout.class);
return layouts.toArray(new Class[0]);
}
开发者ID:marcvanzee,项目名称:mdp-plan-revision,代码行数:16,代码来源:VertexCollapseDemoWithLayouts.java
示例7: getCombos
import edu.uci.ics.jung.algorithms.layout.ISOMLayout; //导入依赖的package包/类
/**
* @return
*/
@SuppressWarnings("unchecked")
private static Class<? extends Layout>[] getCombos()
{
List<Class<? extends Layout>> layouts = new ArrayList<Class<? extends Layout>>();
layouts.add(KKLayout.class);
layouts.add(FRLayout.class);
layouts.add(CircleLayout.class);
layouts.add(SpringLayout.class);
layouts.add(SpringLayout2.class);
layouts.add(ISOMLayout.class);
return layouts.toArray(new Class[0]);
}
开发者ID:marcvanzee,项目名称:mdp-plan-revision,代码行数:16,代码来源:ShowLayouts.java
示例8: buildJungLayout
import edu.uci.ics.jung.algorithms.layout.ISOMLayout; //导入依赖的package包/类
@Override
protected Layout<GraphNode,GraphEdge> buildJungLayout(
DirectedGraph<GraphNode, GraphEdge> jungGraph,
Dimension layoutSize) {
ISOMLayout<GraphNode, GraphEdge> result =
new ISOMLayout<GraphNode, GraphEdge>(jungGraph);
result.setSize(layoutSize);
return result;
}
开发者ID:google,项目名称:depan,代码行数:10,代码来源:JungLayoutPlan.java
示例9: updateLayoutGraph
import edu.uci.ics.jung.algorithms.layout.ISOMLayout; //导入依赖的package包/类
private void updateLayoutGraph()
{
Layout<Vertex,Edge> newlayout = null;
if(((String)layoutChoiceComboBox.getSelectedItem()).equals("FRLayout"))
{
newlayout = new FRLayout<Vertex,Edge>(sequenceGraph);
((FRLayout<Vertex,Edge>)newlayout).setMaxIterations(200);
}
else if(((String)layoutChoiceComboBox.getSelectedItem()).equals("KKLayout"))
{
newlayout = new KKLayout<Vertex,Edge>(sequenceGraph);
((KKLayout<Vertex,Edge>)newlayout).setMaxIterations(200);
}
else if(((String)layoutChoiceComboBox.getSelectedItem()).equals("SpringLayout"))
{
newlayout = new SpringLayout<Vertex,Edge>(sequenceGraph);
}
else if(((String)layoutChoiceComboBox.getSelectedItem()).equals("ISOMLayout"))
{
newlayout = new ISOMLayout<Vertex,Edge>(sequenceGraph);
}
else
{
throw new Error("Error choice: wrong layout name");
}
newlayout.setInitializer(networkCanvas.getGraphLayout());
newlayout.setSize(networkCanvas.getSize());
LayoutTransition<Vertex,Edge> transition =
new LayoutTransition<Vertex,Edge>(networkCanvas, networkCanvas.getGraphLayout(), newlayout);
Animator animator = new Animator(transition);
animator.start();
networkCanvas.getRenderContext().getMultiLayerTransformer().setToIdentity(); // What is the use of those lines ?
networkCanvas.repaint();
}
开发者ID:Conchylicultor,项目名称:NetworkVisualizer,代码行数:37,代码来源:VisualizerWindow.java
示例10: doISOMLayout
import edu.uci.ics.jung.algorithms.layout.ISOMLayout; //导入依赖的package包/类
private void doISOMLayout(final Layout graphLayout, SparseGraph<VertexRef, EdgeRef> jungGraph, Dimension size) {
ISOMLayout<VertexRef, EdgeRef> layout = new ISOMLayout<VertexRef, EdgeRef>(jungGraph);
layout.setInitializer(initializer(graphLayout));
layout.setSize(size);
while(!layout.done()) {
layout.step();
}
for(VertexRef v : jungGraph.getVertices()) {
graphLayout.setLocation(v, (int)layout.getX(v), (int)layout.getY(v));
}
}
开发者ID:qoswork,项目名称:opennmszh,代码行数:16,代码来源:RealUltimateLayoutAlgorithm.java
示例11: visualizeNetworkGraph
import edu.uci.ics.jung.algorithms.layout.ISOMLayout; //导入依赖的package包/类
public static JFrame visualizeNetworkGraph(Graph<NetworkVertex, NetworkEdge> graph) {
Layout<NetworkVertex, NetworkEdge> layout = new ISOMLayout<>(graph);
layout.setSize(new Dimension(600, 600));
BasicVisualizationServer<NetworkVertex, NetworkEdge> vv = new BasicVisualizationServer<>(layout);
vv.setPreferredSize(new Dimension(700, 700));
Transformer<NetworkVertex, Paint> vertexPaint = v -> {
if (v instanceof Host) {
Host host = (Host) v;
return host.isFree() ? Color.GREEN : Color.RED;
} else {
return Color.GRAY;
}
};
vv.getRenderContext().setVertexFillPaintTransformer(vertexPaint);
Transformer<NetworkVertex, String> vertexLabel = v -> v.getId();
vv.getRenderContext().setVertexLabelTransformer(vertexLabel);
vv.getRenderer().getVertexLabelRenderer().setPosition(edu.uci.ics.jung.visualization.renderers.Renderer.VertexLabel.Position.AUTO);
Transformer<NetworkEdge, String> edgeLabel = networkEdge -> networkEdge.getTailPort() + "->" + networkEdge.getHeadPort();
vv.getRenderContext().setEdgeLabelTransformer(edgeLabel);
JFrame frame = new JFrame("Simple Graph View 2");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().add(vv);
frame.pack();
return frame;
}
开发者ID:citlab,项目名称:vs.msc.ws14,代码行数:31,代码来源:StaticGraphUtils.java
示例12: LayoutSelection
import edu.uci.ics.jung.algorithms.layout.ISOMLayout; //导入依赖的package包/类
public LayoutSelection(GraphViewer<V, E> graphViewer, Graph<V,E> graph) {
super();
this.graphViewer = graphViewer;
this.graph = graph;
this.layout = new ISOMLayout<V, E>(graph);
layoutMap = new java.util.LinkedHashMap<String, Class>();
if (graph instanceof Forest) {
layoutMap.put("Tree", ShapeBasedTreeLayout.class);
layoutMap.put("Tree (Tight)", TreeLayout.class);
layoutMap.put("Radial", RadialTreeLayout.class);
layoutMap.put("Balloon", BalloonLayout.class);
}
layoutMap.put("ISOM", ISOMLayout.class);
layoutMap.put("KKLayout", KKLayout.class);
layoutMap.put("FRLayout", FRLayout2.class);
layoutMap.put("Circle", CircleLayout.class);
layoutMap.put("Spring", SpringLayout2.class);
Iterator<String> it = layoutMap.keySet().iterator();
while (it.hasNext())
addItem(it.next());
addActionListener(this);
}
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:28,代码来源:LayoutSelection.java
示例13: DependencyGraphScene
import edu.uci.ics.jung.algorithms.layout.ISOMLayout; //导入依赖的package包/类
DependencyGraphScene(ObservableGraph<ArtifactGraphNode, ArtifactGraphEdge> graph, DelegateForest<ArtifactGraphNode, ArtifactGraphEdge> forest, MavenProject prj, Project nbProj, DependencyGraphTopComponent tc,
POMModel model) {
super(graph, new FRLayout<>(forest));
layoutModel = new DefaultComboBoxModel<>();
layoutModel.addElement(layout());
// These rarely work but look nice when they do
// layoutModel.addElement(new BalloonLayout<>(forest));
// layoutModel.addElement(new RadialTreeLayout<>(forest));
layoutModel.addElement(new CircleLayout<>(graph));
layoutModel.addElement(new FRLayout<>(graph));
layoutModel.addElement(new FRLayout2<>(graph));
layoutModel.addElement(new KKLayout<>(graph));
TreeLayout<ArtifactGraphNode, ArtifactGraphEdge> treeLayout = new TreeLayout<>(forest, 200, 90);
layoutModel.addElement(treeLayout);
layoutModel.addElement(new ISOMLayout<>(graph));
layoutModel.addElement(new SpringLayout<>(graph));
layoutModel.addElement(new SpringLayout2<>(graph));
layoutModel.setSelectedItem(layout());
moveAction = ActionFactory.createMoveAction(null, new MP());
this.forest = forest;
project = prj;
nbProject = nbProj;
this.tc = tc;
this.model = model;
mainLayer = new LayerWidget(this);
addChild(mainLayer);
connectionLayer = new LayerWidget(this);
addChild(connectionLayer);
//getActions().addAction(this.createObjectHoverAction());
getActions().addAction(hoverAction);
getActions().addAction(ActionFactory.createSelectAction(allActionsP));
getActions().addAction(zoomAction);
getActions().addAction(panAction);
getActions().addAction(editAction);
getActions().addAction(popupMenuAction);
getActions().addAction(new ScrollWheelZoomAction());
}
开发者ID:timboudreau,项目名称:vl-jung,代码行数:41,代码来源:DependencyGraphScene.java
示例14: JungVisualizationViewer
import edu.uci.ics.jung.algorithms.layout.ISOMLayout; //导入依赖的package包/类
public JungVisualizationViewer(GraphMatrixWrapper<N, E> graph, boolean showNodeLabels, boolean showEdgeLabels) {
super(graph.getGraphMatrix().getGUIObject());
this.graph = graph;
this.graphMatrix = graph.getGraphMatrix();
this.matrixGUIObject = (MatrixGUIObject) graphMatrix.getGUIObject();
this.showNodeLabels = showNodeLabels;
this.showEdgeLabels = showEdgeLabels;
if (graph.getVertexCount() < 1000) {
layout = new FRLayout<N, EdgeWrapper<E>>(graph);
} else {
layout = new ISOMLayout<N, EdgeWrapper<E>>(graph);
}
VisualizationModel<N, EdgeWrapper<E>> visualizationModel = new DefaultVisualizationModel<N, EdgeWrapper<E>>(
layout);
vv = new VisualizationViewer<N, EdgeWrapper<E>>(visualizationModel);
vv.setForeground(new Color(0, 0, 0, 150));
vv.setBackground(Color.WHITE);
DefaultModalGraphMouse<N, E> graphMouse = new DefaultModalGraphMouse<N, E>();
vv.setGraphMouse(graphMouse);
graphMouse.setMode(Mode.PICKING);
RenderContext<N, EdgeWrapper<E>> rc = vv.getRenderContext();
emptyNodeLabelTransformer = rc.getVertexLabelTransformer();
emptyEdgeLabelTransformer = rc.getEdgeLabelTransformer();
rc.setVertexIconTransformer(new VertexIconTransformer<N>(vv.getPickedVertexState()));
rc.setVertexFillPaintTransformer(new ColorTransformer<N>(vv.getPickedVertexState()));
rc.setVertexLabelRenderer(new DefaultVertexLabelRenderer(UIDefaults.SELECTEDCOLOR));
rc.setEdgeDrawPaintTransformer(new ColorTransformer<EdgeWrapper<E>>(vv.getPickedEdgeState()));
rc.setEdgeLabelRenderer(new DefaultEdgeLabelRenderer(UIDefaults.SELECTEDCOLOR));
rc.setArrowFillPaintTransformer(new ColorTransformer<EdgeWrapper<E>>(vv.getPickedEdgeState()));
rc.setArrowDrawPaintTransformer(new ColorTransformer<EdgeWrapper<E>>(vv.getPickedEdgeState()));
vv.getRenderer().getVertexLabelRenderer().setPositioner(new InsidePositioner());
vv.getRenderer().getVertexLabelRenderer().setPosition(Renderer.VertexLabel.Position.AUTO);
if (showNodeLabels) {
rc.setVertexLabelTransformer(new ToStringLabeller<N>());
}
if (showEdgeLabels) {
rc.setEdgeLabelTransformer(new ToStringLabeller<EdgeWrapper<E>>());
}
vv.setVertexToolTipTransformer(new ToStringLabeller<N>());
setLayout(new BorderLayout());
add(vv, BorderLayout.CENTER);
vv.addMouseListener(this);
addComponentListener(this);
vv.addGraphMouseListener(this);
if (graph instanceof GraphMatrixWrapper) {
((MatrixGUIObject) ((GraphMatrixWrapper<N, E>) graph).getGraphMatrix().getGUIObject())
.addTableModelListener(this);
}
}
开发者ID:ujmp,项目名称:universal-java-matrix-package,代码行数:61,代码来源:JungVisualizationViewer.java
示例15: switchLayout
import edu.uci.ics.jung.algorithms.layout.ISOMLayout; //导入依赖的package包/类
public void switchLayout(GraphLayout type) {
Layout<N, EdgeWrapper<E>> layout = null;
switch (type) {
case KKLayout:
layout = new KKLayout<N, EdgeWrapper<E>>(graph);
break;
case FRLayout:
layout = new FRLayout<N, EdgeWrapper<E>>(graph);
break;
case ISOMLayout:
layout = new ISOMLayout<N, EdgeWrapper<E>>(graph);
break;
case SpringLayout:
layout = new SpringLayout<N, EdgeWrapper<E>>(graph);
break;
case CircleLayout:
layout = new CircleLayout<N, EdgeWrapper<E>>(graph);
break;
case FRLayout2:
layout = new FRLayout2<N, EdgeWrapper<E>>(graph);
break;
case SpringLayout2:
layout = new SpringLayout2<N, EdgeWrapper<E>>(graph);
break;
default:
break;
}
if (graph.getVertexCount() < 100) {
layout.setInitializer(vv.getGraphLayout());
layout.setSize(getSize());
LayoutTransition<N, EdgeWrapper<E>> lt = new LayoutTransition<N, EdgeWrapper<E>>(vv, vv.getGraphLayout(),
layout);
Animator animator = new Animator(lt);
animator.start();
vv.getRenderContext().getMultiLayerTransformer().setToIdentity();
repaint(500);
} else {
vv.setModel(new DefaultVisualizationModel<N, EdgeWrapper<E>>(layout));
repaint(500);
}
}
开发者ID:ujmp,项目名称:universal-java-matrix-package,代码行数:44,代码来源:JungVisualizationViewer.java
示例16: visualize
import edu.uci.ics.jung.algorithms.layout.ISOMLayout; //导入依赖的package包/类
@SuppressWarnings({ "unchecked", "rawtypes" })
public static void visualize(JungNetwork graph, String title, int type)
{
// The Layout<V, E> is parameterized by the vertex and edge types
Layout<JungVertex, JungEdge> layout = null;
switch (type)
{
case CIRCLE:
layout = new CircleLayout<JungVertex, JungEdge>(graph);
break;
case SPRING:
layout = new SpringLayout<JungVertex, JungEdge>(graph);
break;
case FR:
layout = new FRLayout<JungVertex, JungEdge>(graph);
break;
case ISOM:
layout = new ISOMLayout<JungVertex, JungEdge>(graph);
break;
case DAG:
layout = new DAGLayout<JungVertex, JungEdge>(graph);
break;
case SPRING2:
layout = new SpringLayout2<JungVertex, JungEdge>(graph);
break;
default:
layout = new KKLayout<JungVertex, JungEdge>(graph);
}
layout.setSize(new Dimension(800,800)); // sets the initial size of the space
// The BasicVisualizationServer<V,E> is parameterized by the edge types
BasicVisualizationServer<JungVertex,JungEdge> vv =
new BasicVisualizationServer<JungVertex,JungEdge>(layout);
vv.setPreferredSize(new Dimension(900,900)); //Sets the viewing area size
vv.scaleToLayout(new LayoutScalingControl() );
vv.getRenderContext().setVertexLabelTransformer(new ToStringLabeller());
vv.getRenderContext().setEdgeLabelTransformer(new ToStringLabeller());
vv.getRenderer().getVertexLabelRenderer().setPosition(Position.CNTR);
JFrame frame = new JFrame(title);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().add(vv);
frame.pack();
frame.setVisible(true);
}
开发者ID:Rees-Brad,项目名称:FastEgoClustering,代码行数:55,代码来源:Visualize.java
示例17: getInstance
import edu.uci.ics.jung.algorithms.layout.ISOMLayout; //导入依赖的package包/类
public static DIHelper getInstance()
{
if(helper == null)
{
helper = new DIHelper();
// need to set up the shapes here
//Shape square = new Rectangle2D.Double(-5,-5,10, 10);
//new Graphics2D().dr
//square = (Shape) g2;
//Shape circle = new Ellipse2D.Double(-5, -5, 10, 10);
Ellipse2D.Double circle = new Ellipse2D.Double(-6, -6, 12, 12);
Rectangle2D.Double square = new Rectangle2D.Double(-6,-6,12, 12);
//RoundRectangle2D.Double round = new RoundRectangle2D.Double(-6,-6,12, 12, 6, 6);
Shape triangle = helper.createUpTriangle(6);
Shape star = helper.createStar();
Shape rhom = helper.createRhombus(7);
Shape hex = helper.createHex(7);
Shape pent = helper.createPent(7);
helper.localProp.put(Constants.SQUARE, square);
helper.localProp.put(Constants.CIRCLE, circle);
helper.localProp.put(Constants.TRIANGLE, triangle);
helper.localProp.put(Constants.STAR, star);
helper.localProp.put(Constants.DIAMOND, rhom);
helper.localProp.put(Constants.HEXAGON, hex);
helper.localProp.put(Constants.PENTAGON, pent);
Shape squareL = new Rectangle2D.Double(0,0,40, 40);
Shape circleL = new Ellipse2D.Double(0, 0, 13, 13);
Shape triangleL = helper.createUpTriangleL();
Shape starL = helper.createStarL();
Shape rhomL = helper.createRhombusL();
Shape pentL = helper.createPentL();
Shape hexL = helper.createHexL();
helper.localProp.put(Constants.SQUARE + Constants.LEGEND, squareL);
helper.localProp.put(Constants.CIRCLE + Constants.LEGEND, circleL);
helper.localProp.put(Constants.TRIANGLE + Constants.LEGEND, triangleL);
helper.localProp.put(Constants.STAR + Constants.LEGEND, starL);
helper.localProp.put(Constants.HEXAGON + Constants.LEGEND, hex);
helper.localProp.put(Constants.DIAMOND + Constants.LEGEND, rhomL);
helper.localProp.put(Constants.PENTAGON + Constants.LEGEND, pentL);
helper.localProp.put(Constants.HEXAGON + Constants.LEGEND, hexL);
Color blue = new Color(31, 119, 180);
Color green = new Color(44, 160, 44);
Color red = new Color(214, 39, 40);
Color brown = new Color(143, 99, 42);
Color yellow = new Color(254, 208, 2);
Color orange = new Color(255, 127, 14);
Color purple = new Color(148, 103, 189);
Color aqua = new Color(23, 190, 207);
Color pink = new Color(241, 47, 158);
helper.localProp.put(Constants.BLUE, blue);
helper.localProp.put(Constants.GREEN, green);
helper.localProp.put(Constants.RED, red);
helper.localProp.put(Constants.BROWN, brown);
helper.localProp.put(Constants.MAGENTA, pink);
helper.localProp.put(Constants.YELLOW, yellow);
helper.localProp.put(Constants.ORANGE, orange);
helper.localProp.put(Constants.PURPLE, purple);
helper.localProp.put(Constants.AQUA, aqua);
// put all the layouts as well
helper.localProp.put(Constants.FR, FRLayout.class);
helper.localProp.put(Constants.KK, KKLayout.class);
helper.localProp.put(Constants.ISO, ISOMLayout.class);
helper.localProp.put(Constants.SPRING, SpringLayout.class);
helper.localProp.put(Constants.CIRCLE_LAYOUT, CircleLayout.class);
helper.localProp.put(Constants.RADIAL_TREE_LAYOUT, RadialTreeLayout.class);
helper.localProp.put(Constants.TREE_LAYOUT, TreeLayout.class);
helper.localProp.put(Constants.BALLOON_LAYOUT, BalloonLayout.class);
}
return helper;
}
开发者ID:SEMOSS,项目名称:semoss,代码行数:82,代码来源:DIHelper.java
示例18: start
import edu.uci.ics.jung.algorithms.layout.ISOMLayout; //导入依赖的package包/类
@Override
public void start(Stage stage) {
// setup up the scene.
Group root = new Group();
Scene scene = new Scene(root, 800, 400, Color.WHITE);
// create two groups, one for each visualization
Group viz1 = new Group();
Group viz2 = new Group();
// create a sample graph using JUNG's TestGraphs class.
Graph<String, Number> graph1 = TestGraphs.getOneComponentGraph();
// define the layout we want to use for the graph
// The layout will be modified by the VisualizationModel
Layout<String, Number> circleLayout = new CircleLayout<>(graph1);
/*
* Define the visualization model. This is how JUNG calculates the layout
* for the graph. It updates the layout object passed in.
*/
VisualizationModel<String, Number> vm1 = new DefaultVisualizationModel<>(circleLayout, new Dimension(400, 400));
// draw the graph
renderGraph(graph1, circleLayout, viz1);
// Generate a second JUNG sample graph
Graph<String, Number> graph2 = TestGraphs.getOneComponentGraph();
// This time use an Isometric layout.
Layout<String, Number> lay2 = new ISOMLayout<>(graph2);
// Generate the actual layout
VisualizationModel<String, Number> vm2 = new DefaultVisualizationModel<>(lay2, new Dimension(400, 400));
// draw the graph
renderGraph(graph2, lay2, viz2);
// move the second viz to beside the first.
viz2.translateXProperty().set(400);
root.getChildren().add(viz1);
root.getChildren().add(viz2);
stage.setTitle("Displaying Two JUNG Graphs");
stage.setScene(scene);
stage.show();
}
开发者ID:jeffreyguenther,项目名称:JavaFXTutorials,代码行数:51,代码来源:JUNGAndJavaFX.java
示例19: actionPerformed
import edu.uci.ics.jung.algorithms.layout.ISOMLayout; //导入依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {
final GraphViewerPanel viewerPanel = (GraphViewerPanel) frame.getTabbedPane().getSelectedComponent();
ISOMLayout isomLayout = new ISOMLayout<String, String>(viewerPanel.getCurrentGraph());
MyVisualizationViewer vv = (MyVisualizationViewer) viewerPanel.getVisualizationViewer();
vv.setGraphLayout(isomLayout);
vv.repaint();
}
开发者ID:iTransformers,项目名称:netTransformer,代码行数:15,代码来源:ISOMLayoutMenuHandler.java
注:本文中的edu.uci.ics.jung.algorithms.layout.ISOMLayout类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论