当前位置: 首页>>代码示例>>Java>>正文


Java StdAttr.ATTR_LABEL_COLOR属性代码示例

本文整理汇总了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);
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:18,代码来源:PinAttributes.java

示例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;
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:16,代码来源:ProbeAttributes.java

示例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);
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:19,代码来源:ProbeAttributes.java

示例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);
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:16,代码来源:CircuitAttributes.java

示例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);
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:15,代码来源:PinAttributes.java

示例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;
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:28,代码来源:GateAttributes.java

示例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);
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:36,代码来源:GateAttributes.java

示例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);
	}
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:8,代码来源:SubcircuitFactory.java


注:本文中的com.cburch.logisim.instance.StdAttr.ATTR_LABEL_COLOR属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。