use of org.concord.energy3d.undo.ChangeWallTextureCommand in project energy3d by concord-consortium.
the class MainFrame method createWallTextureMenuItem.
JRadioButtonMenuItem createWallTextureMenuItem(final int type, final String imageFile) {
final JRadioButtonMenuItem m = new JRadioButtonMenuItem(new ImageIcon(MainPanel.class.getResource(imageFile)));
m.setText("Texture #" + (type + 1));
m.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(final ItemEvent e) {
if (e.getStateChange() == ItemEvent.SELECTED) {
final ChangeWallTextureCommand c = new ChangeWallTextureCommand();
Scene.getInstance().setTextureMode(TextureMode.Full);
Scene.getInstance().setWallTextureType(type);
Scene.getInstance().setEdited(true);
if (MainPanel.getInstance().getEnergyButton().isSelected()) {
MainPanel.getInstance().getEnergyButton().setSelected(false);
}
SceneManager.getInstance().getUndoManager().addEdit(c);
}
}
});
return m;
}
Aggregations