|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.pavlov.main.AbstractUIFactory net.sourceforge.pavlov.main.standalone.SwingUIFactory
public class SwingUIFactory
The purpose of this class and AbstractUIFactory is to separate user-interface details and program logic so that Pavlov can easily be reimplemented in user interface environments other than Swing. As of 1.0 that separation has not been accomplished. There needs to be a greater level of abstraction here and throughout the code. For example, many classes throughout Pavlov are subclasses of JI_nternalFrame and JComponent. Reimplementation of these classes as Model-View-Controller would allow porting to consist of writing a view, and a UIFactory that couples that view with the controller.
Field Summary | |
---|---|
protected PlugletLoader |
feedbackPlugins
Describe variable feedbackPlugins here. |
protected JFrame |
MYFRAME
Describe variable MYFRAME here. |
protected Pavlov |
pavlov
Describe variable pavlov here. |
protected Quiz |
quiz
Describe variable quiz here. |
protected QuizController |
quizController
Describe variable quizController here. |
protected JSplitPane |
SPLITTER
Describe variable SPLITTER here. |
protected StrategyLoader |
strategyPluglets
Describe variable strategyPluglets here. |
protected SteelmeTheme |
theme
Describe variable theme here. |
protected File |
themeDirectory
Describe variable themeDirectory here. |
protected PlugletLoader |
toolPluglets
Describe variable toolPluglets here. |
protected VelocityPlugletLoader |
velocityPlugins
Describe variable velocityPlugins here. |
Constructor Summary | |
---|---|
SwingUIFactory(Pavlov thePavlov,
JFrame base)
Creates a new SwingUIFactory instance. |
Method Summary | |
---|---|
void |
actionPerformed(ActionEvent e)
Describe actionPerformed method here. |
void |
applyTheme()
Apply the current theme. |
void |
closeSplashScreen()
Null implementation here, since StartupWindow closes itself. |
boolean |
confirmQuit()
Describe confirmQuit method here. |
JMenuBar |
createMenuBar(JComponent rootPane)
Describe createMenuBar method here. |
void |
createQuizSelector(User user,
AbstractLibrary library)
Describe createQuizSelector method here. |
JComponent |
getMain()
Gets the main attribute of the SwingUIFactory object |
Quiz |
getQuiz()
Describe getQuiz method here. |
String |
getResourceString(String a,
String b)
Describe getResourceString method here. |
void |
hyperlinkUpdate(HyperlinkEvent e)
Describe hyperlinkUpdate method here. |
void |
logonAttempt(LogonEvent event)
The LoginController calls this when the user has finished logging in. |
protected void |
makeFeedbackMenu(JMenuBar menuBar)
Describe makeFeedbackMenu method here. |
protected void |
makeFileMenu(JMenuBar menuBar)
Describe makeFileMenu method here. |
protected void |
makeHelpMenu(JMenuBar menuBar)
Describe makeHelpMenu method here. |
ImageIcon |
makeImageIcon(String key,
String def,
int size)
Describe makeImageIcon method here. |
protected void |
makePreferencesMenu(JMenuBar menuBar,
JComponent targ)
Describe makePreferencesMenu method here. |
protected void |
makeSkinMenu(JMenu men)
Describe makeSkinMenu method here. |
protected void |
makeStrategyMenu(JMenuBar menuBar)
Describe makeStrategyMenu method here. |
protected void |
makeToolsMenu(JMenuBar menuBar)
Describe makeToolsMenu method here. |
void |
saveQuiz()
Saves the current quiz. |
void |
setFeedbackPluglets(PlugletLoader loader)
Describe setFeedbackPluglets method here. |
void |
setQuiz(Quiz quiz)
Describe setQuiz method here. |
void |
setStatus(int percent,
String msg)
Sets the message and status number in startup window. |
void |
setStrategyPluglets(StrategyLoader loader)
Describe setStrategyPluglets method here. |
void |
setTemplateToolkit(Skin kit)
Describe setTemplateToolkit method here. |
void |
setToolPluglets(PlugletLoader loader)
Describe setToolPluglets method here. |
void |
setVelocityPluglets(VelocityPlugletLoader loader)
Describe setVelocityPluglets method here. |
int |
showConfirmDialog(Object message)
Describe showConfirmDialog method here. |
void |
showErrorDialog(String message,
Exception ex)
Description of the Method |
int |
showFileChooser(JFileChooser chooser,
boolean openMode)
Describe showFileChooser method here. |
void |
showIncorrectDialog(String msg)
Describe showIncorrectDialog method here. |
void |
showInfoDialog(String msg,
String title)
Description of the Method |
String |
showInputDialog(Object message,
String title,
int messageType)
Describe showInputDialog method here. |
void |
showLoginController(LogonListener lis)
Creates the login widget and shows it to the user. |
void |
showMessageDialog(Object message,
String title,
int messageType)
Describe showMessageDialog method here. |
int |
showOptionDialog(Object message,
String title,
int optionType,
int messageType,
Icon icon,
Object[] options,
Object initialValue)
Describe showOptionDialog method here. |
void |
showSplashScreen(JFrame frame)
Shows the startup window. |
void |
startQuiz(User user,
ChapterReference ref)
Describe startQuiz method here. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final JFrame MYFRAME
MYFRAME
here.
protected final JSplitPane SPLITTER
SPLITTER
here.
protected final Pavlov pavlov
pavlov
here.
protected Quiz quiz
quiz
here.
protected QuizController quizController
quizController
here.
protected SteelmeTheme theme
theme
here.
protected File themeDirectory
themeDirectory
here.
protected PlugletLoader feedbackPlugins
feedbackPlugins
here.
protected VelocityPlugletLoader velocityPlugins
velocityPlugins
here.
protected StrategyLoader strategyPluglets
strategyPluglets
here.
protected PlugletLoader toolPluglets
toolPluglets
here.
Constructor Detail |
---|
public SwingUIFactory(Pavlov thePavlov, JFrame base)
SwingUIFactory
instance.
thePavlov
- a Pavlov
valuebase
- a JComponent
valueMethod Detail |
---|
public JComponent getMain()
public boolean confirmQuit()
confirmQuit
method here.
confirmQuit
in class AbstractUIFactory
boolean
valuepublic void setQuiz(Quiz quiz)
setQuiz
method here.
quiz
- The new quiz valuepublic Quiz getQuiz()
getQuiz
method here.
Quiz
valuepublic void setFeedbackPluglets(PlugletLoader loader)
setFeedbackPluglets
method here.
loader
- The new feedbackPluglets valuepublic void setVelocityPluglets(VelocityPlugletLoader loader)
setVelocityPluglets
method here.
loader
- The new velocityPluglets valuepublic void setStrategyPluglets(StrategyLoader loader)
setStrategyPluglets
method here.
loader
- The new strategyPluglets valuepublic void setToolPluglets(PlugletLoader loader)
setToolPluglets
method here.
loader
- The new toolPluglets valuepublic void applyTheme()
public void setTemplateToolkit(Skin kit)
setTemplateToolkit
method here.
kit
- an AbstractTemplateKit
valuepublic void createQuizSelector(User user, AbstractLibrary library)
createQuizSelector
method here.
createQuizSelector
in class AbstractUIFactory
user
- an User
valuelibrary
- an AbstractLibrary
valuepublic void startQuiz(User user, ChapterReference ref)
startQuiz
method here.
startQuiz
in class AbstractUIFactory
user
- an User
valueref
- a ChapterReference
valuepublic void saveQuiz()
public String getResourceString(String a, String b)
getResourceString
method here.
a
- a String
valueb
- a String
value
String
valuepublic void closeSplashScreen()
closeSplashScreen
in class AbstractUIFactory
public void logonAttempt(LogonEvent event)
logonAttempt
in interface LogonListener
event
- a LogonEvent
valuepublic void setStatus(int percent, String msg)
setStatus
in class AbstractUIFactory
msg
- a String
valuepercent
- The new status valuepublic void showLoginController(LogonListener lis)
showLoginController
in class AbstractUIFactory
lis
- a LogonListener
valuepublic void showSplashScreen(JFrame frame)
frame
- Description of the Parameterpublic void showIncorrectDialog(String msg)
showIncorrectDialog
method here.
showIncorrectDialog
in class AbstractUIFactory
msg
- a String
valuepublic int showFileChooser(JFileChooser chooser, boolean openMode)
showFileChooser
method here.
showFileChooser
in class AbstractUIFactory
chooser
- a JFileChooser
valueopenMode
- a boolean
value
int
valuepublic ImageIcon makeImageIcon(String key, String def, int size)
makeImageIcon
method here.
key
- a String
valuedef
- a String
valuesize
- an int
value
ImageIcon
valuepublic int showConfirmDialog(Object message)
showConfirmDialog
method here.
message
- an Object
value
int
valuepublic void showMessageDialog(Object message, String title, int messageType)
showMessageDialog
method here.
message
- an Object
valuetitle
- a String
valuemessageType
- an int
valuepublic String showInputDialog(Object message, String title, int messageType) throws HeadlessException
showInputDialog
method here.
message
- an Object
valuetitle
- a String
valuemessageType
- an int
value
String
value
HeadlessException
- if an error occurspublic int showOptionDialog(Object message, String title, int optionType, int messageType, Icon icon, Object[] options, Object initialValue) throws HeadlessException
showOptionDialog
method here.
message
- an Object
valuetitle
- a String
valueoptionType
- an int
valuemessageType
- an int
valueicon
- an Icon
valueoptions
- an Object[]
valueinitialValue
- an Object
value
int
value
HeadlessException
- if an error occurspublic void showErrorDialog(String message, Exception ex)
message
- Description of the Parameterex
- Description of the Parameterpublic void showInfoDialog(String msg, String title)
msg
- Description of the Parametertitle
- Description of the Parameterpublic JMenuBar createMenuBar(JComponent rootPane)
createMenuBar
method here.
rootPane
- Description of the Parameter
protected void makeFileMenu(JMenuBar menuBar)
makeFileMenu
method here.
menuBar
- Description of the Parameterprotected void makeFeedbackMenu(JMenuBar menuBar)
makeFeedbackMenu
method here.
menuBar
- Description of the Parameterprotected void makeToolsMenu(JMenuBar menuBar)
makeToolsMenu
method here.
menuBar
- Description of the Parameterprotected void makePreferencesMenu(JMenuBar menuBar, JComponent targ)
makePreferencesMenu
method here.
menuBar
- Description of the Parametertarg
- Description of the Parameterprotected void makeSkinMenu(JMenu men)
makeSkinMenu
method here.
men
- a JMenu
valueprotected void makeStrategyMenu(JMenuBar menuBar)
makeStrategyMenu
method here.
menuBar
- Description of the Parameterprotected void makeHelpMenu(JMenuBar menuBar)
makeHelpMenu
method here.
menuBar
- Description of the Parameterpublic void actionPerformed(ActionEvent e)
actionPerformed
method here.
actionPerformed
in interface ActionListener
e
- a java.awt.event.ActionEvent
valuepublic void hyperlinkUpdate(HyperlinkEvent e)
hyperlinkUpdate
method here.
hyperlinkUpdate
in interface HyperlinkListener
e
- a HyperlinkEvent
value
|
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |