public static boolean internalCopy = false;
static int fileLoadingCount = 0;
-
+ class MyDesktopManager implements DesktopManager {
+
+ private DesktopManager delegate;
+
+ public MyDesktopManager(DesktopManager delegate) {
+ this.delegate = delegate;
+ }
+
+ public void activateFrame(JInternalFrame f) {
+ try {
+ delegate.activateFrame(f);
+ } catch (NullPointerException npe) {
+ Point p = getMousePosition();
+ instance.showPasteMenu(p.x,p.y);
+ }
+ }
+
+ public void beginDraggingFrame(JComponent f) {
+ delegate.beginDraggingFrame(f);
+ }
+
+ public void beginResizingFrame(JComponent f, int direction) {
+ delegate.beginResizingFrame(f, direction);
+ }
+
+ public void closeFrame(JInternalFrame f) {
+ delegate.closeFrame(f);
+ }
+
+ public void deactivateFrame(JInternalFrame f) {
+ delegate.deactivateFrame(f);
+ }
+
+ public void deiconifyFrame(JInternalFrame f) {
+ delegate.deiconifyFrame(f);
+ }
+
+ public void dragFrame(JComponent f, int newX, int newY) {
+ delegate.dragFrame(f, newX, newY);
+ }
+
+ public void endDraggingFrame(JComponent f) {
+ delegate.endDraggingFrame(f);
+ }
+
+ public void endResizingFrame(JComponent f) {
+ delegate.endResizingFrame(f);
+ }
+
+ public void iconifyFrame(JInternalFrame f) {
+ delegate.iconifyFrame(f);
+ }
+
+ public void maximizeFrame(JInternalFrame f) {
+ delegate.maximizeFrame(f);
+ }
+
+ public void minimizeFrame(JInternalFrame f) {
+ delegate.minimizeFrame(f);
+ }
+
+ public void openFrame(JInternalFrame f) {
+ delegate.openFrame(f);
+ }
+
+ public void resizeFrame(JComponent f, int newX, int newY, int newWidth,
+ int newHeight) {
+ delegate.resizeFrame(f, newX, newY, newWidth, newHeight);
+ }
+
+ public void setBoundsForFrame(JComponent f, int newX, int newY,
+ int newWidth, int newHeight) {
+ delegate.setBoundsForFrame(f, newX, newY, newWidth, newHeight);
+ }
+
+ // All other methods, simply delegate
+
+ }
/**
* Creates a new Desktop object.
*/
// This line prevents Windows Look&Feel resizing all new windows to maximum
// if previous window was maximised
- desktop.setDesktopManager(new DefaultDesktopManager());
-
+ desktop.setDesktopManager(new MyDesktopManager(new DefaultDesktopManager()));
Rectangle dims = getLastKnownDimensions("");
if (dims != null)
{