|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcontroller.WorkspaceController
public class WorkspaceController
The WorkspaceController is the starting point for any program using Open Blocks. It contains a Workspace (the block programming area) as well as the Factories (the palettes of blocks), and is responsible for setting up and laying out the overall window including loading some WorkspaceWidgets like the TrashCan.
Field Summary | |
---|---|
protected SearchBar |
searchBar
|
protected static Workspace |
workspace
The single instance of the Workspace Controller |
protected javax.swing.JPanel |
workspacePanel
|
Constructor Summary | |
---|---|
WorkspaceController()
Constructs a WorkspaceController instance that manages the interaction with the codeblocks.Workspace |
Method Summary | |
---|---|
java.lang.Iterable<SearchableContainer> |
getAllSearchableContainers()
Returns an unmodifiable Iterable of SearchableContainers |
java.lang.String |
getSaveString()
Returns the save string for the entire workspace. |
javax.swing.JComponent |
getSearchBar()
Returns a SearchBar instance capable of searching for blocks within the BlockCanvas and block drawers |
javax.swing.JComponent |
getWorkspacePanel()
Returns the JComponent of the entire workspace. |
static void |
initWithLangDefFilePath(java.lang.String langDefFilePath)
|
void |
loadBlockLanguage(org.w3c.dom.Element root)
Loads all the block genuses, properties, and link rules of a language specified in the pre-defined language def file. |
void |
loadFreshWorkspace()
Loads a fresh workspace based on the default specifications in the language definition file. |
void |
loadProject(java.lang.String projectContents)
Loads the programming project specified in the projectContents. |
void |
loadProject(java.lang.String projectContents,
java.lang.String langDefContents)
Loads the programming project specified in the projectContents String, which is associated with the language definition file contained in the specified langDefContents. |
void |
loadProjectFromPath(java.lang.String path)
Loads the programming project from the specified file path. |
static void |
main(java.lang.String[] args)
|
void |
resetLanguage()
Resets the current language within the active Workspace. |
void |
resetWorkspace()
Resets the entire workspace. |
void |
setLangDefFile(java.io.File langDefFile)
Sets the Lang Def File to the specified File langDefFile. |
void |
setLangDefFilePath(java.lang.String filePath)
Sets the file path for the language definition file, if the language definition file is located in |
void |
setLangDefFileString(java.lang.String langDefContents)
Sets the contents of the Lang Def File to the specified String langDefContents |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static Workspace workspace
protected javax.swing.JPanel workspacePanel
protected SearchBar searchBar
Constructor Detail |
---|
public WorkspaceController()
Method Detail |
---|
public void setLangDefFilePath(java.lang.String filePath)
public void setLangDefFileString(java.lang.String langDefContents)
langDefContents
- String contains the specification of a language
definition filepublic void setLangDefFile(java.io.File langDefFile)
langDefFile
- File contains the specification of the a language
definition file.public void loadBlockLanguage(org.w3c.dom.Element root)
root
- Loads the language specified in the Element rootpublic void resetLanguage()
public java.lang.String getSaveString()
public void loadFreshWorkspace()
public void loadProjectFromPath(java.lang.String path)
path
- String file path of the programming project to loadpublic void loadProject(java.lang.String projectContents)
projectContents
- public void loadProject(java.lang.String projectContents, java.lang.String langDefContents)
projectContents
- langDefContents
- String XML that defines the language of
projectContentspublic void resetWorkspace()
public javax.swing.JComponent getWorkspacePanel()
public javax.swing.JComponent getSearchBar()
public java.lang.Iterable<SearchableContainer> getAllSearchableContainers()
public static void main(java.lang.String[] args)
public static void initWithLangDefFilePath(java.lang.String langDefFilePath)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |