public class BlockUtilities
extends java.lang.Object
| Constructor and Description |
|---|
BlockUtilities() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
blockExists(Workspace workspace,
BlockNode node)
Checks to see if the block still exists
|
static RenderableBlock |
cloneBlock(Block myblock) |
static void |
deleteBlock(RenderableBlock block) |
static java.lang.String |
disambiguousStringRep(RenderableBlock block)
Creates a string representation for the given RenderableBlock that
is disambiguated from string representations for blocks with the same label
by appending socket information to the end of the block's label.
|
static java.util.List<TextualFactoryBlock> |
getAllMatchingBlocks(Workspace workspace,
java.lang.String keyword) |
static RenderableBlock |
getBlock(Workspace workspace,
java.lang.String genusName,
java.lang.String label)
Returns a new RenderableBlock instance with the matching genusName.
|
static java.util.List<TextualFactoryBlock> |
getDigits(Workspace workspace,
java.lang.String digits) |
static java.util.List<TextualFactoryBlock> |
getPlusBlocks(Workspace workspace,
java.lang.String plus) |
static boolean |
isLabelValid(Block block,
java.lang.String label) |
static boolean |
isLabelValid(Workspace workspace,
java.lang.Long blockID,
java.lang.String label)
Returns true if the specified label is valid according to the specifications
of this block's genus.
|
static BlockNode |
makeNodeWithChildren(Workspace workspace,
java.lang.Long blockID) |
static BlockNode |
makeNodeWithStack(Workspace workspace,
java.lang.Long blockID) |
static RenderableBlock |
makeRenderable(Workspace workspace,
BlockNode node,
WorkspaceWidget widget) |
static void |
reset() |
static void |
setZoomLevel(double newZoom) |
public static void reset()
public static void setZoomLevel(double newZoom)
public static boolean isLabelValid(Workspace workspace, java.lang.Long blockID, java.lang.String label)
label - the String block label to testpublic static boolean isLabelValid(Block block, java.lang.String label)
public static void deleteBlock(RenderableBlock block)
public static RenderableBlock cloneBlock(Block myblock)
public static java.lang.String disambiguousStringRep(RenderableBlock block)
block - the FactoryRenderableBlock to create a string representation ofpublic static java.util.List<TextualFactoryBlock> getAllMatchingBlocks(Workspace workspace, java.lang.String keyword)
workspace - The workspace in usekeyword - public static java.util.List<TextualFactoryBlock> getPlusBlocks(Workspace workspace, java.lang.String plus)
plus - public static java.util.List<TextualFactoryBlock> getDigits(Workspace workspace, java.lang.String digits)
workspace - digits - public static RenderableBlock getBlock(Workspace workspace, java.lang.String genusName, java.lang.String label)
workspace - The workspace to usegenusName - label - public static BlockNode makeNodeWithChildren(Workspace workspace, java.lang.Long blockID)
public static BlockNode makeNodeWithStack(Workspace workspace, java.lang.Long blockID)
public static boolean blockExists(Workspace workspace, BlockNode node)
public static RenderableBlock makeRenderable(Workspace workspace, BlockNode node, WorkspaceWidget widget)