Skip to content

Commit 2d37de9

Browse files
inicio de sesion con cache (src)
1 parent 800e1b6 commit 2d37de9

28 files changed

+814
-445
lines changed

Aplicacion/Thoth-Web/src/src/GramaticaCS.gwt.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
32
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.7.0//EN"
43
"http://gwtproject.org/doctype/2.7.0/gwt-module.dtd">
54
<module rename-to='gramaticacs'>
65
<inherits name='com.google.gwt.user.User'/>
76
<inherits name='com.google.gwt.user.theme.clean.Clean'/>
7+
<inherits name='com.google.gwt.user.theme.clean.Clean'/>
8+
<stylesheet src='/GramaticaCS.css' />
89
<entry-point class='src.client.main'/>
910
<extend-property name="locale" values="es,de,fr,en"/>
1011
<source path='client'/>

Aplicacion/Thoth-Web/src/src/client/gui/mainGui.java

Lines changed: 47 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,13 @@
1919
import src.client.gui.visual.VisualSNA;
2020
import src.client.gui.visual.VisualSNT;
2121
import src.client.gui.visual.VisualTasp;
22+
import src.client.register.request.RegistrationService;
23+
import src.client.register.request.RegistrationServiceAsync;
2224

2325
import com.google.gwt.core.shared.GWT;
2426
import com.google.gwt.event.dom.client.ClickEvent;
2527
import com.google.gwt.event.dom.client.ClickHandler;
28+
import com.google.gwt.user.client.rpc.AsyncCallback;
2629
import com.google.gwt.user.client.ui.Button;
2730
import com.google.gwt.user.client.ui.Composite;
2831
import com.google.gwt.user.client.ui.DialogBox;
@@ -40,6 +43,11 @@
4043
import com.google.gwt.user.client.Command;
4144
import com.google.gwt.user.client.Window;
4245

46+
/**
47+
*
48+
* @author User
49+
*
50+
*/
4351
public class mainGui extends Composite {
4452

4553
// Attributes
@@ -52,8 +60,10 @@ public class mainGui extends Composite {
5260
private HorizontalPanel hPanel3 = new HorizontalPanel();
5361
private TextBox txt1, txt2, txt3, txt4, txt5;
5462
private FlexTable stocksFlexTable = new FlexTable();
55-
private mainGui mVisual= this;
63+
private mainGui mVisual = this;
5664

65+
private RegistrationServiceAsync loginService = GWT
66+
.create(RegistrationService.class);
5767
DockPanel dockPanel = new DockPanel();
5868

5969
/**
@@ -79,20 +89,21 @@ public class mainGui extends Composite {
7989
*/
8090
public static String INITIAL_TEXT = "% start \n%%\n\n\n\n%%\n";
8191

82-
// Methods
92+
// Methods
8393
// -----------------------------------------------------------------------
8494
/**
8595
* Constructor del panel de gramáticas al que se le pasa el servicio.
8696
*
87-
* @param serviceImp Implementacion del servicio.
97+
* @param serviceImp
98+
* Implementacion del servicio.
8899
*/
89100
public mainGui(GrammarServiceClientImp serviceImp) {
90101
buildMenuBar();
91102
buildGrammarPanel(serviceImp);
92-
//Añadimos los elementos al panel raiz.
103+
// Añadimos los elementos al panel raiz.
93104
RootPanel.get().add(barMenuPanel);
94105
RootPanel.get().add(editorGrammarPanel);
95-
}//manGui
106+
}// manGui
96107

97108
/**
98109
* Constructor del panel de gramáticas al que se le pasa la gramática.
@@ -107,7 +118,7 @@ public mainGui(GrammarServiceClientImp serviceImp, Grammar grammar) {
107118
mGrammar = grammar;
108119
grammarArea.setText(grammar.toString());
109120
}// mainGui
110-
121+
111122
/**
112123
*
113124
* @param serviceImp
@@ -195,7 +206,7 @@ private void buildGrammarPanel(GrammarServiceClientImp serviceImp) {
195206
dockPanel.add(vPanel2, DockPanel.WEST);
196207

197208
editorGrammarPanel.add(dockPanel);
198-
}//buildGrammarPanel
209+
}// buildGrammarPanel
199210

200211
/**
201212
*
@@ -209,7 +220,7 @@ public void onClick(ClickEvent event) {
209220
String textcheck = grammarArea.getText();
210221
serviceImp.checkContent(textcheck);
211222
}
212-
}//Btn1ClickHandler
223+
}// Btn1ClickHandler
213224

214225
/**
215226
* Renombrar
@@ -223,12 +234,9 @@ public void onClick(ClickEvent event) {
223234
String textcheck = grammarArea.getText();
224235
serviceImp.checkContent(textcheck);
225236
new RenameSymbolDialog(mVisual, mGrammar).show();
226-
227237
}
228238
}
229239

230-
231-
232240
/**
233241
*
234242
* @param grammar
@@ -240,7 +248,18 @@ public void updateLabel(Grammar grammar) {
240248

241249
term = term.substring(1, term.length() - 1);
242250
noTerm = noTerm.substring(1, noTerm.length() - 1);
251+
/* loginService.userAction(new AsyncCallback() {
252+
@Override
253+
public void onFailure(Throwable caught) {
254+
Window.alert("Error ");
255+
}
256+
257+
@Override
258+
public void onSuccess(Object result) {
259+
Window.alert("Acierto ");
243260
261+
}
262+
});*/
244263
mGrammar = grammar;
245264
txt2.setText(((Integer) grammar.getProductions().size()).toString());
246265
txt3.setText(grammar.getAxiom().toString());
@@ -260,7 +279,7 @@ public void updateLabel(Grammar grammar) {
260279
txt1.setText(sms.regular());
261280
break;
262281
}
263-
}//updateLabel
282+
}// updateLabel
264283

265284
/**
266285
*
@@ -273,31 +292,33 @@ public void execute() {
273292

274293
}
275294
};
276-
295+
277296
Command download = new Command() {
278297
public void execute() {
279-
//String url = GWT.getModuleBaseURL() + "downloadService?fileInfo1=" + fileInfo1;
280-
//Window.open( url, "_blank", "status=0,toolbar=0,menubar=0,location=0");
281-
//Window.open(GWT.getHostPageBaseURL() + "/file.rar", "name", "enabled");
282-
Window.open("http://127.0.0.1:8888/file.rar", "_self", "enabled");
298+
// String url = GWT.getModuleBaseURL() +
299+
// "downloadService?fileInfo1=" + fileInfo1;
300+
// Window.open( url, "_blank",
301+
// "status=0,toolbar=0,menubar=0,location=0");
302+
// Window.open(GWT.getHostPageBaseURL() + "/file.rar", "name",
303+
// "enabled");
304+
Window.open("http://127.0.0.1:8888/file.rar", "_self",
305+
"enabled");
283306

284307
}
285308
};
286-
309+
287310
Command about = new Command() {
288311
public void execute() {
289312
Window.Location.replace("http://thoth-project.herokuapp.com/");
290313
}
291314
};
292-
293315

294-
//Cambio de idioma
316+
// Cambio de idioma
295317
CommandLang spanish = new CommandLang("es");
296318
CommandLang deutschland = new CommandLang("de");
297319
CommandLang french = new CommandLang("fr");
298-
CommandLang english = new CommandLang("en");
320+
CommandLang english = new CommandLang("en");
299321

300-
301322
Command eliminate_SNT = new Command() {
302323
public void execute() {
303324
serviceImp.checkContent(grammarArea.getText());
@@ -513,7 +534,7 @@ public void onClick(ClickEvent event) {
513534
}
514535
}
515536
};
516-
537+
517538
MenuBar fooMenu = new MenuBar(true);
518539
fooMenu.addItem("Abrir", cmd);
519540
fooMenu.addItem("Guardar", download);
@@ -543,14 +564,14 @@ public void onClick(ClickEvent event) {
543564
algorithmMenu.addItem(sms.tasp(), tasp);
544565

545566
MenuBar selectIdiom = new MenuBar(true);
546-
selectIdiom.addItem("Castellano", spanish);//Command(spanish));
567+
selectIdiom.addItem("Castellano", spanish);// Command(spanish));
547568
selectIdiom.addItem("Deutsch", deutschland);
548569
selectIdiom.addItem("Français", french);
549570
selectIdiom.addItem("English", english);
550571

551572
MenuBar helpMenu = new MenuBar(true);
552573
helpMenu.addItem(sms.about(), about);
553-
574+
554575
MenuBar menu = new MenuBar();
555576
menu.addItem(sms.file(), fooMenu);
556577
menu.addSeparator();
@@ -634,6 +655,7 @@ public void openFiFo() {
634655
barMenuPanel.clear();
635656
new VisualFirstFollow(mGrammar);
636657
}
658+
637659
// TASP
638660
public void openTASP() {
639661
editorGrammarPanel.clear();

Aplicacion/Thoth-Web/src/src/client/gui/mediator/MediatorPNG.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
* </p>
2828
*
2929
* @author Álvar Arnáiz González, Andrés Arnáiz Moreno
30-
* @version 1.0
30+
* @author Francisco Javier Páramo Arnaiz
31+
* @version 2.0
3132
*/
3233
public class MediatorPNG {
3334

@@ -166,7 +167,7 @@ public void accept() {
166167

167168
if (mVisual.mNew.getText().length() > 0) {
168169

169-
mVisual.generalPanel.clear();
170+
mVisual.mGeneralPanel.clear();
170171
new GrammarServiceClientImp(GWT.getModuleBaseURL()
171172
+ "grammarservice", mCleanAlgorithm.getSolution());
172173

@@ -237,9 +238,9 @@ private void highLight(HTML mOld, String pattern, boolean green) {
237238
* aceptar.
238239
*/
239240
public void finish() {
240-
mVisual.btnOneStep.setEnabled(false);
241-
mVisual.btnAllSteps.setEnabled(false);
242-
mVisual.btnAcept.setEnabled(true);
241+
mVisual.mBtnOneStep.setEnabled(false);
242+
mVisual.mBtnAllSteps.setEnabled(false);
243+
mVisual.mBtnAcept.setEnabled(true);
243244

244245
}// finish
245246

@@ -265,7 +266,7 @@ private void removeAllHighLight() {
265266
*/
266267
public void exit() {
267268

268-
mVisual.generalPanel.clear();
269+
mVisual.mGeneralPanel.clear();
269270
new GrammarServiceClientImp(GWT.getModuleBaseURL() + "grammarservice",
270271
mGrammar);
271272

Aplicacion/Thoth-Web/src/src/client/gui/mediator/MediatorRecursive.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
* </p>
2323
*
2424
* @author Álvar Arnáiz González, Andrés Arnáiz Moreno
25-
* @version 1.0
25+
* @author Francisco Javier Páramo Arnaiz
26+
* @version 2.0
2627
*/
2728
public class MediatorRecursive {
2829

Aplicacion/Thoth-Web/src/src/client/gui/mediator/MediatorSA.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
* </p>
2727
*
2828
* @author Álvar Arnáiz González, Andrés Arnáiz Moreno
29-
* @version 1.0
29+
* @author Francisco Javier Páramo Arnaiz
30+
* @version 2.0
3031
*/
3132
public class MediatorSA {
3233

@@ -156,7 +157,7 @@ public void accept() {
156157

157158
if (mVisual.mNew.getText().length() > 0) {
158159

159-
mVisual.generalPanel.clear();
160+
mVisual.mGeneralPanel.clear();
160161
new GrammarServiceClientImp(GWT.getModuleBaseURL()
161162
+ "grammarservice", mCleanAlgorithm.getSolution());
162163

@@ -236,9 +237,9 @@ private void highLight(HTML mOld, String pattern, boolean green) {
236237
* aceptar.
237238
*/
238239
public void finish() {
239-
mVisual.btnOneStep.setEnabled(false);
240-
mVisual.btnAllSteps.setEnabled(false);
241-
mVisual.btnAcept.setEnabled(true);
240+
mVisual.mBtnOneStep.setEnabled(false);
241+
mVisual.mBtnAllSteps.setEnabled(false);
242+
mVisual.mBtnAcept.setEnabled(true);
242243

243244
}// finish
244245

@@ -269,7 +270,7 @@ private void removeAllHighLight() {
269270
*/
270271
public void exit() {
271272

272-
mVisual.generalPanel.clear();
273+
mVisual.mGeneralPanel.clear();
273274
new GrammarServiceClientImp(GWT.getModuleBaseURL() + "grammarservice",
274275
mGrammar);
275276

Aplicacion/Thoth-Web/src/src/client/gui/mediator/MediatorSNA.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
* </p>
2828
*
2929
* @author Álvar Arnáiz González, Andrés Arnáiz Moreno
30-
* @version 1.0
30+
* @author Francisco Javier Páramo Arnaiz
31+
* @version 2.0
3132
*/
3233
public class MediatorSNA {
3334

@@ -143,7 +144,7 @@ public void accept() {
143144

144145
if (mVisual.mNew.getText().length() > 0) {
145146

146-
mVisual.generalPanel.clear();
147+
mVisual.mGeneralPanel.clear();
147148
new GrammarServiceClientImp(GWT.getModuleBaseURL()
148149
+ "grammarservice", mCleanAlgorithm.getSolution());
149150

@@ -201,9 +202,9 @@ private void highLight(HTML mOld, String pattern, boolean green) {
201202
* aceptar.
202203
*/
203204
public void finish() {
204-
mVisual.btnOneStep.setEnabled(false);
205-
mVisual.btnAllSteps.setEnabled(false);
206-
mVisual.btnAcept.setEnabled(true);
205+
mVisual.mBtnOneStep.setEnabled(false);
206+
mVisual.mBtnAllSteps.setEnabled(false);
207+
mVisual.mBtnAcept.setEnabled(true);
207208
removeAllHighLight();
208209

209210
}// finish
@@ -230,7 +231,7 @@ public void removeAllHighLight() {
230231
* Crea una nueva vista con la gramática vieja.
231232
*/
232233
public void exit() {
233-
mVisual.generalPanel.clear();
234+
mVisual.mGeneralPanel.clear();
234235
new GrammarServiceClientImp(GWT.getModuleBaseURL() + "grammarservice",
235236
mGrammar);
236237

Aplicacion/Thoth-Web/src/src/client/gui/mediator/MediatorSNT.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
* </p>
2929
*
3030
* @author Álvar Arnáiz González, Andrés Arnáiz Moreno
31-
* @version 1.0
31+
* @author Francisco Javier Páramo Arnaiz
32+
* @version 2.0
3233
*/
3334
public class MediatorSNT {
3435

0 commit comments

Comments
 (0)