Class Descartes

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Panel
                    |
                    +--java.applet.Applet
                          |
                          +--com.mja.descartes.Descartes
                                |
                                +--Descartes

public class Descartes
extends com.mja.descartes.Descartes


Method Summary
 void about()
          Displays the "about" or Copyright dialog box.
 void add3DGraph(java.lang.String s)
          Adds a new 3D graphic object.
 void addAux(java.lang.String s)
          Adds a new auxiliar object.
 void addControl(java.lang.String s)
          Adds a new control object.
 void addGraph(java.lang.String s)
          Adds a new graphic object.
 void addSpace(java.lang.String s)
          Adds a new space object.
 void clear()
          Cleans the screen form any traces left by graphs.
 void delete3DGraph(java.lang.String num)
          Deletes the num-th 3D graphic object.
 void deleteAux(java.lang.String num)
          Deletes the num-th auxiliar object.
 void deleteControl(java.lang.String num)
          Deletes the num-th control object.
 void deleteGraph(java.lang.String num)
          Deletes the num-th graphic object.
 void deleteSpace(java.lang.String num)
          Deletes the num-th space object.
 void edit()
          Opens the configuration editor window.
 java.lang.String get3DGraph(java.lang.String num)
          Returns the num-th 3D graphic configuration String.
 java.lang.String getAnimation()
          Returns the animation configuration String.
 java.lang.String getAux(java.lang.String num)
          Returns the num-th auxiliar configuration String.
 java.lang.String getCode()
          Returns the applet configuration i.e. the html code that defines the applet configuration.
 java.lang.String getControl(java.lang.String num)
          Returns the num-th control configuration String.
 java.lang.String getGraph(java.lang.String num)
          Returns the num-th graphic configuration String.
 java.lang.String getHTMLEncodedCode()
          Returns the applet configuration i.e. the html code that defines the applet configuration using the standard HTML encoding of accents and "foreign" characters.
 java.lang.String getSpace(java.lang.String num)
          Returns the num-th space configuration String.
 void initAnimation()
          Initializes the animation.
 void original()
          Recovers the original configuration, i.e. the one provided by the applet parameters.
 void refresh()
          Refresheds the scene.
 void remove3DGraphs()
          Removes all 3D graphic objects from the configuration.
 void removeAnimation()
          Removes the animation.
 void removeAux()
          Removes all auxiliar objects from the configuration.
 void removeControls()
          Removes all numerical and graphics controls from the configuration.
 void removeGraphs()
          Removes all graphic objects from the configuration.
 void removeSpaces()
          Removes all spaces from the configuration.
 void replace3DGraph(java.lang.String num, java.lang.String s)
          Replaces the num-th 3D graphic object.
 void replaceAux(java.lang.String num, java.lang.String s)
          Replaces the num-th auxiliar object.
 void replaceControl(java.lang.String num, java.lang.String s)
          Replaces the num control object.
 void replaceGraph(java.lang.String num, java.lang.String s)
          Replaces the num-th graphic object.
 void replaceSpace(java.lang.String num, java.lang.String s)
          Replaces the num space object.
 void setAnimation(java.lang.String s)
          Defines a new animation.
 void setButtons(java.lang.String s)
          Sets the configuration of the buttons.
 void setSpace(java.lang.String s)
          Sets the configuration of the Descartes space.
 void start()
          Starts the applet.
 void stop()
          Stops the applet.
 void toggleAnimation()
          Continues or pauses animation.
Method Detail

start

public void start()
Starts the applet.
If called when the applet is running then it re-starts.

Overrides:
start in class com.mja.descartes.Descartes

stop

public void stop()
Stops the applet.
Disposes external controls window and edit window.

Overrides:
stop in class com.mja.descartes.Descartes

about

public void about()
Displays the "about" or Copyright dialog box.

Overrides:
about in class com.mja.descartes.Descartes

clear

public void clear()
Cleans the screen form any traces left by graphs.
It doesn't change parameter or auxiliary values.
The function may be called while the animation is running.

Overrides:
clear in class com.mja.descartes.Descartes

refresh

public void refresh()
Refresheds the scene.
This method redraws the scene without cleaning the trace left by moving graphs.

Overrides:
refresh in class com.mja.descartes.Descartes

original

public void original()
Recovers the original configuration, i.e. the one provided by the applet parameters.


toggleAnimation

public void toggleAnimation()
Continues or pauses animation.
If the animation has not started starts it.
If the animation is running it puts it in "pause" mode.
If the animation is in "pause" mode then it continues running.

Overrides:
toggleAnimation in class com.mja.descartes.Descartes

initAnimation

public void initAnimation()
Initializes the animation.
It works both on a paused or a running animation.

Overrides:
initAnimation in class com.mja.descartes.Descartes

edit

public void edit()
Opens the configuration editor window.

Overrides:
edit in class com.mja.descartes.Descartes

setButtons

public void setButtons(java.lang.String s)
Sets the configuration of the buttons.

Parameters:
s - Configuration String for the buttons.

A typical form is

s="créditos=si config=no inicio=si limpiar=si"

setSpace

public void setSpace(java.lang.String s)
Sets the configuration of the Descartes space.
If the scene has more than one space, all other spaces are deleted and the only one remaining is the one defined by this method call. Note: in order to modify one space of several, use replaceSpace(String, String).

Parameters:
s - Configuration String for the space.

A typical form is

s="fondo=blanco red=no red10=gris ejes=gris texto=grisObscuro"

removeSpaces

public void removeSpaces()
Removes all spaces from the configuration.


addSpace

public void addSpace(java.lang.String s)
Adds a new space object.

Parameters:
s - Configuration String for the space object.

Typical forms for s are:

s="id='E00' R3='false' fondo='negro' red='grisObscuro' red10='gris' números='false' despliegue_del_fondo='arriba-izquierda'"
s="id='E01' R3='true' x='59%' y='53%' ancho='32%' alto='44%' escala='24' O.y='20' fondo='turquesa' despliegue_del_fondo='arriba-izquierda' despliegue='pintor' cortar='true'"
s="id='E02' x='5%' y='5%' ancho='30%' alto='30%' escala='10%' fondo='blanco' red10='gris' ejes='gris'"
s="id='E03' R3='si' x='5%' y='53%' ancho='32%' alto='44%' escala='32' fondo='turquesa'"

replaceSpace

public void replaceSpace(java.lang.String num,
                         java.lang.String s)
Replaces the num space object.

Parameters:
num - String representing the number of the space object.
s - Configuration String for the new space object.

Typical forms for s are:
s="id='E00' R3='false' fondo='negro' red='grisObscuro' red10='gris' números='false' despliegue_del_fondo='arriba-izquierda'"
s="id='E01' R3='true' x='59%' y='53%' ancho='32%' alto='44%' escala='24' O.y='20' fondo='turquesa' despliegue_del_fondo='arriba-izquierda' despliegue='pintor' cortar='true'"
s="id='E02' x='5%' y='5%' ancho='30%' alto='30%' escala='10%' fondo='blanco' red10='gris' ejes='gris'"
s="id='E03' R3='si' x='5%' y='53%' ancho='32%' alto='44%' escala='32' fondo='turquesa'"


getSpace

public java.lang.String getSpace(java.lang.String num)
Returns the num-th space configuration String.

Parameters:
num - String representing the number of the space object.

deleteSpace

public void deleteSpace(java.lang.String num)
Deletes the num-th space object.

Parameters:
num - String representing the number of the space object to be deleted.

removeControls

public void removeControls()
Removes all numerical and graphics controls from the configuration.


addControl

public void addControl(java.lang.String s)
Adds a new control object.

Parameters:
s - Configuration String for the control object.

Typical forms for s are:

s="id=p tipo=numérico valor='1.5' decimales='2' incr='0.1'"
s="id=C tipo=gráfico expresión='[1,0]' constricción='x^2+y^2=1' text='([C.x],[C.y])'"

replaceControl

public void replaceControl(java.lang.String num,
                           java.lang.String s)
Replaces the num control object.

Parameters:
num - String represinting the number of the control object.
s - Configuration String for the new control object.

Typical forms for s are:
s="id=p tipo=numérico valor='1.5' decimales='2' incr='0.1'"
s="id=C tipo=gráfico expresión='[1,0]' constricción='x^2+y^2=1' text='([C.x],[C.y])'"


getControl

public java.lang.String getControl(java.lang.String num)
Returns the num-th control configuration String.

Parameters:
num - String represinting the number of the control object.

deleteControl

public void deleteControl(java.lang.String num)
Deletes the num-th control object.

Parameters:
num - String representing the number of the control object to be deleted.

removeAux

public void removeAux()
Removes all auxiliar objects from the configuration.


addAux

public void addAux(java.lang.String s)
Adds a new auxiliar object.

Parameters:
s - Configuration String for the auxiliar object.

Typical forms for s are:

s="id=Ta expresión='0' constante=si evaluar=una-sola-vez"
s="id=f(x) expresión='P*cos(x)'"

replaceAux

public void replaceAux(java.lang.String num,
                       java.lang.String s)
Replaces the num-th auxiliar object.

Parameters:
num - String represinting the number of the auxiliar object.
s - Configuration String for the new auxiliar object.

Typical forms for s are:
s="id=Ta expresión='0' constante=si evaluar=una-sola-vez"
s="id=f(x) expresión='P*cos(x)'"


getAux

public java.lang.String getAux(java.lang.String num)
Returns the num-th auxiliar configuration String.

Parameters:
num - String represinting the number of the auxiliar object.

deleteAux

public void deleteAux(java.lang.String num)
Deletes the num-th auxiliar object.

Parameters:
num - String representing the number of the auxiliar object to be deleted.

removeGraphs

public void removeGraphs()
Removes all graphic objects from the configuration.


addGraph

public void addGraph(java.lang.String s)
Adds a new graphic object.

Parameters:
s - Configuration String for the graphic object.

Typical forms for s are:

s="tipo=ecuación expresión='y=f(x)' rastro=turquesa"
s="tipo=segmento expresión='(-3,-1)(4,3)' color=magenta"
s="tipo=curva expresión='(R*t*cos(2*pi*t),R*t*sen(2*pi*t))' color=rojo visible=no parámetro=t t.intervalo=[0,1] t.pasos=32 ancho=3"
s="tipo=polígono expresión='(0,0)(1,1)(2,-1)(0,0)' color=gris"

replaceGraph

public void replaceGraph(java.lang.String num,
                         java.lang.String s)
Replaces the num-th graphic object.

Parameters:
num - String representing the number of the graphic object.
s - Configuration String for the new graphic object.

Typical forms for s are:

s="tipo=ecuación expresión='y=f(x)' rastro=turquesa"
s="espacio='Principal' tipo=segmento expresión='(-3,-1)(4,3)' color=magenta"
s="espacio='E01_2D' tipo=curva expresión='(R*t*cos(2*pi*t),R*t*sen(2*pi*t))' color=rojo visible=no parámetro=t t.intervalo=[0,1] t.pasos=32 ancho=3"
s="espacio='E02' tipo=polígono expresión='(0,0)(1,1)(2,-1)(0,0)' color=gris"

getGraph

public java.lang.String getGraph(java.lang.String num)
Returns the num-th graphic configuration String.

Parameters:
num - String representing the number of the graphic object.

deleteGraph

public void deleteGraph(java.lang.String num)
Deletes the num-th graphic object.

Parameters:
num - String representing the number of the graphic object to be deleted.

remove3DGraphs

public void remove3DGraphs()
Removes all 3D graphic objects from the configuration.


add3DGraph

public void add3DGraph(java.lang.String s)
Adds a new 3D graphic object.

Parameters:
s - Configuration String for the graphic object.

Typical forms for s are:

s="espacio='E01' tipo='Octaedro' color='naranja' color_reverso='rosa' aristas='true' rotini='(180,0,30*(1+C.x))' posini='(0,0,1.5*C.y+1.5)' modelo='luz' cortar='false'"
s="espacio='E01' tipo='Paramétrica' expresión='x=3*u-1.5 y=3*v-1.5 z=p*(y^2-x^2)/1.5' Nu='Nu' Nv='Nu' color_reverso='rosa' aristas='false' rotini='(0,0,30)' modelo='metal' cortar='false'"
s="espacio='E03' tipo='Paramétrica' expresión='x=3*u-1.5 y=3*v-1.5 z=0' Nu='Nu' Nv='Nu' color_reverso='rosa' aristas='false' rotini='(0,0,30)' posini='(0,0,-1.5)' modelo='alambre' cortar='false'"
s="espacio='E03' tipo='Paralelepípedo' ancho='3' largo='3' alto='3' color_reverso='rosa' aristas='false' rotini='(0,0,30)' modelo='alambre' cortar='false'"
s="espacio='E03' tipo='Esfera' Nu='Nu' Nv='2*Nu' ancho='2.5' color='naranja' color_reverso='rosa' aristas='true' modelo='luz' cortar='false'"
s="espacio='E01' tipo='macro' expresión='ejes' color_reverso='rosa' aristas='false' rot='(0,0,30)' cortar='false' nombre='mis_ejes'"

replace3DGraph

public void replace3DGraph(java.lang.String num,
                           java.lang.String s)
Replaces the num-th 3D graphic object.

Parameters:
num - String representing the number of the graphic object.
s - Configuration String for the new 3D graphic object.

Typical forms for s are:

s="espacio='E01' tipo='Octaedro' color='naranja' color_reverso='rosa' aristas='true' rotini='(180,0,30*(1+C.x))' posini='(0,0,1.5*C.y+1.5)' modelo='luz' cortar='false'"
s="espacio='E01' tipo='Paramétrica' expresión='x=3*u-1.5 y=3*v-1.5 z=p*(y^2-x^2)/1.5' Nu='Nu' Nv='Nu' color_reverso='rosa' aristas='false' rotini='(0,0,30)' modelo='metal' cortar='false'"
s="espacio='E03' tipo='Paramétrica' expresión='x=3*u-1.5 y=3*v-1.5 z=0' Nu='Nu' Nv='Nu' color_reverso='rosa' aristas='false' rotini='(0,0,30)' posini='(0,0,-1.5)' modelo='alambre' cortar='false'"
s="espacio='E03' tipo='Paralelepípedo' ancho='3' largo='3' alto='3' color_reverso='rosa' aristas='false' rotini='(0,0,30)' modelo='alambre' cortar='false'"
s="espacio='E03' tipo='Esfera' Nu='Nu' Nv='2*Nu' ancho='2.5' color='naranja' color_reverso='rosa' aristas='true' modelo='luz' cortar='false'"
s="espacio='E01' tipo='macro' expresión='ejes' color_reverso='rosa' aristas='false' rot='(0,0,30)' cortar='false' nombre='mis_ejes'"

get3DGraph

public java.lang.String get3DGraph(java.lang.String num)
Returns the num-th 3D graphic configuration String.

Parameters:
num - String representing the number of the 3D graphic object.

delete3DGraph

public void delete3DGraph(java.lang.String num)
Deletes the num-th 3D graphic object.

Parameters:
num - String representing the number of the 3D graphic object to be deleted.

removeAnimation

public void removeAnimation()
Removes the animation.


getAnimation

public java.lang.String getAnimation()
Returns the animation configuration String.


setAnimation

public void setAnimation(java.lang.String s)
Defines a new animation.

Parameters:
s - Configuration String for the new animation.

A typical form for s:

s="id=Animación algoritmo=si inicio='Ta=0' hacer='Ta=Ta+0.05' mientras='Ta<2' auto=si repetir=si controles=no evaluar=siempre"

getCode

public java.lang.String getCode()
Returns the applet configuration i.e. the html code that defines the applet configuration.


getHTMLEncodedCode

public java.lang.String getHTMLEncodedCode()
Returns the applet configuration i.e. the html code that defines the applet configuration using the standard HTML encoding of accents and "foreign" characters.