org.crosswire.common.swing.desktop
Class MDIViewLayout

java.lang.Object
  extended by org.crosswire.common.swing.desktop.AbstractViewLayout
      extended by org.crosswire.common.swing.desktop.MDIViewLayout
All Implemented Interfaces:
Viewable, Iterable

public class MDIViewLayout
extends AbstractViewLayout

MDI (Multiple documet interface) manager of how we layout views as sub-windows.

Author:
Joe Walker [joe at eireneh dot com], DM Smith [dmsmith555 at yahoo dot com]
See Also:
for license details. The copyright to this program is held by it's authors.

Nested Class Summary
(package private)  class MDIViewLayout.CloseListener
          We need to veto the closing of the last window.
(package private)  class MDIViewLayout.CustomInternalFrameAdapter
          So we can tidy things up when a window is closed
 
Field Summary
protected  JDesktopPane desk
          The desktop of sub-windows
 
Constructor Summary
MDIViewLayout()
          Create a MDIViewLayout
 
Method Summary
 void addView(Component view)
          Add a view to the set.
protected  void forceRemoveView(Component component)
          Unconditionally remove a view from the set.
 Component getSelected()
          Returns the top view.
private  void removeInternalFrameListener(JInternalFrame iframe)
          Find and remove the CustomInternalFrameAdapter that is attached to the iframe.
 void removeView(Component view)
          Remove a view from the set.
 void select(Component component)
          Find the view and select it.
 void updateTitle(Component view)
          Update the title of the view.
 
Methods inherited from class org.crosswire.common.swing.desktop.AbstractViewLayout
addViewEventListener, closeAll, closeOthers, fireViewRemoved, getConstraint, getPanel, getTitle, getView, getViewCount, getViews, iterator, moveTo, removeViewEventListener, visit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

desk

protected JDesktopPane desk
The desktop of sub-windows

Constructor Detail

MDIViewLayout

public MDIViewLayout()
Create a MDIViewLayout

Method Detail

addView

public void addView(Component view)
Description copied from class: AbstractViewLayout
Add a view to the set.

Specified by:
addView in interface Viewable
Overrides:
addView in class AbstractViewLayout

removeView

public void removeView(Component view)
Description copied from class: AbstractViewLayout
Remove a view from the set.

Specified by:
removeView in interface Viewable
Overrides:
removeView in class AbstractViewLayout

forceRemoveView

protected void forceRemoveView(Component component)
Description copied from class: AbstractViewLayout
Unconditionally remove a view from the set.

Overrides:
forceRemoveView in class AbstractViewLayout

updateTitle

public void updateTitle(Component view)
Description copied from class: AbstractViewLayout
Update the title of the view. If the component does not implement Titleable, then a generated title will be used.

Specified by:
updateTitle in interface Viewable
Specified by:
updateTitle in class AbstractViewLayout
Parameters:
view - the component whose title is to be used

getSelected

public Component getSelected()
Description copied from class: AbstractViewLayout
Returns the top view. If no view is the top, it returns the first one added.

Specified by:
getSelected in interface Viewable
Specified by:
getSelected in class AbstractViewLayout

select

public void select(Component component)
Description copied from class: AbstractViewLayout
Find the view and select it.

Specified by:
select in interface Viewable
Specified by:
select in class AbstractViewLayout

removeInternalFrameListener

private void removeInternalFrameListener(JInternalFrame iframe)
Find and remove the CustomInternalFrameAdapter that is attached to the iframe.

Parameters:
iframe -

Copyright ยจ 2003-2006