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

Java DataColorAction类代码示例

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

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



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

示例1: AggregateDemo

import prefuse.action.assignment.DataColorAction; //导入依赖的package包/类
public AggregateDemo() {
    // initialize display and data
    super(new Visualization());
    //initDataGroups();
    
    // set up the renderers
    // draw the nodes as basic shapes
    LabelRenderer nodeR = new LabelRenderer();
    nodeR.setImageField("image");
    nodeR.setTextField(null);
    
    // draw aggregates as polygons with curved edges
    Renderer polyR = new PolygonRenderer(Constants.POLY_TYPE_CURVE);
    ((PolygonRenderer)polyR).setCurveSlack(0.15f);
    
    DefaultRendererFactory drf = new DefaultRendererFactory();
    drf.setDefaultRenderer(nodeR);
    drf.add("ingroup('aggregates')", polyR);
    m_vis.setRendererFactory(drf);
    
    // set up the visual operators
    // first set up all the color actions
    ColorAction nStroke = new ColorAction(NODES, VisualItem.STROKECOLOR);
    nStroke.setDefaultColor(ColorLib.gray(100));
    nStroke.add("_hover", ColorLib.gray(50));
    
    ColorAction nFill = new ColorAction(NODES, VisualItem.FILLCOLOR);
    nFill.setDefaultColor(ColorLib.gray(255));
    nFill.add("_hover", ColorLib.gray(200));
    
    ColorAction nEdges = new ColorAction(EDGES, VisualItem.STROKECOLOR);
    nEdges.setDefaultColor(ColorLib.gray(100));
    
    ColorAction aStroke = new ColorAction(AGGR, VisualItem.STROKECOLOR);
    aStroke.setDefaultColor(ColorLib.gray(200));
    aStroke.add("_hover", ColorLib.rgb(255,100,100));
    
    int[] palette = new int[] {
        ColorLib.rgba(255,200,200,150),
        ColorLib.rgba(200,255,200,150),
        ColorLib.rgba(200,200,255,150)
    };
    ColorAction aFill = new DataColorAction(AGGR, "id",
            Constants.NOMINAL, VisualItem.FILLCOLOR, palette);
    
    // bundle the color actions
    ActionList colors = new ActionList();
    colors.add(nStroke);
    colors.add(nFill);
    colors.add(nEdges);
    colors.add(aStroke);
    colors.add(aFill);
    
    // now create the main layout routine
    ActionList layout = new ActionList(Activity.INFINITY);
    layout.add(colors);
    layout.add(new MyForcedDirectedLayout(GRAPH));
    layout.add(new AggregateLayout(AGGR));
    layout.add(new RepaintAction());
    m_vis.putAction("layout", layout);
    
    // set up the display
    setSize(500,500);
    pan(250, 250);
    setHighQuality(false);
    addControlListener(new AggregateDragControl());
    addControlListener(new ZoomControl());
    addControlListener(new PanControl());
    
    // set things running
    //m_vis.run("layout");
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:73,代码来源:AggregateDemo.java


示例2: AggregateDemo

import prefuse.action.assignment.DataColorAction; //导入依赖的package包/类
public AggregateDemo() {
    // initialize display and data
    super(new Visualization());
    initDataGroups();
    
    // set up the renderers
    // draw the nodes as basic shapes
    Renderer nodeR = new ShapeRenderer(20);
    // draw aggregates as polygons with curved edges
    Renderer polyR = new PolygonRenderer(Constants.POLY_TYPE_CURVE);
    ((PolygonRenderer)polyR).setCurveSlack(0.15f);
    
    DefaultRendererFactory drf = new DefaultRendererFactory();
    drf.setDefaultRenderer(nodeR);
    drf.add("ingroup('aggregates')", polyR);
    m_vis.setRendererFactory(drf);
    
    // set up the visual operators
    // first set up all the color actions
    ColorAction nStroke = new ColorAction(NODES, VisualItem.STROKECOLOR);
    nStroke.setDefaultColor(ColorLib.gray(100));
    nStroke.add("_hover", ColorLib.gray(50));
    
    ColorAction nFill = new ColorAction(NODES, VisualItem.FILLCOLOR);
    nFill.setDefaultColor(ColorLib.gray(255));
    nFill.add("_hover", ColorLib.gray(200));
    
    ColorAction nEdges = new ColorAction(EDGES, VisualItem.STROKECOLOR);
    nEdges.setDefaultColor(ColorLib.gray(100));
    
    ColorAction aStroke = new ColorAction(AGGR, VisualItem.STROKECOLOR);
    aStroke.setDefaultColor(ColorLib.gray(200));
    aStroke.add("_hover", ColorLib.rgb(255,100,100));
    
    int[] palette = new int[] {
        ColorLib.rgba(255,200,200,150),
        ColorLib.rgba(200,255,200,150),
        ColorLib.rgba(200,200,255,150)
    };
    ColorAction aFill = new DataColorAction(AGGR, "id",
            Constants.NOMINAL, VisualItem.FILLCOLOR, palette);
    
    // bundle the color actions
    ActionList colors = new ActionList();
    colors.add(nStroke);
    colors.add(nFill);
    colors.add(nEdges);
    colors.add(aStroke);
    colors.add(aFill);
    
    // now create the main layout routine
    ActionList layout = new ActionList(Activity.INFINITY);
    layout.add(colors);
    layout.add(new ForceDirectedLayout(GRAPH, true));
    layout.add(new AggregateLayout(AGGR));
    layout.add(new RepaintAction());
    m_vis.putAction("layout", layout);
    
    // set up the display
    setSize(500,500);
    pan(250, 250);
    setHighQuality(true);
    addControlListener(new AggregateDragControl());
    addControlListener(new ZoomControl());
    addControlListener(new PanControl());
    
    // set things running
    m_vis.run("layout");
}
 
开发者ID:codydunne,项目名称:netgrok,代码行数:70,代码来源:AggregateDemo.java


示例3: CodyTestWindow

import prefuse.action.assignment.DataColorAction; //导入依赖的package包/类
public CodyTestWindow() {
	// initialize display and data
	super(new Visualization());
	initDataGroups();

	// set up the renderers
	// draw the nodes as basic shapes
	Renderer nodeR = new ShapeRenderer(20);
	// draw aggregates as polygons with curved edges
	Renderer polyR = new PolygonRenderer(Constants.POLY_TYPE_CURVE);
	((PolygonRenderer)polyR).setCurveSlack(0.15f);

	DefaultRendererFactory drf = new DefaultRendererFactory();
	drf.setDefaultRenderer(nodeR);
	drf.add("ingroup('aggregates')", polyR);
	m_vis.setRendererFactory(drf);

	// set up the visual operators
	// first set up all the color actions
	ColorAction nStroke = new ColorAction(NODES, VisualItem.STROKECOLOR);
	nStroke.setDefaultColor(ColorLib.gray(100));
	nStroke.add("_hover", ColorLib.gray(50));

	ColorAction nFill = new ColorAction(NODES, VisualItem.FILLCOLOR);
	nFill.setDefaultColor(ColorLib.gray(255));
	nFill.add("_hover", ColorLib.gray(200));

	ColorAction nEdges = new ColorAction(EDGES, VisualItem.STROKECOLOR);
	nEdges.setDefaultColor(ColorLib.gray(100));

	ColorAction aStroke = new ColorAction(AGGR, VisualItem.STROKECOLOR);
	aStroke.setDefaultColor(ColorLib.gray(200));
	aStroke.add("_hover", ColorLib.rgb(255,100,100));

	int[] palette = new int[] {
			ColorLib.rgba(255,200,200,150),
			ColorLib.rgba(200,255,200,150),
			ColorLib.rgba(200,200,255,150)
	};
	ColorAction aFill = new DataColorAction(AGGR, "id",
			Constants.NOMINAL, VisualItem.FILLCOLOR, palette);

	// bundle the color actions
	ActionList colors = new ActionList();
	colors.add(nStroke);
	colors.add(nFill);
	colors.add(nEdges);
	colors.add(aStroke);
	colors.add(aFill);

	// now create the main layout routine
	ActionList layout = new ActionList(Activity.INFINITY);
	layout.add(colors);
	layout.add(new ForceDirectedLayout(GRAPH, true));
	layout.add(new AggregateLayout(AGGR));
	layout.add(new RepaintAction());
	m_vis.putAction("layout", layout);

	// set up the display
	setSize(500,500);
	pan(250, 250);
	setHighQuality(true);
	addControlListener(new AggregateDragControl());
	addControlListener(new ZoomControl());
	addControlListener(new PanControl());

	// set things running
	m_vis.run("layout");
}
 
开发者ID:codydunne,项目名称:netgrok,代码行数:70,代码来源:CodyTestWindow.java


示例4: AggregateDecoratorDemo

import prefuse.action.assignment.DataColorAction; //导入依赖的package包/类
public AggregateDecoratorDemo() {
    // initialize display and data
    super(new Visualization());
    initDataGroups();
    // set up the renderers
    // draw the nodes as basic shapes
    Renderer nodeR = new ShapeRenderer(20);
    // draw aggregates as polygons with curved edges
    Renderer polyR = new PolygonRenderer(Constants.POLY_TYPE_CURVE);
    ((PolygonRenderer)polyR).setCurveSlack(0.15f);
    DefaultRendererFactory drf = new DefaultRendererFactory();
    drf.setDefaultRenderer(nodeR);
    drf.add("ingroup('aggregates')", polyR);
    drf.add(new InGroupPredicate(EDGE_DECORATORS), new LabelRenderer(VisualItem.LABEL));
    drf.add(new InGroupPredicate(NODE_DECORATORS), new LabelRenderer(VisualItem.LABEL));
    drf.add(new InGroupPredicate(AGGR_DECORATORS), new LabelRenderer("id"));
    m_vis.setRendererFactory(drf);
    // adding decorators, one group for the nodes, one for the edges and one
    // for the aggregates
    DECORATOR_SCHEMA.setDefault(VisualItem.TEXTCOLOR, ColorLib.gray(0));
    m_vis.addDecorators(EDGE_DECORATORS, EDGES, DECORATOR_SCHEMA);
    DECORATOR_SCHEMA.setDefault(VisualItem.TEXTCOLOR, ColorLib.gray(128));
    m_vis.addDecorators(NODE_DECORATORS, NODES, DECORATOR_SCHEMA);
    // the HoverPredicate makes this group of decorators to appear only on mouseOver
    DECORATOR_SCHEMA.setDefault(VisualItem.TEXTCOLOR, ColorLib.gray(255, 128));
    DECORATOR_SCHEMA.setDefault(VisualItem.FONT, FontLib.getFont("Tahoma", Font.BOLD, 48));
    m_vis.addDecorators(AGGR_DECORATORS, AGGR, new HoverPredicate(), DECORATOR_SCHEMA);
    // set up the visual operators
    // first set up all the color actions
    ColorAction nStroke = new ColorAction(NODES, VisualItem.STROKECOLOR);
    nStroke.setDefaultColor(ColorLib.gray(100));
    nStroke.add("_hover", ColorLib.gray(50));
    ColorAction nFill = new ColorAction(NODES, VisualItem.FILLCOLOR);
    nFill.setDefaultColor(ColorLib.gray(255));
    nFill.add("_hover", ColorLib.gray(200));
    ColorAction nEdges = new ColorAction(EDGES, VisualItem.STROKECOLOR);
    nEdges.setDefaultColor(ColorLib.gray(100));
    ColorAction aStroke = new ColorAction(AGGR, VisualItem.STROKECOLOR);
    aStroke.setDefaultColor(ColorLib.gray(200));
    aStroke.add("_hover", ColorLib.rgb(255,100,100));
    int[] palette = new int[] {
        ColorLib.rgba(255,200,200,150),
        ColorLib.rgba(200,255,200,150),
        ColorLib.rgba(200,200,255,150)
    };
    ColorAction aFill = new DataColorAction(AGGR, "id",
            Constants.NOMINAL, VisualItem.FILLCOLOR, palette);
    // bundle the color actions
    ActionList colors = new ActionList();
    colors.add(nStroke);
    colors.add(nFill);
    colors.add(nEdges);
    colors.add(aStroke);
    colors.add(aFill);
    // now create the main layout routine
    ActionList layout = new ActionList(Activity.INFINITY);
    layout.add(colors);
    layout.add(new ForceDirectedLayout(GRAPH, true));
    layout.add(new AggregateLayout2(AGGR));
    layout.add(new LabelLayout2(EDGE_DECORATORS));
    layout.add(new LabelLayout2(NODE_DECORATORS));
    layout.add(new LabelLayout2(AGGR_DECORATORS));
    layout.add(new RepaintAction());
    m_vis.putAction("layout", layout);
    // set up the display
    setSize(500,500);
    pan(250, 250);
    setHighQuality(true);
    addControlListener(new AggregateDragControl2());
    addControlListener(new ZoomControl());
    addControlListener(new PanControl());
    // set things running
    m_vis.run("layout");
}
 
开发者ID:codydunne,项目名称:netgrok,代码行数:75,代码来源:AggregateDecoratorDemo.java


示例5: AggregateDecoratorDemo

import prefuse.action.assignment.DataColorAction; //导入依赖的package包/类
public AggregateDecoratorDemo() {
    // initialize display and data
    super(new Visualization());
    initDataGroups();
    // set up the renderers
    // draw the nodes as basic shapes
    Renderer nodeR = new ShapeRenderer(20);
    // draw aggregates as polygons with curved edges
    Renderer polyR = new PolygonRenderer(Constants.POLY_TYPE_CURVE);
    ((PolygonRenderer)polyR).setCurveSlack(0.15f);
    DefaultRendererFactory drf = new DefaultRendererFactory();
    drf.setDefaultRenderer(nodeR);
    drf.add("ingroup('aggregates')", polyR);
    drf.add(new InGroupPredicate(EDGE_DECORATORS), new LabelRenderer(VisualItem.LABEL));
    drf.add(new InGroupPredicate(NODE_DECORATORS), new LabelRenderer(VisualItem.LABEL));
    drf.add(new InGroupPredicate(AGGR_DECORATORS), new LabelRenderer("id"));
    m_vis.setRendererFactory(drf);
    // adding decorators, one group for the nodes, one for the edges and one
    // for the aggregates
    DECORATOR_SCHEMA.setDefault(VisualItem.TEXTCOLOR, ColorLib.gray(0));
    m_vis.addDecorators(EDGE_DECORATORS, EDGES, DECORATOR_SCHEMA);
    DECORATOR_SCHEMA.setDefault(VisualItem.TEXTCOLOR, ColorLib.gray(128));
    m_vis.addDecorators(NODE_DECORATORS, NODES, DECORATOR_SCHEMA);
    // the HoverPredicate makes this group of decorators to appear only on mouseOver
    DECORATOR_SCHEMA.setDefault(VisualItem.TEXTCOLOR, ColorLib.gray(255, 128));
    DECORATOR_SCHEMA.setDefault(VisualItem.FONT, FontLib.getFont("Tahoma", Font.BOLD, 48));
    m_vis.addDecorators(AGGR_DECORATORS, AGGR, new HoverPredicate(), DECORATOR_SCHEMA);
    // set up the visual operators
    // first set up all the color actions
    ColorAction nStroke = new ColorAction(NODES, VisualItem.STROKECOLOR);
    nStroke.setDefaultColor(ColorLib.gray(100));
    nStroke.add("_hover", ColorLib.gray(50));
    ColorAction nFill = new ColorAction(NODES, VisualItem.FILLCOLOR);
    nFill.setDefaultColor(ColorLib.gray(255));
    nFill.add("_hover", ColorLib.gray(200));
    ColorAction nEdges = new ColorAction(EDGES, VisualItem.STROKECOLOR);
    nEdges.setDefaultColor(ColorLib.gray(100));
    ColorAction aStroke = new ColorAction(AGGR, VisualItem.STROKECOLOR);
    aStroke.setDefaultColor(ColorLib.gray(200));
    aStroke.add("_hover", ColorLib.rgb(255,100,100));
    int[] palette = new int[] {
        ColorLib.rgba(255,200,200,150),
        ColorLib.rgba(200,255,200,150),
        ColorLib.rgba(200,200,255,150)
    };
    ColorAction aFill = new DataColorAction(AGGR, "id",
            Constants.NOMINAL, VisualItem.FILLCOLOR, palette);
    // bundle the color actions
    ActionList colors = new ActionList();
    colors.add(nStroke);
    colors.add(nFill);
    colors.add(nEdges);
    colors.add(aStroke);
    colors.add(aFill);
    // now create the main layout routine
    ActionList layout = new ActionList(Activity.INFINITY);
    layout.add(colors);
    layout.add(new ForceDirectedLayout(GRAPH, true));
    layout.add(new AggregateLayout(AGGR));
    layout.add(new LabelLayout2(EDGE_DECORATORS));
    layout.add(new LabelLayout2(NODE_DECORATORS));
    layout.add(new LabelLayout2(AGGR_DECORATORS));
    layout.add(new RepaintAction());
    m_vis.putAction("layout", layout);
    // set up the display
    setSize(500,500);
    pan(250, 250);
    setHighQuality(true);
    addControlListener(new AggregateDragControl());
    addControlListener(new ZoomControl());
    addControlListener(new PanControl());
    // set things running
    m_vis.run("layout");
}
 
开发者ID:santiontanon,项目名称:fterm,代码行数:75,代码来源:AggregateDecoratorDemo.java


示例6: setActions

import prefuse.action.assignment.DataColorAction; //导入依赖的package包/类
/**
	 * Initializes colors, force, ... Actions.
	 */
	protected void setActions(){
		// DRAW_ACTIONS: node and edge color actions
		ColorAction nodeStroke = new ColorAction(NODES, VisualItem.STROKECOLOR);
		nodeStroke.setDefaultColor(ColorLib.gray(0)); 
		nodeStroke.add(VisualItem.HOVER, ColorLib.gray(0));			
		ColorAction edgeStroke = new ColorAction(EDGES, VisualItem.STROKECOLOR);
		edgeStroke.setDefaultColor(ColorLib.gray(0));
		ColorAction edgeFill = new ColorAction(EDGES, VisualItem.FILLCOLOR);
		edgeFill.setDefaultColor(ColorLib.gray(0));		
//		DataSizeAction edgeWidth = new DataSizeAction(EDGES, EDGE_WEIGHT);
		// bundle the node and edge color actions
		ActionList nodeEdgeList = new ActionList();
		nodeEdgeList.add(new NodeColorAction(NODES));
		nodeEdgeList.add(new ColorAction(NODES, VisualItem.TEXTCOLOR, ColorLib.gray(0)));
		nodeEdgeList.add(nodeStroke);
		nodeEdgeList.add(edgeStroke);		
		nodeEdgeList.add(edgeFill);
		//nodeEdgeList.add(edgeWidth); //paint edges width depends on weight
		nodeEdgeList.add(new RepaintAction());
		// we register our actions
		m_vis.putAction(Actions.DRAW.name(), nodeEdgeList);
		// now create the main layout routine
		ActionList layoutList = new ActionList(Activity.INFINITY);	
//		ActionList layoutList = new ActionList(Activity.DEFAULT_STEP_TIME);	
		distanceFilter = new GraphDistanceFilter(GRAPH, MAX_HOPS);
		layoutList.add(distanceFilter);			
		m_forceLayout = new ForceDirectedLayout(GRAPH, false);
//		m_forceLayout = new FruchtermanReingoldLayout(GRAPH);
		layoutList.add(m_forceLayout);  
		layoutList.add(new RepaintAction());
		// we register	
		m_vis.putAction(Actions.LAYOUT.name(), layoutList);
		m_vis.runAfter(Actions.DRAW.name(), Actions.LAYOUT.name());	
		// Actions aggregate color and layout
		ActionList aggrList = new ActionList(Activity.INFINITY);	
		aggrList.add(m_aggregateLayout);
		aggrList.add(new LabelLayout(AGGR_DECORATORS));	
		ColorAction aggrStroke = new ColorAction(AGGRS, VisualItem.STROKECOLOR);
		aggrStroke.setDefaultColor(ColorLib.gray(0));
		aggrStroke.add(VisualItem.HOVER, ColorLib.rgb(255,100,100));    

		aggrList.add(aggrStroke);
		m_aggrs_color = new DataColorAction(AGGRS, AGGRS_ID, Constants.ORDINAL, VisualItem.FILLCOLOR);

		aggrList.add(m_aggrs_color);
		aggrList.add(new RepaintAction());
		// we register	
		m_vis.putAction(Actions.AGGR.name(), aggrList);	
	}
 
开发者ID:renespeck,项目名称:Cugar,代码行数:53,代码来源:AggregatePanel.java


示例7: initialiseTreeView

import prefuse.action.assignment.DataColorAction; //导入依赖的package包/类
@Override
public void initialiseTreeView(Tree t, Dimension size, String label, int orientation) {
    this.m_orientation = orientation;

    m_vis.add(tree, t);

    m_nodeRenderer = new LabelRenderer(null, "image");

    m_edgeRenderer = new EdgeRenderer(Constants.EDGE_TYPE_CURVE);
    m_edgeRenderer.setDefaultLineWidth(4);

    DefaultRendererFactory rf = new DefaultRendererFactory(m_nodeRenderer);
    rf.add(new InGroupPredicate(treeEdges), m_edgeRenderer);
    m_vis.setRendererFactory(rf);

    int[] colorPalette = new int[]{ColorLib.rgb(51, 51, 51), ColorLib.rgb(51, 51, 51), ColorLib.rgb(51, 51, 51)};

    DataColorAction dataColorAction = new DataColorAction("tree.nodes", "type", Constants.NOMINAL, VisualItem.TEXTCOLOR, colorPalette);

    // colors
    ItemAction nodeColor = new WorkflowNodeColorAction(treeNodes);

    m_vis.putAction("textColor", dataColorAction);

    ItemAction edgeColor = new ColorAction(treeEdges,
            VisualItem.STROKECOLOR, ColorLib.rgba(51, 51, 51, 100));

    // quick repaint
    ActionList repaint = new ActionList();
    repaint.add(nodeColor);
    repaint.add(new RepaintAction());
    m_vis.putAction("repaint", repaint);

    // full paint
    ActionList fullPaint = new ActionList();
    fullPaint.add(nodeColor);
    m_vis.putAction("fullPaint", fullPaint);

    // create the tree layout action
    NodeLinkTreeLayout treeLayout = new NodeLinkTreeLayout(tree,
            m_orientation, 80, 70, 8);
    treeLayout.setLayoutAnchor(new Point2D.Double(size.width / 2, 15));
    m_vis.putAction("treeLayout", treeLayout);

    CollapsedSubtreeLayout subLayout = new CollapsedSubtreeLayout(tree,
            m_orientation);
    m_vis.putAction("subLayout", subLayout);

    createAndAddFilter(dataColorAction, nodeColor, edgeColor, treeLayout, subLayout);
    // animated transition
    createAnimation();
    // ensure size is reasonable!
    finaliseVisualizationSteps(size);
}
 
开发者ID:ISA-tools,项目名称:Automacron,代码行数:55,代码来源:WorkflowVisualisationTreeView.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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