|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectewe.data.DataObject
ewe.data.LiveObject
ewe.net.SocketMaker
This can interactively create a Socket or ServerSocket for connection to a server or client.
| Field Summary | |
static String |
AnyHostName
|
boolean |
canSelectType
This allows users to select the type of connection. |
String |
hostName
The name of the host to connect to. |
static int |
INFRA_RED
This should be used with the "type" member. |
boolean |
isServer
This says whether a ServerSocket is to be created. |
static int |
LOCAL_SOCKET
This should be used with the "type" member. |
int |
port
The port number to connect to. |
static int |
REMOTE_SERVICE
This should be used with the "type" member. |
static int |
REMOTE_SOCKET
This should be used with the "type" member. |
String |
serviceName
Use this if you want to connect to a remote service (via the RemoteConnection) or a providing a remote service. |
int |
timeout
This is the timeout time in seconds to wait for a successful connection. |
String |
title
This is the title of the form that is displayed if you are doing an interactive connection. |
int |
type
By default this is LOCAL_SOCKET |
| Constructor Summary | |
SocketMaker(int type,
boolean isServer,
String title)
Creates a SocketMaker with the specified type, wether it is a server and the title of the dialog box if it is displayed. |
|
| Method Summary | |
void |
action(String fieldName,
Editor f)
This gets called by action(FieldTransfer ft,Editor ed) and by fieldChanged(FieldTransfer ft,Editor ed) if the field changed is a menu item. |
void |
addToPanel(CellPanel cp,
Editor f,
int which)
Override this to provide the user interface for editing the Object. |
void |
fieldChanged(FieldTransfer ft,
Editor f)
This implements the fieldChanged() method in FieldListener. |
Handle |
getClientServerConnection(Frame parent,
int options,
boolean showCancel)
|
Socket |
getConnection(boolean showSelectBox,
boolean showCancel)
This gets a fully connected Socket. |
Socket |
getConnection(Frame parent,
int options,
boolean showCancel)
This is the same as the other getConnection() except it will execute the select connection dialog box with the specified parent and options (e.g. |
Socket |
getConnection(ServerSocket ss,
Frame parent,
boolean showCancel,
int timeoutInSeconds)
This waits for an incoming connection on the ServerSocket for the timeout period (given in seconds). |
String |
getError()
This MAY return additional information if there was an error during socket creation. |
Object |
getSocket(boolean showSelectBox,
boolean showCancel)
This is used to get either a Socket or ServerSocket using the parameters setup for this SocketMaker. |
Object |
getSocket(Frame parent,
int options,
boolean showCancel)
This is the same as the other getSocket() except it will execute the dialog box with the specified parent and options (e.g. |
Object[] |
getTwoWayConnection(boolean showSelectBox)
|
Handle |
getTwoWayConnection(boolean showSelectBox,
boolean showCancel)
|
Handle |
getTwoWayConnection(Frame parent,
int options,
boolean showCancel)
|
Object |
makeClientServerConnection(Frame parent,
int options,
boolean showCancel)
|
static Object |
makeInfraRedConnection(int port,
int timeoutInSeconds,
boolean showCancel)
|
static Socket[] |
pipe()
This method creates two Sockets on the local host connected together. |
boolean |
showInitialFrame(Frame parent,
int options)
|
| Methods inherited from class ewe.data.LiveObject |
action, addMeToPanel, addObjectToPanel, decode, decoded, decodeFields, enableEditorScrolling, encode, encoded, encodeFields, fieldChanged, fieldEvent, getEditor, getEditorScroller, getIcon, getName, input, makeNewEditor, runAsApp, textDecode, textEncode |
| Methods inherited from class ewe.data.DataObject |
_getSetField, appendAllFields, compareTo, copied, copyFrom, equals, getCopy, getDeclaredField, getDeclaredFieldValue, getDeclaredFieldValue, getFieldList, getFieldList, getMyFieldList, getNew |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, toString |
| Methods inherited from interface ewe.data.DataUnit |
copyFrom, getNew |
| Methods inherited from interface ewe.util.Copyable |
getCopy |
| Methods inherited from interface ewe.util.Comparable |
compareTo |
| Field Detail |
public static final int LOCAL_SOCKET
public static final int INFRA_RED
public static final int REMOTE_SERVICE
public static final int REMOTE_SOCKET
public int type
public static String AnyHostName
public String hostName
public int port
public String serviceName
public boolean isServer
public int timeout
public String title
public boolean canSelectType
| Constructor Detail |
public SocketMaker(int type,
boolean isServer,
String title)
| Method Detail |
public String getError()
public void addToPanel(CellPanel cp,
Editor f,
int which)
LiveObject
addToPanel in class LiveObject
public void fieldChanged(FieldTransfer ft,
Editor f)
LiveObjectIf the field is of type ewe.ui.MenuItem then the method action(String name,Editor ed) is called with the "name" parameter being set to the "action" member of the selected MenuItem.
Otherwise the fieldChanged(String fieldName,Editor ed) method is called with the fieldName of the FieldTransfer object.
fieldChanged in interface FieldListenerfieldChanged in class LiveObjectft - The FieldTransfer object representing the changed field.f - The Editor from which the event came.
public void action(String fieldName,
Editor f)
LiveObject
action in class LiveObject
public Object getSocket(boolean showSelectBox,
boolean showCancel)
The method will return a Socket (isServer is false) or a ServerSocket (isServer is true) or null if the socket could not be created or if the user canceled the operation.
public boolean showInitialFrame(Frame parent,
int options)
public Object[] getTwoWayConnection(boolean showSelectBox)
public Handle getTwoWayConnection(boolean showSelectBox,
boolean showCancel)
public Handle getTwoWayConnection(Frame parent,
int options,
boolean showCancel)
public static Object makeInfraRedConnection(int port,
int timeoutInSeconds,
boolean showCancel)
throws IOException
IOException
public Object makeClientServerConnection(Frame parent,
int options,
boolean showCancel)
throws IOException
IOException
public Handle getClientServerConnection(Frame parent,
int options,
boolean showCancel)
public Object getSocket(Frame parent,
int options,
boolean showCancel)
public Socket getConnection(ServerSocket ss,
Frame parent,
boolean showCancel,
int timeoutInSeconds)
public Socket getConnection(boolean showSelectBox,
boolean showCancel)
public Socket getConnection(Frame parent,
int options,
boolean showCancel)
public static Socket[] pipe()
throws IOException
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||