com.javadocking.component
Class DefaultSwComponentFactory

java.lang.Object
  extended by com.javadocking.component.DefaultSwComponentFactory
All Implemented Interfaces:
SwComponentFactory

public class DefaultSwComponentFactory
extends java.lang.Object
implements SwComponentFactory

This Swing component factory provides default implementations for the creation of the components that will be used by the docking library.

It uses the normal constructors of the Swing components (javax.swing.JSplitPane, javax.swing.JTabbedPane, javax.swing.JDialog, javax.swing.JWindow and javax.swing.JLabel).

Author:
Heidi Rakels.

Constructor Summary
DefaultSwComponentFactory()
           
 
Method Summary
 SelectableHeader createCompositeTabDockHeader(Dock childDock, int position)
          Creates a SelectableDockableHeader.
 DockHeader createDockHeader(LeafDock dock, int orientation)
          Creates a DefaultDockHeader.
 ExternalizeDock createExternalizer()
          Creates a SingleDock.
 javax.swing.border.Border createFloatingBorder()
          Creates a raised border.
 java.awt.Component createIconButton(javax.swing.Action action)
          Creates a IconButton.
 javax.swing.JDialog createJDialog(java.awt.Window owner)
          Creates an undecorated non-modal dialog that is resizable.
 javax.swing.JLabel createJLabel()
          Creates a label.
 javax.swing.JSplitPane createJSplitPane()
          Creates a split pane.
 javax.swing.JTabbedPane createJTabbedPane()
          Creates a tabbed pane.
 Header createMaximizeHeader(Dockable dockable, int position)
          Creates a MaximizeHeader.
 SelectableHeader createMinimizeHeader(Dockable dockable, int position)
          Creates a MinimzeHeader.
 javax.swing.JPopupMenu createPopupMenu(Dockable selectedDockable, CompositeDockable compositeDockable)
          Creates a popup menu with PopupMenuFactory of this class.
 DockHeader createSingleDockHeader(LeafDock dock, int position)
          Creates a SingleDockHeader.
 SelectableHeader createTabDockHeader(Dockable dockable, int position)
          Creates a SelectableDockableHeader.
 java.awt.Window createWindow(java.awt.Window owner)
          Creates a window.
 PopupMenuFactory getPopupMenuFactory()
          Gets the factory that creates a popup menu for one dockable or a group of dockables.
 void setPopupMenuFactory(PopupMenuFactory popupMenuFactory)
          Sets the factory that creates a popup menu for one dockable or a group of dockables.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultSwComponentFactory

public DefaultSwComponentFactory()
Method Detail

createJSplitPane

public javax.swing.JSplitPane createJSplitPane()
Description copied from interface: SwComponentFactory
Creates a split pane.

Specified by:
createJSplitPane in interface SwComponentFactory
Returns:
The created split pane.

createJTabbedPane

public javax.swing.JTabbedPane createJTabbedPane()
Description copied from interface: SwComponentFactory
Creates a tabbed pane.

Specified by:
createJTabbedPane in interface SwComponentFactory
Returns:
The created tabbed pane.

createJDialog

public javax.swing.JDialog createJDialog(java.awt.Window owner)
Creates an undecorated non-modal dialog that is resizable.

Specified by:
createJDialog in interface SwComponentFactory
Parameters:
owner - The owner of the dialog.
Returns:
The created non-modal dialog.

createWindow

public java.awt.Window createWindow(java.awt.Window owner)
Description copied from interface: SwComponentFactory
Creates a window.

Specified by:
createWindow in interface SwComponentFactory
Parameters:
owner - The owner of the window.
Returns:
The created window.

createFloatingBorder

public javax.swing.border.Border createFloatingBorder()
Creates a raised border.

Specified by:
createFloatingBorder in interface SwComponentFactory
Returns:
The created border.

createJLabel

public javax.swing.JLabel createJLabel()
Description copied from interface: SwComponentFactory
Creates a label.

Specified by:
createJLabel in interface SwComponentFactory
Returns:
The created label.

createIconButton

public java.awt.Component createIconButton(javax.swing.Action action)
Creates a IconButton.

Specified by:
createIconButton in interface SwComponentFactory
Parameters:
action - The action that will be performed when the button is clicked.
Returns:
The created small icon component to perform the given action.

createTabDockHeader

public SelectableHeader createTabDockHeader(Dockable dockable,
                                            int position)
Creates a SelectableDockableHeader.

Specified by:
createTabDockHeader in interface SwComponentFactory
Parameters:
dockable - The dockable that will be represented in the tab.
position - Possible values are constants defined by the class Position: Position.LEFT, Position.RIGHT, Position.TOP or Position.BOTTOM.
Returns:
A header for the dockable in the tab.

createCompositeTabDockHeader

public SelectableHeader createCompositeTabDockHeader(Dock childDock,
                                                     int position)
Creates a SelectableDockableHeader.

Specified by:
createCompositeTabDockHeader in interface SwComponentFactory
Parameters:
childDock - The child dock that will be represented in the tab.
position - Possible values are constants defined by the class Position: Position.LEFT, Position.RIGHT, Position.TOP or Position.BOTTOM.
Returns:
A header for the dockable in the tab.

createSingleDockHeader

public DockHeader createSingleDockHeader(LeafDock dock,
                                         int position)
Creates a SingleDockHeader.

Specified by:
createSingleDockHeader in interface SwComponentFactory
Parameters:
dock - The dock of the header.
position - Possible values are constants defined by the class Position: Position.LEFT, Position.RIGHT, Position.TOP or Position.BOTTOM.
Returns:
A header for a dock with one dockable.

createDockHeader

public DockHeader createDockHeader(LeafDock dock,
                                   int orientation)
Creates a DefaultDockHeader.

Specified by:
createDockHeader in interface SwComponentFactory
Parameters:
dock - The dock of the header.
orientation - The position of this header. Possible values are constants defined by the class Position, i.e.:
Returns:
The header for a dock with multiple dockables.

createMaximizeHeader

public Header createMaximizeHeader(Dockable dockable,
                                   int position)
Creates a MaximizeHeader.

Specified by:
createMaximizeHeader in interface SwComponentFactory
Parameters:
dockable - The dockable of the header.
position - The position of this header. Possible values are constants defined by the class Position, i.e.:
Returns:
A header for a dockable.

createMinimizeHeader

public SelectableHeader createMinimizeHeader(Dockable dockable,
                                             int position)
Creates a MinimzeHeader.

Specified by:
createMinimizeHeader in interface SwComponentFactory
Parameters:
dockable - The dockable of the header.
position - The position of this header. Possible values are constants defined by the class Position, i.e.:
Returns:
A header for a dockable.

createExternalizer

public ExternalizeDock createExternalizer()
Creates a SingleDock.

Specified by:
createExternalizer in interface SwComponentFactory
Returns:
A dock in which a dockable can be externalized.

createPopupMenu

public javax.swing.JPopupMenu createPopupMenu(Dockable selectedDockable,
                                              CompositeDockable compositeDockable)
Creates a popup menu with PopupMenuFactory of this class.

Specified by:
createPopupMenu in interface SwComponentFactory
Parameters:
selectedDockable - The selected dockable.
compositeDockable - The dockables in the selected dock.
Returns:
A popup menu for the selected dockable and the other dockables in the dock.

getPopupMenuFactory

public PopupMenuFactory getPopupMenuFactory()
Gets the factory that creates a popup menu for one dockable or a group of dockables.

Returns:
The factory that creates a popup menu for one dockable or a group of dockables.

setPopupMenuFactory

public void setPopupMenuFactory(PopupMenuFactory popupMenuFactory)
Sets the factory that creates a popup menu for one dockable or a group of dockables.

Parameters:
popupMenuFactory - The factory that creates a popup menu for one dockable or a group of dockables.