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


Java ColorLib.gray方法代码示例

本文整理汇总了Java中prefuse.util.ColorLib.gray方法的典型用法代码示例。如果您正苦于以下问题:Java ColorLib.gray方法的具体用法?Java ColorLib.gray怎么用?Java ColorLib.gray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在prefuse.util.ColorLib的用法示例。


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

示例1: getColor

import prefuse.util.ColorLib; //导入方法依赖的package包/类
@Override
public int getColor(VisualItem item) {
	Object o = lookup(item);
	if (o != null) {
		if (o instanceof ColorAction) {
			return ((ColorAction) o).getColor(item);
		} else if (o instanceof Integer) {
			return ((Integer) o).intValue();
		} else {
			Logger.getLogger(this.getClass().getName()).warning(
					"Unrecognized Object from predicate chain.");
		}
	}
	// 处理外部分析单元颜色
	if (item.getTable().getBoolean(item.getRow(), "isInner")) {
		return this.getDefaultColor();
	} else {
		return ColorLib.gray(150);
	}

}
 
开发者ID:jdepend,项目名称:cooper,代码行数:22,代码来源:GraphJDepend.java

示例2: getInt

import prefuse.util.ColorLib; //导入方法依赖的package包/类
public int getInt(Tuple t) {
    int g = param(0).getInt(t);
    if ( paramCount() == 2 ) {
        int a = param(1).getInt(t);
        return ColorLib.gray(g, a);
    } else {
        return ColorLib.gray(g);
    }
}
 
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:10,代码来源:FunctionExpression.java

示例3: NodeColorAction

import prefuse.util.ColorLib; //导入方法依赖的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

示例4: run

import prefuse.util.ColorLib; //导入方法依赖的package包/类
@Override
public void run(double frac) {
	Display display = m_vis.getDisplay(0);	
	Rectangle position = new Rectangle(vDepth*60+30,hDepth*20+10,display.getWidth()-vDepth*60-30,display.getHeight()-hDepth*20-10);
	
	m_vis.removeGroup(group);
	m_vis.removeGroup(labelGroup);
	VisualGraph vg = m_vis.addGraph(group, dataProvider.getGranularityAggregationTree());
	
       Schema labelNodeSchema = PrefuseLib.getVisualItemSchema();
       labelNodeSchema.addColumn(VisualItem.LABEL, String.class);
       Integer defColor = new Integer(ColorLib.gray(150));
       labelNodeSchema.setInterpolatedDefault(VisualItem.TEXTCOLOR, defColor);
	VisualTree vgl = m_vis.addTree(labelGroup, labelNodeSchema);
	
	Node root = vgl.addRoot();
	vgl.addChild(root);
       vgl.addChild(root);
	
	try {	
           ArrayList<Float> relativeSize = new ArrayList<Float>();
           ArrayList<Long> minIdentifiers = new ArrayList<Long>();
           ArrayList<Long> maxIdentifiers = new ArrayList<Long>();
           buildSizeChart(dataProvider.getGranularityAggregationTree().roots().iterator().next(),
                   relativeSize,minIdentifiers,maxIdentifiers,0);
           
		layoutGranularity(vg,vgl,vgl.getRoot().getChild(0),vgl.getRoot().getChild(1),
		        (NodeItem)m_vis.getVisualItem(group, dataProvider.getGranularityAggregationTree().roots().iterator().next()),
				position,0,minIdentifiers,maxIdentifiers);
	} catch (Exception e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
}
 
开发者ID:ieg-vienna,项目名称:TimeBench,代码行数:35,代码来源:GROOVELayout.java

示例5: TextColorAction

import prefuse.util.ColorLib; //导入方法依赖的package包/类
public TextColorAction(String group) {
    super(group, VisualItem.TEXTCOLOR, ColorLib.gray(0));
    add("_hover", ColorLib.rgb(255,0,0));
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:5,代码来源:RadialGraphView.java

示例6: initVisualization

import prefuse.util.ColorLib; //导入方法依赖的package包/类
private void initVisualization() {
	/*try
	{
		graph = new GraphMLReader().readGraph("/socialnet.xml");
	} catch ( DataIOException e ) {
		e.printStackTrace();
		System.err.println("Error loading graph. Exiting...");
		System.exit(1);
	}*/
	Graph graph = data.getIPGraph();
	
	vis = new Visualization();
	vis.add(GRAPH, graph);

	LabelRenderer r = new LabelRenderer(data.ADDRESS);
	r.setRoundedCorner(8,8);
	r.setRenderType(LabelRenderer.RENDER_TYPE_DRAW_AND_FILL);
	vis.setRendererFactory(new DefaultRendererFactory(r));
	
	/*int [] palette = new int[] {
			ColorLib.rgb(255,180,180), ColorLib.rgb(190,190,255)
	};
	DataColorAction fill = new DataColorAction("graph.nodes","gender",
			Constants.NOMINAL,VisualItem.FILLCOLOR,palette);*/
	
	ColorAction draw = new ColorAction(NODES,VisualItem.STROKECOLOR,ColorLib.gray(0));
	ColorAction fill = new ColorAction(NODES,VisualItem.FILLCOLOR,ColorLib.rgb(210, 210, 255));
	ColorAction text = new ColorAction(NODES,VisualItem.TEXTCOLOR,ColorLib.gray(0));
	ColorAction edges = new ColorAction(EDGES,VisualItem.STROKECOLOR,ColorLib.gray(200));
	ActionList color = new ActionList(Activity.INFINITY,1000);
	color.add(data.getLockAction());
	color.add(draw);
	color.add(fill);
	color.add(text);
	color.add(edges);
	color.add(data.getUnlockAction());
	
	//ActionList layout = new ActionList(Activity.INFINITY,100);
	ActionList layout = new ActionList(Activity.INFINITY,1000);
	layout.add(data.getLockAction());
	layout.add(new GridMinusCircle(150,10,NODES));
	layout.add(data.getUnlockAction());
	layout.add(new RepaintAction());
	
	vis.putAction(COLOR, color);
	vis.putAction(LAYOUT,layout);

	display = new Display(vis);
	display.setSize(720,500);
	display.addControlListener(new ZoomControl());
	display.addControlListener(new DragControl());
	display.addControlListener(new PanControl());
	
	TupleTableModel ttm = new TupleTableModel(graph.getEdgeTable());
	node_table = new JTable(ttm);
	node_table.getTableHeader().addMouseListener(ttm);
	//ttm.addTableModelListener(node_table);
	//node_table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
	node_table.addMouseListener(new JTableMouseListener());
}
 
开发者ID:codydunne,项目名称:netgrok,代码行数:61,代码来源:AdamTestWindow.java

示例7: TextColorAction

import prefuse.util.ColorLib; //导入方法依赖的package包/类
public TextColorAction(String group) {
	super(group, VisualItem.TEXTCOLOR, ColorLib.gray(0));
	add(VisualItem.HOVER, ColorLib.rgb(255, 0, 0));
}
 
开发者ID:jdepend,项目名称:cooper,代码行数:5,代码来源:GraphJDepend.java


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