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


Java CrossoverScalingControl类代码示例

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


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

示例1: configVisualizationViewer

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

import edu.uci.ics.jung.visualization.control.CrossoverScalingControl; //导入依赖的package包/类
private BufferedImage prepareImage() {

		// Center layout
		NetworkPanel.centerGraph(vv, network, layout, null);
		// NetworkPanel.centerGraph(vv, network, layout, null);

		// Scale to image size
		ScalingControl scaler = new CrossoverScalingControl();
		Point2D center = vv.getCenter();
		float amount = getScaleFactor(dimensions.width, dimensions.height);
		scaler.scale(vv, amount, center);
		vv.repaint();

		System.out.println("Painting");
		BufferedImage img = new BufferedImage(dimensions.width,
				dimensions.height, BufferedImage.TYPE_INT_RGB);

		Graphics2D g = img.createGraphics();
		vv.paint(g);
		g.dispose();

		return img;
	}
 
开发者ID:dev-cuttlefish,项目名称:cuttlefish,代码行数:24,代码来源:JpegExporter.java

示例3: setUpView

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

import edu.uci.ics.jung.visualization.control.CrossoverScalingControl; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public void init() {
	try {
		this.chosenDate = new Date(0L);
		this.entitySourceName = "";
		this.sceneIds = new ArrayList();
		this.involvedTags = new HashSet();
		this.scaler = new CrossoverScalingControl();
		try {
			Internal internal = BookUtil.get(this.mainFrame, SbConstants.BookKey.MEMORIA_BALLOON, Boolean.valueOf(true));
			this.showBalloonLayout = internal.getBooleanValue().booleanValue();
		} catch (Exception exc) {
			this.showBalloonLayout = true;
		}
	} catch (Exception exc2) {
		SbApp.error("MemoriaPanel.init()",exc2);
	}
}
 
开发者ID:markkohdev,项目名称:oStorybook,代码行数:20,代码来源:MemoriaPanel.java

示例5: configVisualizationViewer

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

示例6: loadPlugins

import edu.uci.ics.jung.visualization.control.CrossoverScalingControl; //导入依赖的package包/类
protected void loadPlugins() {
    	pickingPlugin = new HecataeusPickingGraphMousePlugin();
    	animatedPickingPlugin = new AnimatedPickingGraphMousePlugin<VisualNode,VisualEdge>();
    	// add an additional translating plugin 
    	// for middle mouse button that is never removed by other modes 
    	translatingPluginMiddleButton = new TranslatingGraphMousePlugin(InputEvent.BUTTON2_MASK);
    	popupEditingPlugin = new HecataeusPopupGraphMousePlugin();
    	translatingPlugin = new TranslatingGraphMousePlugin(InputEvent.BUTTON1_MASK);
    	scalingPlugin = new ScalingGraphMousePlugin(new CrossoverScalingControl(), 0, in, out);
    	rotatingPlugin = new RotatingGraphMousePlugin();
    	shearingPlugin = new ShearingGraphMousePlugin();
    	add(scalingPlugin);
    	add(translatingPluginMiddleButton);
    	add(popupEditingPlugin);
/** @author pmanousi changed from Mode.TRANSFORMING to Mode.PICKING */
    	setMode(Mode.PICKING);
    }
 
开发者ID:pmanousis,项目名称:Hecataeus,代码行数:18,代码来源:HecataeusModalGraphMouse.java

示例7: autoZoomViewer

import edu.uci.ics.jung.visualization.control.CrossoverScalingControl; //导入依赖的package包/类
public static void autoZoomViewer(VisualizationViewer<?, ?> vv,
		LayerViewer<?, ?> home, Directions direction) {
	if (vv == null || home == null)
		return;

	// reset transforms
	MutableTransformer layoutTrans = vv.getRenderContext()
			.getMultiLayerTransformer()
			.getTransformer(edu.uci.ics.jung.visualization.Layer.LAYOUT);
	layoutTrans.setToIdentity();
	MutableTransformer viewTrans = vv.getRenderContext()
			.getMultiLayerTransformer()
			.getTransformer(edu.uci.ics.jung.visualization.Layer.VIEW);
	viewTrans.setToIdentity();

	Dimension dim = vv.getSize();
	Rectangle2D.Double graphBounds = home.getGraphBoundsCache();

	CrossoverScalingControl scaler = new CrossoverScalingControl();

	// Scale using crossover scaler, so vertices will not grow
	// larger than they are in original
	double factor = Double.POSITIVE_INFINITY;

	if (direction == Directions.HORIZONTAL || direction == Directions.BOTH)
		factor = dim.getWidth() / graphBounds.width;
	if (direction == Directions.VERTICAL || direction == Directions.BOTH
			|| Double.isInfinite(factor))
		factor = Math.min(factor, dim.getHeight() / graphBounds.height);
	scaler.scale(vv, (float) factor, vv.getCenter());

	// Translate center of graph to center of vv.
	Point2D lvc = vv.getRenderContext().getMultiLayerTransformer()
			.inverseTransform(vv.getCenter());
	double dx = (lvc.getX() - graphBounds.getCenterX());
	double dy = (lvc.getY() - graphBounds.getCenterY());
	layoutTrans.translate(dx, dy);
}
 
开发者ID:KeepTheBeats,项目名称:alevin-svn2,代码行数:39,代码来源:LayerViewer.java

示例8: MyMouseContext

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

示例9: loadPlugins

import edu.uci.ics.jung.visualization.control.CrossoverScalingControl; //导入依赖的package包/类
@Override
protected void loadPlugins() {
	super.loadPlugins();
	remove(scalingPlugin);
	scalingPlugin =  new SatelliteScalingGraphMousePlugin(new CrossoverScalingControl(), 0, in, out);
	add(scalingPlugin);
	 
}
 
开发者ID:EnFlexIT,项目名称:AgentWorkbench,代码行数:9,代码来源:SatelliteGraphMouse.java

示例10: MapperEngine

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

示例11: loadPlugins

import edu.uci.ics.jung.visualization.control.CrossoverScalingControl; //导入依赖的package包/类
/**
 * Create and load the plugins to use.
 *
 */
protected void loadPlugins() {
	pickingPlugin = new ExtendedPickingGraphMousePlugin<V, E>();
	pickingPlugin.setRectangleSelectionEnabled(false);
	translatingPlugin = new TranslatingGraphMousePlugin(InputEvent.BUTTON1_MASK);
	scalingPlugin = new ScalingGraphMousePlugin(new CrossoverScalingControl(), 0, in, out);

	add(pickingPlugin);
	add(translatingPlugin);
	add(scalingPlugin);
}
 
开发者ID:rapidminer,项目名称:rapidminer-studio,代码行数:15,代码来源:SingleDefaultGraphMouse.java

示例12: zoomOutMenuItemActionPerformed

import edu.uci.ics.jung.visualization.control.CrossoverScalingControl; //导入依赖的package包/类
private void zoomOutMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_zoomOutMenuItemActionPerformed
     if(newDataModel != null) {   
        PhyloTreeAnalyser activeWindow = (PhyloTreeAnalyser) extendDesk.getSelectedFrame();  
        List<DrawPhyloTreeGraph> list = activeWindow.getDrawedPhyloTreeList();
        final ScalingControl scaler = new CrossoverScalingControl();
        for( DrawPhyloTreeGraph ll: list) {
          ll.getPhyloTreePanel().zoomOut();;
        }
    } else {
         JOptionPane.showMessageDialog(this,
            "You have to import at first PhyloXML- and MetaML-files!",
            "Warning",
            JOptionPane.WARNING_MESSAGE, new javax.swing.ImageIcon(getClass().getResource("/icons/alert_3_32x32.png")));
    }
}
 
开发者ID:modsim,项目名称:vizardous,代码行数:16,代码来源:MainView.java

示例13: loadPlugins

import edu.uci.ics.jung.visualization.control.CrossoverScalingControl; //导入依赖的package包/类
/**
 * create the plugins, and load the plugins for TRANSFORMING mode
 *
 */
@Override
   protected void loadPlugins() {
	pickingPlugin = new PickingGraphMousePlugin<String,String>();
	scalingPlugin = new ScalingGraphMousePlugin(new CrossoverScalingControl(), 0, in, out);
	editingPlugin = new RoleGraphEditingPlugin();
	add(scalingPlugin);
	setMode(Mode.EDITING);
}
 
开发者ID:iig-uni-freiburg,项目名称:SEWOL,代码行数:13,代码来源:RoleGraphMouse.java

示例14: autoZoomViewer

import edu.uci.ics.jung.visualization.control.CrossoverScalingControl; //导入依赖的package包/类
public static void autoZoomViewer(VisualizationViewer<?, ?> vv,
                                  LayerViewer<?, ?> home, Directions direction) {
    if (vv == null || home == null)
        return;

    // reset transforms
    MutableTransformer layoutTrans = vv.getRenderContext()
            .getMultiLayerTransformer()
            .getTransformer(edu.uci.ics.jung.visualization.Layer.LAYOUT);
    layoutTrans.setToIdentity();
    MutableTransformer viewTrans = vv.getRenderContext()
            .getMultiLayerTransformer()
            .getTransformer(edu.uci.ics.jung.visualization.Layer.VIEW);
    viewTrans.setToIdentity();

    Dimension dim = vv.getSize();
    Rectangle2D.Double graphBounds = home.getGraphBoundsCache();

    CrossoverScalingControl scaler = new CrossoverScalingControl();

    // Scale using crossover scaler, so vertices will not grow
    // larger than they are in original
    double factor = Double.POSITIVE_INFINITY;

    if (direction == Directions.HORIZONTAL || direction == Directions.BOTH)
        factor = dim.getWidth() / graphBounds.width;
    if (direction == Directions.VERTICAL || direction == Directions.BOTH
            || Double.isInfinite(factor))
        factor = Math.min(factor, dim.getHeight() / graphBounds.height);
    scaler.scale(vv, (float) factor, vv.getCenter());

    // Translate center of graph to center of vv.
    Point2D lvc = vv.getRenderContext().getMultiLayerTransformer()
            .inverseTransform(vv.getCenter());
    double dx = (lvc.getX() - graphBounds.getCenterX());
    double dy = (lvc.getY() - graphBounds.getCenterY());
    layoutTrans.translate(dx, dy);
}
 
开发者ID:liruixpc11,项目名称:crucian,代码行数:39,代码来源:LayerViewer.java

示例15: MyMouseContext

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


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