Packages
 In this topic

*Constructors

*Methods

*Fields

 

Packages   PreviousThis PackageNext
Package com.ms.ui   Previous This
Package
Next

 


Class UIBand

public class UIBand extends UIMenuList implements IUIBand
{
  // Fields
  public static final int BREAK;
  public static final int DRAGBREAK;

  // Constructors
  public UIBand();
  public UIBand(String name);
  public UIBand(String name, int style);

  // Methods
  public boolean getBreak();
  public boolean getDragBreak();
  public Insets getInsets();
  public Dimension getMinimumSize();
  public int getRestoredWidth();
  public int getRoleCode();
  public int getStyle();
  public boolean handleEvent(Event e);
  public void layout();
  public void setBreak(boolean on);
  public void setDragBreak(boolean on);
  public void setRestoredWidth(int width);
  public void setStyle(int style);
}

This class implements a moveable band of buttons. A UIBand object is typically contained in a UIBandBox control and uses UIFixedFlowLayout as its layout manager. UIBand contains a UIBandThumb object, which is used to reposition the band and its contents in relation to other bands in the band box.

UIComponent
  |
  +--UIContainer
    |
    +--UIStateContainer
      |
      +--UIPanel
        |
        +--UISelector
          |
          +--UIList
            |
            +--UIMenuList
              |
              +--UIBand

Constructors

UIBand

public UIBand();

Creates a band control with no name.

UIBand

public UIBand(String name);

Creates a band control with the specified name.

ParameterDescription
name The text to be displayed on the band control's header.

UIBand

public UIBand(String name, int style);

Creates a band control with the specified name and style.

ParameterDescription
name The text to be displayed on the band control's header.
style The style of the band control. Possible values include any bitwise combination of BREAK and DRAGBREAK.

Exceptions:

IllegalArgumentException if an undefined style was specified.

Methods

getBreak

public boolean getBreak();

Determines whether the BREAK attribute is set in the control's style.

Return Value:

Returns true if the style includes BREAK; otherwise, returns false.

Remarks:

This method implements getBreak in the IUIBand interface.

getDragBreak

public boolean getDragBreak();

Determines whether the DRAGBREAK attribute is set in the control's style.

Return Value:

Returns true if the style includes DRAGBREAK; otherwise, returns false.

Remarks:

This method implements getDragBreak in the IUIBand interface.

getInsets

public Insets getInsets();

Retrieves the control's insets (in pixels), which identify the nonclient area of the control.

Return Value:

Returns an Insets object that contains the band's insets (which includes the band header's UIBandThumb component).

getMinimumSize

public Dimension getMinimumSize();

Determines the minimum size (in pixels) of the band control.

Return Value:

Returns the control's minimum size.

getRestoredWidth

public int getRestoredWidth();

Retrieves the width that the band control will be restored to.

Return Value:

Returns the width (in pixels) of the restored band control.

Remarks:

This method implements getRestoredWidth in the IUIBand interface.

getRoleCode

public int getRoleCode();

Retrieves the ROLE_SYSTEM code that best describes the role of the band control.

Return Value:

Returns the ROLE_SYSTEM_TOOLBAR code.

getStyle

public int getStyle();

Retrieves the current style of the band control.

Return Value:

Returns an integer containing the current style setting. For a list of possible values, see setStyle.

handleEvent

public boolean handleEvent(Event e);

Responds to events occurring within the control.

Return Value:

Returns true if the event was handled; otherwise, returns false.

ParameterDescription
e The event.

layout

public void layout();

Lays out the components contained in the band.

Return Value:

No return value.

setBreak

public void setBreak(boolean on);

Sets or clears the BREAK attribute in the control's style.

Return Value:

No return value.

ParameterDescription
on If true, the BREAK attribute is set; otherwise, it is cleared.

Remarks:

This method implements setBreak in the IUIBand interface.

setDragBreak

public void setDragBreak(boolean on);

Sets or clears the DRAGBREAK attribute in the control's style.

This method is called by the parent when laying out its contained bands; it is not typically called by an application. Use the setBreak(boolean) method to start a band on a new row (or the same row).

Return Value:

No return value.

ParameterDescription
on If true, the DRAGBREAK attribute is set; otherwise, it is cleared.

Remarks:

This method implements setDragBreak in the IUIBand interface.

setRestoredWidth

public void setRestoredWidth(int width);

Sets the width that the band will be restored to.

Return Value:

No return value.

ParameterDescription
width The width (in pixels) of a restored band.

Remarks:

This method implements setRestoredWidth in the IUIBand interface.

setStyle

public void setStyle(int style);

Sets the current style of the band control.

Return Value:

No return value.

ParameterDescription
style The style of the band control. Specify any bitwise combination of BREAK and DRAGBREAK.

Exceptions:

IllegalArgumentException if an undefined style was specified.

Fields

BREAK
Specifies that the band will be displayed on a new row.
DRAGBREAK
Specifies that the band will be displayed on a new row because it does not fit on the current row. This state bit is used by the parent component when laying out its contained bands.
Comments:
Normally, an application uses the BREAK style, not the DRAGBREAK style, to indicate that a band should start on a new row.

upnrm.gif © 1998 Microsoft Corporation. All rights reserved. Terms of use.