com.partnersoft.codex
Class CodexResourceModel

java.lang.Object
  extended by com.partnersoft.codex.CodexResourceModel
All Implemented Interfaces:
CodexNodeView
Direct Known Subclasses:
CogModel, ImageModel, TextModel

public abstract class CodexResourceModel
extends java.lang.Object
implements CodexNodeView

A model for editing CodexResources. Models are designed around the idea that we have several models, each model knows when the underlying data has been edited, and models only update themselves lazily when they need to.

Author:
Russell Cagle Copyright 2006 Partner Software, Inc.
See Also:
com.partnersoft.editor

Field Summary
protected  CodexResource resource
           
 
Constructor Summary
protected CodexResourceModel(CodexResource resource)
           
 
Method Summary
 CodexResource getCodexResource()
          Should return whatever got set in setCodexResource().
abstract  java.lang.String getModelLabel()
          Used to label the model in the user interface.
abstract  void invalidateModel()
          When another model calls CodexResource.touch(), the resource invalidates all other models through this method.
abstract  void save(java.io.OutputStream outie)
          This is the counterpart to CodexResource.touch().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

resource

protected CodexResource resource
Constructor Detail

CodexResourceModel

protected CodexResourceModel(CodexResource resource)
Method Detail

getCodexResource

public CodexResource getCodexResource()
Should return whatever got set in setCodexResource(). This lets CodexResource manage the parent-child relationship.

Returns:

getModelLabel

public abstract java.lang.String getModelLabel()
Used to label the model in the user interface.

Returns:

invalidateModel

public abstract void invalidateModel()
When another model calls CodexResource.touch(), the resource invalidates all other models through this method. Models should clear out their internal model. For example, the CogModel should clear out its Cog object. Models should NOT regenerate their internal model.


save

public abstract void save(java.io.OutputStream outie)
                   throws java.io.IOException
This is the counterpart to CodexResource.touch(). CodexResource.touch() invalidates the resource's bytes, and then the resource calls CodexResourceModel.save() when it needs its bytes back.

Parameters:
outie -
Throws:
java.io.IOException