|
||||||||||
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 org.browsecode.helpers.reorderablelistpanel.ReorderableListPanel<T>
public class ReorderableListPanel<T>
Nested Class Summary | |
---|---|
static interface |
ReorderableListPanel.GetDoubleClicks
If an image icon is set for the items to show on the left, then this will be called whenever a user double-clicks on it. |
static interface |
ReorderableListPanel.ItemActionListener<T2>
|
class |
ReorderableListPanel.MyReorderableChangeListener
|
static interface |
ReorderableListPanel.NewItemListener<T2>
Called whenever a new item is inserted from the GUI. |
static interface |
ReorderableListPanel.RunnableWithSuccessNotification<T2>
|
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
boolean |
debug
|
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 | |
---|---|
protected |
ReorderableListPanel(boolean trash)
Trash constructor! |
|
ReorderableListPanel(ReorderableListModel<T> listModel,
ReorderableListModelRenderer<T> renderer,
java.awt.Insets imageBorderInsets,
java.lang.String itemsName)
|
|
ReorderableListPanel(ReorderableListModel<T> listModel,
ReorderableListModelRenderer<T> renderer,
java.awt.Insets imageBorderInsets,
java.lang.String itemsName,
boolean horizontal)
|
Method Summary | |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent action)
|
protected void |
addItem(java.awt.Component c,
javax.swing.ImageIcon icon,
java.lang.String name,
int index,
T reorderableListItem)
|
void |
addNewListItemFromData(java.lang.Object data,
int oldIndex,
int newIndex)
Add this chunk of data to this list. |
javax.swing.JMenuItem |
addPopupMenuItem(java.lang.String name,
javax.swing.ImageIcon icon,
ReorderableListPanel.ItemActionListener<T> action)
|
boolean |
canAddNewListItemFromData(java.lang.Object data)
Whether or not this chunk of data can be added to this list. |
protected FocusOtherListener |
getFocusOtherListener()
|
ReorderableListPanel.GetDoubleClicks |
getGetDoubleClicks()
|
java.awt.Component |
getItem(int i)
|
int |
getItemCount()
|
java.lang.String |
getItemName()
|
ReorderableListPanel.NewItemListener |
getNewItemListener()
|
static ReorderableListPanel |
getTrashList()
|
boolean |
isCompressionButtonVisible()
|
boolean |
isItemCompressed(int i)
|
static void |
main(java.lang.String[] args)
|
void |
makeNewItemAndDragIt(java.awt.Component c,
java.lang.String name,
java.awt.event.MouseEvent e,
QuestionDragStarterImage thisQuestionDragStarterImage,
ReorderableListPanel.RunnableWithSuccessNotification<T> runnable,
T reorderableItem)
TODO both makeNewItemAndDragIt are wrong -- they have Component passed in, when we also need the ReorderableListItem |
void |
makeNewItemAndDragIt(java.awt.Component c,
java.lang.String name,
java.awt.event.MouseEvent e,
QuestionDragStarterImage thisQuestionDragStarterImage,
T reorderableItem)
Use this only if, for example, you are creating an object outside and you want to let it be dragged around in this panel. |
void |
removeItem(int index)
|
void |
removeItem(ReorderableListItemPanel rItem)
|
protected void |
renderListToGUI(boolean loadList)
This can be overridden to use a custom rendering technique or to delay the time that this list is loaded. |
void |
scrollToShowItem(int i)
|
void |
setAlwaysShowNewButton(boolean alwaysShowNew)
|
void |
setCompressionButtonVisible(boolean b)
|
void |
setFocusOtherListener(FocusOtherListener focusOtherListener)
|
void |
setGetDoubleClicks(ReorderableListPanel.GetDoubleClicks getDoubleClicks)
|
void |
setItemCompressed(int i,
boolean compressed)
|
void |
setNewItemListener(ReorderableListPanel.NewItemListener<T> newItemListener)
|
void |
setRefreshComponent(java.awt.Component c)
The refreshComponent will be repainted and re-laid out every time something changes. |
protected void |
setReorderableListModel(ReorderableListModel<T> listModel,
ReorderableListModelRenderer<T> renderer)
|
static void |
showDemoPanel(boolean horizontal)
|
void |
uninitialize()
Uninitialize the component. |
Methods inherited from class javax.swing.JComponent |
---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public boolean debug
Constructor Detail |
---|
public ReorderableListPanel(ReorderableListModel<T> listModel, ReorderableListModelRenderer<T> renderer, java.awt.Insets imageBorderInsets, java.lang.String itemsName)
public ReorderableListPanel(ReorderableListModel<T> listModel, ReorderableListModelRenderer<T> renderer, java.awt.Insets imageBorderInsets, java.lang.String itemsName, boolean horizontal)
protected ReorderableListPanel(boolean trash)
Method Detail |
---|
protected void setReorderableListModel(ReorderableListModel<T> listModel, ReorderableListModelRenderer<T> renderer)
listModel
- renderer
- loadListToGui
- whether to load the panels in. Auto-load can be skipped if, for example, a subclass wants to show a progress bar while loading or set the compression options at loading time, etc.protected void renderListToGUI(boolean loadList)
public static ReorderableListPanel getTrashList()
public void setRefreshComponent(java.awt.Component c)
component
- public java.lang.String getItemName()
protected void addItem(java.awt.Component c, javax.swing.ImageIcon icon, java.lang.String name, int index, T reorderableListItem)
public void setAlwaysShowNewButton(boolean alwaysShowNew)
public void makeNewItemAndDragIt(java.awt.Component c, java.lang.String name, java.awt.event.MouseEvent e, QuestionDragStarterImage thisQuestionDragStarterImage, T reorderableItem)
c
- name
- thisQuestionDragStarterImage
- public void makeNewItemAndDragIt(java.awt.Component c, java.lang.String name, java.awt.event.MouseEvent e, QuestionDragStarterImage thisQuestionDragStarterImage, ReorderableListPanel.RunnableWithSuccessNotification<T> runnable, T reorderableItem)
public void removeItem(ReorderableListItemPanel rItem)
public void removeItem(int index)
public int getItemCount()
public java.awt.Component getItem(int i)
public boolean isItemCompressed(int i)
public void setItemCompressed(int i, boolean compressed)
public void actionPerformed(java.awt.event.ActionEvent action)
actionPerformed
in interface java.awt.event.ActionListener
public boolean isCompressionButtonVisible()
public void setCompressionButtonVisible(boolean b)
b
- public static final void showDemoPanel(boolean horizontal)
public boolean canAddNewListItemFromData(java.lang.Object data)
data
-
public void addNewListItemFromData(java.lang.Object data, int oldIndex, int newIndex)
oldIndex
- the former index that this was at.newIndex
- the index to add it to the list at (between 0 and getItemCount()).object
- the data to add to this listpublic void setFocusOtherListener(FocusOtherListener focusOtherListener)
protected FocusOtherListener getFocusOtherListener()
public javax.swing.JMenuItem addPopupMenuItem(java.lang.String name, javax.swing.ImageIcon icon, ReorderableListPanel.ItemActionListener<T> action)
public void setGetDoubleClicks(ReorderableListPanel.GetDoubleClicks getDoubleClicks)
getDoubleClicks
- The getDoubleClicks to set.public ReorderableListPanel.GetDoubleClicks getGetDoubleClicks()
public ReorderableListPanel.NewItemListener getNewItemListener()
public void setNewItemListener(ReorderableListPanel.NewItemListener<T> newItemListener)
newItemListener
- The newItemListener to set.public void scrollToShowItem(int i)
public void uninitialize()
Uninitializable
uninitialize
in interface Uninitializable
public static final void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |