|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.peace_tools.core.ViewFactory
public abstract class ViewFactory
A factory to help with creation of views. This class provides a convenience mechanism to create and add a view to a given main frame. This class is a base class that is not meant to be instantiated. Instead ask MainFrame for a valid ViewFactory by calling mainFrame.getViewFactory() method.
Nested Class Summary | |
---|---|
static class |
ViewFactory.ViewType
Set of enumeration values to identify the different types of views that this factory can create. |
Field Summary | |
---|---|
private static java.lang.String |
CANT_MAKE_VIEW
A static message that is to be displayed if a view could not be opened. |
private MainFrame |
mainFrame
A convenient reference to the main frame that logically owns this view factory. |
private java.util.HashMap<ViewFactory.ViewType,DnDTabPos> |
staticViewPos
The last saved positions for the various static views. |
private java.util.HashMap<ViewFactory.ViewType,javax.swing.JComponent> |
staticViews
The list of static views associated with any main frame. |
private static javax.swing.Icon[] |
TabIcons
The array of icons that are displayed in a the tabs along with titles for each view. |
private java.util.HashMap<java.lang.String,java.util.ArrayList<javax.swing.JComponent>> |
views
A hash map that maintains the list of views that are currently visible in this frame. |
Constructor Summary | |
---|---|
protected |
ViewFactory(MainFrame mf)
The constructor. |
Method Summary | |
---|---|
private void |
addView(javax.swing.JComponent view,
java.lang.String dataFileName,
ViewFactory.ViewType viewType)
Utility method to add a newly created view to display and internal tables. |
private javax.swing.JComponent |
createDefaultView(java.lang.String estFileName,
java.lang.String dataFileName,
ViewFactory.ViewType viewType,
java.lang.Object wsEntry)
Helper method to create a default view for a given data type. |
private void |
createLogViews()
This is a helper method that invoked from the constructor to create the programmer and user log panes. |
void |
createOverlapView(MSTClusterData cluster)
Method to create a overlap view for a given entry. |
private void |
createStandardViews()
This is a helper method that invoked from the constructor to create the standard views (tabs that display various information from the work space) . |
void |
createStaticViews()
Method to create the standard set of static views. |
void |
createSummaryView(MSTClusterData cluster)
Method to create a graph type of view for a given entry. |
private javax.swing.JComponent |
createTextView(java.lang.String fileName)
Helper method to create a textual view for a given file. |
void |
createView(Job job,
Server server)
Method to create a graph type of view for a given entry. |
void |
createView(java.lang.Object wsEntry,
boolean duplicate,
boolean textView)
Method to ease creation of a specific view. |
void |
createView(Server server,
java.lang.String userID)
Method to create a server job list view. |
void |
createView(java.lang.String dataFileName,
java.lang.String estFileName,
ViewFactory.ViewType viewType,
boolean duplicate,
boolean textView,
java.lang.Object wsEntry)
Method to create a specific view. |
void |
emphasize(javax.swing.JComponent component)
A helper method to create thread to make a tab blink to emphasize its presence. |
void |
showStaticView(ViewFactory.ViewType view)
Method to display a static view that is currently not visible. |
void |
tabDeleted(java.awt.Component component)
Method to intercept events generated by DnDTabbedPane to report removal of views. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final MainFrame mainFrame
private static final java.lang.String CANT_MAKE_VIEW
private java.util.HashMap<java.lang.String,java.util.ArrayList<javax.swing.JComponent>> views
private java.util.HashMap<ViewFactory.ViewType,javax.swing.JComponent> staticViews
private java.util.HashMap<ViewFactory.ViewType,DnDTabPos> staticViewPos
private static final javax.swing.Icon[] TabIcons
Constructor Detail |
---|
protected ViewFactory(MainFrame mf)
mf
- The main frame that logically owns this view factory.Method Detail |
---|
public void createStaticViews()
public void showStaticView(ViewFactory.ViewType view)
view
- The type of view to be displayed by this method.private void createLogViews()
private void createStandardViews()
private javax.swing.JComponent createDefaultView(java.lang.String estFileName, java.lang.String dataFileName, ViewFactory.ViewType viewType, java.lang.Object wsEntry) throws java.lang.Exception
estFileName
- The EST file name from where the FASTA data is
to be loaded.dataFileName
- The name of the file where the additional data for
this view is stored.viewType
- The type of view to be displayed.wsEntry
- The workspace entry object for which the default view is
to be created. This object is used by the views to reference the workspace
entry as needed. Note that even though the workspace entry is passed in
as an Object, it must be correspond to the type of view being created.
java.lang.Exception
- This method throws various exceptions when errors
occur during view creation.private javax.swing.JComponent createTextView(java.lang.String fileName) throws java.lang.Exception
fileName
- The text file whose contents is to be loaded
and displayed
java.lang.Exception
- This method throws various exceptions when errors
occur during view creation.public void createSummaryView(MSTClusterData cluster)
cluster
- The MSTClusterDAta object for which a graphical
summary view is to be created and added to the viewing area.public void createOverlapView(MSTClusterData cluster)
cluster
- The MSTClusterDAta object for which a graphical
overlap view is to be created and added to the viewing area.public void createView(Job job, Server server)
public void createView(Server server, java.lang.String userID)
server
- The server whose jobs/processes are to be listed.userID
- The ID of the user whose jobs are to be listed.
This parameter is optional and can be null.private void addView(javax.swing.JComponent view, java.lang.String dataFileName, ViewFactory.ViewType viewType)
view
- The newly created view to be added.dataFileName
- The data file from where the view was loaded.viewType
- The type of view that has been created.public void createView(java.lang.Object wsEntry, boolean duplicate, boolean textView)
wsEntry
- The work space entry for which a view must be
created (if one does not exist).duplicate
- If this flag is true, then a duplicate view is created
even if a view already exists.textView
- If this flag is true, then a textual view of the data is
created.public void createView(java.lang.String dataFileName, java.lang.String estFileName, ViewFactory.ViewType viewType, boolean duplicate, boolean textView, java.lang.Object wsEntry)
dataFileName
- The full path to the data file that is to be
loaded and displayed in the specified view.estFileName
- An optional EST (FASTA) file that is associated
with the data file. The EST file name is typically used to obtain
additional information to be displayed to the user.viewType
- The type of view to be created. This value must be
from one of the predefined enumerations. Note that the view type and
the type of file must be coordinated with each other.duplicate
- If this flag is true, then a duplicate view is created
even if a view already exists.textView
- If this flag is true, then a textual view of the data is
created.wsEntry
- The workspace entry for which the view is to be created.
This value is set for some of the views (like: ClusterTreeTableView and
ClusterSummaryView).public void emphasize(javax.swing.JComponent component)
component
- The component to which the user's attention is
to be drawn.public void tabDeleted(java.awt.Component component)
tabDeleted
in interface DnDTabListener
component
- The component to be removed from the set of
views managed by this factory..
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |