Package com.ms.ui Previous
Previous
Contents
Contents
Index
Index
Next
Next

Class UIBand

Constructors , Methods , Fields

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

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

  // Methods
  public boolean getBreak();
  public boolean getDragBreak();
  public int getRestoredWidth();
  public int getRoleCode();
  public int getStyle();

  public void setBreak(boolean on);
  public void setDragBreak(boolean on);
  public void setStyle(int style);
  public void setRestoredWidth(int width);

  public Dimension minimumSize();
  public boolean handleEvent(Event e);

}

A class that manages a band control. Use UIBand to implement moveable bands of buttons in a band box control. UIBand contains a UIBandThumb control, which is used to reposition the band and its contents in relation to other bands in the band box.


Constructors


UIBand

public UIBand();

Creates a band control with no caption name.


UIBand

public UIBand(String name);

Creates a band control with the specified caption name.

ParameterDescription
name Name appearing in the band's caption.


UIBand

public UIBand(String name, int style);

Creates a band control with the specified caption name and the specified style.

ParameterDescription
name Name appearing in the band's caption.
style Style of the band control (see setStyle).


Methods


getBreak

public boolean getBreak();

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

Return Value:

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


getDragBreak

public boolean getDragBreak();

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

Return Value:

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


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.


getRoleCode

public int getRoleCode();

Retrieves the role of the band control.

Return Value:

Returns the ROLE_SYSTEM code that best describes the role of the control.

Remarks:

This method returns the ROLE_SYSTEM_TOOLBAR code.


getStyle

public int getStyle();

Retrieves the current style settings of the band control.

Return Value:

Returns an integer containing the current style bits.


handleEvent

public boolean handleEvent(Event e);

Changes event target and location to the band's thumb object when handling drag motions.

Return Value:

Returns true if the event has been handled and no further action is necessary; returns false if the event is to be given to the component's parent.

ParameterDescription
e The event.

Overrides:

Overrides handleEvent in class Component.


minimumSize

public Dimension minimumSize();

Determines the minimum size of the band.

Return Value:

Returns the minimum size.

Overrides:

Overrides minimumSize in class UIPanel.


setBreak

public void setBreak(boolean on);

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

Return Value:

No return value.

ParameterDescription
on Set to true to set the BREAK attribute; set to false to clear this attribute.


setDragBreak

public void setDragBreak(boolean on);

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

Return Value:

No return value.

ParameterDescription
on Set to true to set the DRAGBREAK attribute; set to false to clear this attribute.


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.


setStyle

public void setStyle(int style);

Sets the current style for the band.

Return Value:

No return value.

ParameterDescription
style Can be any bitwise combination of BREAK and/or DRAGBREAK.

Remarks:

An IllegalArgumentException exception is thrown if any undefined style bits are specified.


Fields

BREAK
Attribute set to cause the band to be displayed on a new row.
DRAGBREAK
Attribute set to cause the band to be displayed on a new row when it will not fit on the current row.
CXEDGE
Width of the vertical border in pixels.
CYEDGE
Height of the horizontal border in pixels.


Top© 1997 Microsoft Corporation. All rights reserved. Legal Notices.