com.yospace.yae.yogi
Class YogiTitleBar

java.lang.Object
  |
  +--com.yospace.yae.yogi.YogiComponent
        |
        +--com.yospace.yae.yogi.YogiTitleBar

public class YogiTitleBar
extends YogiComponent

A title bar component which functions as a container for a title, and buttons to fire minimize, maximize and exit tasks.


Field Summary
static int PROPERTY_COMPACT_BUTTON
          Constant for the compact button property
static int PROPERTY_EXIT_BUTTON
          Constant for the exit button property
static int PROPERTY_MAXIMIZE_BUTTON
          Constant for the maxmimze button property
static int PROPERTY_MINIMIZE_BUTTON
          Constant for the minimize button property
static int PROPERTY_TITLE_LABEL
          Constant for the title label property
 
Fields inherited from class com.yospace.yae.yogi.YogiComponent
ALIGN_CENTER, ALIGN_LEFT, ALIGN_RIGHT, BORDER_DOTTED, BORDER_NONE, BORDER_PLAIN, BORDER_ROUNDED, BORDER_SOLID, COLOR_BACKGROUND, COLOR_BORDER, COLOR_FOREGROUND, FOCUS_DEFAULT, FOCUS_OFF, FOCUS_ON, PROPERTY_ALIGN, PROPERTY_BORDER_STYLE, PROPERTY_BOUNDS, PROPERTY_COLOR, PROPERTY_CONTEXT_ENABLED, PROPERTY_ENABLED, PROPERTY_FOCUS, PROPERTY_FOCUS_INDEX, PROPERTY_FOCUS_TRAVERSABLE, PROPERTY_FONT, PROPERTY_HOTKEY, PROPERTY_LOCATION, PROPERTY_OPAQUE, PROPERTY_SIZE, PROPERTY_VISIBLE, PROPERTY_X_INSET, PROPERTY_Y_INSET
 
Constructor Summary
YogiTitleBar()
          Calls YogiTitleBar(String) with an empty name as the argument.
YogiTitleBar(java.lang.String title)
          Sets up new title bar with the given title.
 
Method Summary
 void addCompactButton(ActionListener al)
          Adds a compact button to the title bar and sets its action listener to be the one provided.
 void addExitButton(ActionListener al)
          Adds an exit button to the title bar and sets its action listener to be the one provided.
 void addMaximizeButton(ActionListener al)
          Adds a maximize button to the title bar and sets its action listener to be the one provided.
 void addMinimizeButton(ActionListener al)
          Adds a minimize button to the title bar and sets its action listener to be the one provided.
 YogiButton getCompactButton()
          Accessor method for the compact button.
 YogiButton getExitButton()
          Accessor method for the exit button.
 YogiButton getMaximizeButton()
          Accessor method for the maximize button.
 YogiButton getMinimizeButton()
          Accessor method for the minimize button.
 java.lang.String getTitle()
          Accessor method for the title String.
 void setCompactButton(YogiButton compactButton)
          Sets the compact button of this title bar.
 void setExitButton(YogiButton exitButton)
          Sets the exit button of this title bar.
 void setMaximizeButton(YogiButton maximizeButton)
          Sets the maximize button of this title bar.
 void setMinimizeButton(YogiButton minimizeButton)
          Sets the minimize button of this title bar.
 void setTitle(java.lang.String title)
          Sets the title of this title bar.
 
Methods inherited from class com.yospace.yae.yogi.YogiComponent
_debugPrintComponents, add, addPropertyChangeListener, bringForwards, bringInFrontOf, bringToFront, contains, containsComponent, ensureVisible, ensureVisible, findComponentAt, findCurrentFocus, findFirstFocus, findFocusDomainRoot, findFocusDomainRootImpl, findHotkeyComponent, findNextFocus, fireActionPerformedEvent, firePropertyChangeEvent, getAlign, getBorderStyle, getBounds, getColor, getColors, getComponent, getComponent, getComponentCount, getComponentIndex, getComponents, getFocusBounds, getFocusIndex, getFont, getGlobalLocation, getHeight, getHotkey, getId, getParent, getParent, getTreeLock, getUI, getWidth, getX, getXInset, getY, getYInset, hasFocus, isActive, isContextEnabled, isEnabled, isFocusDomainRoot, isFocusTraversable, isOpaque, isVisible, keyPressed, keyReleased, keyRepeated, paint, paintBackground, paintBorder, paintForeground, pointerDragged, pointerPressed, pointerReleased, remove, remove, removeAll, removePropertyChangeListener, repaint, repaint, repaintAfterRebounding, requestFocus, requestFocus, sendBackwards, sendBehind, sendToBack, setActionListener, setActive, setAlign, setBorderStyle, setBounds, setColor, setColors, setContextEnabled, setDefaultColor, setEnabled, setFocusDomainRoot, setFocusIndex, setFocusTraversable, setFont, setHotkey, setId, setLocation, setNoFocus, setOpaque, setProperty, setSize, setUI, setVisible, setXInset, setYInset, updateUI
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_MINIMIZE_BUTTON

public static final int PROPERTY_MINIMIZE_BUTTON
Constant for the minimize button property

PROPERTY_COMPACT_BUTTON

public static final int PROPERTY_COMPACT_BUTTON
Constant for the compact button property

PROPERTY_MAXIMIZE_BUTTON

public static final int PROPERTY_MAXIMIZE_BUTTON
Constant for the maxmimze button property

PROPERTY_EXIT_BUTTON

public static final int PROPERTY_EXIT_BUTTON
Constant for the exit button property

PROPERTY_TITLE_LABEL

public static final int PROPERTY_TITLE_LABEL
Constant for the title label property
Constructor Detail

YogiTitleBar

public YogiTitleBar()
Calls YogiTitleBar(String) with an empty name as the argument.

YogiTitleBar

public YogiTitleBar(java.lang.String title)
Sets up new title bar with the given title.
Parameters:
title - the title for this title bar to have.
Method Detail

getMinimizeButton

public YogiButton getMinimizeButton()
Accessor method for the minimize button.
Returns:
the minimize button, or null if there is currently no minimize button.

setMinimizeButton

public void setMinimizeButton(YogiButton minimizeButton)
Sets the minimize button of this title bar. Any current minimize button is removed. This causes the title bar to re-lay itself out and a PROPERTY_MINIMIZE_BUTTON change event to be fired.
Parameters:
minimizeButton - the button to use as this title bar's minimize button.

addMinimizeButton

public void addMinimizeButton(ActionListener al)
Adds a minimize button to the title bar and sets its action listener to be the one provided. If a minimize button already exists on the title bar it is replaced by this one.
Parameters:
al - the action listener to associate with the new button.

getCompactButton

public YogiButton getCompactButton()
Accessor method for the compact button.
Returns:
the compact button, or null if there is currently no compact button.

setCompactButton

public void setCompactButton(YogiButton compactButton)
Sets the compact button of this title bar. Any current compact button is removed. This causes the title bar to re-lay itself out and a PROPERTY_COMPACT_BUTTON change event to be fired.
Parameters:
compactButton - the button to use as this title bar's compact button.

addCompactButton

public void addCompactButton(ActionListener al)
Adds a compact button to the title bar and sets its action listener to be the one provided. If a compact button already exists on the title bar it is replaced by this one.
Parameters:
al - the action listener to associate with the new button.

getMaximizeButton

public YogiButton getMaximizeButton()
Accessor method for the maximize button.
Returns:
the maximize button, or null if there is currently no maximize button.

setMaximizeButton

public void setMaximizeButton(YogiButton maximizeButton)
Sets the maximize button of this title bar. Any current maximize button is removed. This causes the title bar to re-lay itself out and a PROPERTY_MAXIMIZE_BUTTON change event to be fired.
Parameters:
maximizeButton - the button to use as this title bar's maximize button.

addMaximizeButton

public void addMaximizeButton(ActionListener al)
Adds a maximize button to the title bar and sets its action listener to be the one provided. If a maximize button already exists on the title bar it is replaced by this one.
Parameters:
al - the action listener to associate with the new button.

getExitButton

public YogiButton getExitButton()
Accessor method for the exit button.
Returns:
the exit button, or null if there is currently no exit button.

setExitButton

public void setExitButton(YogiButton exitButton)
Sets the exit button of this title bar. Any current exit button is removed. This causes the title bar to re-lay itself out and a PROPERTY_EXIT_BUTTON change event to be fired.
Parameters:
exitButton - the button to use as this title bar's exit button.

addExitButton

public void addExitButton(ActionListener al)
Adds an exit button to the title bar and sets its action listener to be the one provided. If an exit button already exists on the title bar it is replaced by this one.
Parameters:
al - the action listener to associate with the new button.

getTitle

public java.lang.String getTitle()
Accessor method for the title String.
Returns:
the title String, or null if there is currently no title.

setTitle

public void setTitle(java.lang.String title)
Sets the title of this title bar.

If the value changes, the component is repainted and a PROPERTY_TITLE_LABEL change event is fired.

Parameters:
title - the String to use as this title bar's label String.

Copyright 2002 Yospace Holdings Ltd. All Rights Reserved.