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


Java PluggableGraphMouse类代码示例

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


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

示例1: configVisualizationViewer

import edu.uci.ics.jung.visualization.control.PluggableGraphMouse; //导入依赖的package包/类
@Override
public void configVisualizationViewer(final LayerViewer<V, E> vv) {
	PluggableGraphMouse mouse = new PluggableGraphMouse();
	mouse.add(new ScalingGraphMousePlugin(
			new CrossoverScalingControl(), Event.CTRL_MASK, 1 / 1.1f,
			1.1f));
	mouse.add(new PickingGraphMousePlugin<V, E>());
	mouse.add(new MyEditingPopupGraphMousePlugin<T, V, E, N>(vv, scenario));
	vv.setGraphMouse(mouse);

	vv.getRenderContext().setVertexFillPaintTransformer(
			new NodeFillPaintTransformer<V>(vv.getPickedVertexState()));
	vv.setVertexToolTipTransformer(nodeTTT);
	vv.getRenderContext().setVertexLabelTransformer(nodeLT);
	vv.getRenderer().getVertexLabelRenderer()
			.setPosition(Position.AUTO);

	vv.setEdgeToolTipTransformer(linkTTT);
	vv.getRenderContext().setEdgeLabelTransformer(linkLT);
	vv.getRenderContext().getEdgeLabelRenderer()
			.setRotateEdgeLabels(true);
	vv.getRenderContext().setEdgeDrawPaintTransformer(
			new LinkDrawPaintTransformer<E>(vv.getPickedEdgeState()));
}
 
开发者ID:KeepTheBeats,项目名称:alevin-svn2,代码行数:25,代码来源:MyGraphPanel.java

示例2: getPanel

import edu.uci.ics.jung.visualization.control.PluggableGraphMouse; //导入依赖的package包/类
public static GraphVisualizationPanel<MarkovVertex, MarkovEdge> getPanel(
        Graph<MarkovVertex, MarkovEdge> test_graph) {
    GraphVisualizationPanel<MarkovVertex, MarkovEdge> graph_panel = GraphVisualizationPanel
            .factory(test_graph);
    Transformer<MarkovVertex, Paint> transformer = new VertexTransformer<MarkovVertex, Paint>();
    graph_panel.getRenderContext().setVertexFillPaintTransformer(
            transformer);
    graph_panel.getRenderContext().setEdgeLabelTransformer(
            new ToStringLabeller<MarkovEdge>());
    PluggableGraphMouse gm = new PluggableGraphMouse();
    gm.add(new PopupMousePlugin<MarkovVertex, MarkovEdge>());
    gm.add(new TranslatingGraphMousePlugin(MouseEvent.BUTTON1_MASK));
    graph_panel.setGraphMouse(gm);
    Transformer<MarkovVertex, String> labelTransform = new VertexLabelTransformer<MarkovVertex, String>();
    graph_panel.getRenderContext()
            .setVertexLabelTransformer(labelTransform);
    return graph_panel;
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:19,代码来源:MarkovViewer.java

示例3: setUpView

import edu.uci.ics.jung.visualization.control.PluggableGraphMouse; //导入依赖的package包/类
private void setUpView(Graph graph)
    {                 
//        layout = new SpringLayout2(graph);
        layout = new KKLayout(graph);
        //layout.setSize(new Dimension(700,700));
        vv = new VisualizationViewer(layout);
        vv.setPreferredSize(new Dimension(900,900));
        vv.setBackground( Color.white );
        // Tell the renderer to use our own customized label rendering
        vv.getRenderContext().setVertexLabelTransformer(new ToStringLabeller());
        vv.getRenderContext().setEdgeLabelTransformer(new ToStringLabeller());
        vv.getRenderer().getVertexLabelRenderer().setPosition(Position.CNTR);
        getContentPane().add(new GraphZoomScrollPane(vv), BorderLayout.CENTER);

        /*Mouse controller plugins*/
        PluggableGraphMouse gm = new PluggableGraphMouse();
        gm.add(new TranslatingGraphMousePlugin(MouseEvent.BUTTON3_MASK));
        gm.add(new ScalingGraphMousePlugin(new CrossoverScalingControl(), 0, 1.1f, 0.9f));
        gm.add(new PickingGraphMousePlugin());
        vv.setGraphMouse(gm);
    }
 
开发者ID:sinantie,项目名称:Generator,代码行数:22,代码来源:VisualiseHypergraph.java

示例4: configVisualizationViewer

import edu.uci.ics.jung.visualization.control.PluggableGraphMouse; //导入依赖的package包/类
@Override
public void configVisualizationViewer(final LayerViewer<V, E> vv) {
    PluggableGraphMouse mouse = new PluggableGraphMouse();
    mouse.add(new ScalingGraphMousePlugin(
            new CrossoverScalingControl(), Event.CTRL_MASK, 1 / 1.1f,
            1.1f));
    mouse.add(new PickingGraphMousePlugin<V, E>());
    mouse.add(new MyEditingPopupGraphMousePlugin<T, V, E, N>(vv));
    vv.setGraphMouse(mouse);

    vv.getRenderContext().setVertexFillPaintTransformer(
            new NodeFillPaintTransformer<V>(vv.getPickedVertexState()));
    vv.setVertexToolTipTransformer(nodeTTT);
    vv.getRenderContext().setVertexLabelTransformer(nodeLT);
    vv.getRenderer().getVertexLabelRenderer()
            .setPosition(Position.AUTO);

    vv.setEdgeToolTipTransformer(linkTTT);
    vv.getRenderContext().setEdgeLabelTransformer(linkLT);
    vv.getRenderContext().getEdgeLabelRenderer().setRotateEdgeLabels(
            true);
    vv.getRenderContext().setEdgeDrawPaintTransformer(
            new LinkDrawPaintTransformer<E>(vv.getPickedEdgeState()));
}
 
开发者ID:liruixpc11,项目名称:crucian,代码行数:25,代码来源:MyGraphPanel.java

示例5: createPluggableGraphMouse

import edu.uci.ics.jung.visualization.control.PluggableGraphMouse; //导入依赖的package包/类
protected PluggableGraphMouse createPluggableGraphMouse(RenderContext<NubiSaveVertex,NubiSaveEdge> rc,
                Factory<AbstractNubisaveComponent> vertexFactory, Factory<? extends NubiSaveEdge> edgeFactory, DataVertexEdgeFactory dataVertexEdgeFactory) {
    PluggableGraphMouse graphMouse = new PluggableGraphMouse();
    VertexPicker<NubiSaveVertex, NubiSaveEdge> pickingPlugin = new VertexPicker<NubiSaveVertex, NubiSaveEdge>();
    TranslatingGraphMousePlugin translatingPlugin = new TranslatingGraphMousePlugin(InputEvent.BUTTON1_MASK);
    ScalingGraphMousePlugin scalingPlugin = new ScalingGraphMousePlugin(new ViewScalingControl(), 0, 1.1f, 1/1.1f);
    PopupEditor popupEditingPlugin = new PopupEditor(edgeFactory);
    StorageServicePicker<NubiSaveVertex, NubiSaveEdge> storageServicePickingPlugin = new StorageServicePicker<NubiSaveVertex, NubiSaveEdge>();

    ExtensibleNubisaveComponentMousePlugin extendablePlugin = new ExtensibleNubisaveComponentMousePlugin(vertexFactory, edgeFactory);
    extendablePlugin.addEventListener(new AbstractNubiSaveComponentCreator(vv, graph, vertexFactory));
    extendablePlugin.addEventListener(new ToggleActivateNubisaveComponentOnDoubleClick(vv, graph));
    extendablePlugin.addEventListener(new PreventEdgeCreationForRestrictedPorts(vv, graph));
    extendablePlugin.addEventListener(new DataVertexEdgeCreator(vv, graph, dataVertexEdgeFactory));
    extendablePlugin.addEventListener(new AbstractNubisaveComponentEdgeCreator(vv, graph, (WeightedNubisaveVertexEdgeFactory) edgeFactory));

    graphMouse.add(scalingPlugin);
    graphMouse.add(extendablePlugin);
    graphMouse.add(storageServicePickingPlugin);
    graphMouse.add(translatingPlugin);
    graphMouse.add(popupEditingPlugin);
    return graphMouse;
}
 
开发者ID:joe42,项目名称:nubisave,代码行数:24,代码来源:NubisaveEditor.java

示例6: MyMouseContext

import edu.uci.ics.jung.visualization.control.PluggableGraphMouse; //导入依赖的package包/类
public MyMouseContext(GraphPanel<MyL, LayerViewer<MyV, MyE>> owner) {
	super(owner);
	mouse = new PluggableGraphMouse();
	mouse.add(new ScalingGraphMousePlugin(
			new CrossoverScalingControl(), Event.CTRL_MASK, 1 / 1.1f,
			1.1f));
	mouse.add(new PickingGraphMousePlugin<MyV, MyE>());
}
 
开发者ID:KeepTheBeats,项目名称:alevin-svn2,代码行数:9,代码来源:SampleGraphPanel.java

示例7: MapperEngine

import edu.uci.ics.jung.visualization.control.PluggableGraphMouse; //导入依赖的package包/类
public MapperEngine() {
    graph = new SparseMultigraph<Room, Exit>();
    mapperLayout = new MapperLayout( graph );
    mapperLayout.setSize( new Dimension( 500, 500 ) ); //????
    vv = new VisualizationViewer<Room, Exit>( mapperLayout );
    pickedState = vv.getPickedVertexState();
    pickedState.addItemListener( this );
    vv.setPreferredSize( new Dimension( 500, 500 ) ); //????
    RenderContext<Room, Exit> rc = vv.getRenderContext();

    rc.setEdgeLabelTransformer( new ToStringLabeller<Exit>() );
    rc.setEdgeLabelRenderer( new ExitLabelRenderer() );
    rc.setEdgeShapeTransformer( new EdgeShape.QuadCurve<Room, Exit>() );
    rc.setEdgeShapeTransformer( new EdgeShape.Wedge<Room, Exit>( 30 ) );
    rc.setEdgeFillPaintTransformer( new ExitPaintTransformer( vv ) );

    rc.setVertexShapeTransformer( new RoomShape( graph ) );
    rc.setVertexIconTransformer( new RoomIconTransformer() );

    vv.getRenderContext().setLabelOffset( 5 );

    PluggableGraphMouse pgm = new PluggableGraphMouse();
    pgm.add( new MapperPickingGraphMousePlugin<Room, Exit>( MouseEvent.BUTTON1_MASK, MouseEvent.BUTTON3_MASK ) );
    pgm.add( new TranslatingGraphMousePlugin( MouseEvent.BUTTON1_MASK ) );
    scaler = new ScalingGraphMousePlugin( new CrossoverScalingControl(), 0, 1 / 1.1f, 1.1f );
    pgm.add( scaler );
    mousePlugin = new MapperEditingGraphMousePlugin( this );
    pgm.add( mousePlugin );
    vv.setGraphMouse( pgm );
    panel = new MapperPanel( this );
}
 
开发者ID:lauriholmas,项目名称:batmapper,代码行数:32,代码来源:MapperEngine.java

示例8: MyMouseContext

import edu.uci.ics.jung.visualization.control.PluggableGraphMouse; //导入依赖的package包/类
public MyMouseContext(GraphPanel<MyL, LayerViewer<MyV, MyE>> owner) {
    super(owner);
    mouse = new PluggableGraphMouse();
    mouse.add(new ScalingGraphMousePlugin(
            new CrossoverScalingControl(), Event.CTRL_MASK, 1 / 1.1f,
            1.1f));
    mouse.add(new PickingGraphMousePlugin<MyV, MyE>());
}
 
开发者ID:liruixpc11,项目名称:crucian,代码行数:9,代码来源:SampleGraphPanel.java

示例9: setupGraph

import edu.uci.ics.jung.visualization.control.PluggableGraphMouse; //导入依赖的package包/类
public static void setupGraph(DirectedSparseGraph g){
	
	bg = g;
	
	Layout<BooleanNode, TravelEdge> layout = new DAGLayout(bg);
       layout.setSize(new Dimension(300,300)); // sets the initial size of the layout space

       VisualizationViewer<BooleanNode,TravelEdge> vv = new VisualizationViewer<BooleanNode,TravelEdge>(layout);
       vv.setPreferredSize(new Dimension(500,500)); //Sets the viewing area size

       Transformer<BooleanNode,Paint> vertexPaint = new Transformer<BooleanNode,Paint>() {
       	public Paint transform(BooleanNode i) {
       		if (i.isCurrentNode()){
       			return Color.RED;
       		} else if (i.getObserved()){
       			return Color.BLUE;
       		} else if (i.isStartNode()) {
       			return Color.GREEN;
       		} else if (i.isEndNode()){
       			return Color.BLACK;
       		} else {
       			return Color.WHITE;
       		}
       	}
       	}; 
       	
       vv.getRenderContext().setVertexFillPaintTransformer(vertexPaint);
       vv.getRenderContext().setVertexLabelTransformer(new ToStringLabeller());
	
       PluggableGraphMouse gm = new PluggableGraphMouse();
       gm.add(new NetworkGameMousePlugin());
       
       vv.setGraphMouse(gm); 
       
       frame = new JFrame("Simple Graph View");
       frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
       frame.getContentPane().add(vv); 
       
       JMenuBar menuBar = new JMenuBar();
       
       JMenu restartMenu = new JMenu();
       restartMenu.setText("Restart");
       menuBar.add(restartMenu);
       JMenuItem restartItem = new JMenuItem("Restart level");
       
       restartItem.addActionListener(new ActionListener() {
           public void actionPerformed(ActionEvent evt) {
               restartLevel();
           }
       });
       
       restartMenu.add(restartItem);
       
       
       
       frame.setJMenuBar(menuBar);
       
       
       frame.pack();
       frame.setVisible(true);  

       
       
}
 
开发者ID:ksotala,项目名称:BayesGame,代码行数:65,代码来源:SeparationGame.java

示例10: InteractingVerb

import edu.uci.ics.jung.visualization.control.PluggableGraphMouse; //导入依赖的package包/类
public InteractingVerb(Controller controller, returnCall returnType, int button) {
	super(controller, returnType);
	pgm = new PluggableGraphMouse();
	pgm.add(new InteractingMousePlugin(this, button));
}
 
开发者ID:ksotala,项目名称:BayesGame,代码行数:6,代码来源:InteractingVerb.java

示例11: getPGM

import edu.uci.ics.jung.visualization.control.PluggableGraphMouse; //导入依赖的package包/类
@Override
public PluggableGraphMouse getPGM() {
	return pgm;
}
 
开发者ID:ksotala,项目名称:BayesGame,代码行数:5,代码来源:InteractingVerb.java

示例12: AssumeVerb

import edu.uci.ics.jung.visualization.control.PluggableGraphMouse; //导入依赖的package包/类
public AssumeVerb(Controller controller, returnCall returnType) {
	super(controller, returnType);
	pgm = new PluggableGraphMouse();
	pgm.add(new AssumingMousePlugin(this, MouseEvent.BUTTON1));
}
 
开发者ID:ksotala,项目名称:BayesGame,代码行数:6,代码来源:AssumeVerb.java

示例13: TutorialVerb

import edu.uci.ics.jung.visualization.control.PluggableGraphMouse; //导入依赖的package包/类
public TutorialVerb(Controller controller, returnCall returnType) {
	super(controller, returnType);
	pgm = new PluggableGraphMouse();
	pgm.add(new TutorialMousePlugin(this, "Opin"));
}
 
开发者ID:ksotala,项目名称:BayesGame,代码行数:6,代码来源:TutorialVerb.java

示例14: addGraphMouse

import edu.uci.ics.jung.visualization.control.PluggableGraphMouse; //导入依赖的package包/类
private void addGraphMouse(PluggableGraphMouse gm){
	vv.addMouseListener(gm);
}
 
开发者ID:ksotala,项目名称:BayesGame,代码行数:4,代码来源:TutorialInterfaceView.java

示例15: getPGM

import edu.uci.ics.jung.visualization.control.PluggableGraphMouse; //导入依赖的package包/类
public abstract PluggableGraphMouse getPGM(); 
开发者ID:ksotala,项目名称:BayesGame,代码行数:2,代码来源:Verb.java


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