bass.gui
Class StartupScreen

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by javax.swing.JWindow
                  extended by bass.gui.StartupScreen
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.RootPaneContainer

public class StartupScreen
extends javax.swing.JWindow

The Splash Screen for the Gui, this screen is shown as long as starting up the app takes, if the programm is run for the first time you might see this screen for a while because the db needs to be set up etc.

Show this screen in the GUI by simply calling its constructor and waiting till isStarting up returns false

Version:
0.1
Author:
Thomas Klein
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JWindow
javax.swing.JWindow.AccessibleJWindow
 
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
(package private)  int bandDBLines
           
private  java.awt.Color bgDarkBlue
           
private  java.awt.Color bgLightBlue
           
private  javax.swing.JPanel content
           
private  boolean error
           
private  java.lang.String errorMsg
           
(package private)  int friendDBLines
           
private  javax.swing.JPanel header
           
private  javax.swing.JLabel headerText
           
private  boolean isStartingUp
           
private  javax.swing.JEditorPane log
           
private  java.awt.Image logo
           
private  javax.swing.JScrollPane logSP
           
private  javax.swing.JProgressBar progress
           
private static long serialVersionUID
           
 
Fields inherited from class javax.swing.JWindow
accessibleContext, rootPane, rootPaneCheckingEnabled
 
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
StartupScreen()
          creates and starts the startup screen (SPLASH) and starts a StartupThread
 
Method Summary
 void appendToLog(java.lang.String msg)
          appends the msg to the log window
 int getBandDBLines()
           
 int getFriendDBLines()
           
 void increaseProgress(int incremental)
          increases the current progress with the given value
note that max progress is 5000 + dbBandLines + dbFriendLines
 boolean isError()
           
 boolean isStartingUp()
           
 void setError(java.lang.String errorMSG)
          sets the error boolean to true, and saves the error MSG
 void setStartingUp(boolean isStartingUp)
           
 
Methods inherited from class javax.swing.JWindow
addImpl, createRootPane, getAccessibleContext, getContentPane, getGlassPane, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, remove, setContentPane, setGlassPane, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update, windowInit
 
Methods inherited from class java.awt.Window
addNotify, addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, finalize, 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, processWindowEvent, 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, removeNotify, 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, remove, 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
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

isStartingUp

private boolean isStartingUp

error

private boolean error

content

private javax.swing.JPanel content

bgLightBlue

private java.awt.Color bgLightBlue

bgDarkBlue

private java.awt.Color bgDarkBlue

progress

private javax.swing.JProgressBar progress

log

private javax.swing.JEditorPane log

logSP

private javax.swing.JScrollPane logSP

errorMsg

private java.lang.String errorMsg

header

private javax.swing.JPanel header

headerText

private javax.swing.JLabel headerText

bandDBLines

int bandDBLines

friendDBLines

int friendDBLines

logo

private java.awt.Image logo
Constructor Detail

StartupScreen

public StartupScreen()
creates and starts the startup screen (SPLASH) and starts a StartupThread

Method Detail

isStartingUp

public boolean isStartingUp()
Returns:
true if the startup process is still running

setStartingUp

public void setStartingUp(boolean isStartingUp)
Parameters:
isStartingUp - true if startup process is running, false as soon as the process is finished

increaseProgress

public void increaseProgress(int incremental)
increases the current progress with the given value
note that max progress is 5000 + dbBandLines + dbFriendLines

Parameters:
incremental - the value to add to the progress

appendToLog

public void appendToLog(java.lang.String msg)
appends the msg to the log window

Parameters:
msg - the message to add

isError

public boolean isError()
Returns:
the error

setError

public void setError(java.lang.String errorMSG)
sets the error boolean to true, and saves the error MSG

Parameters:
error - the error to set

getBandDBLines

public int getBandDBLines()
Returns:
the bandDBLines

getFriendDBLines

public int getFriendDBLines()
Returns:
the friendDBLines