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


Java DataShapeAction类代码示例

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


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

示例1: createVisualizationV2

import prefuse.action.assignment.DataShapeAction; //导入依赖的package包/类
/**
 * Phase 2 from the example http://www.ifs.tuwien.ac.at/~rind/w/doku.php/java/prefuse-scatterplot without tooltip control
 * 
 * @param data
 * @return
 */

private View createVisualizationV2(Table data)
{
	final Visualization vis = new Visualization();
	PDisplay display = new PDisplay(this, vis);

	// STEP 1: setup the visualized data

	vis.add("data", data);

	/* STEP 2: set up renderers for the visual data */

	vis.setRendererFactory(new DefaultRendererFactory(new ShapeRenderer(12)));

	// STEP 3: create actions to process the visual data

	AxisLayout x_axis = new AxisLayout("data", "NBZ", Constants.X_AXIS, VisiblePredicate.TRUE);

	AxisLayout y_axis = new AxisLayout("data", "BMI", Constants.Y_AXIS, VisiblePredicate.TRUE);

	ColorAction color = new ColorAction("data", VisualItem.STROKECOLOR, ColorLib.rgb(100, 100, 255));

	int[] palette =
	{ Constants.SHAPE_STAR, Constants.SHAPE_ELLIPSE };
	DataShapeAction shape = new DataShapeAction("data", "Insult", palette);

	ActionList draw = new ActionList();
	draw.add(x_axis);
	draw.add(y_axis);
	draw.add(color);
	draw.add(shape);
	draw.add(new RepaintAction());
	vis.putAction("draw", draw);

	// --------------------------------------------------------------------
	// STEP 4: set up a display and controls
	display.setHighQuality(true);
	display.setSize(700, 450);

	// display.setBorder(BorderFactory.createEmptyBorder(15, 30, 15, 30));
	// // TODO for Dritan: setBorder method was in JComponent. See if there
	// is a similar method in Android.View
	display.setBorders(15, 30, 15, 30);

	// STEP 5: launching the visualization. The visualization must run after
	// the Display is ready (Android View)
	// TODO for Dritan: using dispay.post seems to be not a good solution.
	// Fix this before releasing the final solution
	display.post(new Runnable()
	{
		@Override
		public void run()
		{
			vis.run("draw");
		}
	});

	return display;
}
 
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:66,代码来源:MainActivityOld.java


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