NOS.gui
Class NOSDesktop

java.lang.Object
  extended by NOS.gui.NOSDesktop
All Implemented Interfaces:
java.awt.event.AWTEventListener, java.util.EventListener

public class NOSDesktop
extends java.lang.Object
implements java.awt.event.AWTEventListener


Constructor Summary
NOSDesktop(NOSApplet applet, Settings settings)
          Creates a new NOSDesktop object.
 
Method Summary
 void addNOSDesktopListener(NOSDesktopListener list)
          Add a NOSDesktopListener to this desktop.
 void addWindow(NOSWindow window, NOSProcess proc)
          Add a window to this desktop.
 void centreWindow(NOSWindow window)
          Position a NOSWindow in the centre of the dekstop.
 void centreWindowInWindow(NOSWindow window, NOSWindow target)
          Position a window in the centre of another window.
 void destroy()
          Destroy this desktop
 void eventDispatched(java.awt.AWTEvent event)
          Used to listen for the user changing between windows by clicking on them.
 java.awt.Rectangle getDesktopClientRect()
          Returns the rectangle in which ordinary windows are placed on the desktop.
 java.awt.Point getLocationOnScreen()
          Returns the location of the NOS desktop on the system screen.
 Settings getSettings()
          Returns the desktop Settings object.
 java.awt.Dimension getSize()
          Returns the size of this desktop in pixels.
 void registerForRepaint(NOSWindow window)
          Notify the desktop that a window needs to be repainted on the screen.
 void removeNOSDesktopListener(NOSDesktopListener list)
          Remove a NOSDesktopListener from this desktop
 void removeWindow(NOSWindow window, NOSProcess proc)
          Remove a window from this desktop.
 void sendToBack(NOSWindow window)
          Send a window to the back of the z-order.
 void sendToTop(NOSWindow window)
          Send a window to the top of the z-order
 void setBackground(NOSFile background)
          Change the background image.
 void setStyle(NOSFile style)
          Change the style file used to decorate windows and menus on this desktop.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NOSDesktop

public NOSDesktop(NOSApplet applet,
                  Settings settings)
Creates a new NOSDesktop object.

Parameters:
applet - The parent applet window onto which this desktop will be placed.
settings - The settings object to use as a template for the desktop setup.
Method Detail

setBackground

public void setBackground(NOSFile background)
Change the background image.

Parameters:
background - The location of the new background image.

getSettings

public Settings getSettings()
Returns the desktop Settings object.

Returns:
The desktop Settings object.

getSize

public java.awt.Dimension getSize()
Returns the size of this desktop in pixels.

Returns:
The size of this desktop.

getDesktopClientRect

public java.awt.Rectangle getDesktopClientRect()
Returns the rectangle in which ordinary windows are placed on the desktop.

Returns:
The rectangle in which ordinary windows are placed on the desktop.

getLocationOnScreen

public java.awt.Point getLocationOnScreen()
Returns the location of the NOS desktop on the system screen.

Returns:
The location of the NOS desktop on the screen.

setStyle

public void setStyle(NOSFile style)
Change the style file used to decorate windows and menus on this desktop.

Parameters:
style - The location of the Style to be used.

addNOSDesktopListener

public void addNOSDesktopListener(NOSDesktopListener list)
Add a NOSDesktopListener to this desktop.

Parameters:
list - The NOSDesktopListener to be added.

addWindow

public void addWindow(NOSWindow window,
                      NOSProcess proc)
Add a window to this desktop.

Parameters:
window - The NOSWindow to be added
proc - The NOSProcess to which the window being added belongs.

centreWindow

public void centreWindow(NOSWindow window)
Position a NOSWindow in the centre of the dekstop.

Parameters:
window - The window to be relocated.

centreWindowInWindow

public void centreWindowInWindow(NOSWindow window,
                                 NOSWindow target)
Position a window in the centre of another window.

Parameters:
window - The window to be relocated.
target - The window to be centred on.

destroy

public void destroy()
Destroy this desktop


eventDispatched

public void eventDispatched(java.awt.AWTEvent event)
Used to listen for the user changing between windows by clicking on them.

Specified by:
eventDispatched in interface java.awt.event.AWTEventListener
Parameters:
event - The AWTEvent that has been triggered.

registerForRepaint

public void registerForRepaint(NOSWindow window)
Notify the desktop that a window needs to be repainted on the screen.

Parameters:
window - The window to be repainted.

removeNOSDesktopListener

public void removeNOSDesktopListener(NOSDesktopListener list)
Remove a NOSDesktopListener from this desktop

Parameters:
list - The NOSDesktopListener to be removed.

removeWindow

public void removeWindow(NOSWindow window,
                         NOSProcess proc)
Remove a window from this desktop.

Parameters:
window - The NOSWindow to be removed
proc - The NOSProcess to which this window belongs.

sendToBack

public void sendToBack(NOSWindow window)
Send a window to the back of the z-order.

Parameters:
window - The window to be relocated.

sendToTop

public void sendToTop(NOSWindow window)
Send a window to the top of the z-order

Parameters:
window - The window to be relocated.