org.xnap.commons.gui
Class IconSplitPane

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JSplitPane
                  extended by org.xnap.commons.gui.IconSplitPane
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class IconSplitPane
extends JSplitPane

This class provides a tabbed pane like behaving widget. The IconSplitPane is split up in two parts. The left part is a JList that contains icons and their descriptions. The right part can be any component. If the user selects on of the icons from the list the respective panel is show at the right.

The names of the methods are modelled after the JTabbedPane. TODO add ComponentOrientation support TODO show empty icon instead of no icon? to separated list entries

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JSplitPane
JSplitPane.AccessibleJSplitPane
 
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.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
 
Fields inherited from class javax.swing.JSplitPane
BOTTOM, CONTINUOUS_LAYOUT_PROPERTY, continuousLayout, DIVIDER, DIVIDER_LOCATION_PROPERTY, DIVIDER_SIZE_PROPERTY, dividerSize, HORIZONTAL_SPLIT, LAST_DIVIDER_LOCATION_PROPERTY, lastDividerLocation, LEFT, leftComponent, ONE_TOUCH_EXPANDABLE_PROPERTY, oneTouchExpandable, orientation, ORIENTATION_PROPERTY, RESIZE_WEIGHT_PROPERTY, RIGHT, rightComponent, TOP, VERTICAL_SPLIT
 
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
IconSplitPane()
           
 
Method Summary
 void addChangeListener(ChangeListener l)
          Adds a listener that gets notified when a tab is selected.
 void addTab(String description, Icon icon, Component c)
          Adds a new tab.
protected  void fireStateChanged()
          Send a ChangeEvent, whose source is this tabbedpane, to each listener.
 String getDescriptionAt(int i)
          Returns the description at index i.
 Icon getIconAt(int i)
          Returns the icon at index i.
 Component getSelectedComponent()
          Returns the currently selected tab.
 int getSelectedIndex()
          Returns the index of the currently selected tab.
 Component getTabAt(int i)
          Returns the tab at index i.
 int getTabCount()
          Returns the number of tabs.
 Component[] getTabs()
          Returns all tabs as an array.
 String getTitleAt(int i)
          Returns the title at index i.
 int indexOfComponent(Component c)
          Returns the index of c.
 void insertTab(String description, Icon icon, Component c, int index)
          Inserts a new tab at index.
 void remove(Component c)
          Removes tab c.
 void removeChangeListener(ChangeListener l)
          Removes a ChangeListener.
 void removeTabAt(int i)
          Removes tab at index i.
 void setIconAt(int i, Icon icon)
          Sets the icon at index i to icon.
 void setSelectedComponent(Component c)
          Selects c.
 
Methods inherited from class javax.swing.JSplitPane
addImpl, getAccessibleContext, getBottomComponent, getDividerLocation, getDividerSize, getLastDividerLocation, getLeftComponent, getMaximumDividerLocation, getMinimumDividerLocation, getOrientation, getResizeWeight, getRightComponent, getTopComponent, getUI, getUIClassID, isContinuousLayout, isOneTouchExpandable, isValidateRoot, paintChildren, paramString, remove, removeAll, resetToPreferredSizes, setBottomComponent, setContinuousLayout, setDividerLocation, setDividerLocation, setDividerSize, setLastDividerLocation, setLeftComponent, setOneTouchExpandable, setOrientation, setResizeWeight, setRightComponent, setTopComponent, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, 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, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, paint, paintBorder, paintComponent, paintImmediately, paintImmediately, 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
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, 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, 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
 

Constructor Detail

IconSplitPane

public IconSplitPane()
Method Detail

addTab

public void addTab(String description,
                   Icon icon,
                   Component c)
Adds a new tab.


insertTab

public void insertTab(String description,
                      Icon icon,
                      Component c,
                      int index)
Inserts a new tab at index.


getTabs

public Component[] getTabs()
Returns all tabs as an array.


getTabAt

public Component getTabAt(int i)
Returns the tab at index i.


getTabCount

public int getTabCount()
Returns the number of tabs.


getDescriptionAt

public String getDescriptionAt(int i)
Returns the description at index i.


getIconAt

public Icon getIconAt(int i)
Returns the icon at index i.


getTitleAt

public String getTitleAt(int i)
Returns the title at index i.


setIconAt

public void setIconAt(int i,
                      Icon icon)
Sets the icon at index i to icon.


getSelectedIndex

public int getSelectedIndex()
Returns the index of the currently selected tab.


setSelectedComponent

public void setSelectedComponent(Component c)
Selects c. The corresponding icon will also be selected.


indexOfComponent

public int indexOfComponent(Component c)
Returns the index of c.


remove

public void remove(Component c)
Removes tab c.

Overrides:
remove in class JSplitPane

removeTabAt

public void removeTabAt(int i)
Removes tab at index i.


addChangeListener

public void addChangeListener(ChangeListener l)
Adds a listener that gets notified when a tab is selected.


removeChangeListener

public void removeChangeListener(ChangeListener l)
Removes a ChangeListener.

Parameters:
l - the ChangeListener to remove
See Also:
fireStateChanged(), addChangeListener(javax.swing.event.ChangeListener)

fireStateChanged

protected void fireStateChanged()
Send a ChangeEvent, whose source is this tabbedpane, to each listener. This method method is called each time a ChangeEvent is received from the model.

See Also:
addChangeListener(javax.swing.event.ChangeListener)

getSelectedComponent

public Component getSelectedComponent()
Returns the currently selected tab.



Copyright © 2004-2007 XNap Commons Team. All Rights Reserved.