mavis
Class Mavis

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Frame
                  extended by javax.swing.JFrame
                      extended by mavis.Mavis
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants

public class Mavis
extends javax.swing.JFrame

Starts the program. Lays out MainViewPanel, MainMenuBar and MainStatusBar in a JFrame.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
 
Nested classes/interfaces inherited from class java.awt.Frame
java.awt.Frame.AccessibleAWTFrame
 
Nested classes/interfaces inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static java.lang.String APP_BUILD
           
static java.lang.String APP_HOME_PAGE
           
static java.lang.String APP_NAME
           
static java.lang.String APP_VERSION
           
static java.lang.String[] AUTHORS
           
static java.lang.String[] AUTHORS_NEW
           
static java.io.File CALIBRATION_PROJECT_DIR
           
static java.io.File CONFIG_DIR
           
static java.io.File DEBUG_LOG_DIR
           
static java.io.File DEBUG_LOG_FILE
           
static java.lang.String FILE_DESCRIPTION
           
static java.lang.String FILE_TYPE
           
static java.lang.String HELP_PAGES
           
static java.lang.String PROGRAM_JAR_NAME
           
static java.io.File PROPERTIES_FILE
           
static java.io.File STARTUP_DIRECTORY
           
 
Fields inherited from class javax.swing.JFrame
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Frame
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
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
Mavis(Project project)
          Starts the user interface of the program.
 
Method Summary
private static void logDirCleanup(java.io.File directory, int maxDays)
          Removes all old files from the specified directory.
private static void logFileCleanup(java.io.File logFile, long maxLength, int maxFiles)
          Removes the old entries of a log file.
static void main(java.lang.String[] args)
          Starts the program with the provided command line parameters.
 void setTitle(java.lang.String title)
          Sets the title of the program.
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Frame
addNotify, finalize, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setUndecorated
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setAlwaysOnTop, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationByPlatform, setLocationRelativeTo, show, toBack, toFront
 
Methods inherited from class java.awt.Container
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, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, 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, isOpaque, 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, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

APP_NAME

public static final java.lang.String APP_NAME
See Also:
Constant Field Values

APP_VERSION

public static final java.lang.String APP_VERSION
See Also:
Constant Field Values

APP_BUILD

public static final java.lang.String APP_BUILD
See Also:
Constant Field Values

APP_HOME_PAGE

public static final java.lang.String APP_HOME_PAGE
See Also:
Constant Field Values

FILE_TYPE

public static final java.lang.String FILE_TYPE
See Also:
Constant Field Values

FILE_DESCRIPTION

public static final java.lang.String FILE_DESCRIPTION
See Also:
Constant Field Values

AUTHORS

public static final java.lang.String[] AUTHORS

AUTHORS_NEW

public static final java.lang.String[] AUTHORS_NEW

STARTUP_DIRECTORY

public static final java.io.File STARTUP_DIRECTORY

PROGRAM_JAR_NAME

public static final java.lang.String PROGRAM_JAR_NAME
See Also:
Constant Field Values

CONFIG_DIR

public static final java.io.File CONFIG_DIR

PROPERTIES_FILE

public static final java.io.File PROPERTIES_FILE

CALIBRATION_PROJECT_DIR

public static final java.io.File CALIBRATION_PROJECT_DIR

DEBUG_LOG_DIR

public static final java.io.File DEBUG_LOG_DIR

DEBUG_LOG_FILE

public static final java.io.File DEBUG_LOG_FILE

HELP_PAGES

public static final java.lang.String HELP_PAGES
Constructor Detail

Mavis

public Mavis(Project project)
      throws java.awt.HeadlessException
Starts the user interface of the program.

Parameters:
project - a project to be opened when the program starts, or null to open no project.
Throws:
java.awt.HeadlessException - if GraphicsEnvironment.isHeadless() returns true.
Method Detail

main

public static void main(java.lang.String[] args)
Starts the program with the provided command line parameters. If the location of a project file is given as a parameter, the program will try to load it.

Parameters:
args - command line parameters.

logFileCleanup

private static void logFileCleanup(java.io.File logFile,
                                   long maxLength,
                                   int maxFiles)
Removes the old entries of a log file. When the maximum size for the current log file is reached, it will be renamed to file.1, file.2 and so on.

Parameters:
logFile - the log file to be cleaned.
maxLength - maximum size in bytes for an individual log file.
maxFiles - maximum number of log files. When the number is reached, the oldest file will be deleted.

logDirCleanup

private static void logDirCleanup(java.io.File directory,
                                  int maxDays)
Removes all old files from the specified directory.

Parameters:
directory - the directory from which the old files will be removed.
maxDays - the maximum age for the files in days.

setTitle

public void setTitle(java.lang.String title)
Sets the title of the program. Appends the name and version of the program with the supplied parameter.

Overrides:
setTitle in class java.awt.Frame
Parameters:
title - the text to be shown in the title, or null to show only the program's name and version.