本文整理汇总了Java中org.jhotdraw.draw.AttributeKey类的典型用法代码示例。如果您正苦于以下问题:Java AttributeKey类的具体用法?Java AttributeKey怎么用?Java AttributeKey使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AttributeKey类属于org.jhotdraw.draw包,在下文中一共展示了AttributeKey类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: BoundsOutlineHandle
import org.jhotdraw.draw.AttributeKey; //导入依赖的package包/类
/**
* Creates a bounds outline handle for resizing or transforming a component.
*
* @param owner
*/
public BoundsOutlineHandle(Figure owner, //
AttributeKey<Stroke> stroke1Enabled, AttributeKey<Color> strokeColor1Enabled,//
AttributeKey<Stroke> stroke2Enabled, AttributeKey<Color> strokeColor2Enabled,//
AttributeKey<Stroke> stroke1Disabled, AttributeKey<Color> strokeColor1Disabled,//
AttributeKey<Stroke> stroke2Disabled, AttributeKey<Color> strokeColor2Disabled
) {
super(owner);
this.stroke1Enabled = stroke1Enabled;
this.strokeColor1Enabled = strokeColor1Enabled;
this.stroke2Enabled = stroke2Enabled;
this.strokeColor2Enabled = strokeColor2Enabled;
this.stroke1Disabled = stroke1Disabled;
this.strokeColor1Disabled = strokeColor1Disabled;
this.stroke2Disabled = stroke2Disabled;
this.strokeColor2Disabled = strokeColor2Disabled;
}
示例2: attributeChanged
import org.jhotdraw.draw.AttributeKey; //导入依赖的package包/类
@Override
public void attributeChanged(FigureEvent e) {
if (e.getSource() == drawing) {
AttributeKey a = e.getAttribute();
if (a.equals(CANVAS_HEIGHT) || a.equals(CANVAS_WIDTH)) {
validateViewTranslation();
repaint(); // must repaint everything
}
if (e.getInvalidatedArea() != null) {
repaintDrawingArea(e.getInvalidatedArea());
} else {
repaintDrawingArea(viewToDrawing(getCanvasViewBounds()));
}
} else {
if (e.getInvalidatedArea() != null) {
repaintDrawingArea(e.getInvalidatedArea());
}
}
}
示例3: AbstractAttributeEditorHandler
import org.jhotdraw.draw.AttributeKey; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public AbstractAttributeEditorHandler(AttributeKey<T> key, @Nullable Map<AttributeKey, Object> defaultAttributes, AttributeEditor<T> attributeEditor, @Nullable DrawingEditor drawingEditor, boolean updateDrawingEditorDefaults) {
eventHandler = new EventHandler();
this.defaultAttributes = (Map<AttributeKey, Object>) ((defaultAttributes == null) ? Collections.emptyMap() : defaultAttributes);
attributeEditor.setAttributeValue(key.getDefaultValue());
setAttributeKey(key);
setAttributeEditor(attributeEditor);
setEditor(drawingEditor);
isUpdateDrawingEditorDefaults = updateDrawingEditorDefaults;
}
示例4: setAttributeEnabled
import org.jhotdraw.draw.AttributeKey; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
@Override
public void setAttributeEnabled(AttributeKey key, boolean b) {
super.setAttributeEnabled(key, b);
for (final BezierFigure figure : figures) {
figure.setAttributeEnabled(key, b);
}
}
示例5: setAttributes
import org.jhotdraw.draw.AttributeKey; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
@Override
public void setAttributes(Map<AttributeKey, Object> map) {
super.setAttributes(map);
for (final BezierFigure figure : figures) {
figure.setAttributes(map);
}
}
示例6: set
import org.jhotdraw.draw.AttributeKey; //导入依赖的package包/类
/**
* Sets an attribute of the figure.
* AttributeKey name and semantics are defined by the class implementing
* the figure interface.
*/
@Override
public <T> void set(AttributeKey<T> key, T newValue) {
super.set(key, newValue);
for (final BezierFigure figure : figures) {
figure.set(key, newValue);
}
}
示例7: set
import org.jhotdraw.draw.AttributeKey; //导入依赖的package包/类
private <T> void set(final F fig, final AttributeKey<T> key, final T value) {
if (MiscUtils.equal(value, fig.get(key))) {
// NB: Do not trigger an attribute change event if value already matches.
return;
}
fig.set(key, value);
}
示例8: UndoableAttributeEdit
import org.jhotdraw.draw.AttributeKey; //导入依赖的package包/类
public UndoableAttributeEdit(Set<Figure> editedFigures, AttributeKey<T> attributeKey, T editRedoValue, LinkedList<Object> editUndoData) {
this.editedFigures = editedFigures;
this.attributeKey = attributeKey;
this.editRedoValue = editRedoValue;
this.editUndoData = editUndoData;
}
示例9: getAttributeKey
import org.jhotdraw.draw.AttributeKey; //导入依赖的package包/类
public AttributeKey<T> getAttributeKey() {
return attributeKey;
}
示例10: setAttributeKey
import org.jhotdraw.draw.AttributeKey; //导入依赖的package包/类
public void setAttributeKey(AttributeKey<T> newValue) {
attributeKey = newValue;
}
示例11: DrawingAttributeEditorHandler
import org.jhotdraw.draw.AttributeKey; //导入依赖的package包/类
public DrawingAttributeEditorHandler(AttributeKey<T> key, AttributeEditor<T> attributeEditor, @Nullable DrawingEditor drawingEditor) {
super(key, attributeEditor, drawingEditor, false);
}
示例12: FigureAttributeEditorHandler
import org.jhotdraw.draw.AttributeKey; //导入依赖的package包/类
public FigureAttributeEditorHandler(AttributeKey<T> key, AttributeEditor<T> attributeEditor, DrawingEditor drawingEditor) {
super(key, attributeEditor, drawingEditor);
}