edu.cmu.hcii.calo.WinAppBar Class Reference

Inherited by edu.cmu.hcii.calo.SidebarWindow.

Inheritance diagram for edu.cmu.hcii.calo.WinAppBar:

Inheritance graph
[legend]
List of all members.

Detailed Description

A native class that allows a Java frame to be a Windows sidebar.

A frame wishing to become a sidebar must call setAsBar() after becoming visible (it is best to wait briefly before calling setAsBar() so that Windows can catch up) and pass one of the edge constants to determine where the sidebar will be anchored. When the application is about to exit, the frame should call unSetBar() to relinquish its status as a sidebar. When the width of the window changes programmatically, the window should call setSidebarSize() with its new width and height to keep Windows informed about the change.

Warning:
If your application exits for any reason (even an unhandled RuntimeException) and you fail to call unSetBar(), the space claimed by the sidebar will be unavailable to all windows (even maximized ones) until you restart the computer or call setAppBar() or unSetBar() in a subsequent run of the application. So make sure that, however badly you crash, you always find a way to call unSetBar() before you die.
Author:
Brian Ellis


Public Member Functions

native void setAsBar (String title, int position)
 Sets this window as a sidebar and places it on the specified edge of the screen.
native void setSidebarSize (int width, int height)
 Informs the WinAppBar library that the size of the sidebar has changed.
native void unSetBar ()
 Causes this window to relinquish its status as a Windows sidebar.

Static Public Attributes

static final int LEFT = 1
 Pass to setAsBar to indicate that the sidebar should appear on the left edge of the screen.
static final int TOP = 2
 Pass to setAsBar to indicate that the sidebar should appear on the top edge of the screen.
static final int RIGHT = 3
 Pass to setAsBar to indicate that the sidebar should appear on the right edge of the screen.
static final int BOTTOM = 4
 Pass to setAsBar to indicate that the sidebar should appear on the bottom edge of the screen.

Static Package Functions

 [static initializer]
 Attempts to load the WinAppBar library, printing a non-fatal error message if it cannot do so.

Static Private Attributes

static final long serialVersionUID = 1L
 Prevent serialization collisions.


Member Function Documentation

edu.cmu.hcii.calo.WinAppBar.[static initializer] (  )  [static, package]

Attempts to load the WinAppBar library, printing a non-fatal error message if it cannot do so.

native void edu.cmu.hcii.calo.WinAppBar.setAsBar ( String  title,
int  position 
)

Sets this window as a sidebar and places it on the specified edge of the screen.

Warning:
the WinAppBar library uses the window title to find a window handle for the window. Therefore, not only must the title argument match the title of the window, but it must be unique across ALL open windows in every application. It may be worthwhile to temporarily set the window title to a UUID or other guaranteed-unique identifier (the application name and date stamp would suffice in a pinch), then call setAppBar, then set it back when you're done.
Parameters:
title the current title of this window
position the desired position of the sidebar

native void edu.cmu.hcii.calo.WinAppBar.setSidebarSize ( int  width,
int  height 
)

Informs the WinAppBar library that the size of the sidebar has changed.

Call this whenever you set the window size programmatically from within Java.

Parameters:
width the new width of the sidebar
height the new height of the sidebar

native void edu.cmu.hcii.calo.WinAppBar.unSetBar (  ) 

Causes this window to relinquish its status as a Windows sidebar.

You must call unSetBar() before your application exits, or the space claimed by the sidebar will not be available to any other windows (even maximized ones) until you restart the computer or call setAsBar() or unSetBar() in a future run of the application.


Member Data Documentation

final int edu.cmu.hcii.calo.WinAppBar.LEFT = 1 [static]

Pass to setAsBar to indicate that the sidebar should appear on the left edge of the screen.

final int edu.cmu.hcii.calo.WinAppBar.TOP = 2 [static]

Pass to setAsBar to indicate that the sidebar should appear on the top edge of the screen.

final int edu.cmu.hcii.calo.WinAppBar.RIGHT = 3 [static]

Pass to setAsBar to indicate that the sidebar should appear on the right edge of the screen.

final int edu.cmu.hcii.calo.WinAppBar.BOTTOM = 4 [static]

Pass to setAsBar to indicate that the sidebar should appear on the bottom edge of the screen.

final long edu.cmu.hcii.calo.WinAppBar.serialVersionUID = 1L [static, private]

Prevent serialization collisions.

Reimplemented in edu.cmu.hcii.calo.SidebarWindow.


The documentation for this class was generated from the following file:
Generated on Mon Aug 13 15:06:12 2007 for CALO by  doxygen 1.5.2