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


Java InGroupPredicate类代码示例

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


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

示例1: setRendererFactory

import prefuse.visual.expression.InGroupPredicate; //导入依赖的package包/类
/** Sets renderers for {@link #NODES},{@link #EDGES}, {@link #AGGRS} and {@link #AGGR_DECORATORS} group. */
protected void setRendererFactory(){
	// draw aggregates as polygons with curved edges
	Renderer pr = new PolygonRenderer(Constants.POLY_TYPE_CURVE);
	((PolygonRenderer)pr).setCurveSlack(0.15f);  
	// draw node labels
	Renderer nlr = new LabelRenderer(NODE_NAME);
	((LabelRenderer)nlr).setRoundedCorner(10,10);				
	// set renderers to factory
	// nodes and egeds
	DefaultRendererFactory drf = new DefaultRendererFactory();
	drf.add(new InGroupPredicate(NODES),nlr);
	drf.add(new InGroupPredicate(AGGRS), pr);
	// edge direction 
	drf.add(new InGroupPredicate(EDGES), new EdgeRenderer(Constants.EDGE_TYPE_LINE,Constants.EDGE_ARROW_FORWARD));
	// decorators
	drf.add(new InGroupPredicate(AGGR_DECORATORS), new LabelRenderer(AGGRS_ID));
	m_vis.setRendererFactory(drf);
}
 
开发者ID:renespeck,项目名称:Cugar,代码行数:20,代码来源:AggregatePanel.java

示例2: NodeColorAction

import prefuse.visual.expression.InGroupPredicate; //导入依赖的package包/类
public NodeColorAction(String group) {
	super(group, VisualItem.FILLCOLOR,ColorLib.gray(255));
	// keep this order
	add(VisualItem.HOVER,blue);
	add(new InGroupPredicate(Visualization.SEARCH_ITEMS),green);
	add(VisualItem.HIGHLIGHT,orange );	
	add(new InGroupPredicate(Visualization.FOCUS_ITEMS), red);  		
	add(VisualItem.FIXED, red);  		
}
 
开发者ID:renespeck,项目名称:Cugar,代码行数:10,代码来源:NodeColorAction.java

示例3: RenderPrefuseGraph

import prefuse.visual.expression.InGroupPredicate; //导入依赖的package包/类
/**
 * @param prefuseDisplay
 * @param graph
 * @param id
 */
public RenderPrefuseGraph(Display prefuseDisplay, Graph graph, String id) {

	/* default color for nodes and edges 
	 * both is overwritten later (NodeRenderer and TextLayoutDecorator) */
	ColorAction fill = new ColorAction("GraphDataModifier.nodes", VisualItem.FILLCOLOR, ColorLib.rgb(0, 200, 0));
	ColorAction edges = new ColorAction("GraphDataModifier.edges", VisualItem.STROKECOLOR, ColorLib.rgb(0, 0, 0));
	ColorAction arrow = new ColorAction("GraphDataModifier.edges", VisualItem.FILLCOLOR, ColorLib.rgb(0, 0, 0));
	fill.add(VisualItem.FIXED, ColorLib.rgb(0, 250, 0));
	fill.add(VisualItem.HIGHLIGHT, ColorLib.rgb(0, 250, 0));

	ActionList layout = new ActionList(Activity.INFINITY);
	layout.add(fill); // add default node color
	layout.add(edges); // add default edge color
	layout.add(arrow); // add default edge color
	// set layout as force directed layout without (all objects must be displayed)
	ForceDirectedLayoutExtended fdle = new ForceDirectedLayoutExtended("GraphDataModifier", false);
	PrefuseForceAbstractLayoutStorage.addForceDirectedLayout(fdle, id);
	layout.add(fdle);
	layout.add(new TextLayoutDecorator("nodedec"));
	layout.add(new TextLayoutDecorator("NodeExtraData"));
	layout.add(new TextLayoutDecorator("EdgeExtraData"));
	layout.add(new RepaintAction());
	layout.add(new TextLayoutDecorator("edgeDeco"));

	final Visualization vis = new Visualization();
	vis.add("GraphDataModifier", graph);
	vis.putAction("layout", layout);
	NodeRenderer nodeRender = new NodeRenderer();

	EdgeRender edgeRender = new EdgeRender(prefuse.Constants.EDGE_TYPE_LINE, prefuse.Constants.EDGE_ARROW_FORWARD);
	edgeRender.setArrowHeadSize(10, 10);

	DefaultRendererFactory drf = new DefaultRendererFactory();
	drf.setDefaultRenderer(nodeRender);
	drf.setDefaultEdgeRenderer(edgeRender);
	drf.add(new InGroupPredicate("edgeDeco"), new LabelRenderer(ColumnNames.NAME));
	drf.add(new InGroupPredicate("nodedec"), new LabelRenderer(ColumnNames.NAME));
	final Schema DECATOR_SCHEMA = PrefuseLib.getVisualItemSchema();
	DECATOR_SCHEMA.setDefault(VisualItem.INTERACTIVE, false);
	DECATOR_SCHEMA.setDefault(VisualItem.TEXTCOLOR, ColorLib.rgb(255, 255, 255));

	final Schema DECATOR_SCHEMA_EDGES = PrefuseLib.getVisualItemSchema();
	DECATOR_SCHEMA_EDGES.setDefault(VisualItem.INTERACTIVE, true);
	DECATOR_SCHEMA_EDGES.setDefault(VisualItem.TEXTCOLOR, ColorLib.rgb(255, 255, 255));

	DECATOR_SCHEMA.setDefault(VisualItem.FONT, FontUsed.getFont());
	DECATOR_SCHEMA.setDefault(VisualItem.TEXTCOLOR, ColorLib.gray(0));

	// add extra name field (should be done before the normal name field [for edges], otherwise normal field is covered with extra name background)
	final Schema DECATOR_SCHEMA_NAME_EXTRA = PrefuseLib.getVisualItemSchema();
	DECATOR_SCHEMA_NAME_EXTRA.setDefault(VisualItem.SIZE, NameExtraDataSize);
	DECATOR_SCHEMA_NAME_EXTRA.setDefault(VisualItem.INTERACTIVE, false);
	drf.add(new InGroupPredicate("NodeExtraData"), new LabelRenderer(ColumnNames.NAME_DATA));
	vis.addDecorators("NodeExtraData", "GraphDataModifier.nodes", DECATOR_SCHEMA_NAME_EXTRA);
	drf.add(new InGroupPredicate("EdgeExtraData"), new LabelRenderer(ColumnNames.NAME_DATA));
	// disabled because unhappy with the optical result
	// vis.addDecorators("EdgeExtraData", "GraphDataModifier.edges", DECATOR_SCHEMA_NAME_EXTRA);

	// add short name decorators 
	vis.addDecorators("edgeDeco", "GraphDataModifier.edges", DECATOR_SCHEMA_EDGES);
	vis.addDecorators("nodedec", "GraphDataModifier.nodes", DECATOR_SCHEMA);

	vis.setRendererFactory(drf);
	prefuseDisplay.setVisualization(vis);

	vis.run("layout");

}
 
开发者ID:VisualDataWeb,项目名称:ProtegeVOWL,代码行数:74,代码来源:RenderPrefuseGraph.java

示例4: StackedGraphDisplay

import prefuse.visual.expression.InGroupPredicate; //导入依赖的package包/类
StackedGraphDisplay()
{
    super( new Visualization() );

    setBackground( ColorLib.getColor( 0, 51, 88 ) );

    LabelRenderer labelRenderer = new LabelRenderer( NAME_LABEL );
    labelRenderer.setVerticalAlignment( Constants.BOTTOM );
    labelRenderer.setHorizontalAlignment( Constants.LEFT );

    EdgeRenderer usesRenderer = new EdgeRenderer( Constants.EDGE_TYPE_CURVE, Constants.EDGE_ARROW_FORWARD );
    usesRenderer.setHorizontalAlignment1( Constants.CENTER );
    usesRenderer.setHorizontalAlignment2( Constants.CENTER );
    usesRenderer.setVerticalAlignment1( Constants.BOTTOM );
    usesRenderer.setVerticalAlignment2( Constants.TOP );

    Predicate usesPredicate = (Predicate) ExpressionParser.parse( "ingroup('graph.edges') AND [" + USES_EDGES + "]==true", true );

    // set up the renderers - one for nodes and one for LABELS
    DefaultRendererFactory rf = new DefaultRendererFactory();
    rf.add( new InGroupPredicate( GRAPH_NODES ), new NodeRenderer() );
    rf.add( new InGroupPredicate( LABELS ), labelRenderer );
    rf.add( usesPredicate, usesRenderer );
    m_vis.setRendererFactory( rf );

    // border colors
    ColorAction borderColor = new BorderColorAction( GRAPH_NODES );
    ColorAction fillColor = new FillColorAction( GRAPH_NODES );

    // uses edge colors
    ItemAction usesColor = new ColorAction( GRAPH_EDGES, usesPredicate, VisualItem.STROKECOLOR, ColorLib.rgb( 50, 50, 50 ) );
    ItemAction usesArrow = new ColorAction( GRAPH_EDGES, usesPredicate, VisualItem.FILLCOLOR, ColorLib.rgb( 50, 50, 50 ) );

    // color settings
    ActionList colors = new ActionList();
    colors.add( fillColor );
    colors.add( borderColor );
    colors.add( usesColor );
    colors.add( usesArrow );
    m_vis.putAction( COLORS_ACTION, colors );

    ActionList autoPan = new ActionList();
    autoPan.add( colors );
    autoPan.add( new AutoPanAction() );
    autoPan.add( new RepaintAction() );
    m_vis.putAction( AUTO_PAN_ACTION, autoPan );

    // create the layout action list
    stackedLayout = new StackedLayout( GRAPH );
    ActionList layout = new ActionList();
    layout.add( stackedLayout );
    layout.add( new LabelLayout( LABELS ) );
    layout.add( autoPan );
    m_vis.putAction( LAYOUT_ACTION, layout );

    // initialize our display
    Dimension size = new Dimension( 400, 400 );
    setSize( size );
    setPreferredSize( size );
    setItemSorter( new ExtendedTreeDepthItemSorter( true ) );
    addControlListener( new HoverControl() );
    addControlListener( new FocusControl( 1, COLORS_ACTION ) );
    addControlListener( new WheelMouseControl() );
    addControlListener( new PanControl( true ) );
    addControlListener( new ItemSelectionControl() );

    setDamageRedraw( true );
}
 
开发者ID:apache,项目名称:polygene-java,代码行数:69,代码来源:StackedGraphDisplay.java

示例5: AggregateDecoratorDemo

import prefuse.visual.expression.InGroupPredicate; //导入依赖的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

示例6: AggregateDecoratorDemo

import prefuse.visual.expression.InGroupPredicate; //导入依赖的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

示例7: initialiseTreeView

import prefuse.visual.expression.InGroupPredicate; //导入依赖的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

示例8: FisheyeTreeFilter

import prefuse.visual.expression.InGroupPredicate; //导入依赖的package包/类
/**
 * Create a new FisheyeTreeFilter that processes the given group.
 * @param group the data group to process. This should resolve to
 * a Graph instance, otherwise exceptions will result when this
 * Action is run.
 * @param sources the group to use as source nodes, representing the
 * nodes of highest degree-of-interest.
 * @param distance the graph distance threshold from high-interest
 * nodes past which nodes will not be visible nor expanded.
 */
public FisheyeTreeFilter(String group, String sources, int distance)
{
    super(group);
    m_sources = sources;
    m_threshold = -distance;
    m_groupP = new InGroupPredicate(
            PrefuseLib.getGroupName(group, Graph.NODES));
}
 
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:19,代码来源:FisheyeTreeFilter.java

示例9: GraphDistanceFilter

import prefuse.visual.expression.InGroupPredicate; //导入依赖的package包/类
/**
 * Create a new GraphDistanceFilter that processes the given data group
 * and uses the given graph distance.
 * @param group the group to process. This group should resolve to a
 * Graph instance, otherwise exceptions will be thrown when this
 * Action is run.
 * @param sources the group to use as source nodes for measuring
 * graph distance.
 * @param distance the graph distance within which items will be
 * visible.
 */
public GraphDistanceFilter(String group, String sources, int distance)
{
    super(group);
    m_sources = sources;
    m_distance = distance;
    m_groupP = new InGroupPredicate(
        PrefuseLib.getGroupName(group, Graph.NODES));
    m_bfs = new BreadthFirstIterator();
}
 
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:21,代码来源:GraphDistanceFilter.java


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