|
juife v0.1a |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.AbstractListModel
net.sf.juife.DefaultComponentListModel
public class DefaultComponentListModel
This class provides default implementation of the ComponentListModel
interface.
Field Summary |
---|
Fields inherited from class javax.swing.AbstractListModel |
---|
listenerList |
Constructor Summary | |
---|---|
DefaultComponentListModel()
Creates a new instance of DefaultComponentListModel |
Method Summary | |
---|---|
void |
add(java.awt.Component c)
Adds the specified component at the end of the list. |
java.awt.Component |
get(int index)
Gets the component at the specified index. |
java.lang.Object |
getElementAt(int index)
Gets the value at the specified index. |
int |
getSize()
Gets the length of the list. |
int |
indexOf(java.lang.Object o)
Gets the index of the first occurence of the given argument, testing for equality using the equals method. |
void |
insert(java.awt.Component c,
int index)
Inserts the specified component at the specified index. |
void |
moveDown(java.awt.Component c)
Moves the specified component one position down in the list. |
void |
moveUp(java.awt.Component c)
Moves the specified component one position up in the list. |
boolean |
remove(java.awt.Component c)
Removes the specified component. |
java.awt.Component |
remove(int index)
Removes the component at the specified position. |
java.awt.Component |
set(int index,
java.awt.Component c)
Replaces the component at the specified position with the specified component. |
int |
size()
Gets the length of the list. |
Methods inherited from class javax.swing.AbstractListModel |
---|
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.swing.ListModel |
---|
addListDataListener, removeListDataListener |
Constructor Detail |
---|
public DefaultComponentListModel()
Method Detail |
---|
public java.awt.Component get(int index)
get
in interface ComponentListModel
index
- The requested index.
java.lang.ArrayIndexOutOfBoundsException
- If the index is out of range.public java.lang.Object getElementAt(int index)
Note: The preferred method to use is get(int)
.
getElementAt
in interface javax.swing.ListModel
index
- The requested index.
public void insert(java.awt.Component c, int index)
insert
in interface ComponentListModel
c
- The component to be inserted.index
- The position of the new component.
java.lang.ArrayIndexOutOfBoundsException
- If the index is invalid.public void add(java.awt.Component c)
add
in interface ComponentListModel
c
- The component to be added.public java.awt.Component set(int index, java.awt.Component c)
set
in interface ComponentListModel
index
- The index of the component to replace.c
- The component to be stored at the specified position.
public void moveUp(java.awt.Component c)
c
- The component to be moved up.public void moveDown(java.awt.Component c)
c
- The component to be moved down.public boolean remove(java.awt.Component c)
remove
in interface ComponentListModel
c
- The component to be removed.
true
if the list contained the specified component,
false
otherwise.public java.awt.Component remove(int index)
remove
in interface ComponentListModel
index
- The index of the component to be removed.
java.lang.ArrayIndexOutOfBoundsException
- If the index is out of range.public int indexOf(java.lang.Object o)
equals
method.
o
- An object.
public int getSize()
getSize
in interface javax.swing.ListModel
public int size()
size
in interface ComponentListModel
|
juife v0.1a |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2005 Grigor Iliev. All rights reserved. |