本文整理汇总了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;
}