|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.levigo.jadice.demo.launcher.BasicDemoApplication
public class BasicDemoApplication
This class is a base / default implementation of a demo application.
During initialization, the protected configuration methods are being called. It is possible for subclasses to provide a different behavior or other functions by overriding the protected methods.
The appearance of the demo is controlled by the DefaultMenuComponentFactory which will is passed in the Constructor (if none is passed, the default Factory will be used).
This class can also be used in conjunction with the JadiceDemoLauncher
. See
EmbeddedDemoApplication
for an example of subclassing the BasicDemoApplication.
Field Summary | |
---|---|
protected static String |
JADICE_NAME
|
Constructor Summary | |
---|---|
BasicDemoApplication()
Default constructor |
|
BasicDemoApplication(DefaultMenuComponentFactory menuComponentFactory)
Constructor which allows to set the desired MenuComponents.properties file to use. |
|
BasicDemoApplication(DefaultMenuComponentFactory menuComponentFactory,
String[] args)
Full constructor |
Method Summary | |
---|---|
protected void |
addMenuContributions(PopupMenuTool popupMenuTool)
Adds contributions (functions) to the popupMenuTool. |
void |
close()
Called when the window is about to close. |
protected void |
configureAreaSelectionTool(AreaSelectionTool areaSelectionTool,
Context context)
Configures the AreaSelectionTool. |
protected void |
configureDragAndDrop(BasicJadicePanel mainViewerPanel)
Called during initialization. |
protected void |
configureImportExportHandlers(BasicJadicePanel mainViewerPanel,
ToolManager tm)
Is called during initialization. |
protected void |
configureKeyBindingsTool(KeyBindingsTool kbt,
Context ctx)
Configures an instance of KeyBindingsTool by adding a couple of actions to be invoked
when specific KeyEvent s occur. |
protected void |
configureStatusBar(StatusBar snapInStatusBar)
Called during initialization to configure the status bar. |
protected void |
configureTextSelectionTool(TextSelectionTool textSelectionTool,
Context context)
Configures the TextSelectionTool. |
protected void |
configureToolManager(ToolManager tm)
Is called during initialization and registers the available tools. |
protected BasicJadicePanel |
createBasicJadicePanel()
Called during initialization to create the basic jadice panel. |
protected JFrame |
createFrame(BasicJadicePanel viewerPanel)
Called during initialization to create the main Window. |
protected void |
doConfigureImportExportHandlers(ThumbnailView thumbnailView)
Sets the Import / Export handlers for the given ThumbnailView. |
protected static String |
getArgumentValue(String arg,
String defVal,
String[] args)
Gets the String value of an argument from the String array supplied. |
BasicJadicePanel |
getBasicJadicePanel()
Returns the BasicJadicePanel created by createBasicJadicePanel() . |
JFrame |
getFrame()
Returns the JFrame created by createFrame(BasicJadicePanel) . |
protected List<PresentationRule> |
getPresentationRules()
Returns a list of the presentation rules. |
protected String |
getRollingMessagePanelPosition()
Returns the desired position of the rolling message panel. |
protected String |
getSorterToolbarPosition()
Returns the desired sorter toolbar position. |
protected JPopupMenu |
getTrayPopupMenu()
Called when the TrayIcon is being installed. |
protected void |
handleArgs(String[] args)
Called after initialization. |
boolean |
hasTrayIcon()
Checks if this BasicDemoApplication has a registered TrayIcon. |
void |
hideTrayPopupMenu()
Hides the tray icon |
protected static void |
init()
Registers L&F and configures Jadice properties |
void |
installTrayIcon()
Installs a tray icon, if there is no tray icon yet. |
protected boolean |
isTrayVisibilityToggle()
When installing a system tray icon, this method is called to determine whether an ActionListener should be registered on the TrayIcon to toggle the visibility of the Frame. |
static void |
main(String[] args)
Starts the application. |
protected void |
postInitCallback(JFrame mainFrame,
BasicJadicePanel mainViewerPanel)
This method is called after the initialization, but before the main frame is visible. |
protected void |
registerContextListeners(JFrame mainFrame,
BasicJadicePanel mainViewerPanel)
Is called during initialization to register context listeners. |
protected void |
registerPropertyChangeListeners(JFrame mainFrame,
BasicJadicePanel mainViewerPanel)
Called during initialization to register PropertyChangeListeners. |
void |
removeTrayIcon()
If this BasicDemoApplication already registered a TrayIcon, that TrayIcon will be removed. |
void |
showTrayPopupMenu(int x,
int y)
Shows a tray icon popup at the given x,y location. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final String JADICE_NAME
Constructor Detail |
---|
public BasicDemoApplication()
public BasicDemoApplication(DefaultMenuComponentFactory menuComponentFactory)
menuComponentFactory
- - the GUI configuration to usepublic BasicDemoApplication(DefaultMenuComponentFactory menuComponentFactory, String[] args)
menuComponentFactory
- - the path of the menuComponentsProperties file to useargs
- - command line args (may be null)Method Detail |
---|
protected void handleArgs(String[] args)
args
- - the command line argspublic JFrame getFrame()
createFrame(BasicJadicePanel)
.
public BasicJadicePanel getBasicJadicePanel()
createBasicJadicePanel()
.
protected JFrame createFrame(BasicJadicePanel viewerPanel)
viewerPanel
- - the viewer panel
protected BasicJadicePanel createBasicJadicePanel()
protected void configureDragAndDrop(BasicJadicePanel mainViewerPanel)
mainViewerPanel
- - the main viewer panelprotected String getSorterToolbarPosition()
BorderLayout.NORTH
) or null.protected String getRollingMessagePanelPosition()
BorderLayout.NORTH
) or null.protected void configureStatusBar(StatusBar snapInStatusBar)
snapInStatusBar
- - the StatusBar to configureprotected void registerContextListeners(JFrame mainFrame, BasicJadicePanel mainViewerPanel)
mainFrame
- - the main framemainViewerPanel
- - the BasicJadicePanelprotected void registerPropertyChangeListeners(JFrame mainFrame, BasicJadicePanel mainViewerPanel)
mainFrame
- - the main framemainViewerPanel
- - the BasicJadicePanelprotected List<PresentationRule> getPresentationRules()
protected void postInitCallback(JFrame mainFrame, BasicJadicePanel mainViewerPanel)
mainFrame
- - the main framemainViewerPanel
- - the viewer panelpublic static void main(String[] args)
args
- an array of command-line argumentsprotected static void init()
protected void configureToolManager(ToolManager tm)
tm
- - the ToolManagerprotected void configureImportExportHandlers(BasicJadicePanel mainViewerPanel, ToolManager tm)
mainViewerPanel
- - the main viewer panel (a BasicJadicePanel)tm
- - the ToolManagerprotected void doConfigureImportExportHandlers(ThumbnailView thumbnailView)
configureImportExportHandlers(BasicJadicePanel, ToolManager)
thumbnailView
- - the view to set the import/export handlerprotected void configureAreaSelectionTool(AreaSelectionTool areaSelectionTool, Context context)
areaSelectionTool
- - the AreaSelectionTool to configurecontext
- - the Contextprotected void configureTextSelectionTool(TextSelectionTool textSelectionTool, Context context)
textSelectionTool
- - the TextSelectionTool to configurecontext
- - the Contextprotected void configureKeyBindingsTool(KeyBindingsTool kbt, Context ctx)
KeyBindingsTool
by adding a couple of actions to be invoked
when specific KeyEvent
s occur.
kbt
- the KeyBindingsTool
to be configuredctx
- a Context
object to be used for the actions bound to key bindings.protected void addMenuContributions(PopupMenuTool popupMenuTool)
popupMenuTool
- - the PopupMenuToolpublic void close()
protected boolean isTrayVisibilityToggle()
By default, this will return true.
installTrayIcon()
public void installTrayIcon()
public void showTrayPopupMenu(int x, int y)
x
- x locationy
- y locationpublic void hideTrayPopupMenu()
public void removeTrayIcon()
public boolean hasTrayIcon()
protected JPopupMenu getTrayPopupMenu()
protected static String getArgumentValue(String arg, String defVal, String[] args)
String
value of an argument from the String
array supplied.
If the argument cannot be found, the default value will be returned. The equals sign '=' is
used for tokenizing.
arg
- the argument to whose value is requireddefVal
- the default value to return if the argument cannot be foundargs
- the String
array to be searched
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |