|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.crosswire.common.swing.desktop.ViewManager
public class ViewManager
A ViewManager is an abstraction of a desktop that displays views as tabs or sub-windows. All the views are of the same type.
for license details.
The copyright to this program is held by it's authors.
Field Summary | |
---|---|
static String |
CLEAR_VIEW
|
static String |
CLOSE_ALL_VIEWS
|
static String |
CLOSE_OTHER_VIEWS
|
static String |
CLOSE_VIEW
|
private ActionFactory |
contextActions
|
private LayoutType |
current
The current way the views are laid out |
private GridBagConstraints |
gbc
A shared, reusable constraint that makes its contents grow to fill the area. |
private ViewGenerator |
generator
|
private static LayoutType |
initial
The initial layout state |
private JRadioButtonMenuItem |
mdiView
|
static String |
NEW_TAB
|
static String |
OPEN
|
private JPanel |
panel
|
static String |
SAVE
|
static String |
SAVE_ALL
|
static String |
SAVE_AS
|
static String |
TAB_MODE
|
private JRadioButtonMenuItem |
tdiView
|
static String |
WINDOW_MODE
|
Constructor Summary | |
---|---|
ViewManager(ViewGenerator generator)
Construct a ViewManager. |
Method Summary | |
---|---|
Component |
addView()
Adds a view to the list in this Desktop. |
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 |
clear(Component view)
Reset a view so that it can be reused. |
void |
closeAll()
Close all the views. |
void |
closeOthers(Component component)
Close all the views but the one provided. |
void |
doClearView()
Close the current passage window. |
void |
doCloseAllViews()
Close all the passage windows. |
void |
doCloseOtherViews()
Close all other passage windows. |
void |
doCloseView()
Close the current passage window. |
void |
doNewTab()
For creating a new window. |
void |
doTabMode()
View the Tabbed Document Interface (TDI) interface. |
void |
doWindowMode()
View the Multiple Document/Window Interface (MDI) interface. |
(package private) Object |
getConstraint()
|
Action |
getContextAction(String key)
Get a particular action by internal name |
JPanel |
getDesktop()
|
static int |
getInitialLayoutType()
What is the initial layout state? |
private static LayoutType |
getInitialViewLayoutType()
Get the initial layout type. |
JRadioButtonMenuItem |
getMdiView()
|
Component |
getSelected()
Returns the top view. |
JRadioButtonMenuItem |
getTdiView()
|
Component |
getView(int i)
Get the view by position. |
int |
getViewCount()
The number of views held by this layout. |
AbstractViewLayout |
getViewLayout()
What is the current layout? |
private LayoutType |
getViewLayoutType()
What is the current layout type? |
Collection |
getViews()
Get a snapshot of the views as a collection. |
Iterator |
iterator()
|
void |
moveTo(AbstractViewLayout other)
Copies all the views from the one layout to the other |
void |
removeView(Component view)
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. |
static void |
setInitialLayoutType(int initialLayout)
What should the initial layout state be? |
void |
setLayoutType(LayoutType next)
Setup the current view |
private void |
setViewLayoutType(LayoutType newLayoutType)
Set the current layout type |
void |
titleChanged(TitleChangedEvent ev)
A Select pane is telling us that it has changed, and we might want to update the BibleViewPane and the AbstractViewLayout to reflect any potentially new titles |
void |
updateTitle(Component component)
Update the title of the view. |
void |
viewRemoved(ViewEvent event)
|
void |
visit(ViewVisitor visitor)
Visit every view in the order that they were added. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String TAB_MODE
public static final String WINDOW_MODE
public static final String NEW_TAB
public static final String CLOSE_VIEW
public static final String CLEAR_VIEW
public static final String CLOSE_ALL_VIEWS
public static final String CLOSE_OTHER_VIEWS
public static final String OPEN
public static final String SAVE
public static final String SAVE_AS
public static final String SAVE_ALL
private static LayoutType initial
private ViewGenerator generator
private JPanel panel
private LayoutType current
private ActionFactory contextActions
private JRadioButtonMenuItem tdiView
private JRadioButtonMenuItem mdiView
private GridBagConstraints gbc
Constructor Detail |
---|
public ViewManager(ViewGenerator generator)
Method Detail |
---|
public JPanel getDesktop()
public JRadioButtonMenuItem getMdiView()
public JRadioButtonMenuItem getTdiView()
public final void addView(Component component)
Viewable
addView
in interface Viewable
public void closeAll()
Viewable
closeAll
in interface Viewable
public void closeOthers(Component component)
Viewable
closeOthers
in interface Viewable
component
- the view that is to remain open.public Component getView(int i)
Viewable
getView
in interface Viewable
i
- the index of the view
public Collection getViews()
Viewable
getViews
in interface Viewable
public void moveTo(AbstractViewLayout other)
Viewable
moveTo
in interface Viewable
other
- the other layoutpublic void updateTitle(Component component)
Viewable
updateTitle
in interface Viewable
component
- the component whose title is to be usedpublic final Component addView()
public void removeView(Component view)
Viewable
removeView
in interface Viewable
public void clear(Component view)
view
- the view to be clearedpublic Iterator iterator()
iterator
in interface Iterable
public void visit(ViewVisitor visitor)
Viewable
visit
in interface Viewable
visitor
- The visitor for the viewpublic int getViewCount()
Viewable
getViewCount
in interface Viewable
public Component getSelected()
Viewable
getSelected
in interface Viewable
public void select(Component component)
Viewable
select
in interface Viewable
private static LayoutType getInitialViewLayoutType()
private LayoutType getViewLayoutType()
private void setViewLayoutType(LayoutType newLayoutType)
public final AbstractViewLayout getViewLayout()
public void setLayoutType(LayoutType next)
public static int getInitialLayoutType()
public void viewRemoved(ViewEvent event)
viewRemoved
in interface ViewEventListener
public static void setInitialLayoutType(int initialLayout)
public void titleChanged(TitleChangedEvent ev)
TitleChangedListener
titleChanged
in interface TitleChangedListener
public final void addViewEventListener(ViewEventListener listener)
Viewable
addViewEventListener
in interface Viewable
listener
- the listenerpublic void removeViewEventListener(ViewEventListener listener)
Viewable
removeViewEventListener
in interface Viewable
listener
- the listenerpublic Action getContextAction(String key)
key
- the internal name for the action
final Object getConstraint()
public void doTabMode()
public void doWindowMode()
public void doNewTab()
public void doCloseView()
public void doClearView()
public void doCloseAllViews()
public void doCloseOtherViews()
|
Copyright ยจ 2003-2006 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |