|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.hdcookbook.grin.Feature com.hdcookbook.grin.features.Modifier
public abstract class Modifier
Abstract base class for features that modify a single child feature.
Field Summary | |
---|---|
protected boolean |
activated
|
protected Feature |
part
|
Fields inherited from class com.hdcookbook.grin.Feature |
---|
name, show |
Constructor Summary | |
---|---|
Modifier(Show show)
|
|
Modifier(Show show,
java.lang.String name)
|
Method Summary | |
---|---|
void |
addDisplayAreas(RenderContext context)
Add all of the areas that are displayed for this feature with the current frame. |
void |
addSubgraph(java.util.HashSet set)
This is an implementation method that is not intended to be called direction by applications. |
void |
destroy()
Free any resources held by this feature. |
Feature |
getPart()
Get our child feature |
int |
getX()
Get the upper-left hand corner of this feature as presently displayed. |
int |
getY()
Get the upper-left hand corner of this feature as presently displayed Return Integer.MAX_VALUE if this feature has no visible representation. |
void |
initialize()
Initialize this feature. |
void |
markDisplayAreasChanged()
Mark the display areas of this feature as modified for the next call to addDisplayAreas. |
boolean |
needsMoreSetup()
This is where the feaure says whether or not it needs more setup. |
void |
nextFrame()
Called from Segment with the Show lock held, to advance us to the state we should be in for the next frame. |
void |
paintFrame(java.awt.Graphics2D g)
Paint the current state of this feature to gr. |
protected void |
setActivateMode(boolean mode)
Change the activated mode of this feature. |
protected void |
setChildChanged()
Set our child's drawing area(s) as modified, if we modify the appearance of our child node. |
protected int |
setSetupMode(boolean mode)
Change the setup mode of this feature. |
void |
setup(Feature part)
Called from the parser. |
Methods inherited from class com.hdcookbook.grin.Feature |
---|
activate, cloneCommands, clonedReference, cloneSubgraph, createClone, 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 Feature part
protected boolean activated
Constructor Detail |
---|
public Modifier(Show show, java.lang.String name)
public Modifier(Show show)
Method Detail |
---|
public void addSubgraph(java.util.HashSet set)
Add this node and all of its descendent nodes to the given set. The superclass definition of this method adds the current node. Any node types that have children should override this method to call the superclass version, then recursively invoke this method on each child.
addSubgraph
in class Feature
public void setup(Feature part)
public Feature getPart()
public int getX()
getX
in class Feature
public int getY()
getY
in class Feature
public void initialize()
initialize
in class Feature
public void destroy()
It's possible an active segment may be destroyed. For example, the last segment a show is in when the show is destroyed will probably be active (and it will probably be an empty segment too!).
destroy
in class Feature
protected void setActivateMode(boolean mode)
setActivateMode
in class Feature
protected void setChildChanged()
Feature.markDisplayAreasChanged()
protected int setSetupMode(boolean mode)
This method must return a guaranteed lower bound for the number of times it will send a feature setup command as a result of this call. That is, it must send at least as many feature setup commands to the segment as the number returned; sending an accurate number makes the setup process more efficient, since the time it takes to process a command scales with the number of features in a segment. When mode is false, 0 should be returned.
setSetupMode
in class Feature
public boolean needsMoreSetup()
needsMoreSetup
in class Feature
SetupClient.needsMoreSetup()
public void paintFrame(java.awt.Graphics2D g)
paintFrame
in class Feature
g
- The place to paint to.public void markDisplayAreasChanged()
See also Issue 121
markDisplayAreasChanged
in class Feature
Feature.addDisplayAreas(com.hdcookbook.grin.animator.RenderContext)
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 Feature
context
- The context for tracking rendering stateDrawRecord
public void nextFrame()
nextFrame
in class Feature
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |