TelaParametro.java 21.8 KB
   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
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
package circusRefine.gui;

/*
* Projeto : Refine - Ferramenta Educacional para Refinamentos
*
* Tipo : TelaPredParametro
*
*/

import circusRefine.core.ExternalManager;
import circusRefine.util.CodigoParametro;
import circusRefine.util.circusstring.CircusToLatex;
import circusRefine.util.circusstring.LatexToCircus;
import circusRefine.util.zstring.LatexToZ;
import circusRefine.util.zstring.ZtoLatex;
import java.awt.BorderLayout;
import javax.swing.JButton;
import java.awt.Color;
import javax.swing.JDialog;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.GridLayout;
import javax.swing.ButtonGroup;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JTextArea;
import javax.swing.JScrollPane;
import javax.swing.ImageIcon;
import net.sourceforge.czt.session.Markup;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.KeyEvent;
import java.util.Set;

/**
* TelaPredParametro � um tipo que representa a tela de parametro para algumas leis da
* ferramenta.
*/
public class TelaParametro extends JDialog {

private ExternalManager gerInterface;
private CodigoParametro codigo;
private String path = "images/";
private TecladoVirtual tecl;
private String argument;
private Markup marca; /* To unicode/Latex */
private JRadioButton unicode;
private JRadioButton latex;
private ButtonGroup radioGroup;
protected static String Space = " ";
JPanel panel1 = new JPanel();
JButton btnOK = new JButton();
JButton btnCancel = new JButton();
JTextArea tfEspec = new JTextArea();
JScrollPane rolagem;
JLabel labelEntrada = new JLabel();
JButton btnDigitacao = new JButton();
JButton btnTecladoVirtual = new JButton();
JPanel panel2 = new JPanel();
BorderLayout borderLayout1 = new BorderLayout();
BorderLayout borderLayout2 = new BorderLayout();
JPanel panel3 = new JPanel();
GridLayout gridLayout1 = new GridLayout();
JPanel panel4 = new JPanel();
BorderLayout borderLayout3 = new BorderLayout();
FlowLayout flowLayout1 = new FlowLayout();
JPanel panel5 = new JPanel();
JPanel panel6 = new JPanel();
JPanel panel7 = new JPanel();
JPanel panel8 = new JPanel();
JPanel panel9 = new JPanel();


/**
* Construtor da classe TelaPredParametro.
*
* @param telaLeis Um objeto da classe FLeis.
* @param gerInterface Gerenciador de todas as telas do sistema.
*
*/
public TelaParametro(ExternalManager gerInterface) {
super(gerInterface.retornarTelaPrincipal());
try {
this.gerInterface = gerInterface;
this.tecl = new TecladoVirtual(this);
marca = Markup.LATEX;
jbInit();
}
catch (Exception e) {
e.printStackTrace();
}
}
/**
* Construtor da classe TelaPredParametro.
*
* @param telaLeis Um objeto da classe FLeis.
* @param gerInterface Gerenciador de todas as telas do sistema.
*
*/
public TelaParametro(ExternalManager gerInterface, CodigoParametro cod, String str ) {
super(gerInterface.retornarTelaPrincipal());
try {
this.gerInterface = gerInterface;
this.codigo = cod;
this.tecl = new TecladoVirtual(this);
jbInit();
}
catch (Exception e) {
e.printStackTrace();
}
}
/**
* Metodo que retorna o argumento digitado
* @return o argumento digitado
*/
public String getArgument() {
return argument;
}
/**
* M�todo respons�vel pela a��o do bot�o Cancel da tela.
*
* @param e Evento do bot�o Cancel.
*
*/
public void btnCancel_actionPerformed(ActionEvent e) {
this.setVisible(false);
}
/**
* M�todo respons�vel pela a��o do bot�o digita��o.
*
* @param e O evento do bot�o digita��o.
*
*/
void btnTecladoVirtual_actionPerformed(ActionEvent e) {
tecl.pack();
tecl.setLocation(490, 200);
tecl.setVisible(true);
}
/**
* M�todo respons�vel pela a��o do bot�o OK da tela.
*
* @param e Evento do bot�o OK.
*
*/
public void btnOK_actionPerformed(ActionEvent e) {
if(marca.equals(Markup.UNICODE)) {
this.mudarExibicao(Markup.LATEX);
}
this.setArgument(tfEspec.getText());
this.setVisible(false);
gerInterface.setarFocus();

}
private void testarSimbolos() {
String resul = new String();
ZtoLatex zLatex = new ZtoLatex ();
CircusToLatex circusToLatex = new CircusToLatex();
Set<String> ZKeySet = zLatex.keySet();
Set<String> CircusKeySet = circusToLatex.keySet();
for (String str: ZKeySet) {
resul += str + " " + zLatex.get(str) + " z\n";
}
for (String str : CircusKeySet) {
resul += str + " " + circusToLatex.get(str) + " circus\n";
}
tfEspec.setText(resul);
}
/**
* M�todo utilizado para digitar com o auxilio de FDigitacao.
*
* @param carac ........
*
*/
public void escrever(String carac) {
/* captura posicao do cursor na tela Parametro*/
int position = tfEspec.getCaret().getDot();

this.tfEspec.insert(carac, position);
}
/**
* Metodo que reinicializa a string latex que representa o latex do simbolo
* que sera digitado
*
*/
public void AtualizarTfEspec (String texto) {
String result = new String();
result = texto;
LatexToZ latexZ = new LatexToZ ();
LatexToCircus latexCircus = new LatexToCircus();
Set<String> ZKeySet = latexZ.keySet();
Set<String> CircusKeySet = latexCircus.keySet();
String[] StrLatexOrdenado = new String[ZKeySet.size() + CircusKeySet.size()];
int index = 0;
for (String str: ZKeySet) {
StrLatexOrdenado[index++] = str;
}
for (String str : CircusKeySet) {
StrLatexOrdenado[index++] = str;
}//Lista Completa Desordenada -> Ordenar!
for (int i = 0; i < StrLatexOrdenado.length; i++) {
for (int j=0; j< StrLatexOrdenado.length; j++) {
if (StrLatexOrdenado[j].length() < StrLatexOrdenado[i].length()){
String aux = StrLatexOrdenado[i];
StrLatexOrdenado[i] = StrLatexOrdenado[j];
StrLatexOrdenado[j] = aux;
}
}
}
for (int i = 0; i < StrLatexOrdenado.length; i++) {
if (latexZ.get(StrLatexOrdenado[i])!= null) {
result = result.replace(StrLatexOrdenado[i], latexZ.get(StrLatexOrdenado[i]));
}
else if (latexCircus.get(StrLatexOrdenado[i]) != null) {
result = result.replace(StrLatexOrdenado[i], latexCircus.get(StrLatexOrdenado[i]));
}
}
tfEspec.setText(result);
tfEspec.repaint();
}
public void btnRefresh_actionPerformed(ActionEvent e) {
this.AtualizarTfEspec(tfEspec.getText());
}
/**
* Inicializa os atributos da tela de parametro.
*
*/
private void jbInit() throws Exception {
this.setModal (true);
this.setLocation(240,220);
this.setSize(420, 210);
this.setTitle(this.retornarMensagem("COD0109"));
tfEspec.setFont(new Font ("CZT", Font.PLAIN, 12));
tfEspec.setText("");
rolagem = new JScrollPane(tfEspec);
tfEspec.setToolTipText(this.retornarMensagem("COD0509"));
tfEspec.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyPressed(KeyEvent e) {
tfEspec_keyPressed(e);
}
});
btnOK.setForeground(Color.green);
btnOK.setFont(new Font("Dialog", 1, 12));
btnOK.setText(this.retornarMensagem("COD0072"));
btnOK.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(ActionEvent e) {
btnOK_actionPerformed(e);
}
});
ImageIcon teclicon = new ImageIcon(path + "teclado.gif");
btnTecladoVirtual.setIcon(teclicon);
btnTecladoVirtual.setToolTipText("TecladoVirtual");
btnTecladoVirtual.setEnabled(false);
btnTecladoVirtual.addActionListener(new ActionListener(){

public void actionPerformed(ActionEvent e) {
btnTecladoVirtual_actionPerformed(e);
}
});
btnCancel.setForeground(Color.red);
btnCancel.setFont(new Font("Dialog", 1, 12));
btnCancel.setText(this.retornarMensagem("COD0078"));
btnCancel.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(ActionEvent e) {
btnCancel_actionPerformed(e);
}
});
latex = new JRadioButton("LaTeX", true);
//latex.setBackground(SystemColor.scrollbar);
latex.setToolTipText(this.retornarMensagem("COD0587"));

unicode = new JRadioButton("Unicode", false);
//unicode.setBackground(SystemColor.scrollbar);
unicode.setToolTipText(this.retornarMensagem("COD0588"));
latex.addItemListener( new java.awt.event.ItemListener() {
public void itemStateChanged(ItemEvent e) {
if (e.getStateChange() == e.SELECTED) {
mudarExibicao(Markup.LATEX);
} else {
mudarExibicao(Markup.UNICODE);
}
}
}
);
radioGroup = new ButtonGroup();
radioGroup.add(latex);
radioGroup.add(unicode);
labelEntrada.setText(" Entre com tal parametro:");
panel1.setLayout(borderLayout1);
panel2.setLayout(borderLayout2);
panel3.setLayout(gridLayout1);
panel4.setLayout(borderLayout3);
panel9.setLayout(flowLayout1);
this.getContentPane().add(panel1, BorderLayout.CENTER);
panel1.add(panel2, BorderLayout.CENTER);
panel2.add(rolagem, BorderLayout.CENTER);
panel2.add(panel5, BorderLayout.WEST);
panel2.add(panel6, BorderLayout.SOUTH);
panel2.add(panel7, BorderLayout.EAST);
panel2.add(panel8, BorderLayout.NORTH);
panel1.add(panel3, BorderLayout.SOUTH);
panel3.add(btnOK, null);
panel3.add(btnTecladoVirtual);
panel3.add(btnCancel, null);
panel1.add(panel4, BorderLayout.NORTH);
panel9.add(latex);
panel9.add(unicode);
panel4.add(labelEntrada, BorderLayout.CENTER);
panel4.add(panel9, BorderLayout.EAST);
}
/**
* Este metodo muda forma de se conseguir um parametro.
* Um usuario podera inserir um parametro tanto na forma
* latex ou unicode (com auxilio do Teclado Virtual)
* @param marcaN
*/
protected void mudarExibicao(Markup marcaN) {
marca = marcaN;
String result = new String();
result = tfEspec.getText();
if(marca == Markup.LATEX) {
LatexToZ latexZ = new LatexToZ ();
LatexToCircus latexCircus = new LatexToCircus();
Set<String> ZKeySet = latexZ.keySet();
Set<String> CircusKeySet = latexCircus.keySet();
String[] StrLatexOrdenado = new String[ZKeySet.size() + CircusKeySet.size()];
int index = 0;
for (String str: ZKeySet) {
StrLatexOrdenado[index++] = str;
}
for (String str : CircusKeySet) {
StrLatexOrdenado[index++] = str;
}//Lista Completa Desordenada -> Ordenar!
for (int i = 0; i < StrLatexOrdenado.length; i++) {
for (int j=0; j< StrLatexOrdenado.length; j++) {
if (StrLatexOrdenado[j].length() < StrLatexOrdenado[i].length()){
String aux = StrLatexOrdenado[i];
StrLatexOrdenado[i] = StrLatexOrdenado[j];
StrLatexOrdenado[j] = aux;
}
}
}
String resul = "";
for (int i = 0; i < StrLatexOrdenado.length; i++) {
resul += i + " " + StrLatexOrdenado[i] + "\n";
if (latexZ.get(StrLatexOrdenado[i])!= null) {
result = result.replace(latexZ.get(StrLatexOrdenado[i]), StrLatexOrdenado[i]);
}
else if (latexCircus.get(StrLatexOrdenado[i]) != null) {
result = result.replace(latexCircus.get(StrLatexOrdenado[i]), StrLatexOrdenado[i] );
}
}
btnTecladoVirtual.setEnabled(false);
}
else if (marca == Markup.UNICODE){
ZtoLatex latexZ = new ZtoLatex ();
CircusToLatex latexCircus = new CircusToLatex();
Set<String> ZKeySet = latexZ.keySet();
Set<String> CircusKeySet = latexCircus.keySet();
String[] StrLatexOrdenado = new String[ZKeySet.size() + CircusKeySet.size()];
int index = 0;
for (String str: ZKeySet) {
StrLatexOrdenado[index++] = str;
}
for (String str : CircusKeySet) {
StrLatexOrdenado[index++] = str;
}//Lista Completa Desordenada -> Ordenar!
for (int i = 0; i < StrLatexOrdenado.length; i++) {
for (int j=0; j< StrLatexOrdenado.length; j++) {
if (StrLatexOrdenado[j].length() < StrLatexOrdenado[i].length()){
String aux = StrLatexOrdenado[i];
StrLatexOrdenado[i] = StrLatexOrdenado[j];
StrLatexOrdenado[j] = aux;
}
}
}
String resul = "";
for (int i = 0; i < StrLatexOrdenado.length; i++) {
resul += i + " " + StrLatexOrdenado[i] + "\n";
if (latexZ.get(StrLatexOrdenado[i])!= null) {
result = result.replace(latexZ.get(StrLatexOrdenado[i]), StrLatexOrdenado[i]);
}
else if (latexCircus.get(StrLatexOrdenado[i]) != null) {
result = result.replace(latexCircus.get(StrLatexOrdenado[i]), StrLatexOrdenado[i] );
}
}
btnTecladoVirtual.setEnabled(true);
}
tfEspec.setText(result);
tfEspec.repaint();
}
/**
* M�todo que inicializa a tela de parametro com o codigo do parametro
* para a lei aplicada e mostra o layout certo para a janela.
*
* @param codigo Inteiro que representa o c�digo do par�metro.
*
*/
public void mostrarTelaParametro(CodigoParametro codigo, String str) {
this.codigo = codigo;
if(codigo == CodigoParametro.PREDICATE) {
this.mostrarTelaPredicate(str);
}
else if(codigo == CodigoParametro.EXPRESSION) {
this.mostrarTelaExpression(str);
}
else if(codigo == CodigoParametro.ACTION) {
this.mostrarTelaAction(str);
}
else if(codigo == CodigoParametro.NAMESET) {
this.mostrarTelaNameSet(str);
}
else if(codigo == CodigoParametro.CHANSET) {
this.mostrarTelaChannelSet(str);
}
else if(codigo == CodigoParametro.COMMUN) {
this.mostrarTelaCommunication(str);
}
else if(codigo == CodigoParametro.DECLLIST) {
this.mostrarTelaDeclList(str);
}
else if(codigo == CodigoParametro.EXPRLIST) {
this.mostrarTelaExprList(str);
}
else if(codigo == CodigoParametro.STROKE) {
this.mostrarTelaStroke(str);
}
else if(codigo == CodigoParametro.RENAMELIST) {
this.mostrarTelaRenameList(str);
}
else if(codigo == CodigoParametro.NAMELIST) {
this.mostrarTelaNameList(str);
}
else if(codigo == CodigoParametro.NAME) {
this.mostrarTelaName(str);
}
else if(codigo == CodigoParametro.PROCESS) {
this.mostrarTelaProcess(str);
}
else if (codigo == CodigoParametro.PARA) {
this.mostrarTelaPara(str);
}
else if (codigo == CodigoParametro.PARALIST) {
this.mostrarTelaParaList(str);
}
}
private void mostrarTelaParaList(String str) {
String msg = Space + this.retornarMensagem("COD0531")+ Space + "(" + str + ")";
this.setarLabel(msg);
this.setTitle(this.retornarMensagem("COD0109"));
this.setLocation(130, 200);
this.setVisible(true);
this.codigo = CodigoParametro.PARALIST;
}
public void mostrarTelaPara(String str) {
String msg = Space + this.retornarMensagem("COD0530")+ Space + "(" + str + ")";
this.setarLabel(msg);
this.setTitle(this.retornarMensagem("COD0109"));
this.setLocation(130, 200);
this.setVisible(true);
this.codigo = CodigoParametro.PARA;
}
/**
* M�todo que exibe a tela de predicado.
*
*/
private void mostrarTelaPredicate(String str) {
String msg = Space + this.retornarMensagem("COD0110") + Space + "(" + str + ")";
this.setarLabel(msg);
this.setTitle(this.retornarMensagem("COD0109"));
this.setLocation(130, 200);
this.setVisible(true);
this.codigo = CodigoParametro.PREDICATE;
}

private void mostrarTelaExpression(String str) {
String msg = Space + this.retornarMensagem("COD0460")+ Space + "(" + str + ")";
this.setarLabel(msg);
this.setTitle(this.retornarMensagem("COD0109"));
this.setLocation(130, 200);
this.setVisible(true);
this.codigo = CodigoParametro.EXPRESSION;
}

private void mostrarTelaAction(String str) {
String msg = Space + this.retornarMensagem("COD0461")+ Space + "(" + str + ")";
this.setarLabel(msg);
this.setTitle(this.retornarMensagem("COD0109"));
this.setLocation(130, 200);
this.setVisible(true);
this.codigo = CodigoParametro.ACTION;
}

private void mostrarTelaNameSet(String str) {
String msg = Space + this.retornarMensagem("COD0462")+ Space + "(" + str + ")";
this.setarLabel(msg);
this.setTitle(this.retornarMensagem("COD0109"));
this.setLocation(130, 200);
this.setVisible(true);
this.codigo = CodigoParametro.NAMESET;
}

private void mostrarTelaChannelSet(String str) {
String msg = Space + this.retornarMensagem("COD0463")+ Space + "(" + str + ")";
this.setarLabel(msg);
this.setTitle(this.retornarMensagem("COD0109"));
this.setLocation(130, 200);
this.setVisible(true);
this.codigo = CodigoParametro.CHANSET;
}

private void mostrarTelaCommunication(String str) {
String msg = Space + this.retornarMensagem("COD0469")+ Space + "(" + str + ")";
this.setarLabel(msg);
this.setTitle(this.retornarMensagem("COD0109"));
this.setLocation(130, 200);
this.setVisible(true);
this.codigo = CodigoParametro.COMMUN;
}

private void mostrarTelaNameList(String str) {
String msg = Space + this.retornarMensagem("COD0494")+ Space + "(" + str + ")";
this.setarLabel(msg);
this.setTitle(this.retornarMensagem("COD0109"));
this.setLocation(130, 200);
this.setVisible(true);
this.codigo = CodigoParametro.NAMELIST;
}
private void mostrarTelaProcess(String str) {
String msg = Space + this.retornarMensagem("COD0500")+ Space + "(" + str + ")";
this.setarLabel(msg);
this.setTitle(this.retornarMensagem("COD0109"));
this.setLocation(130, 200);
this.setVisible(true);
this.codigo = CodigoParametro.PROCESS;
}
private void mostrarTelaName(String str) {
String msg = Space + this.retornarMensagem("COD0495")+ Space + "(" + str + ")";
this.setarLabel(msg);
this.setTitle(this.retornarMensagem("COD0109"));
this.setLocation(130, 200);
this.setVisible(true);
this.codigo = CodigoParametro.NAME;
}
private void mostrarTelaRenameList(String str) {
String msg = Space + this.retornarMensagem("COD0496")+ Space + "(" + str + ")";
this.setarLabel(msg);
this.setTitle(this.retornarMensagem("COD0109"));
this.setLocation(130, 200);
this.setVisible(true);
this.codigo = CodigoParametro.RENAMELIST;
}
private void mostrarTelaDeclList(String str) {
String msg = Space + this.retornarMensagem("COD0497")+ Space + "(" + str + ")";
this.setarLabel(msg);
this.setTitle(this.retornarMensagem("COD0109"));
this.setLocation(130, 200);
this.setVisible(true);
this.codigo = CodigoParametro.DECLLIST;
}
private void mostrarTelaStroke(String str) {
String msg = Space + this.retornarMensagem("COD0498")+ Space + "(" + str + ")";
this.setarLabel(msg);
this.setTitle(this.retornarMensagem("COD0109"));
this.setLocation(130, 200);
this.setVisible(true);
this.codigo = CodigoParametro.STROKE;
}
private void mostrarTelaExprList(String str) {
String msg = Space + this.retornarMensagem("COD0499")+ Space + "(" + str + ")";
this.setarLabel(msg);
this.setTitle(this.retornarMensagem("COD0109"));
this.setLocation(130, 200);
this.setVisible(true);
this.codigo = CodigoParametro.EXPRLIST;
}

/**
* M�todo que retorna uma mensagem que ser� impressa na tela, tanto na forma
* de t�tulo quanto na forma de mensagem de erro.
*
* @param codigo O c�digo da mensagem que ser� retornada.
*
* @return Uma String que representa a mensagem de retorno.
*
*/
public String retornarMensagem(String codigo) {
String mensagem = gerInterface.getMessage(codigo);
return mensagem;
}
/**
* M�todo que seta o label da tela.
*
* @param label String que representa o label que ser� exibido.
*
*/
public void setarLabel(String label){
labelEntrada.setText(label);
}
public TecladoVirtual getTecladoVirtual() {
return tecl;
}
/**
* Metodo que gerencia eventos de teclado relacionado a TelaParametro
*/
private void tfEspec_keyPressed(KeyEvent e){
if (e.getKeyCode() == e.VK_F12) {
this.AtualizarTfEspec(tfEspec.getText());
}
}
/**
* Metodo que realiza a traducao dos simbolos presentes no tfEspec (JTextArea)
* para a string interna que sera passado pro parser de argumentos
* @param str texto presente mp tfEspec
* @return
*/
public String TraduzirToLatex (String str) {
String result = new String();
int i = 0;
ZtoLatex Zlatex = new ZtoLatex();
CircusToLatex CircusLatex = new CircusToLatex();
while ( i < str.length()) {
if (Character.isWhitespace(str.charAt(i))
|| Character.isLetterOrDigit(str.charAt(i)) ) {

result += str.charAt(i);
}
else {
String aux = "" + str.charAt(i);
if (Zlatex.get(aux)!= null) {
result += Zlatex.get(aux);
}
else if (CircusLatex.get(aux) != null) {
result += CircusLatex.get(aux);
}

}
i++;
}
return result;
}
private void setArgument(String argument) {
this.argument = argument;
}
}