public class Base
extends Object
Modifier and Type | Field and Description |
---|---|
static boolean |
DEBUG
True if heavy debugging error/log messages are enabled.
|
static JMenu |
defaultFileMenu
A lone file menu to be used when all sketch windows are closed.
|
Constructor and Description |
---|
Base(String[] args) |
Modifier and Type | Method and Description |
---|---|
boolean |
addSketches(DefaultMutableTreeNode node,
File folder,
boolean examples) |
boolean |
changeMode(Mode mode)
The call has already checked to make sure this sketch is not modified,
now change the mode.
|
void |
checkFirstEditor(Editor editor)
Tools require an 'Editor' object when they're instantiated, but the
activeEditor will be null when the first Editor that opens is creating
its Tools menu.
|
void |
clearToolMenus() |
Editor |
getActiveEditor()
Returns the front most, active editor window.
|
List<ToolContribution> |
getCoreTools() |
Mode |
getDefaultMode() |
List<Editor> |
getEditors()
Get the list of currently active editor windows.
|
List<ExamplesContribution> |
getExampleContribs() |
byte[] |
getInstalledContribsInfo() |
static File |
getLibFile(String filename)
Return a File from inside the Processing 'lib' folder.
|
static InputStream |
getLibStream(String filename)
Return an InputStream for a file inside the Processing lib folder.
|
List<ModeContribution> |
getModeContribs() |
List<Mode> |
getModeList() |
Mode |
getNextMode()
Used by ThinkDifferent so that it can have a Sketchbook menu.
|
static int |
getRevision() |
static File |
getSettingsFile(String filename)
Convenience method to get a File object for the specified filename inside
the settings folder.
|
static File |
getSettingsFolder()
Get the directory that can store settings.
|
static File |
getSketchbookExamplesFolder() |
static File |
getSketchbookFolder() |
static File |
getSketchbookLibrariesFolder() |
static File |
getSketchbookModesFolder() |
static File |
getSketchbookTemplatesFolder() |
static File |
getSketchbookToolsFolder() |
List<ToolContribution> |
getToolContribs() |
static File |
getToolsFolder() |
static String |
getVersionName() |
void |
handleActivated(Editor whichEditor)
Called when a window is activated.
|
boolean |
handleClose(Editor editor,
boolean modeSwitch)
Close a sketch as specified by its editor window.
|
void |
handleNew()
Create a new untitled document in a new sketch window.
|
Editor |
handleOpen(String path)
Open a sketch from the path specified.
|
Editor |
handleOpen(String path,
boolean untitled)
Open a sketch in a new window.
|
void |
handleOpenPrompt()
Prompt for a sketch to open, and open it in a new window.
|
void |
handlePrefs()
Show the Preferences window.
|
boolean |
handleQuit()
Handler for File → Quit.
|
static boolean |
isCommandLine() |
static void |
locateSketchbookFolder() |
static void |
main(String[] args) |
void |
populateSketchbookMenu(JMenu menu) |
void |
populateToolsMenu(JMenu toolsMenu) |
void |
rebuildToolList() |
void |
refreshContribs(ContributionType ct) |
void |
removeToolContrib(ToolContribution tc) |
static void |
setCommandLine() |
void |
setSketchbookFolder(File folder) |
void |
setUpdatesAvailable(int n) |
void |
thinkDifferentExamples() |
public static boolean DEBUG
public static JMenu defaultFileMenu
public static void main(String[] args)
public static int getRevision()
public static String getVersionName()
public static void setCommandLine()
public static boolean isCommandLine()
public void checkFirstEditor(Editor editor)
public Editor getActiveEditor()
public List<Editor> getEditors()
public void handleActivated(Editor whichEditor)
public void refreshContribs(ContributionType ct)
public void setUpdatesAvailable(int n)
public List<ToolContribution> getCoreTools()
public List<ToolContribution> getToolContribs()
public void removeToolContrib(ToolContribution tc)
public void rebuildToolList()
public void clearToolMenus()
public void populateToolsMenu(JMenu toolsMenu)
public List<ModeContribution> getModeContribs()
public List<Mode> getModeList()
public List<ExamplesContribution> getExampleContribs()
public byte[] getInstalledContribsInfo()
public Mode getDefaultMode()
public Mode getNextMode()
public boolean changeMode(Mode mode)
public void handleNew()
public void handleOpenPrompt()
public Editor handleOpen(String path)
public Editor handleOpen(String path, boolean untitled)
path
- Path to the pde file for the sketch in questionpublic boolean handleClose(Editor editor, boolean modeSwitch)
editor
- Editor object of the sketch to be closed.modeSwitch
- Whether this close is being done in the context of a
mode switch.public boolean handleQuit()
public void thinkDifferentExamples()
public void populateSketchbookMenu(JMenu menu)
public boolean addSketches(DefaultMutableTreeNode node, File folder, boolean examples) throws IOException
IOException
public void handlePrefs()
public static File getLibFile(String filename) throws IOException
IOException
public static InputStream getLibStream(String filename) throws IOException
IOException
public static File getSettingsFolder()
public static File getSettingsFile(String filename)
filename
- A file inside the settings folder.public static File getToolsFolder()
public static void locateSketchbookFolder()
public void setSketchbookFolder(File folder)
public static File getSketchbookFolder()
public static File getSketchbookLibrariesFolder()
public static File getSketchbookToolsFolder()
public static File getSketchbookModesFolder()
public static File getSketchbookExamplesFolder()
public static File getSketchbookTemplatesFolder()