本文整理汇总了Java中com.cburch.logisim.instance.StdAttr.FACING属性的典型用法代码示例。如果您正苦于以下问题:Java StdAttr.FACING属性的具体用法?Java StdAttr.FACING怎么用?Java StdAttr.FACING使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.cburch.logisim.instance.StdAttr
的用法示例。
在下文中一共展示了StdAttr.FACING属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
示例2: instanceAttributeChanged
@Override
protected void instanceAttributeChanged(Instance instance, Attribute<?> attr) {
if (attr == StdAttr.FACING) {
instance.recomputeBounds();
computeTextField(instance);
} else if (attr == Io.ATTR_LABEL_LOC) {
computeTextField(instance);
}
}
示例3: instanceAttributeChanged
@Override
protected void instanceAttributeChanged(Instance instance, Attribute<?> attr) {
if (attr == StdAttr.FACING || attr == NotGate.ATTR_SIZE) {
instance.recomputeBounds();
configurePorts(instance);
NotGate.configureLabel(instance, false, instance.getPortLocation(2));
} else if (attr == ATTR_CONTROL) {
configurePorts(instance);
NotGate.configureLabel(instance, false, instance.getPortLocation(2));
} else if (attr == NEGATE_CONTROL) {
instance.fireInvalidated();
}
}
示例4: instanceAttributeChanged
@Override
protected void instanceAttributeChanged(Instance instance, Attribute<?> attr) {
if (attr == StdAttr.FACING) {
instance.recomputeBounds();
} else if (attr == ATTR_PULL_TYPE) {
instance.fireInvalidated();
}
}
示例5: instanceAttributeChanged
@Override
protected void instanceAttributeChanged(Instance instance, Attribute<?> attr) {
if (attr == Pin.ATTR_LABEL_LOC) {
configureLabel(instance);
} else if (attr == StdAttr.FACING || attr == RadixOption.ATTRIBUTE) {
instance.recomputeBounds();
configureLabel(instance);
}
}
示例6: 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();
}
}
示例7: instanceAttributeChanged
@Override
protected void instanceAttributeChanged(Instance instance, Attribute<?> attr) {
if (attr == ATTR_TYPE) {
configurePorts(instance);
} else if (attr == StdAttr.WIDTH || attr == StdAttr.FACING || attr == Pin.ATTR_LABEL_LOC) {
instance.recomputeBounds();
PinAttributes attrs = (PinAttributes) instance.getAttributeSet();
Probe.configureLabel(instance, attrs.labelloc, attrs.facing);
} else if (attr == Pin.ATTR_TRISTATE || attr == Pin.ATTR_PULL) {
instance.fireInvalidated();
}
}
示例8: instanceAttributeChanged
@Override
protected void instanceAttributeChanged(Instance instance, Attribute<?> attr) {
if (attr == Pin.ATTR_LABEL_LOC) {
configureLabel(instance);
} else if (attr == StdAttr.FACING) {
instance.recomputeBounds();
configureLabel(instance);
}
}
示例9: attributeValueChanged
@Override
public void attributeValueChanged(AttributeEvent e) {
Attribute<?> attr = e.getAttribute();
if (attr == StdAttr.FACING || attr == StdAttr.LABEL || attr == Pin.ATTR_TYPE) {
appearanceManager.updatePorts();
}
}
示例10: 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;
}
示例11: instanceAttributeChanged
@Override
protected void instanceAttributeChanged(Instance instance, Attribute<?> attr) {
if (attr == Io.MULTI_BIT)
updateports(instance);
else if (attr == StdAttr.FACING) {
instance.recomputeBounds();
computeTextField(instance);
updateports(instance);
} else if (attr == Io.ATTR_LABEL_LOC)
computeTextField(instance);
}
示例12: instanceAttributeChanged
@Override
protected void instanceAttributeChanged(Instance instance, Attribute<?> attr) {
if (attr == StdAttr.FACING || attr == ATTR_NSWITCHES) {
instance.recomputeBounds();
computeTextField(instance);
updateports(instance);
} else if (attr == Io.ATTR_LABEL_LOC) {
computeTextField(instance);
}
}
示例13: setValue
@Override
public <V> void setValue(Attribute<V> attr, V value) {
if (attr == StdAttr.FACING) {
facing = (Direction) value;
} else if (attr == StdAttr.WIDTH) {
width = (BitWidth) value;
this.value = this.value.extendWidth(width.getWidth(), this.value.get(this.value.getWidth() - 1));
} else if (attr == ATTR_VALUE) {
int val = ((Integer) value).intValue();
this.value = Value.createKnown(width, val);
} else {
throw new IllegalArgumentException("unknown attribute " + attr);
}
fireAttributeValueChanged(attr, value);
}
示例14: instanceAttributeChanged
@Override
protected void instanceAttributeChanged(Instance instance, Attribute<?> attr) {
if (attr == StdAttr.WIDTH) {
instance.recomputeBounds();
updatePorts(instance);
} else if (attr == StdAttr.FACING) {
instance.recomputeBounds();
} else if (attr == ATTR_VALUE) {
instance.fireInvalidated();
}
}
示例15: 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);
}
}