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


Java AttributeMapKey类代码示例

本文整理汇总了Java中com.cburch.draw.model.AttributeMapKey的典型用法代码示例。如果您正苦于以下问题:Java AttributeMapKey类的具体用法?Java AttributeMapKey怎么用?Java AttributeMapKey使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


AttributeMapKey类属于com.cburch.draw.model包,在下文中一共展示了AttributeMapKey类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getName

import com.cburch.draw.model.AttributeMapKey; //导入依赖的package包/类
@Override
public String getName() {
	Attribute<?> a = attr;
	if (a == null) {
		boolean found = false;
		for (AttributeMapKey key : newValues.keySet()) {
			Attribute<?> at = key.getAttribute();
			if (found) {
				if (a == null ? at != null : !a.equals(at)) {
					a = null;
					break;
				}
			} else {
				found = true;
				a = at;
			}
		}
		attr = a;
	}
	if (a == null) {
		return Strings.get("actionChangeAttributes");
	} else {
		return Strings.get("actionChangeAttribute", a.getDisplayName());
	}
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:26,代码来源:ModelChangeAttributeAction.java

示例2: setValueRequested

import com.cburch.draw.model.AttributeMapKey; //导入依赖的package包/类
@Override
public void setValueRequested(Attribute<Object> attr, Object value)
		throws AttrTableSetException {
	SelectionAttributes attrs = (SelectionAttributes) getAttributeSet();
	Map<AttributeMapKey, Object> oldVals;
	oldVals = new HashMap<AttributeMapKey, Object>();
	Map<AttributeMapKey, Object> newVals;
	newVals = new HashMap<AttributeMapKey, Object>();
	for (Map.Entry<AttributeSet, CanvasObject> ent : attrs.entries()) {
		AttributeMapKey key = new AttributeMapKey(attr, ent.getValue());
		oldVals.put(key, ent.getKey().getValue(attr));
		newVals.put(key, value);
	}
	CanvasModel model = canvas.getModel();
	canvas.doAction(new ModelChangeAttributeAction(model, oldVals, newVals));
	fireTitleChanged();
}
 
开发者ID:reds-heig,项目名称:logisim-evolution,代码行数:18,代码来源:AttrTableSelectionModel.java

示例3: getName

import com.cburch.draw.model.AttributeMapKey; //导入依赖的package包/类
@Override
public String getName() {
	Attribute<?> a = attr;
	if (a == null) {
		boolean found = false;
		for (AttributeMapKey key : newValues.keySet()) {
			Attribute<?> at = key.getAttribute();
			if (found) {
				if (a == null ? at != null : !a.equals(at)) { a = null; break; }
			} else {
				found = true;
				a = at;
			}
		}
		attr = a;
	}
	if (a == null) {
		return Strings.get("actionChangeAttributes");
	} else {
		return Strings.get("actionChangeAttribute", a.getDisplayName());
	}
}
 
开发者ID:franciscaconcha,项目名称:ProyectoLogisim,代码行数:23,代码来源:ModelChangeAttributeAction.java

示例4: setValueRequested

import com.cburch.draw.model.AttributeMapKey; //导入依赖的package包/类
@Override
public void setValueRequested(Attribute<Object> attr, Object value)
		throws AttrTableSetException {
	SelectionAttributes attrs = (SelectionAttributes) getAttributeSet();
	HashMap<AttributeMapKey, Object> oldVals;
	oldVals = new HashMap<AttributeMapKey, Object>();
	HashMap<AttributeMapKey, Object> newVals;
	newVals = new HashMap<AttributeMapKey, Object>();
	for (Map.Entry<AttributeSet, CanvasObject> ent : attrs.entries()) {
		AttributeMapKey key = new AttributeMapKey(attr, ent.getValue());
		oldVals.put(key, ent.getKey().getValue(attr));
		newVals.put(key, value);
	}
	CanvasModel model = canvas.getModel();
	canvas.doAction(new ModelChangeAttributeAction(model, oldVals, newVals));
}
 
开发者ID:franciscaconcha,项目名称:ProyectoLogisim,代码行数:17,代码来源:AttrTableSelectionModel.java

示例5: getObjects

import com.cburch.draw.model.AttributeMapKey; //导入依赖的package包/类
@Override
public Collection<CanvasObject> getObjects() {
	HashSet<CanvasObject> ret = new HashSet<CanvasObject>();
	for (AttributeMapKey key : newValues.keySet()) {
		ret.add(key.getObject());
	}
	return ret;
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:9,代码来源:ModelChangeAttributeAction.java

示例6: setValueRequested

import com.cburch.draw.model.AttributeMapKey; //导入依赖的package包/类
@Override
public void setValueRequested(Attribute<Object> attr, Object value) throws AttrTableSetException {
	SelectionAttributes attrs = (SelectionAttributes) getAttributeSet();
	HashMap<AttributeMapKey, Object> oldVals;
	oldVals = new HashMap<AttributeMapKey, Object>();
	HashMap<AttributeMapKey, Object> newVals;
	newVals = new HashMap<AttributeMapKey, Object>();
	for (Map.Entry<AttributeSet, CanvasObject> ent : attrs.entries()) {
		AttributeMapKey key = new AttributeMapKey(attr, ent.getValue());
		oldVals.put(key, ent.getKey().getValue(attr));
		newVals.put(key, value);
	}
	CanvasModel model = canvas.getModel();
	canvas.doAction(new ModelChangeAttributeAction(model, oldVals, newVals));
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:16,代码来源:AttrTableSelectionModel.java

示例7: ModelChangeAttributeAction

import com.cburch.draw.model.AttributeMapKey; //导入依赖的package包/类
public ModelChangeAttributeAction(CanvasModel model,
		Map<AttributeMapKey, Object> oldValues,
		Map<AttributeMapKey, Object> newValues) {
	super(model);
	this.oldValues = oldValues;
	this.newValues = newValues;
}
 
开发者ID:reds-heig,项目名称:logisim-evolution,代码行数:8,代码来源:ModelChangeAttributeAction.java

示例8: getObjects

import com.cburch.draw.model.AttributeMapKey; //导入依赖的package包/类
@Override
public Collection<CanvasObject> getObjects() {
	Set<CanvasObject> ret = new HashSet<CanvasObject>();
	for (AttributeMapKey key : newValues.keySet()) {
		ret.add(key.getObject());
	}
	return ret;
}
 
开发者ID:reds-heig,项目名称:logisim-evolution,代码行数:9,代码来源:ModelChangeAttributeAction.java

示例9: ModelChangeAttributeAction

import com.cburch.draw.model.AttributeMapKey; //导入依赖的package包/类
public ModelChangeAttributeAction(CanvasModel model, Map<AttributeMapKey, Object> oldValues,
		Map<AttributeMapKey, Object> newValues) {
	super(model);
	this.oldValues = oldValues;
	this.newValues = newValues;
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:7,代码来源:ModelChangeAttributeAction.java


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