|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object processing.app.Sketch
public class Sketch
Stores information about files in the current sketch
Constructor Summary | |
---|---|
Sketch(Editor editor,
java.lang.String path)
path is location of the main .pde file, because this is also simplest to use when opening the file from the finder/explorer. |
Method Summary | |
---|---|
boolean |
addFile(java.io.File sourceFile)
Add a file to the sketch. |
java.lang.String |
build(java.lang.String buildPath)
Preprocess and compile all the code for this sketch. |
static java.lang.String |
checkName(java.lang.String origName)
Convert to sanitized name and alert the user if changes were made. |
boolean |
exportApplet(java.lang.String appletPath)
Handle export to applet. |
boolean |
exportApplication(java.lang.String destPath,
int exportPlatform)
Export to application without GUI. |
boolean |
exportApplicationPrompt()
|
java.lang.String |
getAppletClassName2()
|
java.lang.String |
getClassPath()
|
SketchCode[] |
getCode()
|
SketchCode |
getCode(int index)
|
int |
getCodeCount()
|
java.io.File |
getCodeFolder()
Returns the location of the sketch's code folder. |
int |
getCodeIndex(SketchCode who)
|
SketchCode |
getCurrentCode()
|
java.io.File |
getDataFolder()
Returns the location of the sketch's data folder. |
java.lang.String |
getDefaultExtension()
Returns the default extension for this editor setup. |
java.lang.String[] |
getExtensions()
Returns a String[] array of proper extensions. |
java.io.File |
getFolder()
Returns the sketch folder. |
java.lang.String |
getLibraryPath()
|
java.lang.String |
getMainFilePath()
Returns path to the main .pde file for this sketch. |
java.lang.String |
getName()
Returns the name of this sketch. |
java.io.File |
getPrimaryFile()
Returns a file object for the primary .pde of this sketch. |
void |
handleAddFile()
Prompt the user for a new file to the sketch, then call the other addFile() function to actually add it. |
void |
handleDeleteCode()
Remove a piece of code from the sketch and from the disk. |
void |
handleNewCode()
Handler for the New Code menu option. |
void |
handleNextCode()
Move to the next tab. |
void |
handlePrevCode()
Move to the previous tab. |
void |
handleRenameCode()
Handler for the Rename Code menu option. |
boolean |
hasDefaultExtension(SketchCode code)
True if the specified code has the default file extension. |
boolean |
hideExtension(java.lang.String what)
True if the specified extension should be hidden when shown on a tab. |
void |
importLibrary(java.lang.String jarPath)
Add import statements to the current tab for all of packages inside the specified jar file. |
boolean |
isDefaultExtension(java.lang.String what)
True if the specified extension is the default file extension. |
boolean |
isModified()
|
boolean |
isReadOnly()
Returns true if this is a read-only sketch. |
static boolean |
isSanitaryName(java.lang.String name)
Return true if the name is valid for a Processing sketch. |
boolean |
isUntitled()
|
java.io.File |
prepareCodeFolder()
Create the code folder if it does not exist already. |
java.io.File |
prepareDataFolder()
Create the data folder if it does not exist already. |
java.lang.String |
preprocess(java.lang.String buildPath)
Build all the code for this sketch. |
static java.lang.String |
sanitizeName(java.lang.String origName)
Produce a sanitized name that fits our standards for likely to work. |
boolean |
save()
Save all code in the current sketch. |
static java.lang.String |
scrubComments(java.lang.String what)
Replace all commented portions of a given String as spaces. |
void |
setCurrentCode(int which)
Change what file is currently being edited. |
void |
setModified(boolean state)
Sets the modified value for the code in the frontmost tab. |
void |
setUntitled(boolean u)
|
boolean |
validExtension(java.lang.String what)
Check this extension (no dots, please) against the list of valid extensions. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Sketch(Editor editor, java.lang.String path) throws java.io.IOException
java.io.IOException
Method Detail |
---|
public void handleNewCode()
public void handleRenameCode()
public void handleDeleteCode()
public void handlePrevCode()
public void handleNextCode()
public void setModified(boolean state)
public boolean isModified()
public boolean save() throws java.io.IOException
java.io.IOException
public void handleAddFile()
public boolean addFile(java.io.File sourceFile)
public void importLibrary(java.lang.String jarPath)
public void setCurrentCode(int which)
public java.lang.String preprocess(java.lang.String buildPath) throws RunnerException
buildPath
- Location to copy all the .java files
RunnerException
public java.lang.String build(java.lang.String buildPath) throws RunnerException
RunnerException
public boolean exportApplet(java.lang.String appletPath) throws RunnerException, java.io.IOException
RunnerException
java.io.IOException
public static java.lang.String scrubComments(java.lang.String what)
public boolean exportApplicationPrompt() throws java.io.IOException, RunnerException
java.io.IOException
RunnerException
public boolean exportApplication(java.lang.String destPath, int exportPlatform) throws java.io.IOException, RunnerException
java.io.IOException
RunnerException
public boolean isReadOnly()
public boolean hideExtension(java.lang.String what)
public boolean hasDefaultExtension(SketchCode code)
public boolean isDefaultExtension(java.lang.String what)
public boolean validExtension(java.lang.String what)
public java.lang.String getDefaultExtension()
public java.lang.String[] getExtensions()
public java.lang.String getName()
public java.io.File getPrimaryFile()
public java.lang.String getMainFilePath()
public java.io.File getFolder()
public java.io.File getDataFolder()
public java.io.File prepareDataFolder()
public java.io.File getCodeFolder()
public java.io.File prepareCodeFolder()
public java.lang.String getClassPath()
public java.lang.String getLibraryPath()
public SketchCode[] getCode()
public int getCodeCount()
public SketchCode getCode(int index)
public int getCodeIndex(SketchCode who)
public SketchCode getCurrentCode()
public void setUntitled(boolean u)
public boolean isUntitled()
public java.lang.String getAppletClassName2()
public static java.lang.String checkName(java.lang.String origName)
public static boolean isSanitaryName(java.lang.String name)
public static java.lang.String sanitizeName(java.lang.String origName)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |