}
});
this.iconComponent = new IconPreviewComponent(controller, preferences);
this.turnLeftButton = new JButton(new ResourceAction(preferences, FurniturePanel.class, "TURN_LEFT", true) {
@Override
public void actionPerformed(ActionEvent ev) {
Transform3D oldTransform = getModelRotationTransform();
Transform3D leftRotation = new Transform3D();
leftRotation.rotY(-Math.PI / 2);
leftRotation.mul(oldTransform);
updateModelRotation(leftRotation);
}
});
this.turnRightButton = new JButton(new ResourceAction(preferences, FurniturePanel.class, "TURN_RIGHT", true) {
@Override
public void actionPerformed(ActionEvent ev) {
Transform3D oldTransform = getModelRotationTransform();
Transform3D rightRotation = new Transform3D();
rightRotation.rotY(Math.PI / 2);
rightRotation.mul(oldTransform);
updateModelRotation(rightRotation);
}
});
this.turnUpButton = new JButton(new ResourceAction(preferences, FurniturePanel.class, "TURN_UP", true) {
@Override
public void actionPerformed(ActionEvent ev) {
Transform3D oldTransform = getModelRotationTransform();
Transform3D upRotation = new Transform3D();
upRotation.rotX(-Math.PI / 2);
upRotation.mul(oldTransform);
updateModelRotation(upRotation);
}
});
this.turnDownButton = new JButton(new ResourceAction(preferences, FurniturePanel.class, "TURN_DOWN", true) {
@Override
public void actionPerformed(ActionEvent ev) {
Transform3D oldTransform = getModelRotationTransform();
Transform3D downRotation = new Transform3D();
downRotation.rotX(Math.PI / 2);
downRotation.mul(oldTransform);
updateModelRotation(downRotation);
}
});
this.enlargeTenTimesButton = new JButton(new ResourceAction(preferences, FurniturePanel.class, "ENLARGE_TEN_TIMES", true) {
@Override
public void actionPerformed(ActionEvent ev) {
controller.multiplySize(10);
}
});
this.reduceTenTimesButton = new JButton(new ResourceAction(preferences, FurniturePanel.class, "REDUCE_TEN_TIMES", true) {
@Override
public void actionPerformed(ActionEvent ev) {
controller.multiplySize(0.1f);
}
});
this.enlargeInchTimesButton = new JButton(new ResourceAction(preferences, FurniturePanel.class, "ENLARGE_INCH_TIMES", true) {
@Override
public void actionPerformed(ActionEvent ev) {
controller.multiplySize(2.54f);
}
});