1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
|
package com.emergency.loleas;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;
public class Glasgow extends Activity {
/** Called when the activity is first created. */
RadioGroup Eye,Verbal,Motor;
RadioButton E1,E2,E3,E4,VR1,VR2,VR3,VR4,VR5,VR6,MR1,MR2,MR3,MR4,MR5,MR6;
TextView T_eye,T_verbal,T_motor,T_numero;
int valeureye;
int valeurverbal;
int valeurmotor;
int valeurtotal;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.glasgow2);
Eye = (RadioGroup)findViewById(R.id.radioGroupEye);
E1 = (RadioButton)findViewById(R.id.Radio_E1);
E2 = (RadioButton)findViewById(R.id.Radio_E2);
E3 = (RadioButton)findViewById(R.id.Radio_E3);
E4 = (RadioButton)findViewById(R.id.Radio_E4);
VR1 = (RadioButton)findViewById(R.id.Radio_VR1);
VR2 = (RadioButton)findViewById(R.id.Radio_VR2);
VR3 = (RadioButton)findViewById(R.id.Radio_VR3);
VR4 = (RadioButton)findViewById(R.id.Radio_VR4);
VR5 = (RadioButton)findViewById(R.id.Radio_VR5);
MR1 = (RadioButton)findViewById(R.id.Radio_MR1);
MR2 = (RadioButton)findViewById(R.id.Radio_MR2);
MR3 = (RadioButton)findViewById(R.id.Radio_MR3);
MR4 = (RadioButton)findViewById(R.id.Radio_MR4);
MR5 = (RadioButton)findViewById(R.id.Radio_MR5);
MR6 = (RadioButton)findViewById(R.id.Radio_MR6);
T_eye=(TextView)findViewById(R.id.T_eyeG);
T_motor=(TextView)findViewById(R.id.T_motorrespG);
T_verbal=(TextView)findViewById(R.id.T_verbalrespG);
T_numero=(TextView)findViewById(R.id.T_numeroG);
E4.setChecked(true);
VR4.setChecked(true);
E1.setOnClickListener(choixClickListener);
E2.setOnClickListener(choixClickListener);
E3.setOnClickListener(choixClickListener);
E4.setOnClickListener(choixClickListener);
VR1.setOnClickListener(choixClickListener);
VR2.setOnClickListener(choixClickListener);
VR3.setOnClickListener(choixClickListener);
VR4.setOnClickListener(choixClickListener);
VR5.setOnClickListener(choixClickListener);
MR1.setOnClickListener(choixClickListener);
MR2.setOnClickListener(choixClickListener);
MR3.setOnClickListener(choixClickListener);
MR4.setOnClickListener(choixClickListener);
MR5.setOnClickListener(choixClickListener);
MR6.setOnClickListener(choixClickListener);
}
RadioButton.OnClickListener choixClickListener =
new RadioButton.OnClickListener()
{
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
if(E1.isChecked()==true)
T_eye.setText ("None");
valeureye = 1;
if(E2.isChecked()==true)
T_eye.setText("To painfull stimuli");
valeureye =2;
if(E3.isChecked()==true)
T_eye.setText("On command");
valeureye=3;
if(E4.isChecked()==true)
T_eye.setText("Spontaneous");
valeureye=4;
if(VR1.isChecked()==true)
T_verbal.setText ("None");
valeurverbal=1;
if(VR2.isChecked()==true)
T_verbal.setText ("Incomprehensible sounds");
valeurverbal=2;
if(VR3.isChecked()==true)
T_verbal.setText ("Inappropriate Words");
valeurverbal=3;
if(VR4.isChecked()==true)
T_verbal.setText ("Confused speech");
valeurverbal=4;
if(VR5.isChecked()==true)
T_verbal.setText ("Coherent");
valeurverbal=5;
if(MR1.isChecked()==true)
T_motor.setText ("None");
valeurmotor=1;
if(MR2.isChecked()==true)
T_motor.setText ("Decerebrate (extensor) posturing");
valeurmotor=2;
if(MR3.isChecked()==true)
T_motor.setText ("Decerebrate (extensor) posturing");
valeurmotor=3;
if(MR4.isChecked()==true)
T_motor.setText ("Flexion-withdrawal");
valeurmotor=4;
if(MR5.isChecked()==true)
T_motor.setText ("Localizes pain");
valeurmotor=5;
if(MR6.isChecked()==true)
T_motor.setText ("Follows commandst");
valeurmotor=6;
{
T_numero.setText(String.valueOf(valeureye+valeurmotor+valeurverbal));
}
}
};
} |
Partager