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


Java VisualItem.getBounds方法代码示例

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


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

示例1: run

import prefuse.visual.VisualItem; //导入方法依赖的package包/类
@Override
public void run( double frac )
{
	Iterator<?> iter = m_vis.items( m_group );

	while ( iter.hasNext() ) {
		DecoratorItem decorator = (DecoratorItem)iter.next();
		VisualItem decoratedItem = decorator.getDecoratedItem();
		Rectangle2D bounds = decoratedItem.getBounds();

		double x = bounds.getCenterX();
		double y = bounds.getCenterY();

		setX( decorator, null, x );
		setY( decorator, null, y );
	}
}
 
开发者ID:kartoFlane,项目名称:hiervis,代码行数:18,代码来源:NodeLabelLayout.java

示例2: run

import prefuse.visual.VisualItem; //导入方法依赖的package包/类
public void run(double frac) {
    Iterator iter = m_vis.items(m_group);
    
    int count = 0;
    while ( iter.hasNext() ) {
        DecoratorItem item = (DecoratorItem)iter.next();
        VisualItem node = item.getDecoratedItem();
        if (node.isVisible()) {
          	  item.setVisible(true);
              count++;
        	  Rectangle2D bounds = node.getBounds();
              setX(item, null, bounds.getCenterX());
              setY(item, null, bounds.getCenterY());
        } else {
        	item.setVisible(false);
        }
        
    }
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:20,代码来源:GraphView.java

示例3: run

import prefuse.visual.VisualItem; //导入方法依赖的package包/类
public void run(double frac) {
    Iterator iter = m_vis.items(m_group);
    while ( iter.hasNext() ) {
        DecoratorItem decorator = (DecoratorItem)iter.next();
        VisualItem decoratedItem = decorator.getDecoratedItem();
        Rectangle2D bounds = decoratedItem.getBounds();
        double x = bounds.getCenterX();
        double y = bounds.getCenterY();
        /* modification to move edge labels more to the arrow head
        double x2 = 0, y2 = 0;
        if (decoratedItem instanceof EdgeItem){
        	VisualItem dest = ((EdgeItem)decoratedItem).getTargetItem(); 
        	x2 = dest.getX();
        	y2 = dest.getY();
        	x = (x + x2) / 2;
        	y = (y + y2) / 2;
        }
        */
        setX(decorator, null, x);
        setY(decorator, null, y);
    }
}
 
开发者ID:codydunne,项目名称:netgrok,代码行数:23,代码来源:AggregateDecoratorDemo.java

示例4: editText

import prefuse.visual.VisualItem; //导入方法依赖的package包/类
/**
 * Edit text for the given VisualItem and attribute. Presents a text editing widget spaning the item's bounding box. Use stopEditing() to hide the text widget. When stopEditing() is called, the
 * data field will automatically be updated with the VisualItem.
 * 
 * @param item
 *            the VisualItem to edit
 * @param attribute
 *            the attribute to edit
 */
public void editText(VisualItem item, String attribute)
{
	if (m_editing)
	{
		stopEditing();
	}
	Rectangle2D b = item.getBounds();
	Rectangle r = m_transform.createTransformedShape(b).getBounds();

	// Font f = getFont();
	// int size = (int) Math.round(f.getSize() * m_transform.getScaleX());
	// Font nf = new Font(f.getFontName(), f.getStyle(), size);
	// m_editor.setFont(nf);

	editText(item, attribute, r);
}
 
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:26,代码来源:PDisplay.java

示例5: run

import prefuse.visual.VisualItem; //导入方法依赖的package包/类
@Override
public void run(double frac) {
          Iterator<?> iter = m_vis.items(m_group);
          while ( iter.hasNext() ) {
              DecoratorItem item = (DecoratorItem)iter.next();
              VisualItem node = item.getDecoratedItem();                
              //Dbg.printMsg("--> " + node, LogLvl.Normal);
              Rectangle2D bounds = node.getBounds();
              setX(item, null, bounds.getCenterX());
              setY(item, null, bounds.getCenterY());                
           if (((String)node.get(m_group)).equals("FAKE")) {
               item.setTextColor(ColorLib.alpha(0));	                
           }
           else if (((String)node.get(m_group)).equals("LBUB")) {
               item.setTextColor(ColorLib.alpha(0));	                
           }
          }
      }
 
开发者ID:FedericoPecora,项目名称:meta-csp-framework,代码行数:19,代码来源:PlotSTPTemporalModule.java

示例6: run

import prefuse.visual.VisualItem; //导入方法依赖的package包/类
@Override
public void run( double frac )
{
    Iterator iter = m_vis.items( m_group );
    while( iter.hasNext() )
    {
        DecoratorItem item = (DecoratorItem) iter.next();
        VisualItem node = item.getDecoratedItem();
        Rectangle2D bounds = node.getBounds();
        setX( item, node, bounds.getX() + StackedLayout.INSET );
        setY( item, node, bounds.getY() + StackedLayout.INSET + 12 );
    }
}
 
开发者ID:apache,项目名称:polygene-java,代码行数:14,代码来源:StackedGraphDisplay.java

示例7: run

import prefuse.visual.VisualItem; //导入方法依赖的package包/类
public void run(double frac) {
    Iterator iter = m_vis.items(m_group);
    while ( iter.hasNext() ) {
        DecoratorItem item = (DecoratorItem)iter.next();
        VisualItem node = item.getDecoratedItem();
        Rectangle2D bounds = node.getBounds();
        setX(item, null, bounds.getCenterX());
        setY(item, null, bounds.getCenterY());
    }
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:11,代码来源:PrefuseRenderer.java

示例8: addPoint

import prefuse.visual.VisualItem; //导入方法依赖的package包/类
private static void addPoint(double[] pts, int idx, 
                             VisualItem item, int growth)
{
    Rectangle2D b = item.getBounds();
    double minX = (b.getMinX())-growth, minY = (b.getMinY())-growth;
    double maxX = (b.getMaxX())+growth, maxY = (b.getMaxY())+growth;
    pts[idx]   = minX; pts[idx+1] = minY;
    pts[idx+2] = minX; pts[idx+3] = maxY;
    pts[idx+4] = maxX; pts[idx+5] = minY;
    pts[idx+6] = maxX; pts[idx+7] = maxY;
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:12,代码来源:AggregateDemo.java

示例9: addPoint

import prefuse.visual.VisualItem; //导入方法依赖的package包/类
private static void addPoint(double[] pts, int idx, 
		VisualItem item, int growth)
{
	Rectangle2D b = item.getBounds();
	double minX = (b.getMinX())-growth, minY = (b.getMinY())-growth;
	double maxX = (b.getMaxX())+growth, maxY = (b.getMaxY())+growth;
	pts[idx]   = minX; pts[idx+1] = minY;
	pts[idx+2] = minX; pts[idx+3] = maxY;
	pts[idx+4] = maxX; pts[idx+5] = minY;
	pts[idx+6] = maxX; pts[idx+7] = maxY;
}
 
开发者ID:codydunne,项目名称:netgrok,代码行数:12,代码来源:CodyTestWindow.java

示例10: run

import prefuse.visual.VisualItem; //导入方法依赖的package包/类
/**
 * @see prefuse.action.Action#run(double)
 */
public void run(double frac) {
    Rectangle2D bounds = getLayoutBounds();
    Point2D anchor = correct(m_anchor, bounds);
    
    final Iterator iter = getVisualization().visibleItems(m_group);
    
    while ( iter.hasNext() ) {
        VisualItem item = (VisualItem)iter.next();
        if ( item.isFixed() ) continue;
        
        // reset distorted values
        // TODO - make this play nice with animation?
        item.setX(item.getEndX());
        item.setY(item.getEndY());
        item.setSize(item.getEndSize());
        
        // compute distortion if we have a distortion focus
        if ( anchor != null ) {
            Rectangle2D bbox = item.getBounds();
            double x = item.getX();
            double y = item.getY();
            
            // position distortion
            if ( m_distortX )
                item.setX(x=distortX(x, anchor, bounds));
            if ( m_distortY )
                item.setY(y=distortY(y, anchor, bounds));
            
            // size distortion
            if ( m_distortSize ) {
                double sz = distortSize(bbox, x, y, anchor, bounds);
                item.setSize(sz*item.getSize());
            }
        }
    }
}
 
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:40,代码来源:Distortion.java

示例11: addPoint

import prefuse.visual.VisualItem; //导入方法依赖的package包/类
private static void addPoint(double[] pts, int idx,
                             VisualItem item, int growth)
{
    Rectangle2D b = item.getBounds();
    double minX = (b.getMinX())-growth, minY = (b.getMinY())-growth;
    double maxX = (b.getMaxX())+growth, maxY = (b.getMaxY())+growth;
    pts[idx]   = minX; pts[idx+1] = minY;
    pts[idx+2] = minX; pts[idx+3] = maxY;
    pts[idx+4] = maxX; pts[idx+5] = minY;
    pts[idx+6] = maxX; pts[idx+7] = maxY;
}
 
开发者ID:santiontanon,项目名称:fterm,代码行数:12,代码来源:FTVisualizer.java

示例12: updateNodePositions

import prefuse.visual.VisualItem; //导入方法依赖的package包/类
private void updateNodePositions() {
    Rectangle2D bounds = getLayoutBounds();
    double x1=0, x2=0, y1=0, y2=0;
    if ( bounds != null ) {
        x1 = bounds.getMinX(); y1 = bounds.getMinY();
        x2 = bounds.getMaxX(); y2 = bounds.getMaxY();
    }
    
    // update positions
    Iterator iter = m_vis.visibleItems(m_nodeGroup);
    while ( iter.hasNext() ) {
        VisualItem item = (VisualItem)iter.next();
        ForceItem fitem = (ForceItem)item.get(FORCEITEM);
        
        if ( item.isFixed() ) {
            // clear any force computations
            fitem.force[0] = 0.0f;
            fitem.force[1] = 0.0f;
            fitem.velocity[0] = 0.0f;
            fitem.velocity[1] = 0.0f;
            
            if ( Double.isNaN(item.getX()) ) {
                setX(item, referrer, 0.0);
                setY(item, referrer, 0.0);
            }
            continue;
        }
        
        double x = fitem.location[0];
        double y = fitem.location[1];
        
        if ( m_enforceBounds && bounds != null) {
            Rectangle2D b = item.getBounds();
            double hw = b.getWidth()/2;
            double hh = b.getHeight()/2;
            if ( x+hw > x2 ) x = x2-hw;
            if ( x-hw < x1 ) x = x1+hw;
            if ( y+hh > y2 ) y = y2-hh;
            if ( y-hh < y1 ) y = y1+hh;
        }
        
        // set the actual position
        setX(item, referrer, x);
        setY(item, referrer, y);
    }
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:47,代码来源:ForceDirectedLayout.java

示例13: updateNodePositions

import prefuse.visual.VisualItem; //导入方法依赖的package包/类
private void updateNodePositions() {
	Rectangle2D bounds = getLayoutBounds();
	double x1=0, x2=0, y1=0, y2=0;
	if ( bounds != null ) {
		x1 = bounds.getMinX(); y1 = bounds.getMinY();
		x2 = bounds.getMaxX(); y2 = bounds.getMaxY();
	}

	// update positions
	
	TupleSet ts = m_vis.getGroup(m_nodeGroup);
	
	Iterator<?> iter;

	if (m_filter == null)
		iter = ts.tuples();
	else 
		iter = ts.tuples(m_filter);
	
	while ( iter.hasNext() ) {

		VisualItem item = (VisualItem)iter.next();
		ForceItem fitem = (ForceItem)item.get(FORCEITEM);

		if ( item.isFixed() ) {
			// clear any force computations
			fitem.force[0] = 0.0f;
			fitem.force[1] = 0.0f;
			fitem.velocity[0] = 0.0f;
			fitem.velocity[1] = 0.0f;

			if ( Double.isNaN(item.getX()) ) {
				setX(item, referrer, 0.0);
				setY(item, referrer, 0.0);
			}
			continue;
		}

		double x = fitem.location[0];
		double y = fitem.location[1];

		if ( m_enforceBounds && bounds != null) {
			Rectangle2D b = item.getBounds();
			double hw = b.getWidth()/2;
			double hh = b.getHeight()/2;
			if ( x+hw > x2 ) x = x2-hw;
			if ( x-hw < x1 ) x = x1+hw;
			if ( y+hh > y2 ) y = y2-hh;
			if ( y-hh < y1 ) y = y1+hh;
		}

		// set the actual position
		setX(item, referrer, x);
		setY(item, referrer, y);
	}
}
 
开发者ID:codydunne,项目名称:netgrok,代码行数:57,代码来源:PolarDonutFDRLayout.java


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