All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jclass.bwt.JCTabButton

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Canvas
                   |
                   +----jclass.bwt.JCComponent
                           |
                           +----jclass.bwt.JCLabel
                                   |
                                   +----jclass.bwt.JCButton
                                           |
                                           +----jclass.bwt.JCTabButton

public class JCTabButton
extends JCButton
A private class for use by a JCTabManager for its tabs.

Properties

Name Method
Alignment setAlignment
Background setBackground
DoubleBuffer setDoubleBuffer
Font setFont
Foreground setForeground
HighlightColor setHighlightColor
HighlightThickness setHighlightThickness
Insets setInsets
Label setLabel
PreferredSize setPreferredSize
ShadowThickness setShadowThickness
Traversable setTraversable
UserData setUserData

Events

Class Listener Description
JCActionEvent addActionListener Posted when the button is pressed and then released


Variable Index

 o current_tab
Is this the tab manager's current tab?
 o polygon
Button's shape (may be non-rectangular).

Constructor Index

 o JCTabButton(JCTabManager)
Creates an empty button.
 o JCTabButton(JCTabManager, Applet, String)
Creates a button which reads parameters from the applet's HTML file.

Method Index

 o addNotify()
If the tab manager's TabColorPolicy is BWTEnum.COLOR_PAGE, sets the tab's color to the page's color.
 o armAction(Event)
Sets tabManager's current tab to this button.
 o disarmAction(Event)
Overrides JCButton's method - no action.
 o drawHighlight(Graphics, boolean)
Draws or clears the highlight rectangle (called by paint).
 o drawRectangleShadow(Graphics)
Draws a rectangular shadow.
 o drawShadow(Graphics)
Draws the shadow.
 o drawSlantedShadow(Graphics)
Draws a slanted shadow.
 o fillBackground(Graphics)
Fills the polygon with the background color.
 o getGraphics()
Gets a Graphics context for this component.
 o getPage()
Gets the page for this tab.
 o getPeer()
Gets the peer of the component.
 o gotFocus(Event, Object)
Makes the tab visible.
 o hide()
Hides the component.
 o inside(int, int)
Returns true if the button is enabled and the point is inside the tab's perimeter.
 o invalidate()
Invalidates the component.
 o isShowing()
Checks if this Component is showing on screen.
 o isValid()
Checks if this Component is valid.
 o isVisible()
Checks if this Component is visible.
 o layout()
Lays out the label using the tabManager's alignment if no value has been set.
 o paintComponent(Graphics)
Draws the button's label.
 o preferredWidth()
If this tab is slanted, allow for the slant.
 o repaint(int, int, int, int)
Repaints part of the component by calling paint directly.
 o reshape(int, int, int, int)
Reshapes the internal polygon.
 o resize(boolean)
Resizes the button.
 o setPage(Component)
Sets the page for this tab.
 o show()
Shows the component.
 o toFront()
 o validate()
Validates a component.

Variables

 o polygon
  protected Polygon polygon
Button's shape (may be non-rectangular).

 o current_tab
  protected boolean current_tab
Is this the tab manager's current tab?

Constructors

 o JCTabButton
  public JCTabButton(JCTabManager tab_manager)
Creates an empty button.

 o JCTabButton
  public JCTabButton(JCTabManager tab_manager,
                     Applet applet,
                     String name)
Creates a button which reads parameters from the applet's HTML file.

Parameters:
tab_manager - parent JCTabManager
applet - the applet whose PARAM tags are to be read
name - if this is not null, only parameters preceded by this name are read
See Also:
getParameter

Methods

 o toFront
  public void toFront()
 o inside
  public boolean inside(int x,
                        int y)
Returns true if the button is enabled and the point is inside the tab's perimeter.

Overrides:
inside in class Component
 o getPage
  public Component getPage()
Gets the page for this tab.

See Also:
setPage
 o setPage
  public void setPage(Component page)
Sets the page for this tab. The page will be added to the tabManager if it is not a child.

 o layout
  public synchronized void layout()
Lays out the label using the tabManager's alignment if no value has been set.

Overrides:
layout in class JCButton
 o isValid
  public boolean isValid()
Checks if this Component is valid. Components are invalidated when they are first shown on the screen.

Overrides:
isValid in class Component
See Also:
validate, invalidate
 o isShowing
  public boolean isShowing()
Checks if this Component is showing on screen. This means that the component must be visible, and it must be in a container that is visible and showing.

Overrides:
isShowing in class Component
See Also:
show, hide
 o show
  public synchronized void show()
Shows the component.

Overrides:
show in class Component
See Also:
isVisible, hide
 o hide
  public synchronized void hide()
Hides the component.

Overrides:
hide in class Component
See Also:
isVisible, hide
 o getPeer
  public ComponentPeer getPeer()
Gets the peer of the component.

Overrides:
getPeer in class Component
 o validate
  public void validate()
Validates a component.

Overrides:
validate in class JCComponent
 o invalidate
  public void invalidate()
Invalidates the component. The component and all parents above it are marked as needing to be laid out.

Overrides:
invalidate in class Component
 o isVisible
  public boolean isVisible()
Checks if this Component is visible. Components are initially visible (with the exception of top level components such as Frame).

Overrides:
isVisible in class Component
See Also:
show, hide
 o addNotify
  public void addNotify()
If the tab manager's TabColorPolicy is BWTEnum.COLOR_PAGE, sets the tab's color to the page's color.

Overrides:
addNotify in class JCLabel
 o preferredWidth
  protected int preferredWidth()
If this tab is slanted, allow for the slant.

Overrides:
preferredWidth in class JCButton
 o fillBackground
  protected void fillBackground(Graphics gc)
Fills the polygon with the background color.

Overrides:
fillBackground in class JCComponent
 o paintComponent
  protected synchronized void paintComponent(Graphics gc)
Draws the button's label.

Overrides:
paintComponent in class JCLabel
 o drawShadow
  protected void drawShadow(Graphics gc)
Draws the shadow.

Overrides:
drawShadow in class JCComponent
 o getGraphics
  public Graphics getGraphics()
Gets a Graphics context for this component.

Overrides:
getGraphics in class Component
 o drawHighlight
  protected void drawHighlight(Graphics gc,
                               boolean on)
Draws or clears the highlight rectangle (called by paint).

Parameters:
on - if true, draws the highlight rectangle and a dashed rectangle around the label; otherwise clears the rect
Overrides:
drawHighlight in class JCButton
 o drawRectangleShadow
  protected void drawRectangleShadow(Graphics gc)
Draws a rectangular shadow.

 o drawSlantedShadow
  protected void drawSlantedShadow(Graphics gc)
Draws a slanted shadow.

 o reshape
  public synchronized void reshape(int x,
                                   int y,
                                   int width,
                                   int height)
Reshapes the internal polygon.

Overrides:
reshape in class JCComponent
 o repaint
  public synchronized void repaint(int x,
                                   int y,
                                   int width,
                                   int height)
Repaints part of the component by calling paint directly.

Overrides:
repaint in class JCComponent
 o resize
  protected void resize(boolean current)
Resizes the button.

Parameters:
current - whether this is the tabManager's current tab; if true, the tab will grow by its shadow thickness; otherwise it will shrink.
 o gotFocus
  public boolean gotFocus(Event ev,
                          Object what)
Makes the tab visible.

Overrides:
gotFocus in class JCComponent
See Also:
makeTabVisible
 o armAction
  public void armAction(Event ev)
Sets tabManager's current tab to this button.

Overrides:
armAction in class JCButton
 o disarmAction
  public void disarmAction(Event ev)
Overrides JCButton's method - no action.

Overrides:
disarmAction in class JCButton

All Packages  Class Hierarchy  This Package  Previous  Next  Index