|
JComponentPack 1.5.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
com.zfqjava.swing.JSidePane
public class JSidePane
JSidePane provides a component to add group panel.
ValueAction,
Serialized Form| Nested Class Summary | |
|---|---|
protected class |
JSidePane.AccessibleJSidePane
This class implements accessibility support for the JSidePane class. |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary |
|---|
| 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 |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
JSidePane()
Constructs a JSidePane. |
|
| Method Summary | |
|---|---|
void |
addGroup(Component comp)
Adds the group component. |
void |
addGroup(Component comp,
Action action)
Adds the group componet with the group header action. |
void |
addGroupAt(Component comp,
Action action,
int index)
Adds the group component at the specify index with the group header action. |
void |
addListSelectionListener(ListSelectionListener listener)
Adds a listener to the list that's notified each time a change to the selection occurs. |
protected ListSelectionModel |
createSelectionModel()
Returns an instance of DefaultListSelectionModel. |
protected Component |
createTitle(Action a)
Creates the title component for the specified action. |
protected void |
fireSelectionValueChanged(int firstIndex,
int lastIndex,
boolean isAdjusting)
Notifies JList ListSelectionListeners that
the selection model has changed. |
AccessibleContext |
getAccessibleContext()
Gets the AccessibleContext associated with this JSidePane. |
Action |
getActionAt(int index)
Returns the action at the specify index. |
Component |
getComponentAt(int index)
Returns the component at the specify index. |
int |
getGroupCount()
Returns the group count. |
int |
getGroupGap()
Returns the gap between group. |
ListSelectionListener[] |
getListSelectionListeners()
Returns an array of all the ListSelectionListeners added
to this JList with addListSelectionListener(). |
Component |
getSelectedComponent()
Returns the currently selected component for this sidepane. |
int |
getSelectedIndex()
Returns the currently selected index for this sidepane. |
int |
getSelectionMode()
Returns whether single-item or multiple-item selections are allowed. |
ListSelectionModel |
getSelectionModel()
Returns the value of the current selection model. |
Component |
getTitleAt(int index)
Returns the title component at the specified index. |
int |
indexOfAction(Action action)
Returns the action at the specify index. |
int |
indexOfComponent(Component comp)
Returns the index for the specify component. |
int |
indexOfTitle(Component title)
Returns the index for the specified title component. |
protected void |
paintComponent(Graphics g)
|
protected String |
paramString()
Returns a string representation of this JSidePane. |
void |
removeAllGroup()
Removes all group component. |
void |
removeGroup(Component comp)
Removes the group component. |
void |
removeGroupAt(int index)
Removes the group component at the specified index. |
void |
removeListSelectionListener(ListSelectionListener listener)
Removes a listener from the list that's notified each time a change to the selection occurs. |
void |
setActionAt(int index,
Action action)
Sets the action at the specify index. |
void |
setComponentAt(int index,
Component comp)
Sets the group component at the specify index. |
void |
setGroupGap(int groupGap)
Sets the gap between group. |
void |
setLayout(LayoutManager mgr)
|
void |
setSelectedComponent(Component comp)
Sets the selected component for this sidepane. |
void |
setSelectedIndex(int index)
Sets the selected index for this sidepane. |
void |
setSelectionMode(int selectionMode)
Determines whether single-item or multiple-item selections are allowed. |
void |
setSelectionModel(ListSelectionModel selectionModel)
Sets the selectionModel for the list to a
non-null ListSelectionModel
implementation. |
void |
setTitleAt(int index,
Component title)
Sets the title component at the specified index. |
void |
updateUI()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public JSidePane()
JSidePane.
| Method Detail |
|---|
public void updateUI()
updateUI in class JComponentpublic void setGroupGap(int groupGap)
groupGap - the group gapgetGroupGap()public int getGroupGap()
setGroupGap(int)protected ListSelectionModel createSelectionModel()
DefaultListSelectionModel. This
method is used by the constructor to initialize the
selectionModel property.
ListSelectionModel used by this
JList.setSelectionModel(javax.swing.ListSelectionModel),
DefaultListSelectionModelpublic ListSelectionModel getSelectionModel()
ListSelectionModel that implements
list selectionssetSelectionModel(javax.swing.ListSelectionModel),
ListSelectionModel
protected void fireSelectionValueChanged(int firstIndex,
int lastIndex,
boolean isAdjusting)
JList ListSelectionListeners that
the selection model has changed. It's used to forward
ListSelectionEvents from the selectionModel
to the ListSelectionListeners added directly to the
JList.
firstIndex - the first selected indexlastIndex - the last selected indexisAdjusting - true if multiple changes are being madeaddListSelectionListener(javax.swing.event.ListSelectionListener),
removeListSelectionListener(javax.swing.event.ListSelectionListener),
EventListenerListpublic void addListSelectionListener(ListSelectionListener listener)
JList
will have their ListSelectionEvent.getSource() ==
this JList
(instead of the ListSelectionModel).
listener - the ListSelectionListener to addgetSelectionModel(),
getListSelectionListeners()public void removeListSelectionListener(ListSelectionListener listener)
listener - the ListSelectionListener to removeaddListSelectionListener(javax.swing.event.ListSelectionListener),
getSelectionModel()public ListSelectionListener[] getListSelectionListeners()
ListSelectionListeners added
to this JList with addListSelectionListener().
ListSelectionListeners added or an empty
array if no listeners have been addedaddListSelectionListener(javax.swing.event.ListSelectionListener)public void setSelectionModel(ListSelectionModel selectionModel)
selectionModel for the list to a
non-null ListSelectionModel
implementation. The selection model handles the task of making single
selections, selections of contiguous ranges, and non-contiguous
selections.
This is a JavaBeans bound property.
selectionModel - the ListSelectionModel that
implements the selections
IllegalArgumentException - if selectionModel
is nullgetSelectionModel()public void setSelectionMode(int selectionMode)
selectionMode values are allowed:
ListSelectionModel.SINGLE_SELECTION
Only one list index can be selected at a time. In this
mode the setSelectionInterval and
addSelectionInterval
methods are equivalent, and only the second index
argument is used.
ListSelectionModel.SINGLE_INTERVAL_SELECTION
One contiguous index interval can be selected at a time.
In this mode setSelectionInterval and
addSelectionInterval
are equivalent.
ListSelectionModel.MULTIPLE_INTERVAL_SELECTION
In this mode, there's no restriction on what can be selected.
This is the default.
selectionMode - an integer specifying the type of selections
that are permissiblegetSelectionMode()public int getSelectionMode()
selectionMode propertysetSelectionMode(int)public void setSelectedIndex(int index)
index - the index to be selected
IndexOutOfBoundsException - if index is out of range
(index < -1 || index >= component count)getSelectedIndex(),
SingleSelectionModel.setSelectedIndex(int)public int getSelectedIndex()
setSelectedIndex(int)public void setSelectedComponent(Component comp)
selectedIndex to the index
corresponding to the specified component.
IllegalArgumentException - if component not found in componentbed
panegetSelectedComponent()public Component getSelectedComponent()
null if there is no currently display card.
setSelectedComponent(java.awt.Component)public final void setLayout(LayoutManager mgr)
setLayout in class Containerprotected void paintComponent(Graphics g)
paintComponent in class JComponentpublic void addGroup(Component comp)
comp - the component to add
public void addGroup(Component comp,
Action action)
comp - the group componentaction - the group action
public void addGroupAt(Component comp,
Action action,
int index)
comp - the component to addaction - the group actionindex - the component index
IndexOutOfBoundsExceptionpublic void removeGroupAt(int index)
index - the specified group indexpublic void removeGroup(Component comp)
comp - the component to removepublic void removeAllGroup()
public int getGroupCount()
public void setComponentAt(int index,
Component comp)
index - the specify indexcomponent - the component
NullPointerException - if the comp is null
IndexOutOfBoundsException - if index is out of range
(index < 0 || index > group count)public Component getComponentAt(int index)
index - the specify index
public int indexOfComponent(Component comp)
comp - the specify component
public void setActionAt(int index,
Action action)
index - the action indexaction - the group header action
IndexOutOfBoundsException - if index is out of range
(index < 0 || index > group count)public Action getActionAt(int index)
index - the action index
IndexOutOfBoundsException - if index is out of range
(index < 0 || index > group count)public int indexOfAction(Action action)
index - the action index
public Component getTitleAt(int index)
index - the title index
setTitleAt(int, java.awt.Component)
public void setTitleAt(int index,
Component title)
index - the title indextitle - the title component
NullPointerException - if the title is null
IndexOutOfBoundsException - if index is out of range
(index < 0 || index > group count)getTitleAt(int)public int indexOfTitle(Component title)
title - the title component
protected Component createTitle(Action a)
a - the group title action
protected String paramString()
null.
paramString in class JComponentpublic AccessibleContext getAccessibleContext()
getAccessibleContext in interface AccessiblegetAccessibleContext in class JComponent
|
JComponentPack 1.5.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||