org.crosswire.common.swing.desktop
Interface Viewable

All Known Implementing Classes:
MDIViewLayout, TDIViewLayout, ViewLayout, ViewManager

public interface Viewable

Interface defining what is Viewable.

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: Viewable.java,v 1.2 2004/09/21 17:45:47 dmsmith Exp $
Author:
DM Smith [ dmsmith555 at yahoo dot com]
See Also:
Licence

Method Summary
 void addView(Component component)
          Add a view to the set.
 void addViewEventListener(ViewEventListener listener)
          Adds a view event listener for notification of any changes to the view.
 void closeAll()
          Close all the views.
 void closeOthers(Component component)
          Close all the views but the one provided.
 Component getSelected()
          Returns the top view.
 Component getView(int i)
          Get the view by position.
 int getViewCount()
          The number of views held by this layout.
 Collection getViews()
          Get a snapshot of the views as a collection.
 Iterator iterator()
          Get an iterator of a snapshot of views.
 void moveTo(ViewLayout other)
          Copies all the views from the one layout to the other
 void removeView(Component component)
          Remove a view from the set.
 void removeViewEventListener(ViewEventListener listener)
          Removes a view event listener.
 void select(Component component)
          Find the view and select it.
 void updateTitle(Component component)
          Update the title of the view.
 void visit(ViewVisitor visitor)
          Visit every view in the order that they were added.
 

Method Detail

addView

void addView(Component component)
Add a view to the set.


removeView

void removeView(Component component)
Remove a view from the set.


getViews

Collection getViews()
Get a snapshot of the views as a collection.

Returns:
the views

iterator

Iterator iterator()
Get an iterator of a snapshot of views.

Returns:
an iterator over the views.

moveTo

void moveTo(ViewLayout other)
Copies all the views from the one layout to the other

Parameters:
other - the other layout

closeAll

void closeAll()
Close all the views. Note the policy is enforced that one view is kept. This will keep the last one added.


closeOthers

void closeOthers(Component component)
Close all the views but the one provided.

Parameters:
component - the view that is to remain open.

visit

void visit(ViewVisitor visitor)
Visit every view in the order that they were added.

Parameters:
visitor - The visitor for the view

updateTitle

void updateTitle(Component component)
Update the title of the view. If the component does not implement Titleable, then a generated title will be used.

Parameters:
component - the component whose title is to be used

getSelected

Component getSelected()
Returns the top view. If no view is the top, it returns the first one added.


select

void select(Component component)
Find the view and select it.

Parameters:
component -

getViewCount

int getViewCount()
The number of views held by this layout.

Returns:
the number of views held by this layout

getView

Component getView(int i)
Get the view by position. Note that adding and removing views changes the indexes of the views. Do not use this for iteration as it is not thread safe.

Parameters:
i - the index of the view
Returns:
the requested view.

addViewEventListener

void addViewEventListener(ViewEventListener listener)
Adds a view event listener for notification of any changes to the view.

Parameters:
listener - the listener

removeViewEventListener

void removeViewEventListener(ViewEventListener listener)
Removes a view event listener.

Parameters:
listener - the listener

Copyright ? 2003-2004