ARoad0.Gui1
Class InsideDesktop

java.lang.Object
  extended by javax.swing.DefaultDesktopManager
      extended by ARoad0.Gui1.InsideDesktop
All Implemented Interfaces:
Singleton, java.io.Serializable, javax.swing.DesktopManager

public class InsideDesktop
extends javax.swing.DefaultDesktopManager
implements Singleton

A DesktopManager that keeps its frames inside the desktop when they are resized or dragged, and that keeps the explorer frame location at the upper-left corner of the desktop.

See Also:
Serialized Form

Field Summary
protected static java.lang.String DRAGGING
          Tag internal frames that are being moved using a client property with the name DRAGGING.
protected static java.awt.Point initialLocation__
          Initial location of the frame before the dragging
protected static InsideDesktop instance__
           
protected static java.lang.String RESIZING
          Tag internal frames that are being resized using a client property with the name RESIZING.
 
Constructor Summary
private InsideDesktop()
          With this private constructor, the compiler won't generate a default public constructor.
 
Method Summary
 void beginDraggingFrame(javax.swing.JComponent _f)
           
 void beginResizingFrame(javax.swing.JComponent _f, int dir)
           
 void endDraggingFrame(javax.swing.JComponent _f)
          Keeps the explorer frame location at the upper-left corner of the desktop, and the other frames in the desktop.
 void endResizingFrame(javax.swing.JComponent _f)
           
static InsideDesktop getInstance()
          Only mean to get an instance.
 void setBoundsForFrame(javax.swing.JComponent _f, int _x, int _y, int _w, int _h)
          This is called any time a frame is moved or resized.
 
Methods inherited from class javax.swing.DefaultDesktopManager
activateFrame, closeFrame, deactivateFrame, deiconifyFrame, dragFrame, getBoundsForIconOf, getPreviousBounds, iconifyFrame, maximizeFrame, minimizeFrame, openFrame, removeIconFor, resizeFrame, setPreviousBounds, setWasIcon, wasIcon
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESIZING

protected static final java.lang.String RESIZING
Tag internal frames that are being resized using a client property with the name RESIZING. Used in setBoundsForFrame().

See Also:
Constant Field Values

DRAGGING

protected static final java.lang.String DRAGGING
Tag internal frames that are being moved using a client property with the name DRAGGING.

See Also:
Constant Field Values

initialLocation__

protected static java.awt.Point initialLocation__
Initial location of the frame before the dragging


instance__

protected static final InsideDesktop instance__
Constructor Detail

InsideDesktop

private InsideDesktop()
With this private constructor, the compiler won't generate a default public constructor.

Method Detail

getInstance

public static InsideDesktop getInstance()
Only mean to get an instance.

Returns:
InsideDesktop

beginDraggingFrame

public void beginDraggingFrame(javax.swing.JComponent _f)
Specified by:
beginDraggingFrame in interface javax.swing.DesktopManager
Overrides:
beginDraggingFrame in class javax.swing.DefaultDesktopManager
Parameters:
_f - JComponent

endDraggingFrame

public void endDraggingFrame(javax.swing.JComponent _f)
Keeps the explorer frame location at the upper-left corner of the desktop, and the other frames in the desktop.

Specified by:
endDraggingFrame in interface javax.swing.DesktopManager
Overrides:
endDraggingFrame in class javax.swing.DefaultDesktopManager
Parameters:
_f - JComponent

beginResizingFrame

public void beginResizingFrame(javax.swing.JComponent _f,
                               int dir)
Specified by:
beginResizingFrame in interface javax.swing.DesktopManager
Overrides:
beginResizingFrame in class javax.swing.DefaultDesktopManager
Parameters:
_f - JComponent
dir - int

endResizingFrame

public void endResizingFrame(javax.swing.JComponent _f)
Specified by:
endResizingFrame in interface javax.swing.DesktopManager
Overrides:
endResizingFrame in class javax.swing.DefaultDesktopManager
Parameters:
_f - JComponent

setBoundsForFrame

public void setBoundsForFrame(javax.swing.JComponent _f,
                              int _x,
                              int _y,
                              int _w,
                              int _h)
This is called any time a frame is moved or resized. This implementation keeps the frame from leaving the desktop when it is resized.

Specified by:
setBoundsForFrame in interface javax.swing.DesktopManager
Overrides:
setBoundsForFrame in class javax.swing.DefaultDesktopManager
Parameters:
_f - JComponent
_x - int left border
_y - int top border
_w - int width
_h - int height