Class tea.set.Folder
All Packages Class Hierarchy This Package Previous Next Index
Class tea.set.Folder
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Panel
|
+----tea.set.Folder
- public class Folder
- extends Panel
Folder class is a container that provides an interface similar to a file
folder. Files can be added to the folder by calling add(String, Component)
method. The String argument is the tab name for the file. The Component
argument can be another container within which more component can be
added, or a simply component which will be resized to fit the content
area of the folder. The default size of a folder is the maximum
preferred size of its components plus the space for the tabs.
There are four styles of display:
- LEFT
- tab displayed at left of the folder
- BOTTOM
- tab displayed at bottom of the folder
- RIGHT
- tab displayed at right of the folder
- TOP
- tab displayed at top of the folder
The style of the folder can be set at construction time, or anytime after
a Folder has been constructed. The minimumSize and preferredSize of the
Folder is only an approximate. For optimum effect, set a reasonable size
explicitly.
If tabs don't fit into one row, they are arranged in multiple rows.
When a tab is selected, if it's not at the first row, it will be brought
to the first row along with other tabs on the same row. An action event
is generated when a folder is selected and brought to front. The
target of the event is the Folder itself, and the arg is the string
containing the tab of the folder file.
-
BOTTOM
- Display the tabs at bottom of the folder.
-
LEFT
- Display the tabs at left side of the folder.
-
RIGHT
- Display the tabs at right side of the folder.
-
TOP
- Display the tabs at top of the folder.
-
Folder()
- Create an empty Folder.
-
Folder(int)
- Create an empty Folder with specified the style of the folder.
-
action(Event, Object)
- Action triggered by a tab selection.
-
add(String, Component)
- Add a component to the folder.
-
hide(int)
- Hide the idx'th tab.
-
hide(String)
- Hide the named tab.
-
layout()
- Layout the tabs and their associated components.
-
minimumSize()
- Return the minimum size of the Folder.
-
paint(Graphics)
- Paint the folder.
-
preferredSize()
- Return the preferred size of the Folder.
-
reset()
- Show a blank page (no tab selected).
-
set3D(boolean)
- Set folder 3D mode to true or false.
-
setStyle(int)
- Set the folder to a new style.
-
show(int)
- Make the idx'th tab visible.
-
show(String)
- Make the named tab visible.
-
toFront(int)
- Make the idx'th tab the currently displayed one (on the top).
-
toFront(String)
- Make the named tab the currently displayed one (on the top).
LEFT
public final static int LEFT
- Display the tabs at left side of the folder.
BOTTOM
public final static int BOTTOM
- Display the tabs at bottom of the folder.
RIGHT
public final static int RIGHT
- Display the tabs at right side of the folder.
TOP
public final static int TOP
- Display the tabs at top of the folder.
Folder
public Folder()
- Create an empty Folder. The default style is tab at top.
Folder
public Folder(int style)
- Create an empty Folder with specified the style of the folder.
- Parameters:
- style - folder style, one of the style flag values.
setStyle
public void setStyle(int style)
- Set the folder to a new style. The folder will be redrawn after
the style is changed.
- Parameters:
- style - folder style, one of the style flag values.
set3D
public void set3D(boolean mode)
- Set folder 3D mode to true or false. The default mode is 3D.
- Parameters:
- mode - display in 3D if true.
add
public Component add(String name,
Component comp)
- Add a component to the folder. String is used as the tab name.
Component is used as the content.
- Parameters:
- name - tab string.
- comp - folder page content component.
- Overrides:
- add in class Container
show
public void show(int idx)
- Make the idx'th tab visible. Note this function just unhide the
tab, but do not make it current. @See toFront().
- Parameters:
- idx - folder index, in the order of #add
show
public void show(String name)
- Make the named tab visible. Note this function just unhide the
tab, but do not make it current. @See toFront().
- Parameters:
- name - tab string.
hide
public void hide(int idx)
- Hide the idx'th tab.
- Parameters:
- idx - folder index, in the order of #add
hide
public void hide(String name)
- Hide the named tab.
- Parameters:
- name - tab string.
toFront
public void toFront(int idx)
- Make the idx'th tab the currently displayed one (on the top).
- Parameters:
- idx - folder index, in the order of #add
toFront
public void toFront(String name)
- Make the named tab the currently displayed one (on the top).
- Parameters:
- name - tab string.
reset
public void reset()
- Show a blank page (no tab selected).
minimumSize
public Dimension minimumSize()
- Return the minimum size of the Folder.
- Returns:
- minimum size of folder.
- Overrides:
- minimumSize in class Container
preferredSize
public Dimension preferredSize()
- Return the preferred size of the Folder.
- Returns:
- preferred size of folder.
- Overrides:
- preferredSize in class Container
action
public boolean action(Event e,
Object arg)
- Action triggered by a tab selection. The arg points to the
folder itself.
- Parameters:
- e - event object.
- arg - event argument object.
- Returns:
- false.
- Overrides:
- action in class Component
layout
public synchronized void layout()
- Layout the tabs and their associated components.
- Overrides:
- layout in class Container
paint
public void paint(Graphics g)
- Paint the folder.
- Parameters:
- g - Graphics content of this component.
- Overrides:
- paint in class Component
All Packages Class Hierarchy This Package Previous Next Index