cern::gp::explorer::MultiListExplorer Class Reference

Inheritance diagram for cern::gp::explorer::MultiListExplorer:
Inheritance graph
[legend]
Collaboration diagram for cern::gp::explorer::MultiListExplorer:
Collaboration graph
[legend]

List of all members.

Classes

interface  ComponentCreator
class  ListExplorerPanel
class  ListSelectionListener
class  NextListSelectionListener
interface  SelectionListener

Public Member Functions

 MultiListExplorer ()
 MultiListExplorer (SelectionListener selectionListener, int listCount)
 MultiListExplorer (SelectionListener selectionListener, int width, int height)
 MultiListExplorer (SelectionListener selectionListener, int listCount, int width, int height, boolean twoRows)
void addNotify ()
void removeNotify ()
void setRootNode (GPNode node)
ComponentCreator getTopComponentCreator ()
void setTopComponentCreator (ComponentCreator componentCreator)
ComponentCreator getBottomComponentCreator ()
void setBottomComponentCreator (ComponentCreator componentCreator)
void setListCount (int listCount)
int getListCount ()
void setAutomaticSelection (boolean automaticSelection)
boolean getAutomaticSelection ()

Static Public Attributes

static final int DEFAULT_WIDTH = 600
static final int DEFAULT_HEIGHT = 400
static final int DEFAULT_LIST_COUNT = 4

Protected Member Functions

ExplorerManager getExplorerManager (int listIndex)

Static Protected Member Functions

static void selectNthChildren (ExplorerManager explorerManager, int n)

Private Member Functions

javax.swing.JComponent createExplorerPanelRows (int width, int height, int listCount)
javax.swing.JComponent createExplorerPanelRow (int width, int height, int listCount, int preceedingExplorerCount, ExplorerPanel prevRightPanel)
ExplorerPanel createExplorerPanel (int listIndex, ExplorerPanel prevRightPanel)

Private Attributes

ExplorerPanel[] _explorerPanels
int _listCount = DEFAULT_LIST_COUNT
boolean _twoRows
boolean _automaticSelection = true
ComponentCreator _bottomComponentCreator
ComponentCreator _topComponentCreator
SelectionListener _selectionListener

Detailed Description

MultiListExplorer is an explorer showing several lists linked together allowing to show several levels of depth at once. The first list shows the children of the root node, the second list shows the children of the selected node in the first list, and so on.

The number of lists is parameterizable.

It is possible to register a java.beans.PropertyChangeListener to be notified of the selection in the different list. The method getExplorerManager(int) allow to register such a listener on one particular list.

It is possible to customize the top and bottom component of each list by setting a ComponentCreator for top or bottom before adding the explorer to the gui.

Version:
Revision
1.2
Date
2006/09/25 08:52:36
Author:
Lionel Mestre

Constructor & Destructor Documentation

cern::gp::explorer::MultiListExplorer::MultiListExplorer (  )  [inline]
cern::gp::explorer::MultiListExplorer::MultiListExplorer ( SelectionListener  selectionListener,
int  listCount 
) [inline]

References DEFAULT_HEIGHT, and DEFAULT_WIDTH.

cern::gp::explorer::MultiListExplorer::MultiListExplorer ( SelectionListener  selectionListener,
int  width,
int  height 
) [inline]

References DEFAULT_LIST_COUNT.

cern::gp::explorer::MultiListExplorer::MultiListExplorer ( SelectionListener  selectionListener,
int  listCount,
int  width,
int  height,
boolean  twoRows 
) [inline]

Member Function Documentation

void cern::gp::explorer::MultiListExplorer::addNotify (  )  [inline]
ExplorerPanel cern::gp::explorer::MultiListExplorer::createExplorerPanel ( int  listIndex,
ExplorerPanel  prevRightPanel 
) [inline, private]

Creates one ExplorerPanel representing one list.

Parameters:
listIndex the index of the list to create (from 0 to n-1)
prevRightPanel the possibly null previous right panel displaying the content of the node selected in this list.
Returns:
the new ExplorerPanel

References _explorerPanels, and getExplorerManager().

Referenced by createExplorerPanelRow().

javax.swing.JComponent cern::gp::explorer::MultiListExplorer::createExplorerPanelRow ( int  width,
int  height,
int  listCount,
int  preceedingExplorerCount,
ExplorerPanel  prevRightPanel 
) [inline, private]

Creates all ExplorerPanels (one per list) making the MultiListExplorer. This method is recursive and creates list from right to left

Parameters:
width the remaining available width in pixels
height the available height in pixels
listCount the counter giving how many list remain to be created
prevRightPanel the possibly null previous right panel that was created on the previous call
Returns:
the new component containing all created explorers

References createExplorerPanel().

Referenced by addNotify(), and createExplorerPanelRows().

javax.swing.JComponent cern::gp::explorer::MultiListExplorer::createExplorerPanelRows ( int  width,
int  height,
int  listCount 
) [inline, private]

Creates all ExplorerPanels (one per list) making the MultiListExplorer. This method is recursive and creates list from right to left

Parameters:
width the remaining available width in pixels
height the available height in pixels
listCount the counter giving how many list remain to be created
prevRightPanel the possibly null previous right panel that was created on the previous call
Returns:
the new component containing all created explorers

References _explorerPanels, and createExplorerPanelRow().

Referenced by addNotify().

boolean cern::gp::explorer::MultiListExplorer::getAutomaticSelection (  )  [inline]

Returns if the selection in one list triggers the selection in the subsequent lists.

Returns:
if the selection in one list triggers the selection in the subsequent lists.

References _automaticSelection.

ComponentCreator cern::gp::explorer::MultiListExplorer::getBottomComponentCreator (  )  [inline]

Returns the bottomComponentCreator that is used to create the top component of each list in the explorer or null if none is set.

Returns:
the current bottomComponentCreator or null

References _bottomComponentCreator.

ExplorerManager cern::gp::explorer::MultiListExplorer::getExplorerManager ( int  listIndex  )  [inline, protected]

Returns the explorer manager of the list of given index

Returns:
the explorer manager of the list of given index

References _explorerPanels.

Referenced by addNotify(), createExplorerPanel(), cern::gp::explorer::MultiListExplorer::ListExplorerPanel::initialize(), cern::gp::explorer::MultiListExplorer::ListExplorerPanel::removeNotify(), and setRootNode().

int cern::gp::explorer::MultiListExplorer::getListCount (  )  [inline]

Returns the number of lists in the explorer.

Returns:
the number of lists in the explorer.

References _listCount.

ComponentCreator cern::gp::explorer::MultiListExplorer::getTopComponentCreator (  )  [inline]

Returns the topComponentCreator that is used to create the top component of each list in the explorer or null if none is set.

Returns:
the current topComponentCreator or null

References _topComponentCreator.

void cern::gp::explorer::MultiListExplorer::removeNotify (  )  [inline]

References _explorerPanels.

static void cern::gp::explorer::MultiListExplorer::selectNthChildren ( ExplorerManager  explorerManager,
int  n 
) [inline, static, protected]
void cern::gp::explorer::MultiListExplorer::setAutomaticSelection ( boolean  automaticSelection  )  [inline]

Sets if the selection in one list triggers the selection in the subsequent lists. This property is true by default.

Parameters:
automaticSelection whether the selection in one list cascade to the others

References _automaticSelection.

void cern::gp::explorer::MultiListExplorer::setBottomComponentCreator ( ComponentCreator  componentCreator  )  [inline]

Sets the bottomComponentCreator that is used to create the top component of each list in the explorer. Null can be used to remove an existing creator. The bottomComponentCreator cannot be changed once the explorer has been included in a gui. It can only be changed after instantiation before adding the Explorer into a container.

Parameters:
componentCreator the componentCreator to use to create the bottom components

References _bottomComponentCreator.

void cern::gp::explorer::MultiListExplorer::setListCount ( int  listCount  )  [inline]

Sets the number of lists in the explorer. Cannot be inferior to 2. The number cannot be changed once the explorer has been included in a gui. The number can only be changed after instantiation before adding the Explorer into a container.

Parameters:
listCount the number of ilst in the explorer

References _explorerPanels, and _listCount.

Referenced by cern::gp::explorer::test::TestMultiListExplorer::main().

void cern::gp::explorer::MultiListExplorer::setRootNode ( GPNode  node  )  [inline]

set the root node of the hiearachy to be explored

References getExplorerManager(), and cern::gp::nodes::GPNode::getPeerNode().

Referenced by cern::gp::explorer::test::TestMultiListExplorer::main().

void cern::gp::explorer::MultiListExplorer::setTopComponentCreator ( ComponentCreator  componentCreator  )  [inline]

Sets the topComponentCreator that is used to create the top component of each list in the explorer. Null can be used to remove an existing creator. The topComponentCreator cannot be changed once the explorer has been included in a gui. It can only be changed after instantiation before adding the Explorer into a container.

Parameters:
componentCreator the componentCreator to use to create the top components

References _topComponentCreator.


Member Data Documentation

Referenced by addNotify(), and MultiListExplorer().

Referenced by MultiListExplorer().

Referenced by MultiListExplorer().

Referenced by MultiListExplorer().


The documentation for this class was generated from the following file:

Generated by  doxygen 1.6.2