|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectkawigi.cmd.Dispatcher
public class Dispatcher
This class is the switchboard of KawigiEdit's command infrastructure, as of version 2.0. If you need an Action, it will usually come from here. If you want to execute an action, or find an action so you can change properties on it, this is also your class. And if you need global access to several important UI components (like the main CodePane), you can get it from this class. There is a lot of references to "subdispatchers" in the kawigi.cmd package. There is one global dispatcher that holds commands that don't need access to a control on which to act, and it has a set of dispatchers (called subdispatchers that are bound to objects (currently always CodePanes) on which they act.
| Field Summary | |
|---|---|
protected java.util.Map<ActID,DefaultAction> |
actionMap
Map of ActIDs to Actions that have already been instantiated on this dispatcher. |
protected java.awt.Component |
context
The object for commands to act on if this is a subdispatcher. |
protected static Dispatcher |
globalDispatcher
The all-important singleton global dispatcher. |
| Constructor Summary | |
|---|---|
protected |
Dispatcher(java.awt.Component context)
Instantiates a local subdispatcher that acts on context. |
| Method Summary | |
|---|---|
Dispatcher |
createSubDispatcher(java.awt.Component context)
Creates and returns a local subdispatcher that acts on context. |
void |
eraseSubDispatcher(Dispatcher disp)
Deletes subdispatcher from internal structures and forgets it. |
void |
focusGained(java.awt.event.FocusEvent e)
Notifies the global dispatcher that a new "context" has gotten focus. |
void |
focusLost(java.awt.event.FocusEvent e)
Does nothing - part of the FocusListener interface. |
DefaultAction |
getAction(ActID actid)
Gets the Action instance for the given ActID. |
DefaultAction |
getAction(ActID actid,
boolean useGlobal)
Gets the Action instance for the given ActID. |
static CodePane |
getCodePane()
Gets the CodePane for the code editor. |
static SimpleOutputComponent |
getCompileComponent()
Returns the component that displays compile output. |
static EditorPanel |
getEditorPanel()
Gets the EditorPanel for the code editor. |
static javax.swing.JFileChooser |
getFileChooser()
Returns a "community JFileChooser instance. |
static Dispatcher |
getGlobalDispatcher()
Accessor for the global dispatcher. |
static EditorPanel |
getLocalCodeEditorPanel()
Gets the EditorPanel for the Local Code tab. |
static CodePane |
getLocalCodePane()
Gets the CodePane for the Local Code tab. |
static SimpleOutputComponent |
getOutputComponent()
Returns the component that displays stuff printed from test runs. |
static ProblemTimer |
getProblemTimer()
Returns the problem timer. |
static javax.swing.JTabbedPane |
getTabbedPane()
Returns the JTabbedPane that all the major stuff is on. |
static CodePane |
getTemplateCodePane()
Returns the CodePane for the template editor. |
static EditorPanel |
getTemplateEditor()
Returns the EditorPanel for the template editor. |
static CodePane |
getTestCodePane()
Gets the CodePane for teh Testing Code editor. |
static EditorPanel |
getTestEditorPanel()
Gets the EditorPanel for the Testing Code editor. |
static javax.swing.JFrame |
getWindow()
Gets the main window. |
boolean |
isGlobal()
Returns true if this dispatcher is the global dispatcher. |
static void |
reportError(java.lang.Throwable t)
Brings up a message dialog to notify the user about an error, and also prints the stack trace of the error. |
void |
runCommand(ActID actid)
Launches an event on the given actid (i.e. - does what would happen if you clicked on the button or something like that) |
static void |
setCompileComponent(SimpleOutputComponent comp)
Sets the component that displays compile output. |
static void |
setEditorPanel(EditorPanel panel)
Sets the EditorPanel for the code editor. |
static void |
setLocalCodeEditorPanel(EditorPanel panel)
Sets the EditorPanel for the Local Code tab. |
static void |
setOutputComponent(SimpleOutputComponent comp)
Sets the component that displays stuff printed from test runs. |
static void |
setProblemTimer(ProblemTimer problemTimer)
Sets the problem timer control that's normally on the left side of the window. |
static void |
setTabbedPane(javax.swing.JTabbedPane tabbedPane)
Sets the JTabbedPane that all the major stuff is on. |
static void |
setTemplateEditor(EditorPanel editor)
Sets the EditorPanel for the template editor. |
static void |
setTestEditorPanel(EditorPanel panel)
Sets the EditorPanel for the Testing Code editor. |
static void |
setWindow(javax.swing.JFrame window)
Sets the main window KawigiEdit is on. |
void |
UIRefresh()
Refreshes the settings of all currently mapped actions on this dispatcher. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.util.Map<ActID,DefaultAction> actionMap
protected static Dispatcher globalDispatcher
protected java.awt.Component context
| Constructor Detail |
|---|
protected Dispatcher(java.awt.Component context)
| Method Detail |
|---|
public boolean isGlobal()
public static Dispatcher getGlobalDispatcher()
public Dispatcher createSubDispatcher(java.awt.Component context)
public void eraseSubDispatcher(Dispatcher disp)
public static void setWindow(javax.swing.JFrame window)
public static javax.swing.JFrame getWindow()
public static EditorPanel getEditorPanel()
public static void setEditorPanel(EditorPanel panel)
public static CodePane getCodePane()
public static EditorPanel getLocalCodeEditorPanel()
public static void setLocalCodeEditorPanel(EditorPanel panel)
public static CodePane getLocalCodePane()
public static EditorPanel getTestEditorPanel()
public static void setTestEditorPanel(EditorPanel panel)
public static CodePane getTestCodePane()
public static SimpleOutputComponent getOutputComponent()
public static void setOutputComponent(SimpleOutputComponent comp)
public static SimpleOutputComponent getCompileComponent()
public static void setCompileComponent(SimpleOutputComponent comp)
public static javax.swing.JTabbedPane getTabbedPane()
public static void setTabbedPane(javax.swing.JTabbedPane tabbedPane)
public static void setProblemTimer(ProblemTimer problemTimer)
public static ProblemTimer getProblemTimer()
public static void setTemplateEditor(EditorPanel editor)
public static EditorPanel getTemplateEditor()
public static CodePane getTemplateCodePane()
public static javax.swing.JFileChooser getFileChooser()
public DefaultAction getAction(ActID actid)
public DefaultAction getAction(ActID actid,
boolean useGlobal)
public void runCommand(ActID actid)
public static void reportError(java.lang.Throwable t)
public void UIRefresh()
public void focusGained(java.awt.event.FocusEvent e)
focusGained in interface java.awt.event.FocusListenerpublic void focusLost(java.awt.event.FocusEvent e)
focusLost in interface java.awt.event.FocusListener
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||