本文整理汇总了Java中edu.uci.ics.jung.visualization.control.ScalingGraphMousePlugin类的典型用法代码示例。如果您正苦于以下问题:Java ScalingGraphMousePlugin类的具体用法?Java ScalingGraphMousePlugin怎么用?Java ScalingGraphMousePlugin使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ScalingGraphMousePlugin类属于edu.uci.ics.jung.visualization.control包,在下文中一共展示了ScalingGraphMousePlugin类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: configVisualizationViewer
import edu.uci.ics.jung.visualization.control.ScalingGraphMousePlugin; //导入依赖的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()));
}
示例2: setUpView
import edu.uci.ics.jung.visualization.control.ScalingGraphMousePlugin; //导入依赖的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);
}
示例3: configVisualizationViewer
import edu.uci.ics.jung.visualization.control.ScalingGraphMousePlugin; //导入依赖的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()));
}
示例4: loadPlugins
import edu.uci.ics.jung.visualization.control.ScalingGraphMousePlugin; //导入依赖的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);
}
示例5: createPluggableGraphMouse
import edu.uci.ics.jung.visualization.control.ScalingGraphMousePlugin; //导入依赖的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;
}
示例6: MyMouseContext
import edu.uci.ics.jung.visualization.control.ScalingGraphMousePlugin; //导入依赖的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>());
}
示例7: MapperEngine
import edu.uci.ics.jung.visualization.control.ScalingGraphMousePlugin; //导入依赖的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 );
}
示例8: loadPlugins
import edu.uci.ics.jung.visualization.control.ScalingGraphMousePlugin; //导入依赖的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);
}
示例9: loadPlugins
import edu.uci.ics.jung.visualization.control.ScalingGraphMousePlugin; //导入依赖的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);
}
示例10: MyMouseContext
import edu.uci.ics.jung.visualization.control.ScalingGraphMousePlugin; //导入依赖的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>());
}
示例11: loadPlugins
import edu.uci.ics.jung.visualization.control.ScalingGraphMousePlugin; //导入依赖的package包/类
/**
* create the plugins, and load the plugins for TRANSFORMING mode
*
*/
@Override
protected void loadPlugins() {
this.pickingPlugin = new PickingGraphMousePlugin<V,E>();
this.animatedPickingPlugin = new AnimatedPickingGraphMousePlugin<V,E>();
this.translatingPlugin = new TranslatingGraphMousePlugin(InputEvent.BUTTON1_MASK);
this.scalingPlugin = new ScalingGraphMousePlugin(new CrossoverScalingControl(), 0, in, out);
this.rotatingPlugin = new RotatingGraphMousePlugin();
this.shearingPlugin = new ShearingGraphMousePlugin();
add(scalingPlugin);
setMode(Mode.TRANSFORMING);
}
示例12: getScaler
import edu.uci.ics.jung.visualization.control.ScalingGraphMousePlugin; //导入依赖的package包/类
public ScalingGraphMousePlugin getScaler() {
return scaler;
}
示例13: restore
import edu.uci.ics.jung.visualization.control.ScalingGraphMousePlugin; //导入依赖的package包/类
/** Restores parameters which are not recorded in the view/layout transforms, from the supplied XML stream
*
* @param decode XML decoder to use
*/
public void restore(XMLDecoder decoder) {
((ScalingGraphMousePlugin) scalingPlugin).setIn((Float) decoder.readObject());
((ScalingGraphMousePlugin) scalingPlugin).setOut((Float) decoder.readObject());
}
示例14: store
import edu.uci.ics.jung.visualization.control.ScalingGraphMousePlugin; //导入依赖的package包/类
/** Stores parameters which are not recorded in the view/layout transforms, to the supplied XML stream
*
* @param encoder XML encoder to use
*/
public void store(XMLEncoder encoder) {
encoder.writeObject(((ScalingGraphMousePlugin) scalingPlugin).getIn());
encoder.writeObject(((ScalingGraphMousePlugin) scalingPlugin).getOut());
}
示例15: ZoomPanGraphMouse
import edu.uci.ics.jung.visualization.control.ScalingGraphMousePlugin; //导入依赖的package包/类
public ZoomPanGraphMouse(float in, float out) {
translatingPlugin = new TranslatingGraphMousePlugin();
scalingPlugin = new ScalingGraphMousePlugin(new LayoutScalingControl(), 0, in, out);
add(translatingPlugin);
add(scalingPlugin);
}