org.vigia.client.gui
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.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
           
private  java.awt.event.ActionListener al
           
private  boolean connectVisible
           
private  int control_port
           
private  int data_port
           
private  AdvOptions dialogAdvOptions
           
private  Connect dialogConnect
           
private  ScreenShot dialogScreenShot
           
private  java.lang.String error_file
           
private  ImagePanel imPanel
           
private  int ip1
           
private  int ip2
           
private  int ip3
           
private  int ip4
           
private  javax.swing.JMenu jMenu_File
           
private  javax.swing.JMenu jMenu_Help
           
private  javax.swing.JMenu jMenu_Tools
           
private  javax.swing.JMenuBar jMenuBar
           
private  javax.swing.JMenuItem jMI_About
           
private  javax.swing.JMenuItem jMI_Close
           
private  javax.swing.JMenuItem jMI_Config
           
private  javax.swing.JMenuItem jMI_Conn
           
private  javax.swing.JMenuItem jMI_Disc
           
private  javax.swing.JMenuItem jMI_ScrShot
           
private  javax.swing.JMenuItem jMI_ShowDetails
           
private  javax.swing.JMenuItem jMI_ShowErrors
           
private  java.lang.String log_file
           
private  Log logDetails
           
private  Log logErrors
           
private  java.lang.String target_dir
           
 
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
ActCmdADVOPC_CANCEL, ActCmdADVOPC_OK, ActCmdCONN_ADVOPC, ActCmdCONN_CANCEL, ActCmdCONN_OK, ActCmdPANEL_ABOUT, ActCmdPANEL_CLOSE, ActCmdPANEL_CONFIG, ActCmdPANEL_CONN, ActCmdPANEL_DISC, ActCmdPANEL_SCRSHOT, ActCmdPANEL_SHOWDET, ActCmdPANEL_SHOWERR, 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_error_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(java.awt.event.ActionListener 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.
 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.
 boolean showErrors()
          Reads an error file and shows its content in a added window.
 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

ip2

private int ip2

ip3

private int ip3

ip4

private int ip4

data_port

private int data_port

control_port

private int control_port

log_file

private java.lang.String log_file

error_file

private java.lang.String error_file

target_dir

private java.lang.String target_dir

connectVisible

private boolean connectVisible

advOptionsVisible

private boolean advOptionsVisible

jMenuBar

private javax.swing.JMenuBar jMenuBar

jMenu_File

private javax.swing.JMenu jMenu_File

jMenu_Tools

private javax.swing.JMenu jMenu_Tools

jMenu_Help

private javax.swing.JMenu jMenu_Help

jMI_Conn

private javax.swing.JMenuItem jMI_Conn

jMI_Disc

private javax.swing.JMenuItem jMI_Disc

jMI_Close

private javax.swing.JMenuItem jMI_Close

jMI_Config

private javax.swing.JMenuItem jMI_Config

jMI_ScrShot

private javax.swing.JMenuItem jMI_ScrShot

jMI_ShowErrors

private javax.swing.JMenuItem jMI_ShowErrors

jMI_ShowDetails

private javax.swing.JMenuItem jMI_ShowDetails

jMI_About

private javax.swing.JMenuItem jMI_About

imPanel

private ImagePanel imPanel

dialogConnect

private Connect dialogConnect

dialogAdvOptions

private AdvOptions dialogAdvOptions

dialogScreenShot

private ScreenShot dialogScreenShot

al

private java.awt.event.ActionListener al

logDetails

private Log logDetails

logErrors

private Log logErrors
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_error_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_error_file - Default error file
def_scrshot_dir - Default screenshot 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()

showErrors

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

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

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(java.awt.event.ActionListener 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(java.awt.event.ActionListener ctr)

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()