|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--java.awt.Panel | +--java.applet.Applet | +--simulator.Client
This is an abstract class that performe the basic function of a client applet. You must derive this class and implement your personal function. It's important know that your applet and the vrml view must be in the same page to work correct, so the html page will be like this:
<HTML> <HEAD> <TITLE>Client Applet </HEAD> <BODY> <EMBED SRC="World.wrl" WIDTH=400 HEIGHT=300 NAME="wrl"> <APPLET code="MyClient.class" width=511 height=377 MAYSCRIPT> <PARAM name=port value=6472> <PARAM name=host value=localhost> <PARAM name=showRoundTrip value=false> </APPLET> </BODY>
The World.wrl vrml file will be like this:
#VRML V2.0 utf8 DEF World Group { children [ Viewpoint { position 10 30 -10 orientation 1 0 0 -1.5707 description "Up View" }, Viewpoint { position 10,5,10 description "Front View" }, DEF Room Group { children [ Transform { translation 10,0.005,-10 children [ DEF Floor Shape { geometry Box { size 20,.01,20 } } ] } ] } ] }
In this examples was create a world containing a room and a shape, and
two viepoints. You can create all you need using the vrml syntax, but the
DEF world Group {
must be present for the correct use of the
program.
Inner classes inherited from class java.awt.Component |
java.awt.Component.AWTTreeLock |
Field Summary | |
static java.lang.String |
about
This contains an text that shows who has create the client. |
(package private) vrml.external.Browser |
browser
Contains the instance to the Browser class.
|
static java.lang.String |
DEFAULT_HOST
|
static int |
DEFAULT_PORT
|
static boolean |
DEFAULT_SHOWROUNDTRIP
|
protected java.lang.String |
host
This is the string that contains the host information |
static java.util.Random |
idGen
Create a new random number generator. |
protected int |
istance_ID
The identifier ID of current instance |
protected Listener |
listener
Contains the instance of Listener class |
static int |
MAX_CHARS
Max number of char that the TextArea may contain.
|
protected int |
maxChars
|
(package private) java.util.Hashtable |
nodesList
Contains a list of vrml nodes add to the VRML browser |
protected int |
port
Contains the port number used by the socket |
protected java.lang.String |
remote_name
Contains the information like 'login@machine' |
protected java.net.Socket |
s
Contains the socket to comunicate with the server |
(package private) java.awt.Checkbox |
showRoundTripCheck
This is the control to choose if you want to show the RTT. |
protected boolean |
showRoundTripInitial
Indicate if a RTT will be visible |
protected java.util.Hashtable |
tableMFNode
Contains the tokens available for MFNode VRML field |
protected java.util.Hashtable |
tableSFBool
Contains the tokens available for SFBool VRML field |
protected java.util.Hashtable |
tableSFColor
Contains the tokens available for SFColor VRML field |
protected java.util.Hashtable |
tableSFFloat
Contains the tokens available for SFFloat VRML field |
protected java.util.Hashtable |
tableSFInt32
Contains the tokens available for SFInt32 VRML field |
protected java.util.Hashtable |
tableSFNode
Contains the tokens available for SFNode VRML field |
protected java.util.Hashtable |
tableSFRotation
Contains the tokens available for SFRotation VRML field |
protected java.util.Hashtable |
tableSFTime
Contains the tokens available for SFTime VRML field |
protected java.util.Hashtable |
tableSFVec2f
Contains the tokens available for SFVec2f VRML field |
protected java.util.Hashtable |
tableSFVec3f
Contains the tokens available for SFVec3F VRML field |
(package private) java.awt.Label |
typePrompt
This Label is used with the TextField and it
used only by graphicAppletInit method. |
protected Typist |
typist
Contains the instance of Typist class |
(package private) java.awt.TextArea |
winAll
This is the area used to write the information that the server send us. |
(package private) java.awt.TextField |
winLocal
This is the control used to insert information to send to the server. |
Fields inherited from class java.applet.Applet |
serialVersionUID,
stub |
Fields inherited from class java.awt.Panel |
base,
nameCounter,
serialVersionUID |
Fields inherited from class java.awt.Container |
component,
containerListener,
containerSerializedDataVersion,
dispatcher,
layoutMgr,
maxSize,
ncomponents,
serialVersionUID |
Fields inherited from class java.awt.Component |
actionListenerK,
adjustmentListenerK,
appContext,
assert,
background,
BOTTOM_ALIGNMENT,
CENTER_ALIGNMENT,
changeSupport,
componentListener,
componentListenerK,
componentOrientation,
componentSerializedDataVersion,
containerListenerK,
cursor,
dropTarget,
enabled,
eventMask,
focusListener,
focusListenerK,
font,
foreground,
hasFocus,
height,
incRate,
inputMethodListener,
inputMethodListenerK,
isInc,
isPacked,
itemListenerK,
keyListener,
keyListenerK,
LEFT_ALIGNMENT,
locale,
LOCK,
minSize,
mouseListener,
mouseListenerK,
mouseMotionListener,
mouseMotionListenerK,
name,
nameExplicitlySet,
newEventsOnly,
ownedWindowK,
parent,
peer,
peerFont,
popups,
prefSize,
RIGHT_ALIGNMENT,
serialVersionUID,
textListenerK,
TOP_ALIGNMENT,
valid,
visible,
width,
windowListenerK,
x,
y |
Constructor Summary | |
(package private) |
Client()
|
Method Summary | |
protected void |
buildFieldTable()
Builds the tables used to find rapidally if a field is of VRML type |
void |
cleanUp()
Clean all the active processes before exiting |
void |
destroy()
destroy() |
void |
finalize()
finalize() |
java.lang.String |
getAppletInfo()
return the information about the autor of the client |
java.lang.String[][] |
getParameterInfo()
Specify the type of parameter that the applet want |
void |
graphAppletInit()
Initilize graphic object in the applet. |
void |
init()
Initialize the applet. |
void |
insertText(java.lang.String t)
Insert a text in the applet text window and resize it if buffer length is over maxChars chars. |
boolean |
keyUp(java.awt.Event e,
int key)
If RETURN key was pressed, the contents of TextArea is send
to the server. |
void |
paint(java.awt.Graphics g)
Draw a graphics message about server connection not available |
void |
runCommand(java.lang.String s)
Parse a string command send by server for executing some commands to the virtual world and to the relative structures. |
void |
start()
this method activate a connection with the server, then initilize the graph of the applet and last activate the >threads Listener and Typist |
void |
stop()
This is called by the applet when it stops |
Methods inherited from class java.applet.Applet |
getAppletContext,
getAudioClip,
getAudioClip,
getCodeBase,
getDocumentBase,
getImage,
getImage,
getLocale,
getParameter,
isActive,
newAudioClip,
play,
play,
resize,
resize,
setStub,
showStatus |
Methods inherited from class java.awt.Panel |
|
Methods inherited from class java.awt.Container |
add,
add,
add,
add,
add,
addContainerListener,
addImpl,
applyOrientation,
countComponents,
deliverEvent,
dispatchEventImpl,
dispatchEventToSelf,
doLayout,
eventEnabled,
findComponentAt,
findComponentAt,
getAlignmentX,
getAlignmentY,
getComponent,
getComponentAt,
getComponentAt,
getComponentCount,
getComponents_NoClientCode,
getComponents,
getInsets,
getLayout,
getMaximumSize,
getMinimumSize,
getMouseEventTarget,
getPreferredSize,
getWindow,
initIDs,
insets,
invalidate,
invalidateTree,
isAncestorOf,
layout,
lightweightPrint,
list,
list,
locate,
minimumSize,
nextFocus,
paintComponents,
paramString,
postProcessKeyEvent,
postsOldMouseEvents,
preferredSize,
preProcessKeyEvent,
print,
printComponents,
printOneComponent,
processContainerEvent,
processEvent,
proxyEnableEvents,
proxyRequestFocus,
readObject,
remove,
remove,
removeAll,
removeContainerListener,
removeNotify,
setFocusOwner,
setFont,
setLayout,
transferFocus,
update,
validate,
validateTree,
writeObject |
Methods inherited from class java.awt.Component |
action,
add,
addComponentListener,
addFocusListener,
addInputMethodListener,
addKeyListener,
addMouseListener,
addMouseMotionListener,
addPropertyChangeListener,
addPropertyChangeListener,
areInputMethodsEnabled,
bounds,
checkImage,
checkImage,
coalesceEvents,
contains,
contains,
createImage,
createImage,
disable,
disableEvents,
dispatchEvent,
enable,
enable,
enableEvents,
enableInputMethods,
firePropertyChange,
getBackground,
getBounds,
getBounds,
getColorModel,
getComponentOrientation,
getCursor,
getDropTarget,
getFont_NoClientCode,
getFont,
getFontMetrics,
getForeground,
getGraphics,
getHeight,
getInputContext,
getInputMethodRequests,
getLocation,
getLocation,
getLocationOnScreen,
getName,
getNativeContainer,
getParent_NoClientCode,
getParent,
getPeer,
getSize,
getSize,
getToolkit,
getToolkitImpl,
getTreeLock,
getWidth,
getWindowForObject,
getX,
getY,
gotFocus,
handleEvent,
hasFocus,
hide,
imageUpdate,
inside,
isDisplayable,
isDoubleBuffered,
isEnabled,
isEnabledImpl,
isFocusTraversable,
isLightweight,
isOpaque,
isShowing,
isValid,
isVisible,
keyDown,
list,
list,
list,
location,
lostFocus,
mouseDown,
mouseDrag,
mouseEnter,
mouseExit,
mouseMove,
mouseUp,
move,
nextFocus,
paintAll,
postEvent,
prepareImage,
prepareImage,
printAll,
processComponentEvent,
processFocusEvent,
processInputMethodEvent,
processKeyEvent,
processMouseEvent,
processMouseMotionEvent,
remove,
removeComponentListener,
removeFocusListener,
removeInputMethodListener,
removeKeyListener,
removeMouseListener,
removeMouseMotionListener,
removePropertyChangeListener,
removePropertyChangeListener,
repaint,
repaint,
repaint,
repaint,
requestFocus,
reshape,
setBackground,
setBounds,
setBounds,
setComponentOrientation,
setCursor,
setDropTarget,
setEnabled,
setForeground,
setLocale,
setLocation,
setLocation,
setName,
setSize,
setSize,
setVisible,
show,
show,
size,
toString,
transferFocus |
Methods inherited from class java.lang.Object |
clone,
equals,
getClass,
hashCode,
notify,
notifyAll,
registerNatives,
wait,
wait,
wait |
Field Detail |
public static java.lang.String about
init
method.public static final int DEFAULT_PORT
public static final java.lang.String DEFAULT_HOST
public static final boolean DEFAULT_SHOWROUNDTRIP
public static final int MAX_CHARS
TextArea may contain.
After this value the old will be cut from the head
public static java.util.Random idGen
protected Listener listener
Listener
classprotected Typist typist
Typist
classprotected int port
protected java.lang.String host
protected int maxChars
protected java.net.Socket s
protected java.lang.String remote_name
protected int istance_ID
protected boolean showRoundTripInitial
java.awt.TextField winLocal
java.awt.Label typePrompt
Label
is used with the TextField
and it
used only by graphicAppletInit
method.java.awt.TextArea winAll
java.awt.Checkbox showRoundTripCheck
showRoundTripInitial
correctly.vrml.external.Browser browser
Browser
class.
This class is used to comunicate between your applet and an
VRML browser only if these are in the same HTML page.java.util.Hashtable nodesList
protected java.util.Hashtable tableSFVec3f
protected java.util.Hashtable tableSFColor
protected java.util.Hashtable tableSFRotation
protected java.util.Hashtable tableSFFloat
protected java.util.Hashtable tableSFBool
protected java.util.Hashtable tableSFVec2f
protected java.util.Hashtable tableSFNode
protected java.util.Hashtable tableMFNode
protected java.util.Hashtable tableSFTime
protected java.util.Hashtable tableSFInt32
Constructor Detail |
Client()
Method Detail |
public java.lang.String[][] getParameterInfo()
public java.lang.String getAppletInfo()
public void init()
public void destroy()
public void finalize() throws java.lang.Throwable
public void graphAppletInit()
TextField
and TextArea
, and optionally the
CheckBox
for RTT.public void start()
Listener
and TypistListener
,
Typist
public void stop()
public void cleanUp()
public boolean keyUp(java.awt.Event e, int key)
TextArea
is send
to the server. This type of solution is deprecated but it is not
converted to actual solution becouse when the >Swing become real in
SUN JDK 1.2, some features of Client class probably will to be adapted
to the new filosofy again.e
- the event that occurskey
- the key pressedpublic void paint(java.awt.Graphics g)
g
- the window of applet where draw in graphicspublic void insertText(java.lang.String t)
maxChars
chars.t
- the string to insert in windowprotected void buildFieldTable()
public void runCommand(java.lang.String s)
Available commands are:
s
- the text string with command
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |