当前位置: 首页>>代码示例>>Java>>正文


Java View类代码示例

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


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

示例1: launchDisplay

import org.graphstream.ui.swingViewer.View; //导入依赖的package包/类
private void launchDisplay() {
	this.viewer = this.graph.display();
	this.viewer.disableAutoLayout();

	this.ggraph = this.viewer.getGraphicGraph();

	View view = this.viewer.getDefaultView();

	ViewerPipe fromViewer = this.viewer.newViewerPipe();
	ViewerEventListener viewerListener =
			new ViewerEventListener(fromViewer, this.displayedGraph);
	view.setMouseManager(viewerListener);
	view.addMouseWheelListener(viewerListener);
	fromViewer.addViewerListener(viewerListener);
	fromViewer.addSink(this.graph);
}
 
开发者ID:spideruci,项目名称:cerebro-layout,代码行数:17,代码来源:DynamicDisplay.java

示例2: addViewTransition

import org.graphstream.ui.swingViewer.View; //导入依赖的package包/类
public void addViewTransition(Command command, io.supermonkey.crawler.device.View oldView, io.supermonkey.crawler.device.View newView) {

		org.graphstream.graph.Node oldNode = getOrCreateNode(oldView);
		org.graphstream.graph.Node newNode = getOrCreateNode(newView);

		oldNode.setAttribute("ui.label", oldView.getId().getShortName());
		newNode.setAttribute("ui.label", newView.getId().getShortName());

		for(Node node : graph.getEachNode()) {
			node.removeAttribute("ui.class");
		}
		newNode.addAttribute("ui.class", "current");

		String edgeLabel = toString(command);
		Edge edge = getOrCreateEdge(toEdgeId(edgeLabel, oldNode, newNode), oldNode, newNode);
		if(edge.isLoop()) {
			edge.addAttribute("ui.class", "loop");
		}
		//edge.setAttribute("ui.label", edgeLabel);
	}
 
开发者ID:enijkamp,项目名称:supermonkey,代码行数:21,代码来源:TraversalViewer.java

示例3: GraphView

import org.graphstream.ui.swingViewer.View; //导入依赖的package包/类
/**
 * Konstruktor
 * Erstellt die Anzeige
 */
public GraphView(FacePath fp) {
	this.fp = fp;
	this.initialize();
	if (fs == null) {
		this.fs = fp.getFS();
	}
	Viewer viewer = new Viewer(fs.getGraph(), Viewer.ThreadingModel.GRAPH_IN_ANOTHER_THREAD);
	fs.getFbNetwork().setGraphViewer(viewer);
	View view = viewer.addDefaultView(false);
	
	GridBagConstraints gbc_view = new GridBagConstraints();
	gbc_view.fill = GridBagConstraints.BOTH;
	gbc_view.insets = new Insets(10, 30, 5, 30);
	gbc_view.gridx = 0;
	gbc_view.gridy = 0;
	resultPanel.add(view, gbc_view);
}
 
开发者ID:fabiogermann,项目名称:zhaw-facepath,代码行数:22,代码来源:GraphView.java

示例4: createId

import org.graphstream.ui.swingViewer.View; //导入依赖的package包/类
private static io.supermonkey.crawler.device.View.Id createId(final String name) {
	return new io.supermonkey.crawler.device.View.Id() {
		@Override
		public String getQualifiedName() {
			return name;
		}

		@Override
		public String getShortName() {
			return name;
		}
	};
}
 
开发者ID:enijkamp,项目名称:supermonkey,代码行数:14,代码来源:TraversalViewer.java

示例5: createView

import org.graphstream.ui.swingViewer.View; //导入依赖的package包/类
private static io.supermonkey.crawler.device.View createView(io.supermonkey.crawler.device.View.Id viewId) {
	Element element = new Element(new HashMap<String, String>(), Element.Type.UNKNOWN, false, false);
	List<io.supermonkey.crawler.hierarchy.Node> childs = Collections.emptyList();
	io.supermonkey.crawler.hierarchy.Node elements = new io.supermonkey.crawler.hierarchy.Node(element, childs);

	return new io.supermonkey.crawler.device.View(viewId, elements);
}
 
开发者ID:enijkamp,项目名称:supermonkey,代码行数:8,代码来源:TraversalViewer.java

示例6: getOrCreateNode

import org.graphstream.ui.swingViewer.View; //导入依赖的package包/类
private Node getOrCreateNode(io.supermonkey.crawler.device.View view) {
	if(graph.getNode(view.getId().getQualifiedName()) != null) {
		return graph.getNode(view.getId().getQualifiedName());
	} else {
		return graph.addNode(view.getId().getQualifiedName());
	}
}
 
开发者ID:enijkamp,项目名称:supermonkey,代码行数:8,代码来源:TraversalViewer.java

示例7: NodeClickListener

import org.graphstream.ui.swingViewer.View; //导入依赖的package包/类
/**
 * Constructor
 * @param vpipe - Viewer Pipe of the graph UI
 * @param vw - View of the current graph in swing
 * @param g - graph object for the current graph in use
 */
public NodeClickListener(ViewerPipe vpipe, View vw, Graph g) {
	this.loop=true;
	this.vpipe = vpipe;
	this.vw = vw;
	this.graph = g;
	// Keep piping back while grph is out to hook mouse clicks
	this.vw.addMouseListener(this);

}
 
开发者ID:TeamCohen,项目名称:VisualGraph,代码行数:16,代码来源:NodeClickListener.java

示例8: addViewScreenshot

import org.graphstream.ui.swingViewer.View; //导入依赖的package包/类
public void addViewScreenshot(io.supermonkey.crawler.device.View view, BufferedImage image) {
	addScreenshotThumbnail(image, view.getId().getShortName());
}
 
开发者ID:enijkamp,项目名称:supermonkey,代码行数:4,代码来源:TraversalViewer.java

示例9: createGraphViewer

import org.graphstream.ui.swingViewer.View; //导入依赖的package包/类
/**
 * Create the graph viewer inside the view.
 *
 * @param graph
 *            The graph to show.
 */
private void createGraphViewer(VPMGraph graph) {

    // setting to enable an improved graph renderer
    // java.lang.System.setProperty("org.graphstream.ui.renderer",
    // "org.graphstream.ui.j2dviewer.J2DGraphRenderer");

    this.vpmGraph = graph;

    setTitleToolTip("Graph: " + graph.getId());

    // create the graph viewer
    CustomEdgeLabelAttributeProxy proxy = new CustomEdgeLabelAttributeProxy(vpmGraph,
            RelationshipEdge.RELATIONSHIP_LABEL);
    Viewer v = new Viewer(proxy);

    SpringBox layout = new SpringBox(false, new Random(0));
    v.enableAutoLayout(layout);
    v.setCloseFramePolicy(CloseFramePolicy.HIDE_ONLY);
    View view = v.addDefaultView(false);
    view.setFocusTraversalKeysEnabled(true);

    Panel panel = new Panel(new BorderLayout()) {

        private static final long serialVersionUID = 1L;

        public void update(java.awt.Graphics g) {
            /* Do not erase the background */
            paint(g);
        }
    };
    JRootPane root = new JRootPane();
    panel.add(root);

    root.getContentPane().add(view);

    frame.add(panel);
    frame.setVisible(true);

    setFocus();
}
 
开发者ID:kopl,项目名称:SPLevo,代码行数:47,代码来源:VPMGraphView.java


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