|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.hdcookbook.grin.Feature
com.hdcookbook.grin.features.Modifier
com.hdcookbook.grin.features.SetTarget
public class SetTarget
Causes its child use a different target in its RenderContext. This allows groups of features that are together on the screen to put themselves in a different damage rectangle than unrelated features elsewhere on the screen, thus further minimizing the drawing area per frame.
Field Summary | |
---|---|
protected int |
target
|
protected java.lang.String |
targetName
|
Fields inherited from class com.hdcookbook.grin.features.Modifier |
---|
activated, part |
Fields inherited from class com.hdcookbook.grin.Feature |
---|
name, show |
Constructor Summary | |
---|---|
SetTarget(Show show)
|
Method Summary | |
---|---|
void |
addDisplayAreas(RenderContext context)
Add all of the areas that are displayed for this feature with the current frame. |
protected Feature |
createClone(java.util.HashMap clones)
This is an implementation method that should not be called direction by applications; applications should call cloneSubgraph(). |
void |
mapDrawTarget(java.util.Hashtable targetMap)
Internal use only. |
void |
readInstanceData(GrinDataInputStream in,
int length)
Reads in this node information from the binary file format. |
protected void |
setChildChanged()
Set our child's drawing area(s) as modified, if we modify the appearance of our child node. |
Methods inherited from class com.hdcookbook.grin.features.Modifier |
---|
addSubgraph, destroy, getPart, getX, getY, initialize, markDisplayAreasChanged, needsMoreSetup, nextFrame, paintFrame, setActivateMode, setSetupMode, setup |
Methods inherited from class com.hdcookbook.grin.Feature |
---|
activate, cloneCommands, clonedReference, cloneSubgraph, deactivate, destroyClonedSubgraph, getName, initializeClone, isSetup, makeNewClone, resetFeature, sendFeatureSetup, setName, setup, toString, unsetup |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected int target
protected java.lang.String targetName
Constructor Detail |
---|
public SetTarget(Show show)
Method Detail |
---|
protected Feature createClone(java.util.HashMap clones)
Create a new clone of this feature. This method creates a new instance of this feature, and creates new instances of any sub-features, but it does not initialize the feature. This method is called from Feature.makeNewClone().
See the documentation of cloneSubgraph() for a list of runtime exceptions this method can throw. Subclasses that wish to support cloning must override this method.
createClone
in class Feature
clones
- A map from original feature to cloned feature. Entries
are added by Feature.makeNewClone().Feature.makeNewClone(java.util.HashMap)
,
Feature.cloneSubgraph(java.util.HashMap)
public void mapDrawTarget(java.util.Hashtable targetMap)
protected void setChildChanged()
setChildChanged
in class Modifier
Feature.markDisplayAreasChanged()
public void addDisplayAreas(RenderContext context)
A feature that displays something needs to maintain a record of it in a DrawRecord. The animation framework uses this to track what needs to be erased and drawn from frame to frame.
Clients of the GRIN framework should not call this method directly. Feature subclasses must implement this method.
Subclasses will probably want to override this to account for changes in the drawing environment they make. The version in this class simply calls this method on the modified part.
addDisplayAreas
in class Modifier
context
- The context for tracking rendering stateDrawRecord
public void readInstanceData(GrinDataInputStream in, int length) throws java.io.IOException
Node
An implementation of this method is recommended to call in.readSuperClassData(this) as the first line of the method to read in information that is defined in the base class of this Node type.
This should only be called while initializing this object.
readInstanceData
in interface Node
in
- InputStream to read data from.length
- the number of bytes that this node's information occupies
in the InputStream. The implementation of this method is expected to
read exactly this number of bytes from the stream. This can be used
for a debugging purpose.
java.io.IOException
- if error occurs.GrinDataInputStream.readSuperClassData(Feature)
,
GrinDataInputStream.readSuperClassData(RCHandler)
,
GrinDataInputStream.readSuperClassData(Segment)
,
GrinDataInputStream.readSuperClassData(Command)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |