本文整理汇总了Java中com.cburch.logisim.instance.StdAttr.LABEL属性的典型用法代码示例。如果您正苦于以下问题:Java StdAttr.LABEL属性的具体用法?Java StdAttr.LABEL怎么用?Java StdAttr.LABEL使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.cburch.logisim.instance.StdAttr
的用法示例。
在下文中一共展示了StdAttr.LABEL属性的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setValue
@Override
public <V> void setValue(Attribute<V> attr, V value) {
if (attr == StdAttr.FACING) {
facing = (Direction) value;
configureLabel();
} else if (attr == StdAttr.WIDTH) {
width = (BitWidth) value;
} else if (attr == StdAttr.LABEL) {
label = (String) value;
} else if (attr == StdAttr.LABEL_FONT) {
labelFont = (Font) value;
} else {
throw new IllegalArgumentException("unknown attribute");
}
offsetBounds = null;
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: instanceAttributeChanged
@Override
protected void instanceAttributeChanged(Instance instance, Attribute<?> attr) {
if (attr == StdAttr.FACING) {
configureLabel(instance);
instance.recomputeBounds();
} else if (attr == StdAttr.LABEL || attr == StdAttr.LABEL_FONT) {
instance.recomputeBounds();
}
}
示例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;
return null;
}
示例7: 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;
}
示例8: 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);
}
示例9: attributeValueChanged
@Override
public void attributeValueChanged(AttributeEvent e) {
Object attr = e.getAttribute();
if (attr == CircuitAttributes.CIRCUIT_LABEL_ATTR || attr == StdAttr.LABEL) {
model.fireNodeChanged(this);
}
}
示例10: attributeValueChanged
@Override
public void attributeValueChanged(AttributeEvent e) {
Attribute<?> attr = e.getAttribute();
if (attr == StdAttr.FACING || attr == StdAttr.LABEL || attr == Pin.ATTR_TYPE) {
appearanceManager.updatePorts();
}
}
示例11: attributeValueChanged
@Override
public void attributeValueChanged(AttributeEvent e) {
Attribute<?> attr = e.getAttribute();
if (attr == StdAttr.LABEL || attr == PullResistor.ATTR_PULL_TYPE) {
voidBundleMap();
}
}