com.myjavaworld.jftp
Class JFTP

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 com.myjavaworld.gui.MFrame
                          extended by com.myjavaworld.jftp.JFTP
All Implemented Interfaces:
ActionListener, WindowListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, ChangeListener, RootPaneContainer, WindowConstants

public class JFTP
extends MFrame
implements WindowListener, ActionListener, ChangeListener

The main window that contains various menu items, tool bar and manages various FTP sessions.

Version:
2.0
Author:
Sai Pullabhotla, psai [at] jMethods [dot] com
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JFrame
JFrame.AccessibleJFrame
 
Nested classes/interfaces inherited from class java.awt.Frame
Frame.AccessibleAWTFrame
 
Nested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
static File DATA_HOME
           
static JFTPPreferences prefs
           
static File USER_HOME
           
 
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
JFTP()
          Creates an instance of JFTP, the main window and the central point for the software.
JFTP(boolean applet)
           
 
Method Summary
 void actionPerformed(ActionEvent evt)
           
 void closeSession()
           
 void exit()
          Closes JFTP
static String getClientClassName(String clientName)
          Returns the client class name given the name of the client implementation.
static String getClientName(String clientClassName)
          Returns the name of the implementation given the class name.
 FTPSession getCurrentSession()
          Returns the currently selected session.
static String[] getInstalledClients()
          Gets the installed FTP client implementations.
static String[] getInstalledParsers()
          Returns an array of installed list parsers
static String[] getInstalledThemes()
          Returns all the installed theme names
static String getParserClassName(String parserName)
          Returns the class name of the List Parser, given the name of the parser
static String getParserName(String parserClassName)
          Returns the parser name given the parser class name
static String getThemeClassName(String themeName)
          Returns the class name implementing the given theme name
static JFTPPreferences loadPreferences()
          Loads the preferences by reading them from the file.
 void newSession()
          Creates a new FTP session
static void savePreferences(JFTPPreferences prefs)
          Serializes and saves the preferences to a file in the USER_HOME directory.
 void showAboutDialog()
           
 void showPreferencesDialog()
           
 void stateChanged(ChangeEvent evt)
           
 void updateSessionTitle(FTPSession session)
           
 void updateToolBar()
          Updates the state of various actions(menu items/toolbar buttons) based on the currently selected FTP session.
 void windowActivated(WindowEvent evt)
           
 void windowClosed(WindowEvent evt)
           
 void windowClosing(WindowEvent evt)
           
 void windowDeactivated(WindowEvent evt)
           
 void windowDeiconified(WindowEvent evt)
           
 void windowIconified(WindowEvent evt)
           
 void windowOpened(WindowEvent evt)
           
 
Methods inherited from class com.myjavaworld.gui.MFrame
setBusy
 
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, paint, 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, 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

USER_HOME

public static final File USER_HOME

DATA_HOME

public static final File DATA_HOME

prefs

public static JFTPPreferences prefs
Constructor Detail

JFTP

public JFTP()
Creates an instance of JFTP, the main window and the central point for the software.


JFTP

public JFTP(boolean applet)
Method Detail

newSession

public void newSession()
Creates a new FTP session


windowOpened

public void windowOpened(WindowEvent evt)
Specified by:
windowOpened in interface WindowListener

windowActivated

public void windowActivated(WindowEvent evt)
Specified by:
windowActivated in interface WindowListener

windowDeactivated

public void windowDeactivated(WindowEvent evt)
Specified by:
windowDeactivated in interface WindowListener

windowIconified

public void windowIconified(WindowEvent evt)
Specified by:
windowIconified in interface WindowListener

windowDeiconified

public void windowDeiconified(WindowEvent evt)
Specified by:
windowDeiconified in interface WindowListener

windowClosing

public void windowClosing(WindowEvent evt)
Specified by:
windowClosing in interface WindowListener

windowClosed

public void windowClosed(WindowEvent evt)
Specified by:
windowClosed in interface WindowListener

stateChanged

public void stateChanged(ChangeEvent evt)
Specified by:
stateChanged in interface ChangeListener

closeSession

public void closeSession()

exit

public void exit()
Closes JFTP


actionPerformed

public void actionPerformed(ActionEvent evt)
Specified by:
actionPerformed in interface ActionListener

showPreferencesDialog

public void showPreferencesDialog()

getCurrentSession

public FTPSession getCurrentSession()
Returns the currently selected session.

Returns:
Currently selected session

savePreferences

public static void savePreferences(JFTPPreferences prefs)
                            throws IOException
Serializes and saves the preferences to a file in the USER_HOME directory.

Parameters:
prefs - Preferences
Throws:
IOException - if an IO error occurs

loadPreferences

public static JFTPPreferences loadPreferences()
                                       throws IOException
Loads the preferences by reading them from the file. If the file is not found, all preferences are set to their default values and they will be stored in the file.

Throws:
IOException - if an IO error occurs

getInstalledThemes

public static String[] getInstalledThemes()
Returns all the installed theme names

Returns:
An array of strings containing the installed theme names.

getThemeClassName

public static String getThemeClassName(String themeName)
Returns the class name implementing the given theme name

Parameters:
themeName - Name of the theme
Returns:
Class name of the theme

getInstalledParsers

public static String[] getInstalledParsers()
Returns an array of installed list parsers

Returns:
Installed List parser names

getParserClassName

public static String getParserClassName(String parserName)
Returns the class name of the List Parser, given the name of the parser

Parameters:
parserName - Name of the list parser
Returns:
Class name implementing the list parser

getParserName

public static String getParserName(String parserClassName)
Returns the parser name given the parser class name

Parameters:
parserClassName - Class name of the list parser
Returns:
Name of the list parser

getInstalledClients

public static String[] getInstalledClients()
Gets the installed FTP client implementations.

Returns:
Installed FTP client implementations

getClientClassName

public static String getClientClassName(String clientName)
Returns the client class name given the name of the client implementation.

Parameters:
clientName - name of the FTP client implementation
Returns:
Class name implementing the FTP client interface

getClientName

public static String getClientName(String clientClassName)
Returns the name of the implementation given the class name.

Parameters:
clientClassName - Class name
Returns:
Name of the FTP client implementation

updateSessionTitle

public void updateSessionTitle(FTPSession session)

showAboutDialog

public void showAboutDialog()

updateToolBar

public void updateToolBar()
Updates the state of various actions(menu items/toolbar buttons) based on the currently selected FTP session.



Copyright © 2000-2012 jMethods, Inc.. All Rights Reserved.