|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectechopointng.tabbedpane.AbstractTabModel
echopointng.tabbedpane.DefaultTabModel
public class DefaultTabModel
DefaultTabModel holds its content component references in
memory (and hence does no lazy loading of tab content)
It also does not release tab information unless intructed to do so by the removeTabAt() method.
If no font or color information is passed in when a tab is created, then the current colors and fonts of this model will be used later when the getTabTitleAt() method is called.
| Nested Class Summary | |
|---|---|
class |
DefaultTabModel.TabButton
TabModelButton is a ButtonEx that is linked to the
TabModel and hence is told the tab selection state that it should
reflect in its colors and fonts etc.. by the TabModel. |
| Field Summary | |
|---|---|
static Color |
DEFAULT_BACKGROUND
|
static Border |
DEFAULT_BORDER
|
static Font |
DEFAULT_FONT
|
static Color |
DEFAULT_FOREGROUND
|
static Color |
DEFAULT_ROLLOVER_BACKGROUND
|
static Border |
DEFAULT_ROLLOVER_BORDER
|
static Font |
DEFAULT_ROLLOVER_FONT
|
static Color |
DEFAULT_ROLLOVER_FOREGROUND
|
static Color |
DEFAULT_SELECTED_BACKGROUND
|
static Border |
DEFAULT_SELECTED_BORDER
|
static Font |
DEFAULT_SELECTED_FONT
|
static Color |
DEFAULT_SELECTED_FOREGROUND
|
static Color |
DEFAULT_SELECTED_ROLLOVER_BACKGROUND
|
static Border |
DEFAULT_SELECTED_ROLLOVER_BORDER
|
static Font |
DEFAULT_SELECTED_ROLLOVER_FONT
|
static Color |
DEFAULT_SELECTED_ROLLOVER_FOREGROUND
|
| Fields inherited from class echopointng.tabbedpane.AbstractTabModel |
|---|
changeEvent, listenerList, tabImageRenderer |
| Constructor Summary | |
|---|---|
DefaultTabModel()
Constructs a DefaultTabModel |
|
| Method Summary | |
|---|---|
void |
addTab(Component tabComponent,
Component tabContent)
Adds a new tab to the end of the collection of tabs. |
void |
addTab(ImageReference icon,
Component tabContent)
Adds a new tab with the specified icon. |
void |
addTab(java.lang.String tabTitle,
Component tabContent)
Adds a new tab with the specified title. |
void |
addTab(java.lang.String tabTitle,
ImageReference icon,
Component tabContent)
Adds a new tab with the specified title and icon. |
Color |
getBackground()
|
Border |
getBorder()
|
Font |
getFont()
|
Color |
getForeground()
|
Color |
getRolloverBackground()
|
Border |
getRolloverBorder()
|
Font |
getRolloverFont()
|
Color |
getRolloverForeground()
|
Color |
getSelectedBackground()
|
Border |
getSelectedBorder()
|
Font |
getSelectedFont()
|
Color |
getSelectedForeground()
|
Color |
getSelectedRolloverBackground()
|
Border |
getSelectedRolloverBorder()
|
Font |
getSelectedRolloverFont()
|
Color |
getSelectedRolloverForeground()
|
Component |
getTabAt(int index,
boolean isSelected)
This is called to retrieve a Component that represents the
title of the tab at the specified index. |
Component |
getTabContentAt(int index)
This is called to retrieve the Component that represents
the contents of the tab at the specified index. |
int |
indexOfTab(Component tabComponent)
This is called to return the index of the component that makes up a tab. |
void |
insertTab(int index,
Component tabComponent,
Component tabContent)
Called to insert a new tab at the specified index. |
void |
insertTab(int index,
java.lang.String tabTitle,
ImageReference icon,
Component tabContent)
Called to insert a new tab at the specified index. |
void |
releaseTabAt(int index)
Does nothing as all tabs are kept in memory once added to this TabModel implementation. |
void |
removeTabAt(int index)
Removes the tab details at the specified index |
void |
setBackground(Color background)
Sets the background color to be used on non selected tabs |
void |
setBorder(Border border)
|
void |
setFont(Font font)
Sets the font to be used on non selected tabs |
void |
setForeground(Color foreground)
Sets the foreground color to be used on non selected tabs |
void |
setRolloverBackground(Color rolloverBackground)
Sets the background color to use on tab rollover |
void |
setRolloverBorder(Border rolloverBorder)
|
void |
setRolloverFont(Font rolloverFont)
Sets the font to use on tab rollover |
void |
setRolloverForeground(Color rolloverForeground)
Set the foreground color to use on tab rollover |
void |
setSelectedBackground(Color selectedBackground)
Sets the background color to be used on selected tabs |
void |
setSelectedBorder(Border selectedBorder)
|
void |
setSelectedFont(Font selectedFont)
Sets the font to be used on selected tabs |
void |
setSelectedForeground(Color selectedForeground)
Sets the foreground color to be used on selected tabs |
void |
setSelectedRolloverBackground(Color selectedRolloverBackground)
Sets the background color to use on rollover of selected tabs |
void |
setSelectedRolloverBorder(Border selectedRolloverBorder)
|
void |
setSelectedRolloverFont(Font selectedRolloverFont)
Sets the font to use on rollover of selected tabs |
void |
setSelectedRolloverForeground(Color selectedRolloverForeground)
Sets the foreground color to use on rollover of selected tabs |
int |
size()
This is called to return how many tabs are returned by this TabModel. |
| Methods inherited from class echopointng.tabbedpane.AbstractTabModel |
|---|
addChangeListener, fireStateChanged, getTabImageRenderer, removeChangeListener, setTabImageRenderer |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Color DEFAULT_SELECTED_BACKGROUND
public static final Color DEFAULT_SELECTED_FOREGROUND
public static final Font DEFAULT_SELECTED_FONT
public static final Border DEFAULT_SELECTED_BORDER
public static final Color DEFAULT_SELECTED_ROLLOVER_BACKGROUND
public static final Color DEFAULT_SELECTED_ROLLOVER_FOREGROUND
public static final Font DEFAULT_SELECTED_ROLLOVER_FONT
public static final Border DEFAULT_SELECTED_ROLLOVER_BORDER
public static final Color DEFAULT_BACKGROUND
public static final Color DEFAULT_FOREGROUND
public static final Font DEFAULT_FONT
public static final Border DEFAULT_BORDER
public static final Color DEFAULT_ROLLOVER_BACKGROUND
public static final Color DEFAULT_ROLLOVER_FOREGROUND
public static final Font DEFAULT_ROLLOVER_FONT
public static final Border DEFAULT_ROLLOVER_BORDER
| Constructor Detail |
|---|
public DefaultTabModel()
DefaultTabModel
| Method Detail |
|---|
public int size()
TabModelTabModel.
size in interface TabModelTabModel.size()
public Component getTabAt(int index,
boolean isSelected)
TabModelComponent that represents the
title of the tab at the specified index.
The returned Component must be unique since it will become a child of the TabbedPane so it can be fully rendered.
If the returned Component has ActionListeners, such as a ButtonEx, then the parent TabbedPane wil attach itself so it can know when the Tab is pressed and hence has become selected. If not then it is the responbility of the component to inform that TabbedPane of the events that may affect tab selection.
This method may be called at any time and does not support lazy loading of the tabs (since it makes no sense as they must all be visible in order to select one).
getTabAt in interface TabModelindex - -
the index of the tabisSelected - -
true if the index is the current selected tab index.
index or null
if there isnt a component at that indexTabModel.getTabAt(int, boolean)public Component getTabContentAt(int index)
TabModelComponent that represents
the contents of the tab at the specified index. This is
designed to be lazy loaded, and hence will not be called until absolutely
needed.
However once it has been called it may be called multiples times again so
take care about how content Component s are dynamically
created.
getTabContentAt in interface TabModelindex - -
the index of the tab
index or null if there isnt a component at the
indexTabModel.getTabContentAt(int)public void releaseTabAt(int index)
TabModel implementation.
releaseTabAt in interface TabModelindex - -
the index of the tab to be releasedTabModel.releaseTabAt(int)
public void insertTab(int index,
Component tabComponent,
Component tabContent)
index - -
the index to insert at, growing the collection as requiredtabComponent - -
the component to use as the tab for the given
indextabContent - -
the content to use for the given index
java.lang.IndexOutOfBoundsException - if the index is out of range (index < 0 || index >
size()).
public void insertTab(int index,
java.lang.String tabTitle,
ImageReference icon,
Component tabContent)
This will use the default colors and fonts defined by
this TabModel
index - -
the index to insert at, growing the collection as requiredtabTitle - -
the title of the tabicon - -
the icon to use on the tabtabContent - -
the content to use for the given index
java.lang.IndexOutOfBoundsException - if the index is out of range (index < 0 || index >
size()).
public void addTab(Component tabComponent,
Component tabContent)
This will use the default colors and fonts defined by this
TabModel if no color and font properties are set on the
LabelEx at the time it was passed to the model.
tabComponent - -
the component to use as the tab for the given
indextabContent - -
the component to use as the tab content.
public void addTab(java.lang.String tabTitle,
Component tabContent)
TabModel
tabTitle - -
the title of the new tabtabContent - -
the component to use as the tab content.
public void addTab(ImageReference icon,
Component tabContent)
TabModel
icon - -
the icon of rhe new tabtabContent - -
the component to use as the tab content.
public void addTab(java.lang.String tabTitle,
ImageReference icon,
Component tabContent)
TabModel
tabTitle - -
the title of the new tabicon - -
the icon of rhe new tabtabContent - -
the component to use as the tab content.public void removeTabAt(int index)
index - -
the index of the tab details
java.lang.IndexOutOfBoundsException - if the index is out of range (index < 0 || index >=
size()).public int indexOfTab(Component tabComponent)
TabModel
indexOfTab in interface TabModeltabComponent - -
the component to return and index for
TabModel.indexOfTab(nextapp.echo2.app.Component)public Color getBackground()
public void setBackground(Color background)
public Font getFont()
public void setFont(Font font)
public Color getForeground()
public void setForeground(Color foreground)
public Color getSelectedBackground()
public void setSelectedBackground(Color selectedBackground)
public Font getSelectedFont()
public void setSelectedFont(Font selectedFont)
public Color getSelectedForeground()
public void setSelectedForeground(Color selectedForeground)
public Color getRolloverBackground()
public void setRolloverBackground(Color rolloverBackground)
public Font getRolloverFont()
public void setRolloverFont(Font rolloverFont)
public Color getRolloverForeground()
public void setRolloverForeground(Color rolloverForeground)
public Color getSelectedRolloverBackground()
public void setSelectedRolloverBackground(Color selectedRolloverBackground)
public Font getSelectedRolloverFont()
public void setSelectedRolloverFont(Font selectedRolloverFont)
public Color getSelectedRolloverForeground()
public void setSelectedRolloverForeground(Color selectedRolloverForeground)
public Border getBorder()
public void setBorder(Border border)
public Border getRolloverBorder()
public void setRolloverBorder(Border rolloverBorder)
public Border getSelectedBorder()
public void setSelectedBorder(Border selectedBorder)
public Border getSelectedRolloverBorder()
public void setSelectedRolloverBorder(Border selectedRolloverBorder)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||