ccs.cpc
Class CpCmdr

java.lang.Object
  extended by ccs.cpc.CpCmdr
Direct Known Subclasses:
CpcImpl

public abstract class CpCmdr
extends java.lang.Object

Main class for CPC. This is a facade which is available to internal viewers. main works, although you can't instantiate this class directly. (Main invokes a subclass which contains the implementation).


Field Summary
static java.lang.String VERSION
           
 
Constructor Summary
CpCmdr()
           
 
Method Summary
abstract  ccs.utils.SwappingBuffer chromeFor(java.lang.String path)
          Returns the chrome corresponding to a given file, located in cpc.chrome.cdb.
abstract  ccs.utils.SwappingBuffer docsFor(java.lang.String path)
          Returns a file from CPC's documentation.
abstract  VDevice getDeviceForID(java.lang.String deviceID)
          Given a device ID, returns the device it belongs to, ie. for any VDevice vd, vd === getDeviceForID(vd.getID()).
abstract  ImageManager getImageManager()
           
abstract  ccs.mime.MimeRegistry getMimeReg()
          Returns the MIME Registry currently in use.
abstract  java.lang.String getStrainTitle()
          Checkpoint Commander exists in two "strains" (biological sense): Checkpoint Commander Standard and Checkpoint Commander Plus.
static void main(java.lang.String[] args)
          Main application entry point.
static boolean out(java.lang.String s)
           
abstract  ProfileModelElement readProfileElement(java.lang.String classname, java.lang.String key)
          Read a Profile Element.
abstract  void writeProfileElement(ProfileModelElement element)
          Write a Profile Element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION

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

CpCmdr

public CpCmdr()
Method Detail

chromeFor

public abstract ccs.utils.SwappingBuffer chromeFor(java.lang.String path)
                                            throws java.io.IOException
Returns the chrome corresponding to a given file, located in cpc.chrome.cdb.

Throws:
java.io.IOException

docsFor

public abstract ccs.utils.SwappingBuffer docsFor(java.lang.String path)
                                          throws java.io.IOException
Returns a file from CPC's documentation.

Throws:
java.io.IOException

getImageManager

public abstract ImageManager getImageManager()

readProfileElement

public abstract ProfileModelElement readProfileElement(java.lang.String classname,
                                                       java.lang.String key)
Read a Profile Element. The profile element is where an internal viewer stores its persistent state - eg. settings of controls and other user preferences.

Parameters:
classname - The name of the class used. Must implement ProfileModelElement.
key - An additional distinguishing key, if required. This allows two elements of the same class to be added. This can be useful if, for example, two different but related viewers use the same class for storage. Often this isn't required, in which case it should be the empty string.
Returns:
The element, if present; else null. (In the latter case, your next move should be to create a default and add it with writeProfileElement). Note that the returned instance is shared between all instances of the viewer in question. However, it's often the case that each viewer instance needs its own working copy, which won't be affected by changes made by other viewer instances. If so, you should act accordingly. Typically you proceed by having your ProfileModelElement implement Cloneable, and cloning it off.

writeProfileElement

public abstract void writeProfileElement(ProfileModelElement element)
Write a Profile Element.

Parameters:
element - The Profile Element to write.
See Also:
readProfileElement

getStrainTitle

public abstract java.lang.String getStrainTitle()
Checkpoint Commander exists in two "strains" (biological sense): Checkpoint Commander Standard and Checkpoint Commander Plus. These have different Frame titles (ie. the title which is displayed on the main GUI window). Viewers should usually include the Frame title for the current strain in their own Frame title, so here it is.


getMimeReg

public abstract ccs.mime.MimeRegistry getMimeReg()
Returns the MIME Registry currently in use. This is used to bind filenames to MIME types, and also hints whether files of this type are likely to be compressible. Viewers should use this rather than any other mechanism (eg. java.net.FilenameMap) since it is user-extensible, and when last checked had more up-to-date and more complete defaults.


getDeviceForID

public abstract VDevice getDeviceForID(java.lang.String deviceID)
Given a device ID, returns the device it belongs to, ie. for any VDevice vd, vd === getDeviceForID(vd.getID()).


main

public static void main(java.lang.String[] args)
Main application entry point. Reserved.


out

public static boolean out(java.lang.String s)