• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java VisualizationModel类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中edu.uci.ics.jung.visualization.VisualizationModel的典型用法代码示例。如果您正苦于以下问题:Java VisualizationModel类的具体用法?Java VisualizationModel怎么用?Java VisualizationModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



VisualizationModel类属于edu.uci.ics.jung.visualization包,在下文中一共展示了VisualizationModel类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: SatelliteVisualizationViewer

import edu.uci.ics.jung.visualization.VisualizationModel; //导入依赖的package包/类
/**
 * Used internally, as the satellite should always share the model of the master
 * @param master the master view
 * @param model
 * @param renderer
 * @param preferredSize
 */
protected SatelliteVisualizationViewer(VisualizationViewer<V,E> master, VisualizationModel<V,E> model,
        Dimension preferredSize) {
    super(model, preferredSize);
    this.master = master;
    
    // create a graph mouse with custom plugins to affect the master view
    ModalGraphMouse gm = new ModalSatelliteGraphMouse();
    setGraphMouse(gm);
    
    // this adds the Lens to the satellite view
    addPreRenderPaintable(new ViewLens<V,E>(this, master));
    
    // get a copy of the current layout transform
    // it may have been scaled to fit the graph
    AffineTransform modelLayoutTransform =
        new AffineTransform(master.getRenderContext().getMultiLayerTransformer().getTransformer(Layer.LAYOUT).getTransform());
    
    // I want no layout transformations in the satellite view
    // this resets the auto-scaling that occurs in the super constructor
    getRenderContext().getMultiLayerTransformer().setTransformer(Layer.LAYOUT, new MutableAffineTransformer(modelLayoutTransform));
    
    // make sure the satellite listens for changes in the master
    master.addChangeListener(this);
    
    // share the picked state of the master
    setPickedVertexState(master.getPickedVertexState());
    setPickedEdgeState(master.getPickedEdgeState());
}
 
开发者ID:SiLeBAT,项目名称:BfROpenLab,代码行数:36,代码来源:SatelliteVisualizationViewer.java


示例2: SatelliteVisualizationViewer

import edu.uci.ics.jung.visualization.VisualizationModel; //导入依赖的package包/类
/**
 * @param master the master view
 * @param model
 * @param renderer
 * @param preferredSize
 */
public SatelliteVisualizationViewer(VisualizationViewer master, VisualizationModel model,
        Renderer renderer, Dimension preferredSize) {
    super(model, renderer, preferredSize);
    this.master = master;
    
    // create a graph mouse with custom plugins to affect the master view
    ModalGraphMouse gm = new ModalSatelliteGraphMouse();
    setGraphMouse(gm);
    
    // this adds the Lens to the satellite view
    addPreRenderPaintable(new ViewLens(this, master));
    
    // get a copy of the current layout transform
    // it may have been scaled to fit the graph
    AffineTransform modelLayoutTransform =
        new AffineTransform(master.getLayoutTransformer().getTransform());
    
    // I want no layout transformations in the satellite view
    // this resets the auto-scaling that occurs in the super constructor
    setLayoutTransformer(new MutableAffineTransformer(modelLayoutTransform));
    
    // make sure the satellite listens for changes in the master
    master.addChangeListener(this);
    
    // share the picked state of the master
    setPickedState(master.getPickedState());
    setPickSupport(new ShapePickSupport());
}
 
开发者ID:markus1978,项目名称:clickwatch,代码行数:35,代码来源:SatelliteVisualizationViewer.java


示例3: BasicGraphGuiVisViewer

import edu.uci.ics.jung.visualization.VisualizationModel; //导入依赖的package包/类
/**
 * Instantiates a new VisualizationViewer for the BasicGraphGui.
 * @param model the model
 */
public BasicGraphGuiVisViewer(VisualizationModel<V,E>model) {
	super(model);
	this.initialize();
}
 
开发者ID:EnFlexIT,项目名称:AgentWorkbench,代码行数:9,代码来源:BasicGraphGuiVisViewer.java


示例4: AddComponentVisViewer

import edu.uci.ics.jung.visualization.VisualizationModel; //导入依赖的package包/类
/**
 * Instantiates a new VisualizationViewer for the AddComponentDialog.
 * @param model the model
 */
public AddComponentVisViewer(VisualizationModel<GraphNode, GraphEdge> model) {
	super(model);
	this.initialize();
}
 
开发者ID:EnFlexIT,项目名称:AgentWorkbench,代码行数:9,代码来源:AddComponentVisViewer.java


示例5: getModel

import edu.uci.ics.jung.visualization.VisualizationModel; //导入依赖的package包/类
@Override
public VisualizationModel<INode, IConnection> getModel() {
    throw new UnsupportedOperationException("Operation not implemented yet");
}
 
开发者ID:truffle-hog,项目名称:truffle-hog,代码行数:5,代码来源:FXVisualizationViewer.java


示例6: setModel

import edu.uci.ics.jung.visualization.VisualizationModel; //导入依赖的package包/类
@Override
public void setModel(VisualizationModel<INode, IConnection> visualizationModel) {
    throw new UnsupportedOperationException("Operation not implemented yet");
}
 
开发者ID:truffle-hog,项目名称:truffle-hog,代码行数:5,代码来源:FXVisualizationViewer.java


示例7: JungVisualizationViewer

import edu.uci.ics.jung.visualization.VisualizationModel; //导入依赖的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


示例8: start

import edu.uci.ics.jung.visualization.VisualizationModel; //导入依赖的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



注:本文中的edu.uci.ics.jung.visualization.VisualizationModel类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Segment类代码示例发布时间:2022-05-22
下一篇:
Java StaticUserAuthenticator类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap