本文整理汇总了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());
}
}
示例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();
}
示例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());
}
}
示例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));
}
示例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;
}
示例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));
}
示例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;
}
示例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;
}
示例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;
}