|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcodeblocks.Block
codeblocks.BlockStub
public class BlockStub
BlockStub
are a special form of blocks that provide a particular
reference to its "parent" block. These references can set, get, or increment
the value of its "parent" block. References may also get the value for a
particular agent. Finally, for a procedure block, its reference is a call
block, which executes the procedure.
The parent instance for a set of stubs is not permanent. The parent intance
may change if the original parent it removed and then a new one with the
same parent name is added to the block canvas. BlockStub manages the mapping
between stubs and their parent.
Field Summary |
---|
Fields inherited from class codeblocks.Block |
---|
NULL |
Constructor Summary | |
---|---|
|
BlockStub(java.lang.Long initParentID,
java.lang.String parentGenus,
java.lang.String parentName,
java.lang.String stubGenus)
Constructs a new BlockStub instance using the specified
genus name of its parent block, the block id of its parent, the block name of parent
and its stub genus. |
protected |
BlockStub(java.lang.Long blockID,
java.lang.String stubGenus,
java.lang.String label,
java.lang.String parentName,
java.lang.String parentGenus)
Constructs a new BlockStub instance. |
Method Summary | |
---|---|
void |
changeGenusTo(java.lang.String genusName)
Overriden from Block. |
boolean |
doesParentExist()
|
java.awt.Color |
getColor()
Returns the Color of this; May return Color.Black if color was unspecified. |
Block |
getParent()
Returns the parent block of this stub |
java.lang.String |
getParentGenus()
Returns the parent block genus of this stub |
java.lang.String |
getParentName()
Returns the parent name of this stub |
java.lang.String |
getSaveString(int x,
int y,
java.lang.String commentSaveString,
boolean collapsed)
Returns the save string of this using additional location information specified in x and y and comment text . |
static java.lang.Iterable<java.lang.Long> |
getStubsOfParent(java.lang.Long blockID)
Returns a list of the block ids of the specified parent's stubs |
boolean |
isCommandBlock()
Returns true if this block is a command block (i.e. |
boolean |
isDataBlock()
Returns true if this block is a data block a.k.a. |
boolean |
isFunctionBlock()
Returns true iff this block is a function block, which takes in an input and produces an output. |
static void |
parentConnectorsChanged(java.lang.Long parentID)
Updates the BlocksStubs associated with the parent of its new page label |
static void |
parentNameChanged(java.lang.String oldParentName,
java.lang.String newParentName,
java.lang.Long parentID)
Updates BlockStub hashmaps and the BlockStubs of the parent of its new name |
static void |
parentPageLabelChanged(java.lang.String newPageLabel,
java.lang.Long parentID)
Updates the BlockStubs associated with the parent of its new page label |
static void |
parentPlugChanged(java.lang.Long parentID,
java.lang.String kind)
Updates the plug on caller stubs associated with the given parent. |
static void |
putNewParentInStubMap(java.lang.Long blockID)
Saves the parent block information with the specified blockID in the Stub Map |
static void |
reset()
Clears all the mappings between parents and stubs. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public BlockStub(java.lang.Long initParentID, java.lang.String parentGenus, java.lang.String parentName, java.lang.String stubGenus)
BlockStub
instance using the specified
genus name of its parent block, the block id of its parent, the block name of parent
and its stub genus. The exact reference to the parent through the specified initParentID
is needed, in addition to the other specified parameters, to completely construct a new block
stub.
initParentID
- the Long block ID of its initial parentparentGenus
- the BlockGenus String name of its initial parentparentName
- stubGenus
- protected BlockStub(java.lang.Long blockID, java.lang.String stubGenus, java.lang.String label, java.lang.String parentName, java.lang.String parentGenus)
blockID
- the Long block ID of thisstubGenus
- the BlockGenus of thislabel
- the Block label of thisparentName
- the String name of its parentparentGenus
- the String BlockGenus name of its parentMethod Detail |
---|
public static void reset()
public static java.lang.Iterable<java.lang.Long> getStubsOfParent(java.lang.Long blockID)
blockID
- public static void putNewParentInStubMap(java.lang.Long blockID)
blockID
- public static void parentNameChanged(java.lang.String oldParentName, java.lang.String newParentName, java.lang.Long parentID)
oldParentName
- newParentName
- parentID
- public static void parentPageLabelChanged(java.lang.String newPageLabel, java.lang.Long parentID)
newPageLabel
- parentID
- public static void parentConnectorsChanged(java.lang.Long parentID)
parentID
- public static void parentPlugChanged(java.lang.Long parentID, java.lang.String kind)
kind
- the new plug kind that callers should setpublic java.lang.String getParentName()
public Block getParent()
public java.lang.String getParentGenus()
public boolean doesParentExist()
public void changeGenusTo(java.lang.String genusName)
changeGenusTo
in class Block
genusName
- the String name of the BlockGenus to change this Block topublic java.awt.Color getColor()
getColor
in class Block
public java.lang.String toString()
toString
in class Block
public boolean isCommandBlock()
Block
isCommandBlock
in class Block
public boolean isDataBlock()
Block
isDataBlock
in class Block
public boolean isFunctionBlock()
Block
isFunctionBlock
in class Block
public java.lang.String getSaveString(int x, int y, java.lang.String commentSaveString, boolean collapsed)
Block
getSaveString
in class Block
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |