本文整理汇总了Java中prefuse.util.ColorLib.rgba方法的典型用法代码示例。如果您正苦于以下问题:Java ColorLib.rgba方法的具体用法?Java ColorLib.rgba怎么用?Java ColorLib.rgba使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类prefuse.util.ColorLib
的用法示例。
在下文中一共展示了ColorLib.rgba方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getColor
import prefuse.util.ColorLib; //导入方法依赖的package包/类
@Override
public int getColor( VisualItem item )
{
if( m_vis.isInGroup( item, Visualization.SEARCH_ITEMS ) )
{
return ColorLib.rgb( 255, 190, 190 );
}
else if( m_vis.isInGroup( item, Visualization.FOCUS_ITEMS ) )
{
return ColorLib.rgb( 198, 229, 229 );
}
else if( item.getDOI() > -1 )
{
return ColorLib.rgb( 164, 193, 193 );
}
else
{
return ColorLib.rgba( 255, 255, 255, 0 );
}
}
示例2: getColor
import prefuse.util.ColorLib; //导入方法依赖的package包/类
public int getColor(VisualItem item) {
if ( m_vis.isInGroup(item, Visualization.SEARCH_ITEMS) )
return ColorLib.rgb(255,190,190);
else if ( m_vis.isInGroup(item, Visualization.FOCUS_ITEMS) )
return ColorLib.rgb(198,229,229);
else if ( item.getDOI() > -1 )
return ColorLib.rgb(164,193,193);
else
return ColorLib.rgba(100,100,100,0);
}
示例3: getColor
import prefuse.util.ColorLib; //导入方法依赖的package包/类
public int getColor(VisualItem item) {
if ( m_vis.isInGroup(item, Visualization.SEARCH_ITEMS) )
return ColorLib.rgb(255,190,190);
else if ( m_vis.isInGroup(item, Visualization.FOCUS_ITEMS) )
return ColorLib.rgb(198,229,229);
else if ( item.getDOI() > -1 )
return ColorLib.rgb(164,193,193);
else
return ColorLib.rgba(255,255,255,0);
}
示例4: getInt
import prefuse.util.ColorLib; //导入方法依赖的package包/类
public int getInt(Tuple t) {
int r = param(0).getInt(t);
int g = param(1).getInt(t);
int b = param(2).getInt(t);
int a = param(3).getInt(t);
return ColorLib.rgba(r,g,b,a);
}
示例5: NodeColorAction
import prefuse.util.ColorLib; //导入方法依赖的package包/类
public NodeColorAction(String group) {
super(group, VisualItem.FILLCOLOR, ColorLib.rgba(255, 255, 255, 0));
add(VisualItem.HOVER, ColorLib.rgb(255, 200, 125));
add("ingroup('_search_')", ColorLib.rgb(255, 190, 190));
add("ingroup('_focus_')", ColorLib.rgb(198, 229, 229));
add(VisualItem.HIGHLIGHT, ColorLib.rgb(255, 200, 125));
add("CaColor", ColorLib.rgb(0, 255, 0));
add("CeColor", ColorLib.rgb(137, 0, 255));
add("mutualColor", ColorLib.rgb(140, 140, 140));
}
示例6: 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.");
}
}
// 处理关注类型
String attentionType = item.getTable().getString(item.getRow(),
"attentionType");
if (attentionType.equals(Relation.ComponentLayerAttentionType)) {
return ColorLib.rgba(255, 0, 0, 255);
} else if (attentionType.equals(Relation.MutualDependAttentionType)) {
return ColorLib.rgba(255, 0, 0, 120);
} else if (attentionType.equals(Relation.SDPAttentionType)) {
return ColorLib.rgba(255, 0, 0, 80);
} else if (attentionType.equals(Relation.CycleDependAttentionType)) {
return ColorLib.rgba(255, 0, 0, 40);
} else {
return this.getDefaultColor();
}
}
示例7: getColor
import prefuse.util.ColorLib; //导入方法依赖的package包/类
public int getColor(VisualItem item) {
if (m_vis.isInGroup(item, Visualization.SEARCH_ITEMS))
return ColorLib.rgb(255, 190, 190);
else if (m_vis.isInGroup(item, Visualization.FOCUS_ITEMS))
return ColorLib.rgb(198, 229, 229);
else if (item.getDOI() > -1)
return ColorLib.rgb(164, 193, 193);
else
return ColorLib.rgba(255, 255, 255, 0);
}
示例8: getColor
import prefuse.util.ColorLib; //导入方法依赖的package包/类
public int getColor(VisualItem item) {
if (m_vis.isInGroup(item, Visualization.SEARCH_ITEMS)) {
return ColorLib.rgba(153, 153, 153, 100);
} else {
return ColorLib.rgba(255, 255, 255, 0);
}
}
示例9: rgba
import prefuse.util.ColorLib; //导入方法依赖的package包/类
public static int rgba( Color c )
{
return ColorLib.rgba( c.getRed(), c.getGreen(), c.getBlue(), c.getAlpha() );
}
示例10: NodeColorAction
import prefuse.util.ColorLib; //导入方法依赖的package包/类
public NodeColorAction(String group) {
super(group, VisualItem.FILLCOLOR, ColorLib.rgba(255,255,255,0));
add("_hover", ColorLib.gray(220,230));
add("ingroup('_search_')", ColorLib.rgb(255,190,190));
add("ingroup('_focus_')", ColorLib.rgb(198,229,229));
}
示例11: AggregateDemo
import prefuse.util.ColorLib; //导入方法依赖的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");
}
示例12: AggregateDemo
import prefuse.util.ColorLib; //导入方法依赖的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");
}
示例13: CodyTestWindow
import prefuse.util.ColorLib; //导入方法依赖的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");
}
示例14: AggregateDecoratorDemo
import prefuse.util.ColorLib; //导入方法依赖的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");
}
示例15: AggregateDecoratorDemo
import prefuse.util.ColorLib; //导入方法依赖的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");
}