|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
Netmonitor
Netmonitor is the main class and it is responsible for managing the SQL calls and creating the data objects. It initializes a MapFrame object which acts as Nemo's main GUI window. All classes who needs data from the database calls the respective method in this class, which starts a new thread that performs the SQL query. When the SQL thread finishes, the data is used to build objects that are passed on to other classes.
MapFrame
,
Serialized FormNested Class Summary | |
(package private) class |
Netmonitor.AnimationFrame
Class holding lists of point and line statistics. |
(package private) class |
Netmonitor.AnimationQueue
Fifo circular buffer that holds animation frames. |
(package private) class |
Netmonitor.FrameConsumer
|
(package private) class |
Netmonitor.FrameProducer
|
(package private) class |
Netmonitor.SQLquery
|
(package private) class |
Netmonitor.ThreadCoordinator
|
Nested classes inherited from class javax.swing.JFrame |
javax.swing.JFrame.AccessibleJFrame |
Nested classes inherited from class java.awt.Frame |
java.awt.Frame.AccessibleAWTFrame |
Nested classes inherited from class java.awt.Window |
java.awt.Window.AccessibleAWTWindow |
Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
private boolean |
animating
|
private Netmonitor.AnimationQueue |
animationQueue
|
private boolean |
autoUpdateLoad
|
private Netmonitor.AnimationFrame |
currentAnimationFrame
|
private NetworkElement |
currentNetwork
|
private boolean |
doneFetchingMaps
|
private boolean |
doneFetchingStats
|
private static int |
EQ_STATS
|
private Netmonitor.FrameConsumer |
frameConsumer
|
private Netmonitor.FrameProducer |
frameProducer
|
private static int |
LINE_STATS
|
private static int |
LINES
|
private static int |
LINEURL
|
private static int |
LINEVALUE_STATS
|
private MapFrame |
mapFrame
|
private static int |
MAPS
|
private javax.swing.DefaultListModel |
networkList
|
private static int |
NETWORKS
|
private static int |
POINT_STATS
|
private static int |
POINTS
|
private static int |
POINTURL
|
private java.sql.Connection |
SQLconnection
|
private static int |
STATISTICS
|
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.Window |
|
Fields inherited from class java.awt.Container |
|
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 | |
Netmonitor()
Creates new form Netmonitor |
Method Summary | |
void |
addStatistic(StatisticElement statElement)
Adds a statistic to the list of chosen statistics in the current network. |
void |
checkAvailableStatistics(int stepSize)
|
void |
connectSQLdatabase(java.lang.String databaseURL,
java.lang.String username,
java.lang.String password)
Connects to the SQL database given in the databaseURL argument. |
void |
createEquipmentStatistics(java.sql.ResultSet rs)
|
void |
createLineElements(java.sql.ResultSet rs)
|
void |
createLineStatistics(java.sql.ResultSet rs)
|
void |
createLineURL(java.sql.ResultSet rs)
|
void |
createLineValueStatistics(java.sql.ResultSet rs)
|
void |
createMapElements(java.sql.ResultSet rs)
|
void |
createNetworkElements(java.sql.ResultSet rs)
|
void |
createPointElements(java.sql.ResultSet rs)
|
void |
createPointStatistics(java.sql.ResultSet rs)
|
void |
createPointURL(java.sql.ResultSet rs)
|
void |
createStatisticElements(java.sql.ResultSet rs)
|
boolean |
getAutoUpdateLoad()
|
NetworkElement |
getCurrentNetwork()
Returns the current network. |
void |
handleSQLResult(int queryid,
java.sql.ResultSet rs)
|
void |
init(java.lang.String dbname,
java.lang.String username,
java.lang.String password,
java.lang.String networkString,
java.lang.String mapString,
java.lang.String lineColourString,
java.lang.String lineSizeString,
java.lang.String pointColourString,
java.lang.String pointSizeString)
Takes all the command-line parameters as arguments and uses them to select a network, map or statistic. |
private void |
initComponents()
This method is called from within the constructor to initialize the form. |
static void |
main(java.lang.String[] args)
Execution of Nemo starts here. |
java.lang.String |
parseEquipmentStatQuery(StatisticElement.PointSQLTable table,
java.util.Date date,
PointElement pointElement,
StatisticElement statElement)
|
java.lang.String |
parseLineStatQuery(StatisticElement.LineSQLTable table,
java.util.Date date,
MapElement mapElement,
StatisticElement statElement)
|
java.lang.String |
parseLineValueStatQuery(StatisticElement.LineSQLTable table,
java.util.Date date,
LineElement lineElement,
StatisticElement statElement)
|
java.lang.String |
parsePointStatQuery(StatisticElement.PointSQLTable table,
java.util.Date date,
MapElement mapElement,
StatisticElement statElement)
|
void |
retrieveEquipmentStatistics(java.util.Date date,
int stepSize,
PointElement pointElement)
|
void |
retrieveLineURL(LineElement lineElement)
|
void |
retrieveLineValueStatistics(java.util.Date date,
int stepSize,
LineElement lineElement)
|
void |
retrieveMap(MapElement mapElement)
Creates SQLqueries that asks for the image of the map to be retrieved, and all the lines and points belonging to the map. |
void |
retrieveMapList()
Creates a new SQLquery thread that asks for all the maps that belongs to the current network. |
void |
retrievePointURL(PointElement pointElement)
|
void |
retrieveStatisticList()
Creates a new SQLquery thread that asks for all the statistics that belongs to the current network. |
void |
retrieveStatistics(java.util.Date date,
int stepSize)
Tells the FrameProducer and FrameConsumer objects that a new frame is requested. |
void |
setCurrentNetwork(NetworkElement network)
Sets the current network to the networkelement given in the argument. |
void |
setMaxBufferSize(int size)
|
void |
stop()
Disconnects from sql database. |
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, 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, setIconImage, 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, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, 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, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setFocusTraversalKeys, setFocusTraversalPolicy, 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, 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, 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, isOpaque, 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, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, 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 |
private NetworkElement currentNetwork
private javax.swing.DefaultListModel networkList
private MapFrame mapFrame
private boolean autoUpdateLoad
private boolean doneFetchingMaps
private boolean doneFetchingStats
private boolean animating
private java.sql.Connection SQLconnection
private Netmonitor.AnimationFrame currentAnimationFrame
private Netmonitor.AnimationQueue animationQueue
private Netmonitor.FrameProducer frameProducer
private Netmonitor.FrameConsumer frameConsumer
private static final int MAPS
private static final int POINTS
private static final int LINES
private static final int POINT_STATS
private static final int LINE_STATS
private static final int NETWORKS
private static final int STATISTICS
private static final int POINTURL
private static final int LINEURL
private static final int EQ_STATS
private static final int LINEVALUE_STATS
Constructor Detail |
public Netmonitor()
Method Detail |
private void initComponents()
public void init(java.lang.String dbname, java.lang.String username, java.lang.String password, java.lang.String networkString, java.lang.String mapString, java.lang.String lineColourString, java.lang.String lineSizeString, java.lang.String pointColourString, java.lang.String pointSizeString)
networkString
- name of the network to be selected at startupmapString
- name of the map to be selected at startuplineColourString
- name of the statistic used to represent the linecolour at startuplineSizeString
- name of the statistic used to represent the linesize at startuppointColourString
- name of the statistic used to represent the pointcolour at startuppointSizeString
- name of the statistic used to represent the pointsize at startuppublic static void main(java.lang.String[] args)
public void connectSQLdatabase(java.lang.String databaseURL, java.lang.String username, java.lang.String password)
databaseURL
- the location of the database.username
- the username to log into the database with.password
- the password to log into the database with.public void setCurrentNetwork(NetworkElement network)
network
- a NetworkElement that will be used as the current network.public NetworkElement getCurrentNetwork()
public void addStatistic(StatisticElement statElement)
statElement
- a StatisticElement to be added to the list of chosen statistics.public void retrieveMapList()
public void retrieveStatisticList()
public void retrieveMap(MapElement mapElement)
mapElement
- the map to be retrieved.public void retrieveStatistics(java.util.Date date, int stepSize)
date
- the date the statistic is from.stepSize
- the size of the steps in time between each recorded measure point. E.g. 5 minutes, 1 hour, 1 day.public java.lang.String parsePointStatQuery(StatisticElement.PointSQLTable table, java.util.Date date, MapElement mapElement, StatisticElement statElement)
public java.lang.String parseLineStatQuery(StatisticElement.LineSQLTable table, java.util.Date date, MapElement mapElement, StatisticElement statElement)
public void retrieveEquipmentStatistics(java.util.Date date, int stepSize, PointElement pointElement)
public java.lang.String parseEquipmentStatQuery(StatisticElement.PointSQLTable table, java.util.Date date, PointElement pointElement, StatisticElement statElement)
public void retrievePointURL(PointElement pointElement)
public void retrieveLineURL(LineElement lineElement)
public void retrieveLineValueStatistics(java.util.Date date, int stepSize, LineElement lineElement)
public java.lang.String parseLineValueStatQuery(StatisticElement.LineSQLTable table, java.util.Date date, LineElement lineElement, StatisticElement statElement)
public void checkAvailableStatistics(int stepSize)
public void handleSQLResult(int queryid, java.sql.ResultSet rs)
public void createMapElements(java.sql.ResultSet rs)
public void createPointElements(java.sql.ResultSet rs)
public void createLineElements(java.sql.ResultSet rs)
public void createStatisticElements(java.sql.ResultSet rs)
public void createPointStatistics(java.sql.ResultSet rs)
public void createLineStatistics(java.sql.ResultSet rs)
public void createEquipmentStatistics(java.sql.ResultSet rs)
public void createLineValueStatistics(java.sql.ResultSet rs)
public void createNetworkElements(java.sql.ResultSet rs)
public void createPointURL(java.sql.ResultSet rs)
public void createLineURL(java.sql.ResultSet rs)
public void setMaxBufferSize(int size)
public void stop()
public boolean getAutoUpdateLoad()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |