socks
Class SocksDialog

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Window
                    |
                    +--java.awt.Dialog
                          |
                          +--socks.SocksDialog

public class SocksDialog
extends java.awt.Dialog
implements java.awt.event.WindowListener, java.awt.event.ItemListener, java.awt.event.ActionListener, java.lang.Runnable

Socks configuration dialog.
Class which provides GUI means of getting Proxy configuration from the user.

See Also:
Serialized Form

Field Summary
static boolean useThreads
          Wether to resolve addresses in separate thread.
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
SocksDialog(java.awt.Frame parent)
          Creates SOCKS configuration dialog.
Uses default initialisation:
Proxy host: socks-proxy
Proxy port: 1080
Version: 5
SocksDialog(java.awt.Frame parent, Proxy init_proxy)
          Creates SOCKS configuration dialog and initialises it to given proxy.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent ae)
           
 Proxy getProxy()
          Displays SOCKS configuartion dialog.
 Proxy getProxy(Proxy p)
          Initialises dialog to given proxy and displays SOCKS configuartion dialog.
 void itemStateChanged(java.awt.event.ItemEvent ie)
           
 void run()
          Resolves proxy address in other thread, to avoid annoying blocking in GUI thread.
 void windowActivated(java.awt.event.WindowEvent e)
           
 void windowClosed(java.awt.event.WindowEvent e)
           
 void windowClosing(java.awt.event.WindowEvent e)
           
 void windowDeactivated(java.awt.event.WindowEvent e)
           
 void windowDeiconified(java.awt.event.WindowEvent e)
           
 void windowIconified(java.awt.event.WindowEvent e)
           
 void windowOpened(java.awt.event.WindowEvent e)
           
 
Methods inherited from class java.awt.Dialog
addNotify, dispose, getTitle, hide, isModal, isResizable, setModal, setResizable, setTitle, show
 
Methods inherited from class java.awt.Window
addWindowListener, applyResourceBundle, applyResourceBundle, getFocusOwner, getInputContext, getLocale, getOwnedWindows, getOwner, getToolkit, getWarningString, isShowing, pack, postEvent, removeWindowListener, setCursor, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, remove, remove, removeAll, removeContainerListener, removeNotify, setFont, setLayout, update, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, disable, dispatchEvent, enable, enable, enableInputMethods, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

useThreads

public static boolean useThreads
Wether to resolve addresses in separate thread.

Default value is true, however on some JVMs, namely one from the Microsoft, it doesn't want to work properly, separate thread can't close the dialog opened in GUI thread, and everuthing else is then crashes.

When setting this variable to false, SocksDialog will block while trying to look up proxy host, and if this takes considerable amount of time it might be annoying to user.

Constructor Detail

SocksDialog

public SocksDialog(java.awt.Frame parent)
Creates SOCKS configuration dialog.
Uses default initialisation:
Proxy host: socks-proxy
Proxy port: 1080
Version: 5

SocksDialog

public SocksDialog(java.awt.Frame parent,
                   Proxy init_proxy)
Creates SOCKS configuration dialog and initialises it to given proxy.
Method Detail

getProxy

public Proxy getProxy()
Displays SOCKS configuartion dialog.

Returns initialised proxy object, or null if user cancels dialog by either pressing Cancel or closing the dialog window.


getProxy

public Proxy getProxy(Proxy p)
Initialises dialog to given proxy and displays SOCKS configuartion dialog.

Returns initialised proxy object, or null if user cancels dialog by either pressing Cancel or closing the dialog window.


windowActivated

public void windowActivated(java.awt.event.WindowEvent e)
Specified by:
windowActivated in interface java.awt.event.WindowListener

windowDeactivated

public void windowDeactivated(java.awt.event.WindowEvent e)
Specified by:
windowDeactivated in interface java.awt.event.WindowListener

windowOpened

public void windowOpened(java.awt.event.WindowEvent e)
Specified by:
windowOpened in interface java.awt.event.WindowListener

windowClosing

public void windowClosing(java.awt.event.WindowEvent e)
Specified by:
windowClosing in interface java.awt.event.WindowListener

windowClosed

public void windowClosed(java.awt.event.WindowEvent e)
Specified by:
windowClosed in interface java.awt.event.WindowListener

windowIconified

public void windowIconified(java.awt.event.WindowEvent e)
Specified by:
windowIconified in interface java.awt.event.WindowListener

windowDeiconified

public void windowDeiconified(java.awt.event.WindowEvent e)
Specified by:
windowDeiconified in interface java.awt.event.WindowListener

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent ae)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent ie)
Specified by:
itemStateChanged in interface java.awt.event.ItemListener

run

public void run()
Resolves proxy address in other thread, to avoid annoying blocking in GUI thread.
Specified by:
run in interface java.lang.Runnable