public class BasicDemoApplication extends Object
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.
Modifier and Type | Field and Description |
---|---|
protected static String |
JADICE_NAME |
Constructor and Description |
---|
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
|
Modifier and Type | Method and Description |
---|---|
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 |
configureBookmarkStore(BasicJadicePanel mainViewerPanel)
Called during initialization to register a
BookmarkStore on the given panels context. |
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 |
configureLinkTool(EmbeddedLinkTool embeddedLinkToolToBeConfigured)
Configure the EmbeddedLinkTool with an
InstructionExecutorInventory containing the
executors desired to be used for embedded links |
protected void |
configureStatusBar(StatusBar snapInStatusBar)
Called during initialization to configure the status bar.
|
protected void |
configureTextSelectionTool(TextSelectionTool textSelectionTool,
Context context) |
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 BookmarkStore |
createBookmarkStore()
Called when the document changes to create a new bookmark store.
|
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 in general
|
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) |
protected void |
registerInstructionExecutorInventory(Context context)
Called during initialization to register an
InstructionExecutorInventory on the main
panel context. |
protected void |
registerPropertyChangeListeners(JFrame mainFrame,
BasicJadicePanel mainViewerPanel) |
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.
|
protected static final String JADICE_NAME
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)public static void main(String[] args)
args
- an array of command-line argumentsprotected static void init()
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 searchedprotected void configureBookmarkStore(BasicJadicePanel mainViewerPanel)
BookmarkStore
on the given panels context.
By default, this will register a bookmark store in the panels context and registers a
BookmarkDecorationTool
in the thumbnail view's tool manager.
mainViewerPanel
- the panelprotected BookmarkStore createBookmarkStore()
protected void configureLinkTool(EmbeddedLinkTool embeddedLinkToolToBeConfigured)
InstructionExecutorInventory
containing the
executors desired to be used for embedded linksprotected 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 panelprotected 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)
protected void registerInstructionExecutorInventory(Context context)
InstructionExecutorInventory
on the main
panel context.context
- the context to register the inventoryprotected void registerPropertyChangeListeners(JFrame mainFrame, BasicJadicePanel mainViewerPanel)
protected List<PresentationRule> getPresentationRules()
protected void postInitCallback(JFrame mainFrame, BasicJadicePanel mainViewerPanel)
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)
protected 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)
public 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()
Copyright © 2024 levigo holding gmbh. All rights reserved.