|
JClass DesktopViews 6.3.0 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--com.klg.jclass.swing.JCMultiSelectList
JCMultiSelectList
matches the API for JList
, except that
two lists instead of one appear in the component’s GUI. There are
buttons between the two lists that move items back and forth.
Nested Class Summary | |
protected class |
JCMultiSelectList.JCFixedCenterLayout
Internal layout. |
protected class |
JCMultiSelectList.MultiSelectListUI
|
protected class |
JCMultiSelectList.SelectionButton
Internal selection button class. |
Nested classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent |
Nested classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
protected JPanel |
buttonPanel
|
protected Dimension |
defaultListSize
|
protected static String |
DESELECT_ALL
|
protected static String |
DESELECT_ITEM
|
protected JCMultiSelectList.SelectionButton |
deselectAllButton
|
protected JCMultiSelectList.SelectionButton |
deselectItemButton
|
protected com.klg.jclass.swing.JCMultiSelectList.EventHandler |
eventHandler
|
protected FontMetrics |
lastFontMetrics
|
protected JList |
mainList
|
protected static String |
SELECT_ALL
|
protected static String |
SELECT_ITEM
|
protected JCMultiSelectList.SelectionButton |
selectAllButton
|
protected JList |
selectionList
|
protected JScrollPane |
selectionPane
|
protected JCMultiSelectList.SelectionButton |
selectItemButton
|
protected JList |
sourceList
|
protected JScrollPane |
sourcePane
|
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 | |
JCMultiSelectList()
Creates a new JCMultiSelectList component with an empty model. |
|
JCMultiSelectList(int hgap)
Creates a new JCMultiSelectList component with an empty model
and the specified horizontal gap between components. |
|
JCMultiSelectList(ListModel dataModel)
Constructs a JCMultiSelectList that displays the elements in
the specified non-null model. |
|
JCMultiSelectList(Object[] listData)
Constructs a JCMultiSelectList that displays the elements in
the specified array. |
|
JCMultiSelectList(Vector listData)
Constructs a JCMultiSelectList that displays the elements in
the specified Vector. |
Method Summary | |
void |
addListSelectionListener(ListSelectionListener listener)
Adds a listener to the ListSelectionListeners list. |
void |
addSelectionInterval(int anchor,
int lead)
Adds the specified interval to the current selection. |
void |
clearSelection()
Clears the selection. |
protected void |
deselectAll()
Moves all items from the right list to the left list. |
protected void |
deselectItem()
Moves the items selected in the right list to the left list. |
protected void |
disableButtons()
Disables all the buttons. |
protected void |
doUpdate(JList list,
Object[] values,
int[] newIndices)
Move the selected items from one list and also selects the next item in the list. |
protected void |
fireSelectionValueChanged(int firstIndex,
int lastIndex,
boolean isAdjusting)
Forwards the given notification event to all registered listeners. |
String |
getAbout()
Returns vendor information. |
int |
getAnchorSelectionIndex()
Returns the first index argument from the most recent interval selection. |
static Dimension |
getButtonSize()
Returns the nominal size of the component. |
ListCellRenderer |
getCellRenderer()
Returns the renderer that's used to paint each cell. |
int |
getFixedCellHeight()
Returns the fixed cell height. |
int |
getFixedCellWidth()
Returns the fixed cell width. |
int |
getIndexFromItem(JList list,
Object item)
Given an Object, finds its index in the list. |
int |
getLeadSelectionIndex()
Returns the second index argument from the most recent interval selection. |
int |
getListPreferredWidth()
Returns the preferred width of the list. |
Dimension |
getMaximumSize()
Returns the maximum size of the component. |
int |
getMaxSelectionIndex()
Returns the maximal selected cell index. |
Dimension |
getMinimumSize()
Returns the minimum size of the component. |
int |
getMinSelectionIndex()
Returns the minimal selected cell index. |
ListModel |
getModel()
Returns the list's data model. |
Dimension |
getPreferredSize()
Returns the preferred size of the component. |
Object |
getPrototypeCellValue()
Returns the cell size based on an estimate of the cell's width and height. |
int |
getSelectedIndex()
Returns the first selected cell index. |
int[] |
getSelectedIndices()
Returns the selected indices array. |
Object |
getSelectedValue()
Returns the first selected cell value. |
Object[] |
getSelectedValues()
Returns an array of the selected cell values. |
Color |
getSelectionBackground()
Returns the background color for selected cells. |
Color |
getSelectionForeground()
Returns the foreground color for selected cells. |
int |
getSelectionMode()
Returns the selectionMode property value. |
ListSelectionModel |
getSelectionModel()
Returns the current selection model. |
String |
getUIClassID()
Returns the name of the UIFactory for this component. |
protected void |
init()
Initializes the component after it is created. |
protected JCMultiSelectList.SelectionButton |
initButton(JCMultiSelectList.SelectionButton button,
String toolTipText)
Initializes and adds a button to the component. |
boolean |
isSelectedIndex(int index)
Returns true if the specified index is selected. |
boolean |
isSelectionEmpty()
Returns true if nothing is selected. |
void |
paint(Graphics g)
|
protected String |
paramString()
Returns a String representation of the object. |
void |
removeListSelectionListener(ListSelectionListener listener)
Removes a listener from the the ListSelectionListeners list. |
void |
removeSelectionInterval(int index0,
int index1)
Removes the specified interval to the current selection. |
protected void |
selectAll()
Moves all items from the left list to the right list. |
protected void |
selectItem()
Moves the items selected in the left list to the right list. |
void |
setAbout(String s)
Provided for Beans property editors - has no effect. |
void |
setCellRenderer(ListCellRenderer cellRenderer)
Sets the renderer that's used to paint each cell. |
void |
setEnabled(boolean b)
Enables, disables this component and its subcomponents. |
void |
setFixedCellHeight(int height)
Sets the fixed cell height. |
void |
setFixedCellWidth(int width)
Sets the fixed cell width. |
void |
setListData(Object[] listData)
Constructs the list's data model from an array of Objects. |
void |
setListData(Vector listData)
Constructs the list's data model from a Vector. |
void |
setModel(ListModel model)
Sets the list's data model. |
void |
setPrototypeCellValue(Object prototypeCellValue)
Sets the cell size based on an estimate of the cell's width and height. |
void |
setSelectedIndex(int index)
Selects a cell by the index. |
void |
setSelectedIndices(int[] indices)
Selects the specified cells. |
void |
setSelectedValue(Object anObject,
boolean shouldScroll)
Selects the specified object. |
void |
setSelectionBackground(Color selectionBackground)
Sets the background color for selected cells. |
void |
setSelectionForeground(Color selectionForeground)
Sets the foreground color for selected cells. |
void |
setSelectionInterval(int anchor,
int lead)
Selects the specified interval. |
void |
updateButtons()
|
void |
updateUI()
Updates the look and feel. |
protected void |
updateView()
Initializes and adds a button to the component. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected static final String SELECT_ITEM
protected static final String SELECT_ALL
protected static final String DESELECT_ITEM
protected static final String DESELECT_ALL
protected JList mainList
protected JList sourceList
protected JList selectionList
protected JScrollPane sourcePane
protected JScrollPane selectionPane
protected JCMultiSelectList.SelectionButton selectItemButton
protected JCMultiSelectList.SelectionButton selectAllButton
protected JCMultiSelectList.SelectionButton deselectItemButton
protected JCMultiSelectList.SelectionButton deselectAllButton
protected JPanel buttonPanel
protected com.klg.jclass.swing.JCMultiSelectList.EventHandler eventHandler
protected Dimension defaultListSize
protected FontMetrics lastFontMetrics
Constructor Detail |
public JCMultiSelectList(ListModel dataModel)
JCMultiSelectList
that displays the elements in
the specified non-null model.
All JCMultiSelectList
constructors delegate to this one.
dataModel
- public JCMultiSelectList(Object[] listData)
JCMultiSelectList
that displays the elements in
the specified array.
This constructor just delegates to the ListModel
constructor.
listData
- public JCMultiSelectList(Vector listData)
JCMultiSelectList
that displays the elements in
the specified Vector.
This constructor just delegates to the ListModel
constructor.
listData
- com.sun.java.util.collections.Vector
.public JCMultiSelectList()
JCMultiSelectList
component with an empty model.
public JCMultiSelectList(int hgap)
JCMultiSelectList
component with an empty model
and the specified horizontal gap between components.
hgap
- Method Detail |
public void updateUI()
updateUI
in class JComponent
public String getUIClassID()
UIFactory
for this component.
getUIClassID
in class JComponent
UIFactory
namepublic void setAbout(String s)
s
- public String getAbout()
public Object getPrototypeCellValue()
public void setPrototypeCellValue(Object prototypeCellValue)
prototypeCellValue
- public int getFixedCellWidth()
public void setFixedCellWidth(int width)
width
- fixed cell widthpublic int getFixedCellHeight()
public void setFixedCellHeight(int height)
height
- fixed cell heightpublic ListCellRenderer getCellRenderer()
public void setCellRenderer(ListCellRenderer cellRenderer)
cellRenderer
- rendered used to paint each cellpublic Color getSelectionForeground()
public void setSelectionForeground(Color selectionForeground)
selectionForeground
- foreground colorpublic Color getSelectionBackground()
public void setSelectionBackground(Color selectionBackground)
selectionBackground
- background colorpublic ListModel getModel()
public void setModel(ListModel model)
model
- public void setListData(Object[] listData)
listData
- public void setListData(Vector listData)
listData
- public ListSelectionModel getSelectionModel()
public void addListSelectionListener(ListSelectionListener listener)
ListSelectionListeners
list.
listener
- public void removeListSelectionListener(ListSelectionListener listener)
ListSelectionListeners
list.
listener
- protected void fireSelectionValueChanged(int firstIndex, int lastIndex, boolean isAdjusting)
firstIndex
- isAdjusting
- lastIndex
- public int getSelectionMode()
selectionMode
property value.
selectionMode
property valuepublic int getAnchorSelectionIndex()
public int getLeadSelectionIndex()
public int getMinSelectionIndex()
public int getMaxSelectionIndex()
public boolean isSelectedIndex(int index)
true
if the specified index is selected.
index
- specified index
true
if the specified index is selectedpublic boolean isSelectionEmpty()
true
if nothing is selected.
true
if nothing is selectedpublic void clearSelection()
public void setSelectionInterval(int anchor, int lead)
anchor
- lead
- public void addSelectionInterval(int anchor, int lead)
anchor
- lead
- public void removeSelectionInterval(int index0, int index1)
index0
- index1
- public int getSelectedIndex()
public void setSelectedIndex(int index)
index
- public int[] getSelectedIndices()
public void setSelectedIndices(int[] indices)
indices
- public Object[] getSelectedValues()
public Object getSelectedValue()
public void setSelectedValue(Object anObject, boolean shouldScroll)
anObject
- shouldScroll
- protected String paramString()
paramString
in class JComponent
protected JCMultiSelectList.SelectionButton initButton(JCMultiSelectList.SelectionButton button, String toolTipText)
button
- toolTipText
-
protected void init()
protected void updateView()
public void updateButtons()
public static final Dimension getButtonSize()
public Dimension getPreferredSize()
getPreferredSize
in class JComponent
public Dimension getMinimumSize()
getMinimumSize
in class JComponent
public Dimension getMaximumSize()
getMaximumSize
in class JComponent
public void paint(Graphics g)
paint
in class JComponent
public int getListPreferredWidth()
protected void selectItem()
protected void selectAll()
protected void deselectItem()
protected void doUpdate(JList list, Object[] values, int[] newIndices)
list
- the list which is to be changedvalues
- the selected valuesnewIndices
- the indeces of the selected itemspublic int getIndexFromItem(JList list, Object item)
list
- the JList
to be searcheditem
- the Object to search for
protected void deselectAll()
public void setEnabled(boolean b)
setEnabled
in class JComponent
b
- boolean: true
means enable, false
means
disableprotected void disableButtons()
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |