本文整理汇总了Java中com.cburch.logisim.instance.StdAttr.ATTR_LABEL_COLOR属性的典型用法代码示例。如果您正苦于以下问题:Java StdAttr.ATTR_LABEL_COLOR属性的具体用法?Java StdAttr.ATTR_LABEL_COLOR怎么用?Java StdAttr.ATTR_LABEL_COLOR使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.cburch.logisim.instance.StdAttr
的用法示例。
在下文中一共展示了StdAttr.ATTR_LABEL_COLOR属性的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setValue
@Override
public <V> void setValue(Attribute<V> attr, V value) {
if (attr == StdAttr.WIDTH) {
width = (BitWidth) value;
} else if (attr == Pin.ATTR_TRISTATE) {
threeState = ((Boolean) value).booleanValue();
} else if (attr == Pin.ATTR_TYPE) {
type = ((Boolean) value).booleanValue() ? EndData.OUTPUT_ONLY : EndData.INPUT_ONLY;
} else if (attr == Pin.ATTR_PULL) {
pull = value;
} else if (attr == StdAttr.ATTR_LABEL_COLOR) {
LabelColor = (Color) value;
} else {
super.setValue(attr, value);
return;
}
fireAttributeValueChanged(attr, value);
}
示例2: getValue
@Override
public <E> E getValue(Attribute<E> attr) {
if (attr == StdAttr.FACING)
return (E) facing;
if (attr == StdAttr.LABEL)
return (E) label;
if (attr == Pin.ATTR_LABEL_LOC)
return (E) labelloc;
if (attr == StdAttr.LABEL_FONT)
return (E) labelfont;
if (attr == RadixOption.ATTRIBUTE)
return (E) radix;
if (attr == StdAttr.ATTR_LABEL_COLOR)
return (E) labelColor;
return null;
}
示例3: setValue
@Override
public <V> void setValue(Attribute<V> attr, V value) {
if (attr == StdAttr.FACING) {
facing = (Direction) value;
} else if (attr == StdAttr.LABEL) {
label = (String) value;
} else if (attr == Pin.ATTR_LABEL_LOC) {
labelloc = (Direction) value;
} else if (attr == StdAttr.LABEL_FONT) {
labelfont = (Font) value;
} else if (attr == RadixOption.ATTRIBUTE) {
radix = (RadixOption) value;
} else if (attr == StdAttr.ATTR_LABEL_COLOR) {
labelColor = (Color) value;
} else {
throw new IllegalArgumentException("unknown attribute");
}
fireAttributeValueChanged(attr, value);
}
示例4: getValue
@Override
public <E> E getValue(Attribute<E> attr) {
if (attr == StdAttr.FACING)
return (E) facing;
if (attr == StdAttr.LABEL)
return (E) label;
if (attr == StdAttr.LABEL_FONT)
return (E) labelFont;
if (attr == StdAttr.ATTR_LABEL_COLOR)
return (E) labelcolor;
if (attr == LABEL_LOCATION_ATTR)
return (E) labelLocation;
else
return source.getStaticAttributes().getValue(attr);
}
示例5: getValue
@Override
public <V> V getValue(Attribute<V> attr) {
if (attr == StdAttr.WIDTH)
return (V) width;
if (attr == Pin.ATTR_TRISTATE)
return (V) Boolean.valueOf(threeState);
if (attr == Pin.ATTR_TYPE)
return (V) Boolean.valueOf(type == EndData.OUTPUT_ONLY);
if (attr == Pin.ATTR_PULL)
return (V) pull;
if (attr == StdAttr.ATTR_LABEL_COLOR) {
return (V) LabelColor;
}
return super.getValue(attr);
}
示例6: getValue
@Override
public <V> V getValue(Attribute<V> attr) {
if (attr == StdAttr.FACING)
return (V) facing;
if (attr == StdAttr.WIDTH)
return (V) width;
if (attr == StdAttr.LABEL)
return (V) label;
if (attr == StdAttr.LABEL_FONT)
return (V) labelFont;
if (attr == ATTR_SIZE)
return (V) size;
if (attr == ATTR_INPUTS)
return (V) Integer.valueOf(inputs);
if (attr == ATTR_OUTPUT)
return (V) out;
if (attr == ATTR_XOR)
return (V) xorBehave;
if (attr == StdAttr.ATTR_LABEL_COLOR)
return (V) labelColor;
if (attr instanceof NegateAttribute) {
int index = ((NegateAttribute) attr).index;
int bit = (negated >> index) & 1;
return (V) Boolean.valueOf(bit == 1);
}
return null;
}
示例7: setValue
@Override
public <V> void setValue(Attribute<V> attr, V value) {
if (attr == StdAttr.WIDTH) {
width = (BitWidth) value;
int bits = width.getWidth();
int mask = bits >= 32 ? -1 : ((1 << inputs) - 1);
negated &= mask;
} else if (attr == StdAttr.FACING) {
facing = (Direction) value;
} else if (attr == StdAttr.LABEL) {
label = (String) value;
} else if (attr == StdAttr.LABEL_FONT) {
labelFont = (Font) value;
} else if (attr == ATTR_SIZE) {
size = (AttributeOption) value;
} else if (attr == ATTR_INPUTS) {
inputs = ((Integer) value).intValue();
fireAttributeListChanged();
} else if (attr == ATTR_XOR) {
xorBehave = (AttributeOption) value;
} else if (attr == ATTR_OUTPUT) {
out = (AttributeOption) value;
} else if (attr == StdAttr.ATTR_LABEL_COLOR) {
labelColor = (Color) value;
} else if (attr instanceof NegateAttribute) {
int index = ((NegateAttribute) attr).index;
if (((Boolean) value).booleanValue()) {
negated |= 1 << index;
} else {
negated &= ~(1 << index);
}
} else {
throw new IllegalArgumentException("unrecognized argument");
}
fireAttributeValueChanged(attr, value);
}
示例8: instanceAttributeChanged
@Override
public void instanceAttributeChanged(Instance instance, Attribute<?> attr) {
if (attr == StdAttr.FACING) {
computePorts(instance);
} else if (attr == CircuitAttributes.LABEL_LOCATION_ATTR || attr == StdAttr.ATTR_LABEL_COLOR) {
configureLabel(instance);
}
}