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


Java StdAttr.LABEL属性代码示例

本文整理汇总了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);
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:17,代码来源:TunnelAttributes.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: 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();
	}
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:9,代码来源:Tunnel.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;
	return null;
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:12,代码来源:TunnelAttributes.java

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

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

示例9: attributeValueChanged

@Override
public void attributeValueChanged(AttributeEvent e) {
	Object attr = e.getAttribute();
	if (attr == CircuitAttributes.CIRCUIT_LABEL_ATTR || attr == StdAttr.LABEL) {
		model.fireNodeChanged(this);
	}
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:7,代码来源:SimulationTreeCircuitNode.java

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

示例11: attributeValueChanged

@Override
public void attributeValueChanged(AttributeEvent e) {
	Attribute<?> attr = e.getAttribute();
	if (attr == StdAttr.LABEL || attr == PullResistor.ATTR_PULL_TYPE) {
		voidBundleMap();
	}
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:7,代码来源:CircuitWires.java


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