apps
Class Apps

Show UML class diagram
java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by apps.Apps
All Implemented Interfaces:
WindowListener, ImageObserver, MenuContainer, PropertyChangeListener, Serializable, EventListener, Accessible
Direct Known Subclasses:
CornwallRR, DecoderPro, DispatcherPro, InstallTest, JMRIdemo, LocoTools, PacketPro, PacketScript, PanelPro, SignalPro, SoundPro

public class Apps
extends JPanel
implements PropertyChangeListener, WindowListener

Base class for Jmri applications.

See Also:
Serialized Form

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
(package private) static JComponent _buttonSpace
           
(package private) static JComponent _jynstrumentSpace
           
protected static boolean configDeferredLoadOK
           
(package private) static String configFilename
           
protected static boolean configOK
           
(package private)  ConnectionConfig[] connection
           
(package private)  JLabel cs4
           
(package private)  JLabel cs5
           
(package private)  JLabel cs6
           
(package private)  JLabel cs7
           
(package private) static boolean debugFired
           
(package private) static AWTEventListener debugListener
           
(package private) static boolean debugmsg
           
(package private) static org.slf4j.Logger log
           
(package private) static boolean log4JSetUp
           
(package private) static String nameString
           
(package private) static AppConfigBase prefs
           
(package private)  Action prefsAction
           
protected static ResourceBundle rb
           
(package private) static SplashWindow sp
           
 
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
Apps(JFrame frame)
           
 
Method Summary
protected  void addToActionModel()
           
protected  void buildLine(ConnectionConfig conn, JLabel cs, JPanel pane)
           
protected  void buildLine4(JPanel pane)
           
protected  void buildLine5(JPanel pane)
           
protected  void buildLine6(JPanel pane)
           
protected  void buildLine7(JPanel pane)
           
static JComponent buttonSpace()
          Provide access to a place where applications can expect the configuration code to build run-time buttons.
protected static void createFrame(Apps containedPane, JFrame frame)
           
protected  void createMenus(JMenuBar menuBar, WindowInterface wi)
          Create default menubar.
protected  void debugMenu(JMenuBar menuBar, WindowInterface wi)
           
protected  void developmentMenu(JMenuBar menuBar, WindowInterface wi)
           
 void doPreferences()
           
protected  void editMenu(JMenuBar menuBar, WindowInterface wi)
           
protected  void fileMenu(JMenuBar menuBar, WindowInterface wi)
           
static String getConfigFileName()
           
static String getConnection1()
          Deprecated. as of 2.13.3, directly access the connection configuration from the instance list jmri.InstanceManager.configureManagerInstance().getInstanceList(jmri.jmrix.ConnectionConfig.class)
static String getConnection2()
          Deprecated. as of 2.13.3, directly access the connection configuration from the instance list jmri.InstanceManager.configureManagerInstance().getInstanceList(jmri.jmrix.ConnectionConfig.class)
static String getConnection3()
          Deprecated. as of 2.13.3, directly access the connection configuration from the instance list jmri.InstanceManager.configureManagerInstance().getInstanceList(jmri.jmrix.ConnectionConfig.class)
static String getConnection4()
          Deprecated. as of 2.13.3, directly access the connection configuration from the instance list jmri.InstanceManager.configureManagerInstance().getInstanceList(jmri.jmrix.ConnectionConfig.class)
static AppConfigBase getPrefs()
           
static Boolean handleQuit()
          The application decided to quit, handle that.
static Boolean handleRestart()
          The application decided to restart, handle that.
protected  void helpMenu(JMenuBar menuBar, WindowInterface wi)
           
protected static void initLog4J()
           
protected  String line1()
           
protected  String line2()
           
protected  String line3()
           
protected  String line8()
           
protected  String line9()
           
protected static void loadFile(String name)
           
protected  String logo()
           
protected  String mainWindowHelpID()
          Returns the ID for the main window's help, which is application specific
protected  void operationsMenu(JMenuBar menuBar, WindowInterface wi)
           
protected  void panelMenu(JMenuBar menuBar, WindowInterface wi)
           
 void propertyChange(PropertyChangeEvent ev)
           
protected  void rosterMenu(JMenuBar menuBar, WindowInterface wi)
           
protected  void scriptMenu(JMenuBar menuBar, WindowInterface wi)
           
protected static void setApplication(String name)
           
protected  void setButtonSpace()
          Prepare the JPanel to contain buttons in the startup GUI.
protected static void setConfigFilename(String def, String[] args)
          Set up the configuration file name at startup.
protected static void setJmriSystemProperty(String key, String value)
           
protected  void setJynstrumentSpace()
           
protected  void setPrefsFrameHelp(JmriJFrame f, String l)
          Set the location of the window-specific help for the preferences pane.
protected static void splash(boolean show)
           
protected static void splash(boolean show, boolean debug)
           
protected static JPanel splashDebugMsg()
           
protected static void startupDebug()
           
static String startupInfo(String program)
           
protected  JPanel statusPanel()
          Fill in the logo and status panel
protected  void systemsMenu(JMenuBar menuBar, WindowInterface wi)
          Show only active systems in the menu bar.
protected  void toolsMenu(JMenuBar menuBar, WindowInterface wi)
           
protected  void updateLine(ConnectionConfig conn, JLabel cs)
           
 void windowActivated(WindowEvent e)
           
 void windowClosed(WindowEvent e)
           
 void windowClosing(WindowEvent e)
          Closing the main window is a shutdown request
 void windowDeactivated(WindowEvent e)
           
 void windowDeiconified(WindowEvent e)
           
 void windowIconified(WindowEvent e)
           
 void windowOpened(WindowEvent e)
           
static void ynstrument(String path)
           
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_jynstrumentSpace

static JComponent _jynstrumentSpace

prefsAction

Action prefsAction

cs4

JLabel cs4

cs5

JLabel cs5

cs6

JLabel cs6

cs7

JLabel cs7

connection

ConnectionConfig[] connection

_buttonSpace

static JComponent _buttonSpace

rb

protected static ResourceBundle rb

prefs

static AppConfigBase prefs

sp

static SplashWindow sp

debugListener

static AWTEventListener debugListener

debugFired

static boolean debugFired

debugmsg

static boolean debugmsg

log4JSetUp

static boolean log4JSetUp

configFilename

static String configFilename

configOK

protected static boolean configOK

configDeferredLoadOK

protected static boolean configDeferredLoadOK

nameString

static String nameString

log

static org.slf4j.Logger log
Constructor Detail

Apps

public Apps(JFrame frame)
Method Detail

addToActionModel

protected final void addToActionModel()

setButtonSpace

protected void setButtonSpace()
Prepare the JPanel to contain buttons in the startup GUI. Since it's possible to add buttons via the preferences, this space may have additional buttons appended to it later. The default implementation here just creates an empty space for these to be added to.


setJynstrumentSpace

protected void setJynstrumentSpace()

ynstrument

public static void ynstrument(String path)

createMenus

protected void createMenus(JMenuBar menuBar,
                           WindowInterface wi)
Create default menubar.

This does not include the development menu.

Parameters:
menuBar -
wi -

fileMenu

protected void fileMenu(JMenuBar menuBar,
                        WindowInterface wi)

doPreferences

public void doPreferences()

setPrefsFrameHelp

protected void setPrefsFrameHelp(JmriJFrame f,
                                 String l)
Set the location of the window-specific help for the preferences pane. Made a separate method so if can be overridden for application specific preferences help


editMenu

protected void editMenu(JMenuBar menuBar,
                        WindowInterface wi)

toolsMenu

protected void toolsMenu(JMenuBar menuBar,
                         WindowInterface wi)

operationsMenu

protected void operationsMenu(JMenuBar menuBar,
                              WindowInterface wi)

rosterMenu

protected void rosterMenu(JMenuBar menuBar,
                          WindowInterface wi)

panelMenu

protected void panelMenu(JMenuBar menuBar,
                         WindowInterface wi)

systemsMenu

protected void systemsMenu(JMenuBar menuBar,
                           WindowInterface wi)
Show only active systems in the menu bar.

Alternately, you might want to do

    menuBar.add(new jmri.jmrix.SystemsMenu());
 

Parameters:
menuBar -
wi -

debugMenu

protected void debugMenu(JMenuBar menuBar,
                         WindowInterface wi)

scriptMenu

protected void scriptMenu(JMenuBar menuBar,
                          WindowInterface wi)

developmentMenu

protected void developmentMenu(JMenuBar menuBar,
                               WindowInterface wi)

helpMenu

protected void helpMenu(JMenuBar menuBar,
                        WindowInterface wi)

mainWindowHelpID

protected String mainWindowHelpID()
Returns the ID for the main window's help, which is application specific


line1

protected String line1()

line2

protected String line2()

line3

protected String line3()

buildLine4

protected void buildLine4(JPanel pane)

buildLine5

protected void buildLine5(JPanel pane)

buildLine6

protected void buildLine6(JPanel pane)

buildLine7

protected void buildLine7(JPanel pane)

buildLine

protected void buildLine(ConnectionConfig conn,
                         JLabel cs,
                         JPanel pane)

updateLine

protected void updateLine(ConnectionConfig conn,
                          JLabel cs)

line8

protected String line8()

line9

protected String line9()

logo

protected String logo()

statusPanel

protected JPanel statusPanel()
Fill in the logo and status panel

Returns:
Properly-filled out JPanel

windowClosing

public void windowClosing(WindowEvent e)
Closing the main window is a shutdown request

Specified by:
windowClosing in interface WindowListener

windowActivated

public void windowActivated(WindowEvent e)
Specified by:
windowActivated in interface WindowListener

windowClosed

public void windowClosed(WindowEvent e)
Specified by:
windowClosed in interface WindowListener

windowDeactivated

public void windowDeactivated(WindowEvent e)
Specified by:
windowDeactivated in interface WindowListener

windowDeiconified

public void windowDeiconified(WindowEvent e)
Specified by:
windowDeiconified in interface WindowListener

windowIconified

public void windowIconified(WindowEvent e)
Specified by:
windowIconified in interface WindowListener

windowOpened

public void windowOpened(WindowEvent e)
Specified by:
windowOpened in interface WindowListener

setJmriSystemProperty

protected static void setJmriSystemProperty(String key,
                                            String value)

buttonSpace

public static JComponent buttonSpace()
Provide access to a place where applications can expect the configuration code to build run-time buttons.

Returns:
null if no such space exists
See Also:
CreateButtonPanel

getPrefs

public static AppConfigBase getPrefs()

getConnection1

@Deprecated
public static String getConnection1()
Deprecated. as of 2.13.3, directly access the connection configuration from the instance list jmri.InstanceManager.configureManagerInstance().getInstanceList(jmri.jmrix.ConnectionConfig.class)


getConnection2

@Deprecated
public static String getConnection2()
Deprecated. as of 2.13.3, directly access the connection configuration from the instance list jmri.InstanceManager.configureManagerInstance().getInstanceList(jmri.jmrix.ConnectionConfig.class)


getConnection3

@Deprecated
public static String getConnection3()
Deprecated. as of 2.13.3, directly access the connection configuration from the instance list jmri.InstanceManager.configureManagerInstance().getInstanceList(jmri.jmrix.ConnectionConfig.class)


getConnection4

@Deprecated
public static String getConnection4()
Deprecated. as of 2.13.3, directly access the connection configuration from the instance list jmri.InstanceManager.configureManagerInstance().getInstanceList(jmri.jmrix.ConnectionConfig.class)


splash

protected static void splash(boolean show)

splash

protected static void splash(boolean show,
                             boolean debug)

splashDebugMsg

protected static JPanel splashDebugMsg()

startupDebug

protected static void startupDebug()

handleQuit

public static Boolean handleQuit()
The application decided to quit, handle that.


handleRestart

public static Boolean handleRestart()
The application decided to restart, handle that.


initLog4J

protected static void initLog4J()

setConfigFilename

protected static void setConfigFilename(String def,
                                        String[] args)
Set up the configuration file name at startup.

The Configuration File name variable holds the name used to load the configuration file during later startup processing. Applications invoke this method to handle the usual startup hierarchy:

This name will be used for reading and writing the preferences. It need not exist when the program first starts up. This name may be proceeded with config= and may not contain the equals sign (=).

Parameters:
def - Default value if no other is provided
args - Argument array from the main routine

getConfigFileName

public static String getConfigFileName()

createFrame

protected static void createFrame(Apps containedPane,
                                  JFrame frame)

loadFile

protected static void loadFile(String name)

startupInfo

public static String startupInfo(String program)

setApplication

protected static void setApplication(String name)

propertyChange

public void propertyChange(PropertyChangeEvent ev)
Specified by:
propertyChange in interface PropertyChangeListener


Copyright © 1997-2013 JMRI Community.
JMRI, DecoderPro, PanelPro, SoundPro, DispatcherPro and associated logos are our trademarks.

Additional information on copyright, trademarks and licenses is linked here.
Site hosted by: Get JMRI Model Railroad Interface at SourceForge.net. Fast, secure and Free Open Source software downloads