Right click rotation during component creation throws an error

This commit is contained in:
bancika
2013-04-30 10:06:49 +00:00
parent 8def96d03c
commit bee14895d7
2 changed files with 15 additions and 13 deletions
@@ -376,20 +376,22 @@ public class InstantiationManager {
return;
}
try {
angleProperty.readFrom(this.componentSlot);
Object value = angleProperty.getValue();
if (value instanceof Orientation) {
angleProperty
.setValue(Orientation.values()[(((Orientation) value)
.ordinal() + 1)
% Orientation.values().length]);
} else if (value instanceof OrientationHV) {
angleProperty
.setValue(OrientationHV.values()[(((OrientationHV) value)
.ordinal() + 1)
% OrientationHV.values().length]);
for (IDIYComponent<?> component : this.componentSlot) {
angleProperty.readFrom(component);
Object value = angleProperty.getValue();
if (value instanceof Orientation) {
angleProperty
.setValue(Orientation.values()[(((Orientation) value)
.ordinal() + 1)
% Orientation.values().length]);
} else if (value instanceof OrientationHV) {
angleProperty
.setValue(OrientationHV.values()[(((OrientationHV) value)
.ordinal() + 1)
% OrientationHV.values().length]);
}
angleProperty.writeTo(component);
}
angleProperty.writeTo(this.componentSlot);
} catch (Exception e) {
LOG.warn("Error trying to rotate the component", e);
}