Class SEGuaranteeFill

  extended by com.hdcookbook.grin.Feature
      extended by com.hdcookbook.grin.features.Modifier
          extended by com.hdcookbook.grin.features.GuaranteeFill
              extended by com.hdcookbook.grin.features.SEGuaranteeFill
All Implemented Interfaces:
Node, SENode, SEScalableNode

public class SEGuaranteeFill
extends GuaranteeFill
implements SENode, SEScalableNode

Field Summary
Fields inherited from class com.hdcookbook.grin.features.GuaranteeFill
fills, guaranteed
Fields inherited from class com.hdcookbook.grin.features.Modifier
activated, part
Fields inherited from class com.hdcookbook.grin.Feature
name, show
Constructor Summary
SEGuaranteeFill(SEShow show)
SEGuaranteeFill(SEShow show, java.lang.String name, java.awt.Rectangle guaranteed, java.awt.Rectangle[] fills)
          Create a new node.
Method Summary
 void accept(SEShowVisitor visitor)
          Calls the visit method corresponding to this node type.
 void changeFeatureReference(Feature from, Feature to)
          Change a feature reference from one feature to a new one.
 java.awt.Rectangle[] getFills()
          Internal use only.
 java.awt.Rectangle getGuaranteed()
          Internal use only.
 java.lang.String getRuntimeClassName()
          Returns the class that should be constructed at Show runtime to represent this SENode.
 void postProcess(ShowBuilder builder)
          Do any needed post-processing in this show.
 void scaleBy(int xScale, int yScale, int xOffset, int yOffset)
          Scale this node by the given scale factor, and apply the given offset.
 void setFills(java.awt.Rectangle[] fills)
          Internal use only.
 void setGuaranteed(java.awt.Rectangle guaranteed)
          Internal use only.
 java.lang.String toString()
 void writeInstanceData(GrinDataOutputStream out)
          Record this node information to the binary file format.
Methods inherited from class com.hdcookbook.grin.features.GuaranteeFill
addDisplayAreas, createClone, paintFrame, readInstanceData, setChildChanged
Methods inherited from class com.hdcookbook.grin.features.Modifier
addSubgraph, destroy, getPart, getX, getY, initialize, markDisplayAreasChanged, needsMoreSetup, nextFrame, 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, unsetup
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail


public SEGuaranteeFill(SEShow show)


public SEGuaranteeFill(SEShow show,
                       java.lang.String name,
                       java.awt.Rectangle guaranteed,
                       java.awt.Rectangle[] fills)
Create a new node.

show - The show we're a part of
name - The name of this node (can be null)
guaranteed - The area guaranteed to be filled by this node
fills - The rectangles this node will fill with transparent pixels. Can be empty or null.
Method Detail


public java.awt.Rectangle getGuaranteed()
Internal use only.


public java.awt.Rectangle[] getFills()
Internal use only.


public void setGuaranteed(java.awt.Rectangle guaranteed)
Internal use only.


public void setFills(java.awt.Rectangle[] fills)
Internal use only.


public void writeInstanceData(GrinDataOutputStream out)
Description copied from interface: SENode
Record this node information to the binary file format. An implementation of this method is recommended to call out.writeSuperClassData(this) as the first line of the method to write out data defined in the base class of this Node type.

Specified by:
writeInstanceData in interface SENode
out - The stream to write out.
Throws: - if error occurs.
See Also:
GrinDataOutputStream.writeSuperClassData(Feature), GrinDataOutputStream.writeSuperClassData(RCHandler), GrinDataOutputStream.writeSuperClassData(Segment), GrinDataOutputStream.writeSuperClassData(Command)


public java.lang.String getRuntimeClassName()
Description copied from interface: SENode
Returns the class that should be constructed at Show runtime to represent this SENode.

Specified by:
getRuntimeClassName in interface SENode
String A fully qualified classname of a Node at xlet runtime.


public void accept(SEShowVisitor visitor)
Description copied from interface: SENode
Calls the visit method corresponding to this node type.

If you are defining a user-defined feature, there are some restrictions that you'll want to follow. If your extension is a feature that has children, then you should make it a subclass of one of the built-in feature types, Assembly, Modifer or Group. That's because the GRIN compiler defines visitors that need to visit every node in the tree, but these built-in visitors don't know about your extension types. By making your extension type a subclass of one of the standard ones, and by making your accept() method call either visitAssembly(), visitGroup() or visitUserDefinedModifier(), as appropriate, you'll ensure that all the children get visited.

Specified by:
accept in interface SENode
visitor - SEShowVisitor object.
See Also:


public void postProcess(ShowBuilder builder)
Do any needed post-processing in this show. The grin compiler works as follows:

During the post-process phase, a node can add new features to the show, by calling ShowBuilder.addSyntheticFeature(), and it can insert a new feature as the parent of a given feature, by calling ShowBuilder.injectParent(). It can also add segments and handlers by calling the appropriate builder methods.

When a parent is injected, the ShowBuilder calls postProcess() on all nodes automatically, including nodes that are created during the execution of postProcess() in another node.

Specified by:
postProcess in interface SENode
builder - The builder that holds state for the show
Throws: - if an error is encountered
See Also:
ShowBuilder.addSyntheticFeature(Feature), ShowBuilder.injectParent(Feature, Feature)


public void changeFeatureReference(Feature from,
                                   Feature to)
Change a feature reference from one feature to a new one. If your node has a reference to the feature from, it should be changed to refer to to. This is called for every node in an SEShow when SENode.injectParent is used.

The ShowBuilder calls changeFeatureReference() on all nodes automatically, including nodes that are created during the execution of postProcess().

Specified by:
changeFeatureReference in interface SENode
See Also:
SENode.changeFeatureReference(Feature, Feature)


public void scaleBy(int xScale,
                    int yScale,
                    int xOffset,
                    int yOffset)
Scale this node by the given scale factor, and apply the given offset. This will change the size of the features and RC handlers within the show at compile time, so no special scaling action is required at runtime.

Specified by:
scaleBy in interface SEScalableNode
xScale - x scale factor in mills
yScale - y scale factor in mills
xOffset - x offset in pixels
yOffset - y offset in pixels


public java.lang.String toString()

toString in class Feature
a developer-friendly description of this feature, for debugging