SilverStream
Application Server 3.5

com.sssw.rt.form
Class AgcTabControl

java.lang.Object
 |
 +--java.awt.Component
       |
       +--java.awt.Container
             |
             +--javax.swing.JComponent
                   |
                   +--javax.swing.JPanel
                         |
                         +--com.sssw.rt.atlas.AtPanel
                               |
                               +--com.sssw.rt.form.PvBasePanel
                                     |
                                     +--com.sssw.rt.form.PvBaseContainer
                                           |
                                           +--com.sssw.rt.form.AgcTabControl
All Implemented Interfaces:
Accessible, AgiControl, AgiHelpInfo, AgiTabstopHandler, AgiValueChangingListener, EventListener, ImageObserver, MenuContainer, MouseListener, MouseMotionListener, Serializable

public class AgcTabControl
extends PvBaseContainer
implements AgiValueChangingListener, MouseListener, MouseMotionListener

A container control that organizes the components of complex applications. The Tab Panel can contain any of the SilverStream controls.

Properties:
Background Color, Control Type, Dark Shadow Color, Enabled, Font Name, Font Size, Font Style, Height, Highlight Color, Inactive Tab Color, Left, Name, Pane Captions, Pane Images, Panes, Shadow Color, Tool Tip, Top, Visible, Width
Events:
mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, paneChanged
See Also:
Serialized Form

Inner classes inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Inner classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Fields inherited from class com.sssw.rt.atlas.AtPanel
BGIMAGE_DRAW_CENTERED, BGIMAGE_DRAW_NORMAL, BGIMAGE_DRAW_STRETCH, BGIMAGE_DRAW_TILED
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
AgcTabControl()
           
 
Method Summary
 void addControl(int pane, Component control)
          Get/set control information.
 void addControl(int pane, Component control, Object constraints)
           
 void addControlAt(int pane, Component control, int pos)
           
 void addControlAt(int pane, Component control, int pos, Object constraints)
           
 void addPane(String name)
          Adds a pane to the Tab Panel control.
 void addPane(String name, Image image)
          Adds a pane with an image to the Tab Panel control.
 Component getControl(int pane, int control)
           
 int getControlCount(int pane)
           
 int getCurrentPane()
          Returns the index of the currently active pane.
 Color getDarkShadowColor()
          Returns the Color object associated with the control's dark shadow property.
 AgoFontIdentifier getFontIdentifier()
          Returns the SilverStream font object (AgoFontIdentifier) for the control's text.
 Color getHighlightColor()
          Returns the Color object displayed as the highlight effect on the control.
 Color getInactiveTabColor()
          Returns the Color object displayed for inactive panes.
 int getPaneCount()
          Returns the number of panes that comprise a Tab Panel control.
 Image getPaneImage(int pane)
          Returns the image associated with the specified pane.
 String getPaneName(int pane)
          Returns the text displayed in the tab of a pane.
 Color getShadowColor()
          Returns the Color object associated with the control's shadow Color.
 int getTabHeight()
          Get the height of a tab (depends on the font)
 void removeControl(int pane, Component control)
           
 void removePane(int pane)
          Removes a specific pane from the Tab Panel control.
 void setBackgroundColor(Color color)
          Assigns the control's background Color.
 void setColors(Color backgroundColor, Color highlightColor, Color shadowColor, Color darkShadowColor, Color inactiveTabColor)
          Set the shading colors.
 void setCurrentPane(int pane)
          Assigns a pane as the currently active pane.
 void setDarkShadowColor(Color color)
          Assigns the Color object associated with the control's dark shadow Color.
 void setFontIdentifier(AgoFontIdentifier font)
          Assigns the SilverStream font object (AgoFontIdentifier)for the text on the tab labels.
 void setHighlightColor(Color color)
          Assigns the Color object to display as the highlight effect on the control.
 void setInactiveTabColor(Color color)
          Assigns the Color object displayed for inactive panes.
 void setPaneCount(int n, String prefix)
          Creates a specified number of panes for a Tab control.
 void setPaneImage(int pane, Image image)
          Assigns the specified image to the specified pane.
 void setPaneName(int pane, String name)
          Assigns the text displayed in the tab of a pane.
 void setShadowColor(Color color)
          Assigns the Color object associated with the control's shadow Color.
 
Methods inherited from class com.sssw.rt.form.PvBaseContainer
acceptValues, addControl, addControlAt, getControl, getControlCount, getUserDefinedTabOrder, removeControl, setTabOrder, setUserDefinedTabOrder
 
Methods inherited from class com.sssw.rt.form.PvBasePanel
getBackgroundColor
 
Methods inherited from class com.sssw.rt.atlas.AtPanel
addImpl, addNotify, clientPaint, clientPaint, deliverMouseEvent, deliverMouseMoveEvent, doAtCommand, drawTiledImage, enableAtCommands, getBackgroundImage, getBackgroundImageMode, getHelper, getTransparent, hide, hideToolTip, imageUpdate, isFocusTraversable, isOptimizedDrawingEnabled, ownedImage, paintBorder, paintComponent, paintImmediately, paintImmediately, paintNow, preprocessKeyEvent, processEvent, reshape, setBackgroundImage, setBackgroundImageMode, setTransparent, show, showToolTip
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUIClassID, paramString, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInsets, getInsets, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, isDoubleBuffered, isFocusCycleRoot, isLightweightComponent, isManagingFocus, isOpaque, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintChildren, print, printAll, processComponentKeyEvent, processFocusEvent, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, revalidate, scrollRectToVisible, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, setCursor, setLayout, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods implemented from interface com.sssw.rt.form.AgiControl
getComponent, getHelpInfo, setHelpInfo
 
Methods implemented from interface com.sssw.rt.util.AgiTabstopHandler
getTabOrder
 
Methods implemented from interface com.sssw.rt.event.AgiValueChangingListener
valueChanging
 
Methods implemented from interface java.awt.event.MouseListener
mouseClicked, mouseEntered, mouseExited, mousePressed, mouseReleased
 
Methods implemented from interface java.awt.event.MouseMotionListener
mouseDragged, mouseMoved
 

Constructor Detail

AgcTabControl

public AgcTabControl()
Method Detail

addPane

public void addPane(String name,
                    Image image)
Adds a pane with an image to the Tab Panel control.
Parameters:
name - specifies the text displayed on the tab of the pane
image - specifies the image to display on the tab of the pane
Usage:

New panes are added to the end of the tab control.

Example:

The following code fragment illustrates how to add a pane with the text "database" and the "newdatabase.gif" image. The image is located in the same database as the form.

  Image img;
  img = getImage("newdatabase.gif");
  TabControl1.addPane("Database",img);
 

addPane

public void addPane(String name)
Adds a pane to the Tab Panel control.
Parameters:
name - specifies the text displayed on the tab of the pane
Usage:

New panes are added to the end of the tab control.

Example:

The following code fragment illustrates how to add a pane with the text "Database".

  TabControl1.addPane("Database");
 

removePane

public void removePane(int pane)
Removes a specific pane from the Tab Panel control.
Parameters:
pane - specifies the index of the pane to remove
Usage:

The Tab Control is zero-based so the index of the first pane is zero.

Example:

The following code fragment illustrates how to remove the fourth pane of a Tab control.

  TabControl1.removePane(3);
 

getPaneCount

public int getPaneCount()
Returns the number of panes that comprise a Tab Panel control.
Usage:

The number of panes can be specified at runtime using the AgcTabControl.setPaneCount(int, String) method or at design time using the Pane property.

Example:

The following code fragment illustrates how to obtain the number of panes.

  int paneCount;
  paneCount = TabControl1.getPaneCount();
 

setPaneCount

public void setPaneCount(int n,
                         String prefix)
Creates a specified number of panes for a Tab control.
Parameters:
count - specifies the total number of panes for the control
namePrefix - specifies a text string to add to the tab of any new panes that are created
Usage:

The text is added to the tab of the new panes along with an integer that indicates the index of the pane. If the number of panes decreases, this parameter is not used.

Example:

The following code fragment illustrates how to create a Tab control with four panes with each pane containing the text "newPane" followed by an integer that represents the index of the pane.

  TabControl1.setPaneCount(3,"newPane");
 
See Also:
AgcTabControl.addPane(String), AgcTabControl.addPane(String, Image), AgcTabControl.getPaneCount(), AgcTabControl.removePane(int)

getPaneName

public String getPaneName(int pane)
Returns the text displayed in the tab of a pane.
Parameters:
pane - specifies the pane whose text or name is to be obtained
Usage:

The Tab Control is zero-based so the index for the first pane is zero. This value can be set at design time using the Pane Name property, or assigned or changed at runtime using the AgcTabControl.setPaneName(int, String) method.

Example:

The following code fragment illustrates how to obtain the text displayed for the pane whose index is three.

  String name;
  name = TabControl1.getPaneName(3);
 

setPaneName

public void setPaneName(int pane,
                        String name)
Assigns the text displayed in the tab of a pane.
Parameters:
paneIndex - specifies the index of the pane whose name is to be set
name - specifies the text to display on the tab of the specified pane
Usage:

The Tab Control is zero-based so the index of the first pane is zero. This value can be established at design time using the Pane Name property.

Example:

The following code fragment illustrates how to assign the text "New Database" to the fourth tab.

  TabControl1.setPaneName(3,"New Database");
 
See Also:
AgcTabControl.getPaneName(int)

getPaneImage

public Image getPaneImage(int pane)
Returns the image associated with the specified pane.
Parameters:
pane - specifies the pane whose image is to be obtained
Usage:

The Tab Control is zero-based so the index for the first pane is zero. This value can be set at runtime using the @link #setPaneImage(int, Image)} method.

Example:

The following code fragment illustrates how to obtain the image currently assigned to the fourth pane.

  Image img;
  img = TabControl1.getPaneImage(3);
 

setPaneImage

public void setPaneImage(int pane,
                         Image image)
Assigns the specified image to the specified pane.
Parameters:
paneIndex - specifies the pane
image - specifies the image
Usage:

The Tab Control is zero-based so the index for the first pane is zero.

Example:

The following code fragment illustrates how to assign an image to a pane in a tab control. This example first obtains the image using the getImage() method, then assigns it with setPaneImage().

  Image img;
  img = getImage("newdatabase.gif");
  TabControl1.setPaneImage(3,img);
 
See Also:
AgcTabControl.getPaneImage(int)

getTabHeight

public int getTabHeight()
Get the height of a tab (depends on the font)

addControl

public void addControl(int pane,
                       Component control)
Get/set control information.

You may need to call the awt method validate() after calling addControl() in order to make the controls redraw correctly. Specifically, if you programmatically add a subform containing a tab control on which there are other controls, say, buttons. The tab control shows up but the buttons don't until you call validate() - or resize the designer, which has the same effect.

See Also:
Container.validate()

addControl

public void addControl(int pane,
                       Component control,
                       Object constraints)

addControlAt

public void addControlAt(int pane,
                         Component control,
                         int pos)

addControlAt

public void addControlAt(int pane,
                         Component control,
                         int pos,
                         Object constraints)

removeControl

public void removeControl(int pane,
                          Component control)

getControl

public Component getControl(int pane,
                            int control)

getControlCount

public int getControlCount(int pane)

setCurrentPane

public void setCurrentPane(int pane)
Assigns a pane as the currently active pane.
Parameters:
paneIndex - specifies the pane to assign as current
Usage:

The Tab Control is zero-based so the index for the first pane is zero.

Example:

The following code fragment illustrates how to make the fourth pane active.

  TabControl1.setCurrentPane(3);
 
See Also:
AgcTabControl.getCurrentPane()

getCurrentPane

public int getCurrentPane()
Returns the index of the currently active pane.
Usage:

The Tab control is zero-based so the index for the first pane is zero.

Example:

The following code fragment illustrates how to use the getCurrentPane() method.

  int currentPane;
  currentPane = TabControl1.getCurrentPane();
 
See Also:
AgcTabControl.setCurrentPane(int)

setFontIdentifier

public void setFontIdentifier(AgoFontIdentifier font)
Assigns the SilverStream font object (AgoFontIdentifier)for the text on the tab labels.
Overrides:
setFontIdentifier in class PvBasePanel
Parameters:
fontID - specifies the AgoFontIdentifier object that assigns the font for the control
Usage:

The AgoFontIdentifier object consists of three parts: a Font Name, a Font Style and a Font Size. The Font Name can be one of these values: Dialog, SansSerif, Serif, Monospaced, Helvetica, TimesRoman, Courier, DialogInput, Zapfdingbats. At runtime, Java translates this value to the appropriate font installed on the system.

The Font Size can be any integer.

The Font Style can be one of these values:

  • AgoFontIdentifier.PLAIN
  • AgoFontIdentifier.BOLD
  • AgoFontIdentifier.ITALIC
  • AgoFontIdentifier.BOLD + AgoFontIdentifier.ITALIC
Example:

This code fragment illustrates how to construct a new AgoFontIdentifier object (called newFont) and how to call the setFontIdentifier() method:

  AgoFontIdentifier     newFont;
  String		   newName;
  int	           newSize;
  int		   newStyle;
 
  newName="TimesRoman";
  newSize=20;
  newStyle=AgoFontIdentifier.ITALIC;
  newFont=new AgoFontIdentifier(newName, newStyle, newSize);
 
  TabControl1.setFontIdentifier(newFont);
 
See Also:
AgcTabControl.getFontIdentifier(), Font Name property, Font Size property, Font Style property

getFontIdentifier

public AgoFontIdentifier getFontIdentifier()
Returns the SilverStream font object (AgoFontIdentifier) for the control's text.
Overrides:
getFontIdentifier in class PvBasePanel
Usage:

The AgoFontIdentifier object consists of three parts: a Font Name, a Font Style and a Font Size. The Font Style can be one of these values:

  • AgoFontIdentifier.PLAIN
  • AgoFontIdentifier.BOLD
  • AgoFontIdentifier.ITALIC
  • AgoFontIdentifier.BOLD + AgoFontIdentifier.ITALIC

The Font Name can be one of these values:Dialog, SansSerif, Serif, Monospaced, Helvetica, TimesRoman, Courier, DialogInput, Zapfdingbats.

At runtime, Java translates this value to the appropriate font installed on the system.

The Font Size can be any integer.

Example:

The following code fragment illustrates how to construct a new AgoFontIdentifier object (called newFont) and how to call the getFontIdentifier() method:

  AgoFontIdentifier font;
  font = TabControl1.getFontIdentifier();
 
See Also:
AgcTabControl.setFontIdentifier(AgoFontIdentifier), Font Name property, Font Size property, Font Style property

setColors

public void setColors(Color backgroundColor,
                      Color highlightColor,
                      Color shadowColor,
                      Color darkShadowColor,
                      Color inactiveTabColor)
Set the shading colors.
Parameters:
backgroundColor -  
highlightColor -  
shadowColor -  
darkShadowColor -  
inactiveTabColor -  

setBackgroundColor

public void setBackgroundColor(Color color)
Assigns the control's background Color.
Overrides:
setBackgroundColor in class PvBasePanel
Parameters:
bgColor - the instance of a java.awt.Color object or one of the Color constants, for example, Color.red
Usage:

For controls that support it, the Transparent property must be false for the background Color to show.

Example:

The following example illustrates how to set the background Color on a control using one of the Color constants:

  TabControl1.setBackgroundColor(Color.white);
 
This example illustrates how to create a new Color and then use it to set the background Color:
  Color colLabelColor = new Color(247, 247, 222);
  TabControl1.setBackgroundColor(colLabelColor);
 

setHighlightColor

public void setHighlightColor(Color color)
Assigns the Color object to display as the highlight effect on the control.
Parameters:
color - specifies the instance of a java.awt.Color object or one of the Color constants, for example, Color.red
Example:

The following example illustrates how to set the highlight Color to red using the Java Color constant.

  TabControl1.setHighlightColor(Color.red);
 
See Also:
Highlight Color property, AgcTabControl.getHighlightColor()

setShadowColor

public void setShadowColor(Color color)
Assigns the Color object associated with the control's shadow Color.
Parameters:
color - specifies the instance of a java.awt.Color object or one of the Color constants, for example, Color.red
Example:

This example illustrates how to set the Shadow Color to red using the Java Color constant.

  TabControl1.setShadowColor(Color.red);
 
See Also:
Shadow Color property, AgcTabControl.getShadowColor()

setDarkShadowColor

public void setDarkShadowColor(Color color)
Assigns the Color object associated with the control's dark shadow Color.
Parameters:
color - specifies the instance of a java.awt.Color object. or one of the Color constants, for example, Color.red.
Example:

This example illustrates how to set the Dark Shadow to red using the Java Color constant.

  TabControl1.setDarkShadowColor(Color.red);
 
See Also:
Dark Shadow property, AgcTabControl.getDarkShadowColor()

setInactiveTabColor

public void setInactiveTabColor(Color color)
Assigns the Color object displayed for inactive panes.
Parameters:
color - specifies the instance of a java.awt.Color object. or one of the Color constants, for example, Color.red
Example:

This example illustrates how to set the Inactive Tab Color to red using the Java Color constant.

  TabControl1.setInactiveTabColor(Color.red);
 
See Also:
Inactive Tab Color property, AgcTabControl.getInactiveTabColor()

getHighlightColor

public Color getHighlightColor()
Returns the Color object displayed as the highlight effect on the control.
Example:

The following example illustrates how to obtain the current Highlight Color.

  Color c;
  c = TabControl1.getHighlightColor();
 
See Also:
Highlight Color property, AgcTabControl.setHighlightColor(Color)

getShadowColor

public Color getShadowColor()
Returns the Color object associated with the control's shadow Color.
Example:

This example illustrates how to obtain the current Shadow Color.

  Color c;
  c = TabControl1.getShadowColor();
 
See Also:
Shadow Color property, AgcTabControl.setShadowColor(Color)

getDarkShadowColor

public Color getDarkShadowColor()
Returns the Color object associated with the control's dark shadow property.
Usage:

This value can be set at design time with the Dark Shadow property, or at runtime using the setDarkShadowColor() method.

Example:

This example illustrates how to obtain the current Dark Shadow Color.

  Color c;
  c = TabControl1.getDarkShadowColor();
 
See Also:
Dark Shadow property, AgcTabControl.setDarkShadowColor(Color)

getInactiveTabColor

public Color getInactiveTabColor()
Returns the Color object displayed for inactive panes.
Example:

The following example illustrates how to obtain the current Inactive Tab Color.

  Color c;
  c = TabControl1.getInactiveTabColor();
 
See Also:
Inactive Tab Color property, AgcTabControl.setInactiveTabColor(Color)

SilverStream
Application Server 3.5