org.vigia.client.gui.view
Class Panel

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 org.vigia.client.gui.view.Panel
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants, View

public class Panel
extends javax.swing.JFrame
implements View

GUI for client

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.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
private  boolean advOptionsVisible
          advOptionsVisible: State of advOptions panel
private  java.awt.event.ActionListener al
          al: Action Listener in controller
private  boolean connectVisible
          connectVisible: State of connect panel
private  int control_port
          control_port: Integer for control port
private  int data_port
          data_port: Integer for data port
private  AdvOptions dialogAdvOptions
          dialogAdvOptions: Dialog for Advanced Options
private  Connect dialogConnect
          dialogConnect: Dialog for Connect
private  ScreenShot dialogScreenShot
          dialogScreenShot: Dialog for Screen Shot
private  ImagePanel imPanel
          imPanel: Image's Panel
private  int ip1
          ip1: First Integer of IP address
private  int ip2
          ip2: Second Integer of IP address
private  int ip3
          ip3: Third Integer of IP address
private  int ip4
          ip4: Fourth Integer of IP address
private  javax.swing.JLabel jL_StatusBar
          jL_StatusBar: Label for status bar
private  javax.swing.JMenu jMenu_File
          jMenu_File: Menu file
private  javax.swing.JMenu jMenu_Help
          jMenu_Help: Menu help
private  javax.swing.JMenu jMenu_Tools
          jMenu_Tools: Menu tools
private  javax.swing.JMenuBar jMenuBar
          jMenuBar: Application's menu bar
private  javax.swing.JMenuItem jMI_About
          jMI_About: Menu item About
private  javax.swing.JMenuItem jMI_Close
          jMI_Close: Menu item Close
private  javax.swing.JMenuItem jMI_Config
          jMI_Config: Menu item Config
private  javax.swing.JMenuItem jMI_Conn
          jMI_Conn: Menu item Connect
private  javax.swing.JMenuItem jMI_Disc
          jMI_Disc: Menu item Disconnect
private  javax.swing.JMenuItem jMI_ScrShot
          jMI_ScrShot: Menu item Screen Shot
private  javax.swing.JMenuItem jMI_ShowLog
          jMI_ShowLog: Menu item Show Log
private  java.lang.String log_file
          log_file: Path to log file
private  Log logDetails
          logDetails: Frame for log details
private  java.lang.String target_dir
          target_dir: Directory for screen shot
 
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 org.vigia.client.gui.view.View
ActCmdADVOPC_CANCEL, ActCmdADVOPC_OK, ActCmdCONN_ADVOPC, ActCmdCONN_CANCEL, ActCmdCONN_OK, ActCmdPANEL_ABOUT, ActCmdPANEL_CLOSE, ActCmdPANEL_CONFIG, ActCmdPANEL_CONN, ActCmdPANEL_DISC, ActCmdPANEL_SCRSHOT, ActCmdPANEL_SHOWLOG, ActCmdSCRSHOT_CANCEL, ActCmdSCRSHOT_OK
 
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
Panel(java.lang.String title, java.lang.String def_ip, java.lang.String def_data_port, java.lang.String def_control_port, java.lang.String def_log_file, java.lang.String def_scrshot_dir)
          Constructor for the Panel
 
Method Summary
 void closeAdvancedConnectionSettingsPanel()
          Close the dialog box to change the advanced setting of the connection.
 void closeConnectToServerPanel()
          Close the dialog box to connect to a server.
 void closeGetScreenShotPanel()
          Close the dialog box for getting a screen shot.
 void controller(Controller ctr)
          Adds the controller ctr to all the buttons of the View
 java.lang.String getControlPort()
          Gets the control port from a dialog box.
 java.lang.String getDataPort()
          Gets the data port from a dialog box.
 java.awt.image.BufferedImage getImage()
          Gets a screenshot of the video.
 java.lang.String getIPServer()
          Gets the IP address of the server from a dialog box.
 java.lang.String getResolution()
          Gets the desired resolution of the screen.
 java.lang.String getScreenShotURL()
          Gets the url where the screenshot will be saved.
 void reloadLog()
          Reloads the log file.
 void setStatusInfo(java.lang.String status)
          Changes the status message.
 boolean showAboutInfo()
          Shows information about the application.
 void showAdvancedConnectionSettingsPanel()
          Shows the dialog box to change the advanced setting of the connection.
 void showConnectToServerPanel()
          Shows the dialog box to connect to a server.
 void showGetScreenShotPanel()
          Shows the dialog box for getting a screen shot.
 boolean showImage(java.awt.image.BufferedImage frame)
          Shows an image in the panel.
 boolean showLog()
          Reads a log file and shows its content in a added window.
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
 
Methods inherited from class java.awt.Frame
addNotify, 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, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setVisible, 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, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, 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, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

ip1

private int ip1
ip1: First Integer of IP address


ip2

private int ip2
ip2: Second Integer of IP address


ip3

private int ip3
ip3: Third Integer of IP address


ip4

private int ip4
ip4: Fourth Integer of IP address


data_port

private int data_port
data_port: Integer for data port


control_port

private int control_port
control_port: Integer for control port


log_file

private java.lang.String log_file
log_file: Path to log file


target_dir

private java.lang.String target_dir
target_dir: Directory for screen shot


connectVisible

private boolean connectVisible
connectVisible: State of connect panel


advOptionsVisible

private boolean advOptionsVisible
advOptionsVisible: State of advOptions panel


jMenuBar

private javax.swing.JMenuBar jMenuBar
jMenuBar: Application's menu bar


jMenu_File

private javax.swing.JMenu jMenu_File
jMenu_File: Menu file


jMenu_Tools

private javax.swing.JMenu jMenu_Tools
jMenu_Tools: Menu tools


jMenu_Help

private javax.swing.JMenu jMenu_Help
jMenu_Help: Menu help


jMI_Conn

private javax.swing.JMenuItem jMI_Conn
jMI_Conn: Menu item Connect


jMI_Disc

private javax.swing.JMenuItem jMI_Disc
jMI_Disc: Menu item Disconnect


jMI_Close

private javax.swing.JMenuItem jMI_Close
jMI_Close: Menu item Close


jMI_Config

private javax.swing.JMenuItem jMI_Config
jMI_Config: Menu item Config


jMI_ScrShot

private javax.swing.JMenuItem jMI_ScrShot
jMI_ScrShot: Menu item Screen Shot


jMI_ShowLog

private javax.swing.JMenuItem jMI_ShowLog
jMI_ShowLog: Menu item Show Log


jMI_About

private javax.swing.JMenuItem jMI_About
jMI_About: Menu item About


imPanel

private ImagePanel imPanel
imPanel: Image's Panel


dialogConnect

private Connect dialogConnect
dialogConnect: Dialog for Connect


dialogAdvOptions

private AdvOptions dialogAdvOptions
dialogAdvOptions: Dialog for Advanced Options


dialogScreenShot

private ScreenShot dialogScreenShot
dialogScreenShot: Dialog for Screen Shot


al

private java.awt.event.ActionListener al
al: Action Listener in controller


logDetails

private Log logDetails
logDetails: Frame for log details


jL_StatusBar

private javax.swing.JLabel jL_StatusBar
jL_StatusBar: Label for status bar

Constructor Detail

Panel

public Panel(java.lang.String title,
             java.lang.String def_ip,
             java.lang.String def_data_port,
             java.lang.String def_control_port,
             java.lang.String def_log_file,
             java.lang.String def_scrshot_dir)
Constructor for the Panel

Parameters:
title - Title of JFrame
def_ip - Default IP
def_data_port - Default data port
def_control_port - Default control port
def_log_file - Default log file
def_scrshot_dir - Default screen shot path
Method Detail

getControlPort

public java.lang.String getControlPort()
                                throws VigiaClientException
Description copied from interface: View
Gets the control port from a dialog box. The control port is used to send commands and receive status messages.

Specified by:
getControlPort in interface View
Returns:
Control port.
Throws:
VigiaClientException - error from the View.
See Also:
View.getControlPort()

getDataPort

public java.lang.String getDataPort()
                             throws VigiaClientException
Description copied from interface: View
Gets the data port from a dialog box. The data port is used to receive the images from the server.

Specified by:
getDataPort in interface View
Returns:
Data port.
Throws:
VigiaClientException - error from the View.
See Also:
View.getDataPort()

getIPServer

public java.lang.String getIPServer()
                             throws VigiaClientException
Description copied from interface: View
Gets the IP address of the server from a dialog box.

Specified by:
getIPServer in interface View
Returns:
IP address.
Throws:
VigiaClientException - error from the View.
See Also:
View.getIPServer()

getImage

public java.awt.image.BufferedImage getImage()
                                      throws VigiaClientException
Description copied from interface: View
Gets a screenshot of the video.

Specified by:
getImage in interface View
Returns:
a frame.
Throws:
VigiaClientException - error from the View.
See Also:
View.getImage()

getResolution

public java.lang.String getResolution()
                               throws VigiaClientException
Description copied from interface: View
Gets the desired resolution of the screen.

Specified by:
getResolution in interface View
Returns:
Resolution in the form AxB.
Throws:
VigiaClientException - error from the View.
See Also:
View.getResolution()

getScreenShotURL

public java.lang.String getScreenShotURL()
                                  throws VigiaClientException
Description copied from interface: View
Gets the url where the screenshot will be saved.

Specified by:
getScreenShotURL in interface View
Returns:
an url.
Throws:
VigiaClientException - error from the View.
See Also:
View.getScreenShotURL()

showAboutInfo

public boolean showAboutInfo()
                      throws VigiaClientException
Description copied from interface: View
Shows information about the application.

Specified by:
showAboutInfo in interface View
Returns:
true if it was successful, false in another case.
Throws:
VigiaClientException - error from the View.
See Also:
View.showAboutInfo()

showImage

public boolean showImage(java.awt.image.BufferedImage frame)
                  throws VigiaClientException
Description copied from interface: View
Shows an image in the panel.

Specified by:
showImage in interface View
Parameters:
frame - the image to show.
Returns:
true if it was successful, false in another case.
Throws:
VigiaClientException - error from the View.
See Also:
View.showImage(java.awt.image.BufferedImage)

showLog

public boolean showLog()
                throws VigiaClientException
Description copied from interface: View
Reads a log file and shows its content in a added window.

Specified by:
showLog in interface View
Returns:
true if it was successful, false in another case.
Throws:
VigiaClientException - error from the View.
See Also:
View.showLog()

controller

public void controller(Controller ctr)
Description copied from interface: View
Adds the controller ctr to all the buttons of the View

Specified by:
controller in interface View
Parameters:
ctr - the controller.
See Also:
View.controller(org.vigia.client.gui.controller.Controller)

showAdvancedConnectionSettingsPanel

public void showAdvancedConnectionSettingsPanel()
                                         throws VigiaClientException
Description copied from interface: View
Shows the dialog box to change the advanced setting of the connection.

Specified by:
showAdvancedConnectionSettingsPanel in interface View
Throws:
VigiaClientException - error from the View.
See Also:
View.showAdvancedConnectionSettingsPanel()

showConnectToServerPanel

public void showConnectToServerPanel()
                              throws VigiaClientException
Description copied from interface: View
Shows the dialog box to connect to a server.

Specified by:
showConnectToServerPanel in interface View
Throws:
VigiaClientException - error from the View.
See Also:
View.showConnectToServerPanel()

showGetScreenShotPanel

public void showGetScreenShotPanel()
                            throws VigiaClientException
Description copied from interface: View
Shows the dialog box for getting a screen shot.

Specified by:
showGetScreenShotPanel in interface View
Throws:
VigiaClientException - error from the View.
See Also:
View.showGetScreenShotPanel()

closeAdvancedConnectionSettingsPanel

public void closeAdvancedConnectionSettingsPanel()
                                          throws VigiaClientException
Description copied from interface: View
Close the dialog box to change the advanced setting of the connection.

Specified by:
closeAdvancedConnectionSettingsPanel in interface View
Throws:
VigiaClientException - error from the View.
See Also:
View.closeAdvancedConnectionSettingsPanel()

closeConnectToServerPanel

public void closeConnectToServerPanel()
                               throws VigiaClientException
Description copied from interface: View
Close the dialog box to connect to a server.

Specified by:
closeConnectToServerPanel in interface View
Throws:
VigiaClientException - error from the View.
See Also:
View.closeConnectToServerPanel()

closeGetScreenShotPanel

public void closeGetScreenShotPanel()
                             throws VigiaClientException
Description copied from interface: View
Close the dialog box for getting a screen shot.

Specified by:
closeGetScreenShotPanel in interface View
Throws:
VigiaClientException - error from the View.
See Also:
View.closeGetScreenShotPanel()

reloadLog

public void reloadLog()
               throws VigiaClientException
Description copied from interface: View
Reloads the log file.

Specified by:
reloadLog in interface View
Throws:
VigiaClientException - error from the View.
See Also:
View.reloadLog()

setStatusInfo

public void setStatusInfo(java.lang.String status)
Description copied from interface: View
Changes the status message.

Specified by:
setStatusInfo in interface View
Parameters:
status - The status message.
See Also:
View.setStatusInfo(String status)