use of com.cburch.logisim.data.Attribute in project logisim-evolution by reds-heig.
the class AbstractCanvasObject method setForStroke.
protected boolean setForStroke(Graphics g) {
List<Attribute<?>> attrs = getAttributes();
if (attrs.contains(DrawAttr.PAINT_TYPE)) {
Object value = getValue(DrawAttr.PAINT_TYPE);
if (value == DrawAttr.PAINT_FILL)
return false;
}
Integer width = getValue(DrawAttr.STROKE_WIDTH);
if (width != null && width.intValue() > 0) {
Color color = getValue(DrawAttr.STROKE_COLOR);
if (color != null && color.getAlpha() == 0) {
return false;
} else {
GraphicsUtil.switchToWidth(g, width.intValue());
if (color != null)
g.setColor(color);
return true;
}
} else {
return false;
}
}
Aggregations