本文整理汇总了Java中prefuse.visual.VisualItem.setFillColor方法的典型用法代码示例。如果您正苦于以下问题:Java VisualItem.setFillColor方法的具体用法?Java VisualItem.setFillColor怎么用?Java VisualItem.setFillColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类prefuse.visual.VisualItem
的用法示例。
在下文中一共展示了VisualItem.setFillColor方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: isBoxItem
import prefuse.visual.VisualItem; //导入方法依赖的package包/类
public boolean isBoxItem(VisualItem item) {
if (BOX_ITEM_LABEL.equals(item.getString("label"))) {
boxItem = item;
item.setFillColor(ColorLib.rgba(150, 150, 255, 100));
return true;
}
return false;
}
示例3: 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;
}
}