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


Java StdAttr.FACING属性代码示例

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

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

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

示例4: instanceAttributeChanged

@Override
protected void instanceAttributeChanged(Instance instance, Attribute<?> attr) {
	if (attr == StdAttr.FACING) {
		instance.recomputeBounds();
	} else if (attr == ATTR_PULL_TYPE) {
		instance.fireInvalidated();
	}
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:8,代码来源:PullResistor.java

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

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

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

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

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

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

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

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

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

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

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


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