org.crosswire.common.swing.desktop
Class MDIViewLayout

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

public class MDIViewLayout
extends ViewLayout

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

Distribution Licence:
JSword is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
The License is available on the internet here, or by writing to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
The copyright to this program is held by it's authors.

Version:
$Id: MDIViewLayout.java,v 1.2 2004/09/21 17:45:47 dmsmith Exp $
Author:
Joe Walker [joe at eireneh dot com], DM Smith [dmsmith555 at yahoo dot com]
See Also:
Licence

Nested Class Summary
private  class MDIViewLayout.CloseListener
          We need to veto the closing of the last window.
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.ViewLayout
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: ViewLayout
Add a view to the set.

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

removeView

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

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

forceRemoveView

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

Overrides:
forceRemoveView in class ViewLayout

updateTitle

public void updateTitle(Component view)
Description copied from class: ViewLayout
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 ViewLayout
Parameters:
view - the component whose title is to be used

getSelected

public Component getSelected()
Description copied from class: ViewLayout
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 ViewLayout

select

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

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

removeInternalFrameListener

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

Parameters:
iframe -

Copyright ? 2003-2004