@Deprecated public abstract class DocumentedDistribution<M extends Model,G extends Gui> extends JFrame
class Program extends DocumentedDistribution { @Override void executeBatchOperation( [*glo in optionsModel*] ){ ... } public static void main (final String[] args){ new Program(new DocumentedDistribution.Configuration(){ {programName = ...; ..}}).execute(args); } }
Model
and
a corresponding class derived from Gui
, as generated by the
Compiler
. See the
BandM metatools user doc
for details.
Modifier and Type | Class and Description |
---|---|
static class |
DocumentedDistribution.Configuration<MM extends Model,GG extends Gui>
Deprecated.
Auxiliary class to pass the main operation parameters from a particular
application, realized as a subclass of
DocumentedDistribution . |
static class |
DocumentedDistribution.executeModes
Deprecated.
|
JFrame.AccessibleJFrame
Frame.AccessibleAWTFrame
Window.AccessibleAWTWindow, Window.Type
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
protected ActionListener |
al_lang_select
Deprecated.
|
protected Map<Component,String> |
anyTabbedPane2textKey
Deprecated.
|
protected Map<AbstractButton,String> |
button2textKey
Deprecated.
|
DocumentedDistribution.Configuration<M,G> |
configuration
Deprecated.
|
protected byte[] |
DES_cs
Deprecated.
Checksum of all files in DES.
|
protected String |
DES_dir
Deprecated.
Common root position of documentation, examples and sources.
|
static String[] |
emptyArgs
Deprecated.
|
protected SwingMessageField<SimpleMessage<String>> |
errorMsgField
Deprecated.
Text label showing always the last message sent to , iff it is an error.
|
protected JButton |
executeButton
Deprecated.
|
protected boolean |
hasCmdlineParameters
Deprecated.
|
static ImageIcon |
icon_flag_de
Deprecated.
|
static ImageIcon |
icon_flag_en
Deprecated.
|
static ImageIcon |
icon_flag_es
Deprecated.
|
static ImageIcon |
icon_flag_la
Deprecated.
|
protected String |
initialStatusInformation
Deprecated.
|
protected boolean |
interactiveIsRequested
Deprecated.
HACK, required that the
errorMsgField does not collapse visually if its
text contents are emmpty !-) |
protected boolean |
isInitialCall
Deprecated.
|
protected boolean |
isMuli
Deprecated.
|
protected JnlpAdapter |
jnlpAdapter
Deprecated.
|
protected boolean |
jnlpMode
Deprecated.
|
protected JTabbedPane |
jTabbedPane
Deprecated.
|
static String |
KEY_about_additional_text
Deprecated.
This is a key string pointing into the translation
CatalogByString , to an
OPTIONAL additional text shown after the first two sentences of the about window. |
static String |
KEY_PATH_local_userdocumentation
Deprecated.
This is a key string pointing into the translation
CatalogByString , which is
required because the language of the document may depend on the current language preferences. |
static String |
KEY_ultra_short_description
Deprecated.
This is a key string pointing into the translation
CatalogByString , to a
three-word explanation of the program's purpose, in different languages. |
static String |
KEY_URL_web_userdocumentation
Deprecated.
This is a key string pointing into the translation
CatalogByString , which is
required because the language of the document may depend on the current language preferences. |
protected Map<JLabel,String> |
label2textKey
Deprecated.
|
protected ButtonGroup |
langButtons
Deprecated.
|
static String |
lf
Deprecated.
|
protected JMenu |
menu_lang
Deprecated.
|
static String |
menu_languages_name
Deprecated.
|
static char |
menu_languages_short
Deprecated.
|
protected MessageStore<SimpleMessage<String>> |
messageStore
Deprecated.
|
protected List<String> |
modified_user_languages
Deprecated.
This is a copy of the original list of languages
#user_languages ,
which duplicates the first element
and allows by later overriding this very first position to switch language preferences
dynamically. |
MuLiMessageReceiver<String> |
msg
Deprecated.
The message receiver for all error messages.
|
protected MessageTee<SimpleMessage<String>> |
msgtee
Deprecated.
|
protected M |
optionsModel
Deprecated.
|
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
DocumentedDistribution(DocumentedDistribution.Configuration<M,G> configuration)
Deprecated.
Only constructor, which stores the
DocumentedDistribution.Configuration value and
initializes msg , messageStore and modified_user_languages , |
Modifier and Type | Method and Description |
---|---|
protected void |
add_lang_select(String text)
Deprecated.
FIXME generic protocol for finding flag icons.
|
protected void |
addMenu()
Deprecated.
Add a new Menu, currently only with "close year", "quit", and "help"
See
http://docs.oracle.com/javase/tutorial/uiswing/
|
protected void |
addMuli_jTabbedPane(Component p,
String text)
Deprecated.
Adds the component to the top-level JTabbedPane and memorizes it for
later language switch.
|
protected abstract void |
addUserMenuItems()
Deprecated.
Call-back method to be overridden whenever a derived class wants to add further items
to the main menu bar.
|
protected abstract void |
addUserPagesToTabbedPane()
Deprecated.
Call-back method to be overridden whenever a derived class wants to add further tabbed
panes to the main windows tabbed stack.
|
protected void |
clearErrorMsg()
Deprecated.
|
String |
closeDialogLink()
Deprecated.
|
protected void |
executeBatchOperation_caught()
Deprecated.
|
protected abstract void |
executeBatchOperation()
Deprecated.
Call-back main execution method, called with all parameters entered
into
optionsModel ,
coming from the GUI or command line. |
int |
getCriticalCount()
Deprecated.
|
JnlpAdapter |
getJnlpAdapter()
Deprecated.
|
protected String |
insitu(String key,
List<String> translations)
Deprecated.
Makes an "in.situ" definition using
Catalog.insitu(Object,List,List)
of the current muli messages catalog, with the current language preferences. |
protected String |
insitu(String key,
List<String> translations,
Object... args)
Deprecated.
Makes an "in situ" definition using
Catalog.insitu(Object,List,List,Object...)
of the current muli messages catalog, with the current language preferences. |
protected String |
insitu(String key,
String... translations)
Deprecated.
|
protected boolean |
isInitialCall()
Deprecated.
|
protected JMenuItem |
make_JMenuItem_lang(String text,
Icon icon)
Deprecated.
|
protected TextDialog |
makeAboutDialog(String title,
boolean modal)
Deprecated.
|
protected void |
makeMuli_anyTabbedPane(Component p,
String text)
Deprecated.
Memorizes the component as being contained in ANY JTabbedPane for
later language switch.
|
protected JButton |
makeMuli_JButton(String text)
Deprecated.
use
makeMuli(AbstractButton,String) instead. |
protected JLabel |
makeMuli_JLabel(String text)
Deprecated.
|
protected JMenu |
makeMuli_JMenu(String text)
Deprecated.
use
makeMuli(AbstractButton,String) instead. |
protected JMenuItem |
makeMuli_JMenuItem(String text)
Deprecated.
use
makeMuli(AbstractButton,String) instead. |
protected <X extends AbstractButton> |
makeMuli(X button,
String text)
Deprecated.
Should work for JButton, JMenu, JMenuItem, JRadioButton, JCheckBox.
|
void |
non_static_main(String[] args)
Deprecated.
Main entry for command line and for GUI operation.
|
protected void |
populate()
Deprecated.
|
protected void |
requestInteraction(boolean rq)
Deprecated.
A call-back to be called from
executeBatchOperation() to switch on/off
gui mode, according to the analysed options, or to performance results, etc. |
protected void |
setErrorMsg(String s)
Deprecated.
|
void |
setNewExampleDir(File file,
byte[] cs)
Deprecated.
Write new example path into persistent storage, after new selection
by the user from the GUI.
|
void |
setUserLanguages(List<String> preferences)
Deprecated.
|
boolean |
switchLanguage(String lang)
Deprecated.
Only let pass languages which have a menu entry.
|
void |
terminateApplicationDueToSevereErrors()
Deprecated.
|
void |
terminateApplicationDueToSevereErrors(MessageCounter<?> m)
Deprecated.
Prints a text to the terminal of the command line and exits the application.
|
String |
translate(String t)
Deprecated.
Translate the input String as defined by the catalog object and the language code
priority sequence, both from
msg . |
String |
translate(String t,
Object... args)
Deprecated.
Translate the input String as defined by the catalog object and the language code
priority sequence, both from
msg . |
protected String[] |
translateAndExtractShortcut(String text)
Deprecated.
Make a translation, then eliminate the shortcutIndication Character and
set the one-key mnemonic to its successor.
|
@Opt String |
translateNonRobust(String t)
Deprecated.
|
protected abstract boolean |
updateExampleOptionsModel(boolean changed)
Deprecated.
Call-back method to adapt the example options when the DES-files have been
downloaded.
|
protected void |
updateLanguage_anyTabbedPane(Component p)
Deprecated.
Switcht the text and the mnemonic of the tab of the JTabbedPane, containing the
component.
|
void |
user_requests_documentation()
Deprecated.
|
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, show, toBack, toFront
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getFont, postEvent
public final DocumentedDistribution.Configuration<M extends Model,G extends Gui> configuration
protected boolean isMuli
public static final String menu_languages_name
public static final char menu_languages_short
public static final String KEY_PATH_local_userdocumentation
CatalogByString
, which is
required because the language of the document may depend on the current language preferences.public static final String KEY_URL_web_userdocumentation
CatalogByString
, which is
required because the language of the document may depend on the current language preferences.public static final String KEY_ultra_short_description
CatalogByString
, to a
three-word explanation of the program's purpose, in different languages.public static final String KEY_about_additional_text
CatalogByString
, to an
OPTIONAL additional text shown after the first two sentences of the about window.public static final String lf
public static final ImageIcon icon_flag_de
public static final ImageIcon icon_flag_en
public static final ImageIcon icon_flag_la
public static final ImageIcon icon_flag_es
public final MuLiMessageReceiver<String> msg
protected final MessageTee<SimpleMessage<String>> msgtee
protected final MessageStore<SimpleMessage<String>> messageStore
protected final List<String> modified_user_languages
#user_languages
,
which duplicates the first element
and allows by later overriding this very first position to switch language preferences
dynamically.protected boolean jnlpMode
protected boolean hasCmdlineParameters
protected String DES_dir
protected byte[] DES_cs
protected JnlpAdapter jnlpAdapter
public static final String[] emptyArgs
protected JButton executeButton
protected JTabbedPane jTabbedPane
protected String initialStatusInformation
protected SwingMessageField<SimpleMessage<String>> errorMsgField
protected boolean interactiveIsRequested
errorMsgField
does not collapse visually if its
text contents are emmpty !-)protected boolean isInitialCall
protected ActionListener al_lang_select
protected Map<AbstractButton,String> button2textKey
protected final ButtonGroup langButtons
protected JMenu menu_lang
public DocumentedDistribution(DocumentedDistribution.Configuration<M,G> configuration)
DocumentedDistribution.Configuration
value and
initializes msg
, messageStore
and modified_user_languages
,public String closeDialogLink()
public String translate(String t)
msg
.
If no translation is defined, the KEY ITSELF is returned!
The work is done by the method
Catalog.translateRobust(Object,List)
public String translate(String t, Object... args)
msg
.
The work is done by the method
Catalog.translateAllAndFormatRobust(Object,List,List)
protected String insitu(String key, List<String> translations, Object... args)
Catalog.insitu(Object,List,List,Object...)
of the current muli messages catalog, with the current language preferences.
That means it delivers the selected text immediately, but stores
the translations as a side effect, for later retrieval.translations
- list of PAIRS of String, each language code and textargs
- objects formatted into the translated text by printf codesprotected String insitu(String key, List<String> translations)
Catalog.insitu(Object,List,List)
of the current muli messages catalog, with the current language preferences.
That means it delivers the selected text immediately, but stores
the translations as a side effect, for later retrieval.
This is the variant for constant texts, i.e. without printf embedding.translations
- list of PAIRS of String, each language code and textprotected String insitu(String key, String... translations)
insitu(String,List)
public void terminateApplicationDueToSevereErrors(MessageCounter<?> m)
public void terminateApplicationDueToSevereErrors()
public int getCriticalCount()
public JnlpAdapter getJnlpAdapter()
protected abstract boolean updateExampleOptionsModel(boolean changed)
Configuration.exampleOptionsModel
and
DES_dir
.
The application can decide NOT to change the option settings.changed
- whether the call is caused by an explicit download request by the user.protected abstract void executeBatchOperation()
optionsModel
,
coming from the GUI or command line.
Must be called by one of the user-defined GUI field entries, or a button like "go!-)".
cmd-line-parameters filled in | startup with example data | interactively filled, | derived from DES position | GO button pressed | | isInitialCall=true | =true | =false | | execute (possibly skip GUI) | process data or not !?!? FIXME | process data, return | | to GUI
protected abstract void addUserPagesToTabbedPane()
addMuli_jTabbedPane(Component, String)
, with "String" being the key
for MuLi Translation.
FIXME SOME applications still call "jTabbedPane.add()", which is DEPRECATED!protected abstract void addUserMenuItems()
protected void requestInteraction(boolean rq)
executeBatchOperation()
to switch on/off
gui mode, according to the analysed options, or to performance results, etc.protected boolean isInitialCall()
public void non_static_main(String[] args)
executeBatchOperation()
on this data, controlled
by the global input optionsModel
Possible use cases:
X cmd line not empty - parsed w/o errors --> execute cmd line - parsed with errors --> signal (gui/non-gui) X cmd line empty - non jnlp mode --> signal situation, start with an empty Gui - jnlp mode x example downloaded --> signal situation, start with example x example not downloaded --> signal situation, start with an empty GuiThe states (and possible transitions) are as follows:
(_)no data loaded (_)notJnlpMode (_)cmdLineEmpty | | (_)jnlpMode: (_)cmdLineGiven: V +----------------------+ +--------------- /\ | (_)DES_notLocal | | (_)cmdLine task=A / \ | | | | (_)cmdLine task=B / (_)loaded_ok | V | | (_)cmdLine task=... | / | (_)DES_onLocalDisk | / | / (_) loaded_error
protected TextDialog makeAboutDialog(String title, boolean modal)
public void setNewExampleDir(File file, byte[] cs)
protected void setErrorMsg(String s)
protected void clearErrorMsg()
protected void populate()
protected void executeBatchOperation_caught()
protected String[] translateAndExtractShortcut(String text)
!be!enden long=beenden short=e $$quit long=quit short=q !quit quit short=null !$quit $quit short=null !$qui!t $quit short=t
protected void addMuli_jTabbedPane(Component p, String text)
text
- text to translate, in "Mnemomic format": First character is
deleted and its second appearance marks the mnemonic, as in "%e%xit" or "&&File"protected void makeMuli_anyTabbedPane(Component p, String text)
jTabbedPane
and does not insert the component anywhere. Instead, the component must already
be inserted in some JTabbedPane.text
- text to translate, in "Mnemomic format": First character is
deleted and its second appearance marks the mnemonic, as in "%e%xit" or "&&File"IllegalArgumentException
- in case "p" is not directly contained in a JTabbedPane.protected void updateLanguage_anyTabbedPane(Component p)
@Deprecated protected JMenu makeMuli_JMenu(String text)
makeMuli(AbstractButton,String)
instead.@Deprecated protected JMenuItem makeMuli_JMenuItem(String text)
makeMuli(AbstractButton,String)
instead.@Deprecated protected JButton makeMuli_JButton(String text)
makeMuli(AbstractButton,String)
instead.protected <X extends AbstractButton> X makeMuli(X button, String text)
myPanel.add(makeMuli(new JButton(), "$button$text"));
text
- text to translate, in "Mnemomic format": First character is
deleted and its second appearance marks the mnemonic, as in "%e%xit" or "&&File"protected void add_lang_select(String text)
public boolean switchLanguage(String lang)
protected void addMenu()
public void user_requests_documentation()
see also the complete user documentation .