本文整理汇总了Java中prefuse.visual.VisualItem.setSize方法的典型用法代码示例。如果您正苦于以下问题:Java VisualItem.setSize方法的具体用法?Java VisualItem.setSize怎么用?Java VisualItem.setSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类prefuse.visual.VisualItem
的用法示例。
在下文中一共展示了VisualItem.setSize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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());
}
}
}
}
示例2: render
import prefuse.visual.VisualItem; //导入方法依赖的package包/类
/**
* Renders an {@link Association}.
*
* @param g the 2D graphics
* @param item visual item for the association
* @param isSelected <code>true</code> for selected association
*/
public void render(Graphics2D g, VisualItem item, boolean isSelected) {
Association association = (Association) item.get("association");
item.setSize(isSelected? 3 : 1);
int color;
if (!Boolean.TRUE.equals(item.get("full"))) {
if (!full) {
return;
}
color = associationColor(association);
} else {
if (full) {
return;
}
color = reversed? associationColor(association.reversalAssociation) : associationColor(association);
}
item.setFillColor(color);
item.setStrokeColor(color);
BasicStroke stroke = item.getStroke();
if (stroke != null) {
if (reversed) {
if (association != null) {
association = association.reversalAssociation;
}
}
if (association != null && association.isRestricted() && !association.isIgnored()) {
item.setStroke(new BasicStroke(stroke.getLineWidth(), stroke.getEndCap(), stroke.getLineJoin(), stroke.getMiterLimit(),
new float[] { 8f, 6f }, 1.0f));
} else {
item.setStroke(new BasicStroke(stroke.getLineWidth(), stroke.getEndCap(), stroke.getLineJoin(), stroke.getMiterLimit()));
}
}
if ("XML".equals(association.getDataModel().getExportModus())) {
m_arrowHead = updateArrowHead(m_arrowWidth, m_arrowHeight, association, isSelected);
arrowIsPotAggregation = true;
} else {
if (arrowIsPotAggregation) {
m_arrowHead = updateArrowHead(m_arrowWidth, m_arrowHeight);
}
arrowIsPotAggregation = false;
}
starPosition = null;
render(g, item);
if (starPosition != null && starImage != null) {
double size = STAR_SIZE;
transform.setTransform(size, 0, 0, size, starPosition.getX() - size * (starWidth / 2), starPosition.getY() - size * (starHeight / 2));
g.drawImage(starImage, transform, null);
starPosition = null;
}
}
示例3: process
import prefuse.visual.VisualItem; //导入方法依赖的package包/类
/**
* @see prefuse.action.ItemAction#process(prefuse.visual.VisualItem, double)
*/
public void process(VisualItem item, double frac) {
double ss = item.getStartSize();
item.setSize(ss + frac*(item.getEndSize() - ss));
}