本文整理汇总了Java中prefuse.util.PrefuseLib类的典型用法代码示例。如果您正苦于以下问题:Java PrefuseLib类的具体用法?Java PrefuseLib怎么用?Java PrefuseLib使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PrefuseLib类属于prefuse.util包,在下文中一共展示了PrefuseLib类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: run
import prefuse.util.PrefuseLib; //导入依赖的package包/类
@Override
public void run( double frac )
{
super.run( frac );
// set uses_edges always visible
Iterator items = m_vis.items( GRAPH_EDGES );
while( items.hasNext() )
{
VisualItem item = (VisualItem) items.next();
if( item.getBoolean( USES_EDGES ) )
{
PrefuseLib.updateVisible( item, true );
}
}
}
开发者ID:apache,项目名称:polygene-java,代码行数:17,代码来源:TreeGraphDisplay.java
示例2: PolarDonutFDRLayout
import prefuse.util.PrefuseLib; //导入依赖的package包/类
/**
* Create a new PolarDonutFDRLayout.
* @param group the data group to layout. Must resolve to a Graph instance.
* @param enforceBounds indicates whether or not the layout should require
* that all node placements stay within the layout bounds.
* @param runonce indicates if the layout will be run in a run-once or
* animated fashion. In run-once mode, the layout will run for a set number
* of iterations when invoked. In animation mode, only one iteration of the
* layout is computed.
*/
public PolarDonutFDRLayout(double circleRadius, String m_group, String filter,
boolean enforceBounds, boolean runonce){
super(m_group);
this.circleRadius = circleRadius;
this.filter = filter + " and visible()";// and isnode()";
this.m_filter = (Predicate)ExpressionParser.parse(this.filter);
m_nodeGroup = PrefuseLib.getGroupName(m_group, Graph.NODES);
m_edgeGroup = PrefuseLib.getGroupName(m_group, Graph.EDGES);
m_enforceBounds = enforceBounds;
m_runonce = runonce;
m_fsim = new ForceSimulator();
m_fsim.addForce(new NBodyForce());
m_fsim.addForce(new SpringForce());
m_fsim.addForce(new DragForce());
//getForceSimulator().setSpeedLimit(.3f);//XXX: Tweak
}
开发者ID:codydunne,项目名称:netgrok,代码行数:31,代码来源:PolarDonutFDRLayout.java
示例3: getSize
import prefuse.util.PrefuseLib; //导入依赖的package包/类
/**
* @see prefuse.action.assignment.SizeAction#getSize(prefuse.visual.VisualItem)
*/
public double getSize(VisualItem item) {
// check for any cascaded rules first
double size = super.getSize(item);
if ( !Double.isNaN(size) ) {
return size;
}
// otherwise perform data-driven assignment
double v = item.getDouble(m_dataField);
double f = MathLib.interp(m_scale, v, m_dist);
if ( m_bins < 1 ) {
// continuous scale
v = m_minSize + f * m_sizeRange;
} else {
// binned sizes
int bin = f < 1.0 ? (int)(f*m_bins) : m_bins-1;
v = m_minSize + bin*(m_sizeRange/(m_bins-1));
}
// return the size value. if this action is configured to return
// 2-dimensional sizes (ie area rather than length) then the
// size value is appropriately scaled first
return m_is2DArea ? PrefuseLib.getSize2D(v) : v;
}
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:27,代码来源:DataSizeAction.java
示例4: setColorFields
import prefuse.util.PrefuseLib; //导入依赖的package包/类
/**
* Sets the color fields to interpolate.
* @param fields the color fields to interpolate
*/
public void setColorFields(String[] fields) {
if ( fields == null ) {
throw new IllegalArgumentException();
}
if ( m_colorFields == null )
m_colorFields = new CopyOnWriteArrayList<String>();
else
m_colorFields.clear();
for ( int i=0; i<fields.length; ++i ) {
m_colorFields.add(fields[i]);
m_colorFields.add(PrefuseLib.getStartField(fields[i]));
m_colorFields.add(PrefuseLib.getEndField(fields[i]));
}
}
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:21,代码来源:ColorAnimator.java
示例5: StackedAreaChart
import prefuse.util.PrefuseLib; //导入依赖的package包/类
/**
* Create a new StackedAreaChart.
* @param group the data group to layout
* @param field the data field in which to store computed polygons
* @param columns the various data fields, in sorted order, that
* should be referenced for each consecutive point of a stack layer
* @param threshold height threshold under which stacks should not
* be made visible.
*/
public StackedAreaChart(String group, String field, String[] columns,
double threshold)
{
super(group);
this.columns = columns;
baseline = new double[columns.length];
peaks = new double[columns.length];
poly = new float[4*columns.length];
m_field = field;
m_start = PrefuseLib.getStartField(field);
m_end = PrefuseLib.getEndField(field);
setThreshold(threshold);
m_model = new NumberRangeModel(0,1,0,1);
}
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:26,代码来源:StackedAreaChart.java
示例6: set
import prefuse.util.PrefuseLib; //导入依赖的package包/类
/**
* Set the layout values for an axis label item.
*/
protected void set(VisualItem item, double xOrY, Rectangle2D b) {
switch ( m_axis ) {
case Constants.X_AXIS:
xOrY = m_asc ? xOrY + b.getMinX() : b.getMaxX() - xOrY;
PrefuseLib.updateDouble(item, VisualItem.X, xOrY);
PrefuseLib.updateDouble(item, VisualItem.Y, b.getMinY());
PrefuseLib.updateDouble(item, VisualItem.X2, xOrY);
PrefuseLib.updateDouble(item, VisualItem.Y2, b.getMaxY());
break;
case Constants.Y_AXIS:
xOrY = m_asc ? b.getMaxY() - xOrY - 1 : xOrY + b.getMinY();
PrefuseLib.updateDouble(item, VisualItem.X, b.getMinX());
PrefuseLib.updateDouble(item, VisualItem.Y, xOrY);
PrefuseLib.updateDouble(item, VisualItem.X2, b.getMaxX());
PrefuseLib.updateDouble(item, VisualItem.Y2, xOrY);
}
}
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:21,代码来源:AxisLabelLayout.java
示例7: run
import prefuse.util.PrefuseLib; //导入依赖的package包/类
@Override
public void run(double frac) {
// get visual table of my visualization
VisualTable lines = (VisualTable) m_vis.getGroup(m_group);
// update x and y coordinates of lines
@SuppressWarnings("rawtypes")
Iterator items = lines.tuples();
while ( items.hasNext() ) {
VisualItem item = (VisualItem)items.next();
VisualItem v1 = (VisualItem)item.get("v1");
VisualItem v2 = (VisualItem)item.get("v2");
if ( !(v1.isValid() && v2.isValid()) ) {
lines.removeTuple(item);
} else if ( v1.isVisible() && v2.isVisible() ) {
item.setX(v1.getX());
item.setY(v1.getY());
item.setDouble(VisualItem.X2, v2.getX());
item.setDouble(VisualItem.Y2, v2.getY());
PrefuseLib.updateVisible(item, true);
} else {
PrefuseLib.updateVisible(item, false);
}
}
}
开发者ID:ieg-vienna,项目名称:ieg-prefuse,代码行数:26,代码来源:LinePlotLayout.java
示例8: getTable
import prefuse.util.PrefuseLib; //导入依赖的package包/类
/**
* Create a new table for representing line segments.
*/
protected VisualTable getTable() {
TupleSet ts = m_vis.getGroup(m_group);
if ( ts == null ) {
Schema lineSchema = PrefuseLib.getVisualItemSchema();
lineSchema.addColumn(VisualItem.X2, double.class);
lineSchema.addColumn(VisualItem.Y2, double.class);
lineSchema.addColumn("v1", VisualItem.class);
lineSchema.addColumn("v2", VisualItem.class);
VisualTable vt = m_vis.addTable(m_group, lineSchema);
return vt;
} else if ( ts instanceof VisualTable ) {
// empty table
ts.clear();
return (VisualTable)ts;
} else {
throw new IllegalStateException(
"Group already exists, not being used for line segments");
}
}
开发者ID:ieg-vienna,项目名称:ieg-prefuse,代码行数:24,代码来源:LinePlotAction.java
示例9: run
import prefuse.util.PrefuseLib; //导入依赖的package包/类
public void run(double frac) {
// Need to set all visable.
Iterator items = m_vis.items(nodes);
while ( items.hasNext() ) {
Object o = items.next();
if (o instanceof VisualItem) {
VisualItem item = (VisualItem)o;
item.setDOI(Constants.MINIMUM_DOI);
PrefuseLib.updateVisible(item, true);
item.setExpanded(false);
}
}
}
开发者ID:luox12,项目名称:onecmdb,代码行数:14,代码来源:VisabilityActivity.java
示例10: process
import prefuse.util.PrefuseLib; //导入依赖的package包/类
@Override
public void process(VisualItem item, double frac) {
if (item.canGetBoolean("visible")) {
if (!item.getBoolean("visible")) {
PrefuseLib.updateVisible(item, false);
}
}
}
开发者ID:luox12,项目名称:onecmdb,代码行数:10,代码来源:EdgeVisibleAction.java
示例11: ForceDirectedLayout
import prefuse.util.PrefuseLib; //导入依赖的package包/类
/**
* Create a new ForceDirectedLayout.
* @param group the data group to layout. Must resolve to a Graph instance.
* @param enforceBounds indicates whether or not the layout should require
* that all node placements stay within the layout bounds.
* @param runonce indicates if the layout will be run in a run-once or
* animated fashion. In run-once mode, the layout will run for a set number
* of iterations when invoked. In animation mode, only one iteration of the
* layout is computed.
*/
public ForceDirectedLayout(String group,
boolean enforceBounds, boolean runonce)
{
super(group);
m_nodeGroup = PrefuseLib.getGroupName(group, Graph.NODES);
m_edgeGroup = PrefuseLib.getGroupName(group, Graph.EDGES);
m_enforceBounds = enforceBounds;
m_runonce = runonce;
m_fsim = new ForceSimulator();
m_fsim.addForce(new NBodyForce());
m_fsim.addForce(new SpringForce());
m_fsim.addForce(new DragForce());
}
开发者ID:luox12,项目名称:onecmdb,代码行数:25,代码来源:ForceDirectedLayout.java
示例12: collapseAggregate
import prefuse.util.PrefuseLib; //导入依赖的package包/类
public static void collapseAggregate(Visualization vis, String nodeType, boolean enable) {
Iterator iter = vis.items(new FieldMatchGroupPredicate("aggregates", "type", nodeType));
while(iter.hasNext()) {
AggregateItem aitem = (AggregateItem)iter.next();
double x = aitem.getBounds().getCenterX();
double y = aitem.getBounds().getCenterY();
// Make all items invisable...
Iterator aiter = aitem.items();
while(aiter.hasNext()) {
NodeItem item = (NodeItem)aiter.next();
item.setVisible(enable);
if (!enable) {
item.setFixed(true);
PrefuseLib.setX(item, null, x);
PrefuseLib.setY(item, null, y);
}
Iterator edges = item.edges();
while(edges.hasNext()) {
EdgeItem e = (EdgeItem)edges.next();
VisualItem target = e.getTargetItem();
VisualItem source = e.getSourceItem();
if (aitem.containsItem(target) && aitem.containsItem(source)) {
e.setVisible(enable);
}
}
}
}
}
开发者ID:luox12,项目名称:onecmdb,代码行数:35,代码来源:AggregateControl.java
示例13: CodysFDR
import prefuse.util.PrefuseLib; //导入依赖的package包/类
/**
* Create a new ForceDirectedLayout.
* @param group the data group to layout. Must resolve to a Graph instance.
* @param enforceBounds indicates whether or not the layout should require
* that all node placements stay within the layout bounds.
* @param runonce indicates if the layout will be run in a run-once or
* animated fashion. In run-once mode, the layout will run for a set number
* of iterations when invoked. In animation mode, only one iteration of the
* layout is computed.
*/
public CodysFDR(String group,
boolean enforceBounds, boolean runonce)
{
super(group);
m_nodeGroup = PrefuseLib.getGroupName(group, Graph.NODES);
m_edgeGroup = PrefuseLib.getGroupName(group, Graph.EDGES);
m_enforceBounds = enforceBounds;
m_runonce = runonce;
m_fsim = new ForceSimulator();
m_fsim.addForce(new NBodyForce());
m_fsim.addForce(new SpringForce());
m_fsim.addForce(new DragForce());
}
开发者ID:codydunne,项目名称:netgrok,代码行数:25,代码来源:CodysFDR.java
示例14: addGraph
import prefuse.util.PrefuseLib; //导入依赖的package包/类
/**
* Adds a graph to this visualization, using the given data group
* name. A visual abstraction of the data will be created and registered
* with the visualization. An exception will be thrown if the group name
* is already in use.
* @param group the data group name for the visualized graph. The nodes
* and edges will be available in the "group.nodes" and "group.edges"
* subgroups.
* @param graph the graph to visualize
* @param filter a filter Predicate determining which data Tuples in the
* input graph are visualized
* @param nodeSchema the data schema to use for the visual node table
* @param edgeSchema the data schema to use for the visual edge table
*/
public synchronized VisualGraph addGraph(String group, Graph graph,
Predicate filter, Schema nodeSchema, Schema edgeSchema)
{
checkGroupExists(group); // check before adding sub-tables
String ngroup = PrefuseLib.getGroupName(group, Graph.NODES);
String egroup = PrefuseLib.getGroupName(group, Graph.EDGES);
VisualTable nt, et;
nt = addTable(ngroup, graph.getNodeTable(), filter, nodeSchema);
et = addTable(egroup, graph.getEdgeTable(), filter, edgeSchema);
VisualGraph vg = new VisualGraph(nt, et,
graph.isDirected(), graph.getNodeKeyField(),
graph.getEdgeSourceField(), graph.getEdgeTargetField());
vg.setVisualization(this);
vg.setGroup(group);
addDataGroup(group, vg, graph);
TupleManager ntm = new TupleManager(nt, vg, TableNodeItem.class);
TupleManager etm = new TupleManager(et, vg, TableEdgeItem.class);
nt.setTupleManager(ntm);
et.setTupleManager(etm);
vg.setTupleManagers(ntm, etm);
return vg;
}
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:42,代码来源:Visualization.java
示例15: addTree
import prefuse.util.PrefuseLib; //导入依赖的package包/类
/**
* Adds a tree to this visualization, using the given data group
* name. A visual abstraction of the data will be created and registered
* with the visualization. An exception will be thrown if the group name
* is already in use.
* @param group the data group name for the visualized tree. The nodes
* and edges will be available in the "group.nodes" and "group.edges"
* subgroups.
* @param tree the tree to visualize
* @param filter a filter Predicate determining which data Tuples in the
* input graph are visualized
* @param nodeSchema the data schema to use for the visual node table
* @param edgeSchema the data schema to use for the visual edge table
*/
public synchronized VisualTree addTree(String group, Tree tree,
Predicate filter, Schema nodeSchema, Schema edgeSchema)
{
checkGroupExists(group); // check before adding sub-tables
String ngroup = PrefuseLib.getGroupName(group, Graph.NODES);
String egroup = PrefuseLib.getGroupName(group, Graph.EDGES);
VisualTable nt, et;
nt = addTable(ngroup, tree.getNodeTable(), filter, nodeSchema);
et = addTable(egroup, tree.getEdgeTable(), filter, edgeSchema);
VisualTree vt = new VisualTree(nt, et, tree.getNodeKeyField(),
tree.getEdgeSourceField(), tree.getEdgeTargetField());
vt.setVisualization(this);
vt.setGroup(group);
addDataGroup(group, vt, tree);
TupleManager ntm = new TupleManager(nt, vt, TableNodeItem.class);
TupleManager etm = new TupleManager(et, vt, TableEdgeItem.class);
nt.setTupleManager(ntm);
et.setTupleManager(etm);
vt.setTupleManagers(ntm, etm);
return vt;
}
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:41,代码来源:Visualization.java
示例16: getSourceTuple
import prefuse.util.PrefuseLib; //导入依赖的package包/类
/**
* Get the Tuple from a backing source data set that corresponds most
* closely to the given VisualItem.
* @param item the VisualItem for which to retreive the source tuple
* @return the data source tuple, or null if no such tuple could
* be found
*/
public Tuple getSourceTuple(VisualItem item) {
// get the source group and tuple set, exit if none
String group = item.getGroup();
TupleSet source = getSourceData(group);
if ( source == null ) return null;
// first get the source table and row value
int row = item.getRow();
Table t = item.getTable();
while ( t instanceof VisualTable ) {
VisualTable vt = (VisualTable)t;
row = vt.getParentRow(row);
t = vt.getParentTable();
}
// now get the appropriate source tuple
// graphs maintain their own tuple managers so treat them specially
String cgroup = PrefuseLib.getChildGroup(group);
if ( cgroup != null ) {
String pgroup = PrefuseLib.getParentGroup(group);
Graph g = (Graph)getSourceData(pgroup);
if ( t == g.getNodeTable() ) {
return g.getNode(row);
} else {
return g.getEdge(row);
}
} else {
return t.getTuple(row);
}
}
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:38,代码来源:Visualization.java
示例17: visit
import prefuse.util.PrefuseLib; //导入依赖的package包/类
/**
* Visit a specific node and update its degree-of-interest.
*/
private void visit(NodeItem n, NodeItem c, int doi, int ldist) {
PrefuseLib.updateVisible(n, true);
double localDOI = -ldist / Math.min(1000.0, m_divisor);
n.setDOI(doi+localDOI);
if ( c != null ) {
EdgeItem e = (EdgeItem)c.getParentEdge();
e.setDOI(c.getDOI());
PrefuseLib.updateVisible(e, true);
}
}
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:15,代码来源:FisheyeTreeFilter.java
示例18: run
import prefuse.util.PrefuseLib; //导入依赖的package包/类
/**
* @see prefuse.action.Action#run(double)
*/
public void run(double frac) {
Iterator items = m_vis.items(m_group, m_filter);
while ( items.hasNext() ) {
VisualItem item = (VisualItem)items.next();
PrefuseLib.updateVisible(item, m_predicate.getBoolean(item));
}
}
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:11,代码来源:VisibilityFilter.java
示例19: getTable
import prefuse.util.PrefuseLib; //导入依赖的package包/类
/**
* Create a new table for representing axis labels.
*/
protected VisualTable getTable() {
TupleSet ts = m_vis.getGroup(m_group);
if ( ts == null ) {
Schema s = PrefuseLib.getAxisLabelSchema();
VisualTable vt = m_vis.addTable(m_group, s);
vt.index(VALUE);
return vt;
} else if ( ts instanceof VisualTable ) {
return (VisualTable)ts;
} else {
throw new IllegalStateException(
"Group already exists, not being used for labels");
}
}
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:18,代码来源:AxisLabelLayout.java
示例20: FruchtermanReingoldLayout
import prefuse.util.PrefuseLib; //导入依赖的package包/类
/**
* Create a new FruchtermanReingoldLayout
* @param graph the data field to layout. Must resolve to a Graph instance.
* @param maxIter the maximum number of iterations of the algorithm to run
*/
public FruchtermanReingoldLayout(String graph, int maxIter) {
super(graph);
m_nodeGroup = PrefuseLib.getGroupName(graph, Graph.NODES);
m_edgeGroup = PrefuseLib.getGroupName(graph, Graph.EDGES);
this.maxIter = maxIter;
}
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:12,代码来源:FruchtermanReingoldLayout.java
注:本文中的prefuse.util.PrefuseLib类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论