com.japisoft.multipanes
Class MultiPanes

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--com.japisoft.multipanes.MultiPanes
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class MultiPanes
extends javax.swing.JComponent

This is the main container, it stores a set of TitledPane. Each titledPane has a state opened or closed and properties like name, icon... . The TitledPane set is stored in a titledPaneModel available calling getModel. Each titledPane state is shown with the titledPaneView available calling getView. Thus you can develop your own view calling setView .

For freeing inner cross-references, it is recommended to call dispose after the multipanes usage

Basic usage sample :

 JFrame f = new JFrame();
	MultiPanes mp = new MultiPanes();
 TitledPane pane1 = null;
	mp.getModel().addTitledPane( 
		pane1 = new BasicTitledPane("test2", "Title 2", "ToolTip2", new JTable() ) );
 		f.getContentPane().add( mp );
  mp.open( pane1 ); // We open it at starting
 

More information at http://www.japisoft.com

See Also:
TitledPane, Serialized Form

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
MultiPanes()
           
 
Method Summary
 void addNotify()
           
 void addTitledPaneListener(TitledPaneListener listener)
          Store a listener for notifying a titledPane opening/closing new status
 void close(TitledPane tp)
          Closed the following titledPane, it can't be null
 java.awt.Color getDefaultSelectedTitledPaneBackground()
          Reset the default background color for the selected titled pane
 java.awt.Color getDefaultSelectedTitledPaneForeground()
          Reset the default background color for the selected titled pane
 java.awt.Color getDefaultTitledPaneBackground()
           
 java.awt.Font getDefaultTitledPaneFont()
           
 java.awt.Color getDefaultTitledPaneForeground()
           
 TitledPaneModel getModel()
           
 TitledPane getOpenedTitledPane()
           
 int getVerticalInset()
           
 TitledPaneView getView()
           
 boolean isEnabledKeyAccelerator()
           
 void open(TitledPane tp)
          Opened the following titledPane, it can't be null
protected  void prepareTitledPaneKeyMapping()
          This is called once to map a key for each titled pane with the following format "ctrl + shift + number" of the titled pane starting from 1.
 void removeTitledPaneListener(TitledPaneListener listener)
          Remove a listener for notifying a titledPane opening/closing new status
 void requestFocus()
           
 void setArrowMode(boolean arrowMode)
          If true, it will update the view adding open/hide arrow.
 void setDefaultSelectedTitledPaneBackground(java.awt.Color color)
          Reset the default foreground color for the selected titled pane
 void setDefaultSelectedTitledPaneForeground(java.awt.Color color)
          Reset the default foreground color for the selected titled pane
 void setDefaultTitledPaneBackground(java.awt.Color color)
          Reset the default background color for the set of titled pane
 void setDefaultTitledPaneFont(java.awt.Font font)
          Reset the default font for the set of titled pane
 void setDefaultTitledPaneForeground(java.awt.Color color)
          Reset the default foreground color for the set of titled pane
 void setEnabledKeyAccelerator(boolean enabled)
          Set a key for opening each titled pane from 1 to 9 with a mask ctrl + shit before.
 void setModel(TitledPaneModel model)
          Set a new model for the set of titledPane
 void setVerticalInset(int verticalInset)
          Set a separator between each titled pane.
 void setView(TitledPaneView view)
          View for the opening/closing titledPane state
 void updateView()
          This method rebuilds the user interface view, so it musn't be called a lot of time.
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, 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, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, 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

MultiPanes

public MultiPanes()
Method Detail

setModel

public void setModel(TitledPaneModel model)
Set a new model for the set of titledPane


getModel

public TitledPaneModel getModel()
Returns:
a model containing a set of titledPane

setView

public void setView(TitledPaneView view)
View for the opening/closing titledPane state


getView

public TitledPaneView getView()
Returns:
a view for each titledPane state : close/open

setArrowMode

public void setArrowMode(boolean arrowMode)
If true, it will update the view adding open/hide arrow. Note that this method must be called BEFORE the Multipanes is visible

Parameters:
arrowMode -

setVerticalInset

public void setVerticalInset(int verticalInset)
Set a separator between each titled pane. By default to 0


getVerticalInset

public int getVerticalInset()
Returns:
the current separator between each titled pane.

open

public void open(TitledPane tp)
Opened the following titledPane, it can't be null


close

public void close(TitledPane tp)
Closed the following titledPane, it can't be null


getOpenedTitledPane

public TitledPane getOpenedTitledPane()
Returns:
the current opened titledPane, it can be null

updateView

public void updateView()
This method rebuilds the user interface view, so it musn't be called a lot of time. This is for inner usage


addNotify

public void addNotify()
Overrides:
addNotify in class javax.swing.JComponent

requestFocus

public void requestFocus()
Overrides:
requestFocus in class javax.swing.JComponent

addTitledPaneListener

public void addTitledPaneListener(TitledPaneListener listener)
Store a listener for notifying a titledPane opening/closing new status


removeTitledPaneListener

public void removeTitledPaneListener(TitledPaneListener listener)
Remove a listener for notifying a titledPane opening/closing new status


setEnabledKeyAccelerator

public void setEnabledKeyAccelerator(boolean enabled)
Set a key for opening each titled pane from 1 to 9 with a mask ctrl + shit before. By default true

Parameters:
enabled - Bind a key for opening a titled pane

isEnabledKeyAccelerator

public boolean isEnabledKeyAccelerator()
Returns:
true if a key ctrl + shift + number is available for opening a titled pane.

prepareTitledPaneKeyMapping

protected void prepareTitledPaneKeyMapping()
This is called once to map a key for each titled pane with the following format "ctrl + shift + number" of the titled pane starting from 1.


setDefaultTitledPaneFont

public void setDefaultTitledPaneFont(java.awt.Font font)
Reset the default font for the set of titled pane


getDefaultTitledPaneFont

public java.awt.Font getDefaultTitledPaneFont()
Returns:
the default font for the set of titled pane. null by default

setDefaultTitledPaneForeground

public void setDefaultTitledPaneForeground(java.awt.Color color)
Reset the default foreground color for the set of titled pane


getDefaultTitledPaneForeground

public java.awt.Color getDefaultTitledPaneForeground()
Returns:
the default foreground color for the set of titled pane. null by default

setDefaultTitledPaneBackground

public void setDefaultTitledPaneBackground(java.awt.Color color)
Reset the default background color for the set of titled pane


getDefaultTitledPaneBackground

public java.awt.Color getDefaultTitledPaneBackground()
Returns:
the default background color for the set of titled pane. null by default

setDefaultSelectedTitledPaneForeground

public void setDefaultSelectedTitledPaneForeground(java.awt.Color color)
Reset the default foreground color for the selected titled pane


getDefaultSelectedTitledPaneForeground

public java.awt.Color getDefaultSelectedTitledPaneForeground()
Reset the default background color for the selected titled pane


setDefaultSelectedTitledPaneBackground

public void setDefaultSelectedTitledPaneBackground(java.awt.Color color)
Reset the default foreground color for the selected titled pane


getDefaultSelectedTitledPaneBackground

public java.awt.Color getDefaultSelectedTitledPaneBackground()
Reset the default background color for the selected titled pane