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

Java Mode类代码示例

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

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



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

示例1: MouseTransformPickPopupMenuListener

import edu.uci.ics.jung.visualization.control.ModalGraphMouse.Mode; //导入依赖的package包/类
/**
 * Method setPlaysheet. Sets the playsheet that the listener will access.
 *
 * @param ps IPlaySheet
 * @param m
 */
public MouseTransformPickPopupMenuListener( VisualizationViewer ps, Mode m ) {
	super( ( Mode.TRANSFORMING == m ? "Move" : "Pick" ) + " Graph" );

	String desc = ( Mode.TRANSFORMING == m
			? "Move entire graph as a single unit" : "Pick specific nodes" );
	putValue( Action.SHORT_DESCRIPTION, desc );
	this.ps = ps;
	mode = m;
}
 
开发者ID:Ostrich-Emulators,项目名称:semtool,代码行数:16,代码来源:MouseTransformPickPopupMenuListener.java


示例2: actionPerformed

import edu.uci.ics.jung.visualization.control.ModalGraphMouse.Mode; //导入依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {
	
	// changes mouse based on what is selected		
	GraphPlaySheet ps2 = (GraphPlaySheet)ps;
	((ModalGraphMouse)ps2.getView().getGraphMouse()).setMode(Mode.TRANSFORMING);
}
 
开发者ID:SEMOSS,项目名称:semoss,代码行数:8,代码来源:MouseTransformPopupMenuListener.java


示例3: actionPerformed

import edu.uci.ics.jung.visualization.control.ModalGraphMouse.Mode; //导入依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {
	
	// changes mouse based on what is selected		
	GraphPlaySheet ps2 = (GraphPlaySheet)ps;
	((ModalGraphMouse)ps2.getView().getGraphMouse()).setMode(Mode.PICKING);
}
 
开发者ID:SEMOSS,项目名称:semoss,代码行数:8,代码来源:MousePickingPopupMenuListener.java


示例4: JungVisualizationViewer

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


示例5: getListCellRendererComponent

import edu.uci.ics.jung.visualization.control.ModalGraphMouse.Mode; //导入依赖的package包/类
public Component getListCellRendererComponent(JList list,
           Object value,
           int index,
           boolean isSelected,
           boolean cellHasFocus) {

   	if(value.equals(Mode.TRANSFORMING))
   	{
   		setText("Pan");
   	}
   	else if (value.equals(Mode.PICKING))
   	{
   		setText("Grab");
   	}
	
   	
       Color background;
       Color foreground;

       // check if this cell represents the current DnD drop location
       JList.DropLocation dropLocation = list.getDropLocation();
       if (dropLocation != null
               && !dropLocation.isInsert()
               && dropLocation.getIndex() == index) {

           background = Color.BLUE;
           foreground = Color.WHITE;

       // check if this cell is selected
       } else if (isSelected) {
           background = Color.RED;
           foreground = Color.WHITE;

       // unselected, and not the DnD drop location
       } else {
           background = Color.WHITE;
           foreground = Color.BLACK;
       };

       setBackground(background);
       setForeground(foreground);

	
	return this;
}
 
开发者ID:ltrr-arizona-edu,项目名称:tellervo,代码行数:46,代码来源:JUNGModeRenderer.java


示例6: addTransformingModeOptions

import edu.uci.ics.jung.visualization.control.ModalGraphMouse.Mode; //导入依赖的package包/类
private HBox addTransformingModeOptions() {
  	HBox hBox = new HBox();
  	
  	hBox.setPadding(new Insets(15, 12, 15, 12));
  	hBox.setSpacing(10);
  	hBox.setStyle("-fx-background-color: #66FFFF;");
  	
  	final ToggleGroup optionGroup = new ToggleGroup();
  	
  	Label lblMouseMode = new Label("Mouse Mode: ");
  	lblMouseMode.setPrefSize(100,  20);
  	
  	RadioButton rbTransform = new RadioButton("Pan & Zoom");
  	rbTransform.setPrefSize(100, 20);
  	rbTransform.setToggleGroup(optionGroup);
  	rbTransform.setUserData("T");
  	rbTransform.setSelected(true);
  	
  	RadioButton rbPick = new RadioButton("Picking");
  	rbPick.setPrefSize(100, 20);
  	rbPick.setUserData("P");
  	rbPick.setToggleGroup(optionGroup);
  	
  	
  	
  	optionGroup.selectedToggleProperty().addListener(new ChangeListener<Toggle>() {

	@Override
	public void changed(ObservableValue<? extends Toggle> observable,
			Toggle oldValue, Toggle newValue) {
		if (optionGroup.getSelectedToggle() != null){
			DefaultModalGraphMouse dmg = (DefaultModalGraphMouse) vv.getGraphMouse();
			
			if (optionGroup.getSelectedToggle().getUserData().equals("T")){
				dmg.setMode(Mode.TRANSFORMING);
			} else 	if (optionGroup.getSelectedToggle().getUserData().equals("P")){
				dmg.setMode(Mode.PICKING);
			}
		}
		
	}
});
  	
  	
  	
  	hBox.getChildren().addAll(lblMouseMode, rbTransform, rbPick);
  	
  	return hBox;

  }
 
开发者ID:gems-uff,项目名称:dominoes,代码行数:51,代码来源:GraphPane.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java ErrorMessageDialog类代码示例发布时间:2022-05-22
下一篇:
Java DataHolder类代码示例发布时间: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