com.swfm.mica.view
Class MiController

java.lang.Object
  extended bycom.swfm.mica.view.MiController
All Implemented Interfaces:
MiiController

public class MiController
extends java.lang.Object
implements MiiController

This class manages the saving an loading of MiiModelEntitys and converting them to/from graphics objects.

Version:
%I% %G%
Author:
Michael L. Davis

Field Summary
static java.lang.String Mi_MODEL_FILE_IO_MANAGER_NAME
           
static java.lang.String Mi_MODEL_FORMATTED_FILE_IDENTIFIER
           
static java.lang.String Mi_MODEL_VIEW_MANAGER_NAME
           
 
Constructor Summary
MiController()
          Constructs a new MiController.
 
Method Summary
 void closeOpenDocument()
          Closes the document this is managing.
 MiiController copy()
          Copies this controller.
 MiiModelIOFormatManager getIOFormatManager()
          Gets the IO manager.
 MiiModelIOManager getIOManager()
           
 MiiModelEntity getOpenDocument()
          Gets the document this is managing.
 boolean getRequiresMicaFormattedFiles()
           
 MiPart getView()
           
 MiiViewManager getViewManager()
          Gets the view manager.
 boolean isCacheEnabled()
           
 void load()
          Loads the view with graphics generated by the viewManager from the model generated by the ioFormatManager from the data loaded by the ioManager.
 java.lang.String makeFormattedDataHeaderFromManagers(MiiViewManager viewManager, MiiModelIOFormatManager ioFormatManager)
           
 java.lang.String makeHeader()
           
 void save()
          Saves the contents of the previously assigned target.
 void saveAs(MiiModelIOFormatManager outputIOFormatManager, MiiModelIOManager outputIOManager)
          Saves the contents of the previously assigned target.
 void setCacheEnabled(boolean flag)
           
 void setIOFormatManager(MiiModelIOFormatManager manager)
          Sets the IO manager.
 void setIOManager(MiiModelIOManager manager)
           
 void setOpenDocument(MiiModelEntity doc)
          Sets the document this is managing and hands off the doc to the ViewManager, if any, which populates the view it manages with a graphics representation of the doc.
 void setRequiresMicaFormattedFiles(boolean flag)
           
 void setView(MiPart view)
           
 void setViewManager(MiiViewManager manager)
          Sets the view manager.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

Mi_MODEL_FORMATTED_FILE_IDENTIFIER

public static final java.lang.String Mi_MODEL_FORMATTED_FILE_IDENTIFIER
See Also:
Constant Field Values

Mi_MODEL_FILE_IO_MANAGER_NAME

public static final java.lang.String Mi_MODEL_FILE_IO_MANAGER_NAME
See Also:
Constant Field Values

Mi_MODEL_VIEW_MANAGER_NAME

public static final java.lang.String Mi_MODEL_VIEW_MANAGER_NAME
See Also:
Constant Field Values
Constructor Detail

MiController

public MiController()
Constructs a new MiController.

Method Detail

copy

public MiiController copy()
Copies this controller.

Specified by:
copy in interface MiiController
Returns:
the copy

setRequiresMicaFormattedFiles

public void setRequiresMicaFormattedFiles(boolean flag)

getRequiresMicaFormattedFiles

public boolean getRequiresMicaFormattedFiles()

setCacheEnabled

public void setCacheEnabled(boolean flag)

isCacheEnabled

public boolean isCacheEnabled()

setOpenDocument

public void setOpenDocument(MiiModelEntity doc)
Sets the document this is managing and hands off the doc to the ViewManager, if any, which populates the view it manages with a graphics representation of the doc.

Specified by:
setOpenDocument in interface MiiController
Parameters:
doc - the open document

getOpenDocument

public MiiModelEntity getOpenDocument()
Gets the document this is managing.

Specified by:
getOpenDocument in interface MiiController
Returns:
the open document

closeOpenDocument

public void closeOpenDocument()
Closes the document this is managing.

Specified by:
closeOpenDocument in interface MiiController
Returns:
the open document

setIOFormatManager

public void setIOFormatManager(MiiModelIOFormatManager manager)
Sets the IO manager.

Specified by:
setIOFormatManager in interface MiiController
Parameters:
manager - the IO manager

getIOFormatManager

public MiiModelIOFormatManager getIOFormatManager()
Gets the IO manager.

Specified by:
getIOFormatManager in interface MiiController
Returns:
the IO manager

setViewManager

public void setViewManager(MiiViewManager manager)
Sets the view manager.

Specified by:
setViewManager in interface MiiController
Parameters:
manager - the view manager

getViewManager

public MiiViewManager getViewManager()
Gets the view manager.

Specified by:
getViewManager in interface MiiController
Returns:
the managers

setIOManager

public void setIOManager(MiiModelIOManager manager)
Specified by:
setIOManager in interface MiiController

getIOManager

public MiiModelIOManager getIOManager()
Specified by:
getIOManager in interface MiiController

setView

public void setView(MiPart view)
Specified by:
setView in interface MiiController

getView

public MiPart getView()
Specified by:
getView in interface MiiController

load

public void load()
          throws java.lang.Exception
Loads the view with graphics generated by the viewManager from the model generated by the ioFormatManager from the data loaded by the ioManager.

Specified by:
load in interface MiiController
Throws:
java.lang.Exception

save

public void save()
          throws java.lang.Exception
Saves the contents of the previously assigned target.

Specified by:
save in interface MiiController
Throws:
java.lang.Exception

saveAs

public void saveAs(MiiModelIOFormatManager outputIOFormatManager,
                   MiiModelIOManager outputIOManager)
            throws java.lang.Exception
Saves the contents of the previously assigned target.

Specified by:
saveAs in interface MiiController
Parameters:
outputIOFormatManager - format to save the contents in
outputIOManager - the stream
Throws:
java.lang.Exception

makeHeader

public java.lang.String makeHeader()

makeFormattedDataHeaderFromManagers

public java.lang.String makeFormattedDataHeaderFromManagers(MiiViewManager viewManager,
                                                            MiiModelIOFormatManager ioFormatManager)

toString

public java.lang.String toString()