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


Java VisualItem.setX方法代码示例

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


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

示例1: process

import prefuse.visual.VisualItem; //导入方法依赖的package包/类
/**
 * @see prefuse.action.ItemAction#process(prefuse.visual.VisualItem, double)
 */
public void process(VisualItem item, double frac) {
    double v = item.getStartX();
    item.setX(v + frac*(item.getEndX()-v));
    v = item.getStartY();
    item.setY(v + frac*(item.getEndY()-v));
    v = item.getDouble(VisualItem.STARTX2);
    v = v + frac*(item.getDouble(VisualItem.ENDX2)-v);
    item.setDouble(VisualItem.X2, v);
    v = item.getDouble(VisualItem.STARTY2);
    v = v + frac*(item.getDouble(VisualItem.ENDY2)-v);
    item.setDouble(VisualItem.Y2, v);
    
    int c = ColorLib.interp(item.getStartStrokeColor(),
            item.getEndStrokeColor(), frac);
    item.setStrokeColor(c);
    
    int tc = ColorLib.interp(item.getStartTextColor(),
            item.getEndTextColor(), frac);
    item.setTextColor(tc);
    
    int fc = ColorLib.interp(item.getStartFillColor(),
            item.getEndFillColor(), frac);
    item.setFillColor(fc);
}
 
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:28,代码来源:AxisLabelAnimator.java

示例2: move

import prefuse.visual.VisualItem; //导入方法依赖的package包/类
protected static void move(VisualItem item, double dx, double dy) {
    if ( item instanceof AggregateItem ) {
        Iterator items = ((AggregateItem)item).items();
        while ( items.hasNext() ) {
            move((VisualItem)items.next(), dx, dy);
        }
    } else {
        double x = item.getX();
        double y = item.getY();
        item.setStartX(x);  item.setStartY(y);
        item.setX(x+dx);    item.setY(y+dy);
        item.setEndX(x+dx); item.setEndY(y+dy);
    }
}
 
开发者ID:santiontanon,项目名称:RHOG,代码行数:15,代码来源:DLGVisualizer.java

示例3: move

import prefuse.visual.VisualItem; //导入方法依赖的package包/类
protected static void move(VisualItem item, double dx, double dy) {
    if ( item instanceof AggregateItem ) {
        Iterator<?> items = ((AggregateItem)item).items();
        while ( items.hasNext() ) {
            move((VisualItem)items.next(), dx, dy);
        }
    } else {
        double x = item.getX();
        double y = item.getY();
        item.setStartX(x);  item.setStartY(y);
        item.setX(x+dx);    item.setY(y+dy);
        item.setEndX(x+dx); item.setEndY(y+dy);
    }
}
 
开发者ID:codydunne,项目名称:netgrok,代码行数:15,代码来源:AggregateDemo.java

示例4: move

import prefuse.visual.VisualItem; //导入方法依赖的package包/类
protected static void move(VisualItem item, double dx, double dy) {
	if ( item instanceof AggregateItem ) {
		Iterator<?> items = ((AggregateItem)item).items();
		while ( items.hasNext() ) {
			move((VisualItem)items.next(), dx, dy);
		}
	} else {
		double x = item.getX();
		double y = item.getY();
		item.setStartX(x);  item.setStartY(y);
		item.setX(x+dx);    item.setY(y+dy);
		item.setEndX(x+dx); item.setEndY(y+dy);
	}
}
 
开发者ID:codydunne,项目名称:netgrok,代码行数:15,代码来源:CodyTestWindow.java

示例5: 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

示例6: process

import prefuse.visual.VisualItem; //导入方法依赖的package包/类
/**
 * @see prefuse.action.ItemAction#process(prefuse.visual.VisualItem, double)
 */
public void process(VisualItem item, double frac) {
    double sx = item.getStartX();
    double sy = item.getStartY();
    item.setX(sx + frac*(item.getEndX()-sx));
    item.setY(sy + frac*(item.getEndY()-sy));
}
 
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:10,代码来源:LocationAnimator.java

示例7: updateItemsPosition

import prefuse.visual.VisualItem; //导入方法依赖的package包/类
/**
 * Update items position.
 * 
 * @param orderedTerms
 *            the ordered terms
 */
private void updateItemsPosition(List<FeatureTerm> orderedTerms) {
	Iterator<?> i;
	System.out.println("Updating positions...");
	i = vg.nodes();
	int xy = 0;
	for (FeatureTerm t : orderedTerms) {
		System.out.print(".");
		VisualItem vi = (VisualItem) i.next();
		vi.set("id", new Integer(orderedTerms.indexOf(t)));
		// set positions
		int x = caseX(xy);
		int y = caseY(xy);

		// System.out.println(this.getSize().getHeight());
		// System.out.println(orderedTerms.size());
		// System.out.println(this.getSize().getHeight() / orderedTerms.size());

		int multiplier = Math.min(Math.max(orderedTerms.size(), 20), 30);

		vi.setX(x * multiplier);
		vi.setY(y * multiplier);
		xy++;
	}
	// if (gui != null)
	// gui.panelGeneralCB.invalidate();
}
 
开发者ID:santiontanon,项目名称:fterm,代码行数:33,代码来源:CBVisualizer.java

示例8: process

import prefuse.visual.VisualItem; //导入方法依赖的package包/类
/**
 * @see prefuse.action.ItemAction#process(prefuse.visual.VisualItem, double)
 */
public void process(VisualItem item, double frac) {
    if ( m_linear != null && item.isInGroup(m_linear) ) {
        // perform linear interpolation instead
        double s = item.getStartX();
        item.setX(s + frac*(item.getEndX()-s));
        s = item.getStartY();
        item.setY(s + frac*(item.getEndY()-s));
        return;
    }
    
    // otherwise, interpolate in polar coordinates
    sx = item.getStartX() - ax;
    sy = item.getStartY() - ay;
    ex = item.getEndX() - ax;
    ey = item.getEndY() - ay;
        
    sr = Math.sqrt(sx*sx + sy*sy);
    st = Math.atan2(sy,sx);
        
    er = Math.sqrt(ex*ex + ey*ey);
    et = Math.atan2(ey,ex);
    
    stt = st < 0 ? st+MathLib.TWO_PI : st;
    ett = et < 0 ? et+MathLib.TWO_PI : et;
        
    dt1 = et - st;
    dt2 = ett - stt;
        
    if ( Math.abs(dt1) < Math.abs(dt2) ) {
        t = st + frac * dt1;
    } else {
        t = stt + frac * dt2;
    }
    r = sr + frac * (er - sr);
                    
    x = Math.round(ax + r*Math.cos(t));
    y = Math.round(ay + r*Math.sin(t));
        
    item.setX(x);
    item.setY(y);
}
 
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:45,代码来源:PolarLocationAnimator.java

示例9: setX

import prefuse.visual.VisualItem; //导入方法依赖的package包/类
/**
 * Update the x-coordinate of an item. The current x value will become the
 * new starting x value, while the given value will become the new current
 * x and ending x values. This method also supports an optional referrer
 * item, whose x coordinate will become the new starting x coordinate
 * of item if item's current x value is NaN.
 * @param item the VisualItem to update
 * @param referrer an optional referrer VisualItem
 * @param x the x value to set
 */
public static void setX(VisualItem item, VisualItem referrer, double x) {
    double sx = item.getX();
    if ( Double.isNaN(sx) )
        sx = (referrer != null ? referrer.getX() : x);
    
    item.setStartX(sx);
    item.setEndX(x);
    item.setX(x);
}
 
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:20,代码来源:PrefuseLib.java


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