本文整理汇总了Java中prefuse.visual.VisualItem.setY方法的典型用法代码示例。如果您正苦于以下问题:Java VisualItem.setY方法的具体用法?Java VisualItem.setY怎么用?Java VisualItem.setY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类prefuse.visual.VisualItem
的用法示例。
在下文中一共展示了VisualItem.setY方法的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);
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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());
}
}
}
}
示例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));
}
示例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();
}
示例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);
}
示例9: setY
import prefuse.visual.VisualItem; //导入方法依赖的package包/类
/**
* Update the y-coordinate of an item. The current y value will become the
* new starting y value, while the given value will become the new current
* x and ending y values. This method also supports an optional referrer
* item, whose y coordinate will become the new starting y coordinate
* of item if item's current x value is NaN.
* @param item the VisualItem to update
* @param referrer an optional referrer VisualItem
* @param y the y value to set
*/
public static void setY(VisualItem item, VisualItem referrer, double y) {
double sy = item.getY();
if ( Double.isNaN(sy) )
sy = (referrer != null ? referrer.getY() : y);
item.setStartY(sy);
item.setEndY(y);
item.setY(y);
}