|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.jminor.framework.client.ui.EntityApplicationPanel
public abstract class EntityApplicationPanel
A central application panel class.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
static String |
TIPS_AND_TRICKS_FILE
|
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
EntityApplicationPanel()
|
Method Summary | |
---|---|
void |
activatePanel()
Activates this panel, showing it and preparing it for input |
void |
addAlwaysOnTopListener(ActionListener listener)
|
void |
addApplicationStartedListener(ActionListener listener)
|
EntityApplicationPanel |
addMainApplicationPanelProvider(EntityPanelProvider panelProvider)
Adds a main application panel, displayed on application start |
EntityApplicationPanel |
addMainApplicationPanelProviders(EntityPanelProvider... panelProviders)
Adds main application panels, displayed on application start |
void |
addSelectedPanelListener(ActionListener listener)
|
EntityApplicationPanel |
addSupportPanelProvider(EntityPanelProvider panelProvider)
Adds a support application panel, available via a support panel manu |
EntityApplicationPanel |
addSupportPanelProviders(EntityPanelProvider... panelProviders)
Adds support application panels, available via a support panel manu |
protected void |
bindEvents()
Override to add event bindings after initialization |
protected JMenuBar |
createMenuBar()
|
void |
exit()
Exists this application |
protected JPanel |
getAboutPanel()
|
protected List<ControlSet> |
getAdditionalMenuControlSet()
|
MasterDetailPanel |
getCurrentDetailPanel()
|
protected String |
getDefaultLookAndFeelClassName()
|
List<? extends MasterDetailPanel> |
getDetailPanels()
|
protected EntityPanel |
getEntityPanel(Class<? extends EntityPanel> entityPanelClass)
|
protected EntityPanel |
getEntityPanel(String entityID)
|
protected ControlSet |
getFileControlSet()
|
protected String |
getFrameTitle(String frameCaption,
User user)
|
protected ControlSet |
getHelpControlSet()
|
protected JPanel |
getHelpPanel()
|
protected String |
getHelpText()
|
EntityPanel |
getMainApplicationPanel(String entityID)
|
List<EntityPanel> |
getMainApplicationPanels()
|
protected ControlSet |
getMainMenuControlSet()
|
MasterDetailPanel |
getMasterPanel()
|
EntityApplicationModel |
getModel()
|
MasterDetailPanel |
getNextPanel()
|
protected JToolBar |
getNorthToolBar()
|
MasterDetailPanel |
getPreviousPanel()
|
protected ControlSet |
getSettingsControlSet()
|
protected ControlSet |
getSupportTableControlSet()
|
protected ControlSet |
getToolsControlSet()
|
protected User |
getUser(String frameCaption,
User defaultUser,
String applicationIdentifier,
ImageIcon applicationIcon)
Returns the user, either via a login dialog or via override, called during startup |
protected ControlSet |
getViewControlSet()
|
void |
handleException(Throwable exception,
JComponent dialogParent)
Handle the given exception and display it to the user. |
void |
initialize(EntityConnectionProvider connectionProvider)
Initializes this application panel |
protected abstract EntityApplicationModel |
initializeApplicationModel(EntityConnectionProvider connectionProvider)
Initializes the application model |
protected EntityConnectionProvider |
initializeConnectionProvider(User user,
String clientTypeID)
Initializes the entity db provider |
protected JPanel |
initializeSouthPanel()
Initializes a panel to show in the SOUTH position of this application frame, override to provide a south panel. |
protected JDialog |
initializeStartupDialog(Icon icon,
String startupMessage)
Initializes the startup dialog |
protected JPanel |
initializeStartupProgressPanel(Icon icon)
Initializes the progress panel to show in the startup dialog |
protected void |
initializeUI()
Initializes this EntityApplicationPanel |
boolean |
isAlwaysOnTop()
|
protected boolean |
isLoginRequired()
|
protected boolean |
isShowStartupDialog()
|
void |
login()
Performs a login, fetching user information via getUser |
void |
logout()
Performs a logout |
protected JFrame |
prepareFrame(String title,
boolean maximize,
boolean showMenuBar,
Dimension size,
ImageIcon applicationIcon,
boolean setVisible)
Initializes a JFrame according to the given parameters, containing this EntityApplicationPanel |
void |
removeAlwaysOnTopListener(ActionListener listener)
|
void |
removeApplicationStartedListener(ActionListener listener)
|
void |
removeSelectedPanelListener(ActionListener listener)
|
protected void |
saveDefaultUser(User user)
Saves the user info so that it can be used as default the next time this application is started. |
protected void |
savePreferences()
Called during the exit() method, override to save user preferences on program exit |
void |
setAlwaysOnTop(boolean value)
fires: evtAlwaysOnTopChanged |
void |
setLoggingLevel()
Shows a dialog for setting the logging level |
protected void |
setLoginRequired(boolean loginRequired)
Sets wheteher or not this application requires a login dialog |
protected void |
setShowStartupDialog(boolean startupDialog)
|
protected void |
setUncaughtExceptionHandler()
Sets the uncaught exception handler, override to add specific uncaught exception handling |
void |
showAbout()
Shows an about dialog |
void |
showDetailPanel(MasterDetailPanel detailPanel)
Shows the given detail panel |
protected void |
showEntityPanelDialog(EntityPanelProvider panelProvider)
Shows a dialog containing the entity panel provided by the given panel provider |
protected void |
showEntityPanelDialog(EntityPanelProvider panelProvider,
boolean modalDialog)
Shows a dialog containing the entity panel provided by the given panel provider |
void |
showHelp()
Shows a help dialog |
void |
startApplication(String frameCaption,
String iconName,
boolean maximize,
Dimension frameSize)
Starts this application. |
void |
startApplication(String frameCaption,
String iconName,
boolean maximize,
Dimension frameSize,
User defaultUser)
Starts this application. |
void |
startApplication(String frameCaption,
String iconName,
boolean maximize,
Dimension frameSize,
User defaultUser,
boolean showFrame)
Starts this application. |
void |
viewApplicationTree()
|
void |
viewDependencyTree()
Shows a dialog containing a dependency tree view of all defined entities |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String TIPS_AND_TRICKS_FILE
Constructor Detail |
---|
public EntityApplicationPanel()
Method Detail |
---|
public final void handleException(Throwable exception, JComponent dialogParent)
handleException
in interface ExceptionHandler
exception
- the exceptiondialogParent
- the component to use as parent to the exception dialogpublic final EntityApplicationModel getModel()
public final EntityApplicationPanel addMainApplicationPanelProviders(EntityPanelProvider... panelProviders)
panelProviders
- the main application panel providers
public final EntityApplicationPanel addMainApplicationPanelProvider(EntityPanelProvider panelProvider)
panelProvider
- the main application panel provider
public final EntityApplicationPanel addSupportPanelProviders(EntityPanelProvider... panelProviders)
panelProviders
- the support application panel providers
public final EntityApplicationPanel addSupportPanelProvider(EntityPanelProvider panelProvider)
panelProvider
- the support application panel provider
public final EntityPanel getMainApplicationPanel(String entityID)
entityID
- the entity ID
public final List<EntityPanel> getMainApplicationPanels()
public final boolean isAlwaysOnTop()
public final void setAlwaysOnTop(boolean value)
value
- the new valuepublic final void login() throws CancelException
getUser
CancelException
- in case the login is cancelledgetUser(String, org.jminor.common.model.User, String, javax.swing.ImageIcon)
public final void logout()
public final void setLoggingLevel()
public final void viewApplicationTree()
public final void viewDependencyTree()
public final void startApplication(String frameCaption, String iconName, boolean maximize, Dimension frameSize)
frameCaption
- the caption to display on the frameiconName
- the name of the icon to usemaximize
- if true the application frame is maximized on startupframeSize
- the frame size when unmaximizedpublic final void startApplication(String frameCaption, String iconName, boolean maximize, Dimension frameSize, User defaultUser)
frameCaption
- the caption to display on the frameiconName
- the name of the icon to usemaximize
- if true the application frame is maximized on startupframeSize
- the frame size when unmaximizeddefaultUser
- the default user to display in the login dialogpublic final void startApplication(String frameCaption, String iconName, boolean maximize, Dimension frameSize, User defaultUser, boolean showFrame)
frameCaption
- the caption to display on the frameiconName
- the name of the icon to usemaximize
- if true the application frame is maximized on startupframeSize
- the frame size when unmaximizeddefaultUser
- the default user to display in the login dialogshowFrame
- if true the frame is set visiblepublic final void initialize(EntityConnectionProvider connectionProvider) throws CancelException
connectionProvider
- the connection provider
IllegalStateException
- if the application model has not been set
CancelException
- in case the initialization is cancelledpublic final MasterDetailPanel getMasterPanel()
getMasterPanel
in interface MasterDetailPanel
public final MasterDetailPanel getCurrentDetailPanel()
getCurrentDetailPanel
in interface MasterDetailPanel
public final MasterDetailPanel getPreviousPanel()
getPreviousPanel
in interface MasterDetailPanel
public final MasterDetailPanel getNextPanel()
getNextPanel
in interface MasterDetailPanel
public final List<? extends MasterDetailPanel> getDetailPanels()
getDetailPanels
in interface MasterDetailPanel
public final void showDetailPanel(MasterDetailPanel detailPanel)
showDetailPanel
in interface MasterDetailPanel
detailPanel
- the detail panel to showpublic final void activatePanel()
activatePanel
in interface MasterDetailPanel
public final void exit() throws CancelException
CancelException
- if the exit is cancelledpublic final void showHelp()
getHelpPanel()
public final void showAbout()
getAboutPanel()
public final void addAlwaysOnTopListener(ActionListener listener)
listener
- a listener notified each time the always on top status changespublic final void removeAlwaysOnTopListener(ActionListener listener)
listener
- the listener to removepublic final void addApplicationStartedListener(ActionListener listener)
listener
- a listener notified when to application has been successfully startedpublic final void removeApplicationStartedListener(ActionListener listener)
listener
- the listener to removepublic final void addSelectedPanelListener(ActionListener listener)
listener
- a listener notified each time the selected main panel changespublic final void removeSelectedPanelListener(ActionListener listener)
listener
- the listener to removeprotected ControlSet getMainMenuControlSet()
getFileControlSet()
,
getSettingsControlSet()
,
getViewControlSet()
,
getToolsControlSet()
,
getHelpControlSet()
protected ControlSet getFileControlSet()
protected ControlSet getSettingsControlSet()
protected ControlSet getToolsControlSet()
protected ControlSet getViewControlSet()
protected ControlSet getHelpControlSet()
protected JPanel getHelpPanel()
protected String getHelpText() throws IOException
IOException
- in case of an IO exceptionprotected JPanel getAboutPanel()
protected final EntityPanel getEntityPanel(Class<? extends EntityPanel> entityPanelClass)
entityPanelClass
- the entity panel class
protected final EntityPanel getEntityPanel(String entityID)
entityID
- the entity ID
protected EntityConnectionProvider initializeConnectionProvider(User user, String clientTypeID) throws CancelException
user
- the userclientTypeID
- a string specifying the client type
CancelException
- in case the initialization is cancelledprotected void bindEvents()
initialize(org.jminor.framework.db.provider.EntityConnectionProvider)
protected List<ControlSet> getAdditionalMenuControlSet()
protected ControlSet getSupportTableControlSet()
protected final void showEntityPanelDialog(EntityPanelProvider panelProvider)
panelProvider
- the entity panel providerprotected final void showEntityPanelDialog(EntityPanelProvider panelProvider, boolean modalDialog)
panelProvider
- the entity panel providermodalDialog
- if true the dialog is made modalprotected JToolBar getNorthToolBar()
protected void initializeUI()
protected final boolean isLoginRequired()
protected final void setLoginRequired(boolean loginRequired)
loginRequired
- the login required statusprotected final boolean isShowStartupDialog()
protected final void setShowStartupDialog(boolean startupDialog)
startupDialog
- true if a startup dialog should be shownprotected String getDefaultLookAndFeelClassName()
Configuration.DEFAULT_LOOK_AND_FEEL_CLASSNAME
protected JPanel initializeSouthPanel()
protected final JDialog initializeStartupDialog(Icon icon, String startupMessage)
icon
- the iconstartupMessage
- the startup message
initializeStartupProgressPanel(javax.swing.Icon)
protected JPanel initializeStartupProgressPanel(Icon icon)
icon
- the icon
protected String getFrameTitle(String frameCaption, User user)
frameCaption
- the caption for the frameuser
- the user
protected final JFrame prepareFrame(String title, boolean maximize, boolean showMenuBar, Dimension size, ImageIcon applicationIcon, boolean setVisible)
title
- the title string for the JFramemaximize
- if true then the JFrame is maximized, overrides the prefSeizeAsRatioOfScreen parametershowMenuBar
- true if a menubar should be createdsize
- if the JFrame is not maximized then it's preferredSize is set to this valueapplicationIcon
- the application iconsetVisible
- if true then the JFrame is set visible
getNorthToolBar()
protected final JMenuBar createMenuBar()
getMainMenuControlSet()
protected void setUncaughtExceptionHandler()
protected abstract EntityApplicationModel initializeApplicationModel(EntityConnectionProvider connectionProvider) throws CancelException
connectionProvider
- the db provider
CancelException
- in case the initialization is cancelledprotected User getUser(String frameCaption, User defaultUser, String applicationIdentifier, ImageIcon applicationIcon) throws CancelException
frameCaption
- the application frame captiondefaultUser
- the default userapplicationIdentifier
- the application identifierapplicationIcon
- the application icon
CancelException
- in case a login dialog is cancelledprotected void saveDefaultUser(User user)
user
- the userprotected void savePreferences()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |