}
}
);
// The crop and rotate modes likes to end themselves:
cropMode.addCropListener(
new CropListener() {
public void cropCommitted(CropBounds bounds) {
// This may be called because someone already switched
// away from the crop mode, but it may also be called
// from the "Commit" crop mode popup menu item, in which
// case we must handle the mode switch ourselves.
EventQueue.invokeLater(
new Runnable() {
public void run() {
if (modeButtons != null) {
if (modeButtons.isCropSelected()) {
setEditorMode( EditorMode.ARROW );
}
}
}
}
);
}
public void unCrop() {
}
}
);
rotateMode.addCropListener(
new CropListener() {
public void cropCommitted(CropBounds bounds) {
// This may be called because someone already switched
// away from the rotate mode, but it may also be called
// from the "Commit" crop mode popup menu item, in which
// case we must handle the mode switch ourselves.