bass.crawler
Class ServerGui

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 bass.crawler.ServerGui
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants

public class ServerGui
extends javax.swing.JFrame

quick GUI for crawler server

Version:
0.1
Author:
Thomas Klein
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
private  int bandIdErrors
           
private  boolean buttonPressed
           
private  java.awt.event.ActionListener cf_listen
           
private  javax.swing.JList connectedClients
           
private  java.awt.event.ActionListener cp_listen
           
private  javax.swing.JButton crawlFriends
           
private  int crawlmode
           
private  javax.swing.JButton crawlProfiles
           
private  javax.swing.JButton crawlSearch
           
private  java.awt.event.ActionListener cs_listen
           
private  int currentBandIdCount
           
private  int currentSearchPage
           
private  int currentSearchPageErrors
           
private  java.awt.event.ActionListener exit_listen
           
private  ServerGui gui
           
private  javax.swing.JLabel label_errors
           
private  javax.swing.JLabel label_Mode
           
private  javax.swing.JLabel label_progress
           
private  javax.swing.JFileChooser loadFile
           
private  java.awt.event.ActionListener loadFList_listen
           
private  java.awt.event.ActionListener loadProfile_listen
           
private  java.awt.event.ActionListener loadSearch_listen
           
private  javax.swing.JEditorPane log
           
private  javax.swing.JScrollPane logPane
           
private  int maxBandIds
           
private  int maxSearchPages
           
private  javax.swing.JMenuBar menu
           
private  javax.swing.JMenu mFile
           
private  javax.swing.JMenuItem miExit
           
private  javax.swing.JMenuItem miLoadFList
           
private  javax.swing.JMenuItem miLoadProfile
           
private  javax.swing.JMenuItem miLoadSearch
           
private  javax.swing.JMenuItem miSaveLog
           
private  javax.swing.JMenu mLoadLog
           
 int MODE_FRIENDS
           
 int MODE_PROFILE
           
 int MODE_SEARCH
           
private  java.io.File openFile
           
private  javax.swing.JProgressBar progressBar
           
private  java.awt.event.ActionListener save_listen
           
 
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
ServerGui()
           
 
Method Summary
 int getCrawlmode()
           
 java.io.File getOpenFile()
          returns a opened logile, if one IS opened, otherwise null
 void increaseBandIdErrors()
           
 void increaseCurrentBandIdCount()
           
 void increaseCurrentSearchPage()
           
 void increaseCurrentSearchPageErrors()
           
private  void installWindowListener()
          installs listener for handling window closing
 boolean isButtonPressed()
           
private  java.io.File loadFile()
           
 void printToLog(java.lang.String text)
          appends the text to the log-window-output
private  void setAllButtons(boolean toWhat)
          enables / disables crawlmode buttons
 void setConnectedClients(java.util.LinkedList<DTO_Client> clients)
          sets the connected clients to the list
 void setMaxBandIds(int maxBandIds)
           
 void setMaxSearchPages(int maxSearchPages)
           
 
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, setTitle, 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

gui

private ServerGui gui

log

private javax.swing.JEditorPane log

maxSearchPages

private int maxSearchPages

currentSearchPage

private int currentSearchPage

currentSearchPageErrors

private int currentSearchPageErrors

maxBandIds

private int maxBandIds

currentBandIdCount

private int currentBandIdCount

bandIdErrors

private int bandIdErrors

logPane

private javax.swing.JScrollPane logPane

crawlSearch

private javax.swing.JButton crawlSearch

crawlFriends

private javax.swing.JButton crawlFriends

crawlProfiles

private javax.swing.JButton crawlProfiles

buttonPressed

private boolean buttonPressed

MODE_SEARCH

public final int MODE_SEARCH
See Also:
Constant Field Values

MODE_FRIENDS

public final int MODE_FRIENDS
See Also:
Constant Field Values

MODE_PROFILE

public final int MODE_PROFILE
See Also:
Constant Field Values

crawlmode

private int crawlmode

progressBar

private javax.swing.JProgressBar progressBar

label_Mode

private javax.swing.JLabel label_Mode

label_progress

private javax.swing.JLabel label_progress

label_errors

private javax.swing.JLabel label_errors

connectedClients

private javax.swing.JList connectedClients

menu

private javax.swing.JMenuBar menu

mFile

private javax.swing.JMenu mFile

miSaveLog

private javax.swing.JMenuItem miSaveLog

miExit

private javax.swing.JMenuItem miExit

mLoadLog

private javax.swing.JMenu mLoadLog

miLoadSearch

private javax.swing.JMenuItem miLoadSearch

miLoadFList

private javax.swing.JMenuItem miLoadFList

miLoadProfile

private javax.swing.JMenuItem miLoadProfile

loadFile

private javax.swing.JFileChooser loadFile

openFile

private java.io.File openFile

cs_listen

private java.awt.event.ActionListener cs_listen

cf_listen

private java.awt.event.ActionListener cf_listen

cp_listen

private java.awt.event.ActionListener cp_listen

save_listen

private java.awt.event.ActionListener save_listen

exit_listen

private java.awt.event.ActionListener exit_listen

loadSearch_listen

private java.awt.event.ActionListener loadSearch_listen

loadFList_listen

private java.awt.event.ActionListener loadFList_listen

loadProfile_listen

private java.awt.event.ActionListener loadProfile_listen
Constructor Detail

ServerGui

public ServerGui()
Method Detail

installWindowListener

private void installWindowListener()
installs listener for handling window closing


increaseBandIdErrors

public void increaseBandIdErrors()

increaseCurrentBandIdCount

public void increaseCurrentBandIdCount()

increaseCurrentSearchPage

public void increaseCurrentSearchPage()

increaseCurrentSearchPageErrors

public void increaseCurrentSearchPageErrors()

setMaxBandIds

public void setMaxBandIds(int maxBandIds)

setMaxSearchPages

public void setMaxSearchPages(int maxSearchPages)

printToLog

public void printToLog(java.lang.String text)
appends the text to the log-window-output

Parameters:
text - the text to append

isButtonPressed

public boolean isButtonPressed()
Returns:
returns true if a crawlmode was selected

setAllButtons

private void setAllButtons(boolean toWhat)
enables / disables crawlmode buttons

Parameters:
toWhat - true to enable all, false to disable

getCrawlmode

public int getCrawlmode()
Returns:
current crawlmode (int) MODE_SEARCH / FRIENDS / PROFILE etc ..

setConnectedClients

public void setConnectedClients(java.util.LinkedList<DTO_Client> clients)
sets the connected clients to the list

Parameters:
clients - LinkedList of DTO_Client's

loadFile

private java.io.File loadFile()
Returns:
the file from the JFileChooser(LoadFile) used for logfile reading

getOpenFile

public java.io.File getOpenFile()
returns a opened logile, if one IS opened, otherwise null

Returns:
the openFile