Задать вопрос
@Urfack

Как выполняется команда, последовательность?

Куда ссылается this в скобка this. word. setCommandListener(this) ;
И откуда word в this. word как это выполняется?
*/ public class Translator implements CommandListener {
/*     */   private Alert error;
/*     */   private List lfrom;
/*     */   private List lto;
/*     */   private Command ok;
/*     */   private Command back;
/*     */   private Command ok2;
/*     */   private Command fromc;
/*     */   private Command toc;
/*     */   private Command edit;
/*     */   private Command clear;
/*     */   private Command set;
/*     */   private Form form;
/*     */   private Form mesf;
/*     */   private int from;
/*     */   private int to;
/*     */   private String answer2;
/*     */   public static String[] default_op_ind = { 
/*  39 */       "sq", "en", "ar", "af", "be", "bg", "cy", "hu", "vi", "gl", "nl", "el", "da", "iw", "id", "ga", "is", "es", "it", "ca", "zh-CN", "ko", "lv", "lt", "mk", "ms", "mt", "de", "no", "fa", "pl", "pt", "ro", "ru", "sr", "sk", "sl", "sw", "tl", "th", "tr", "uk", "fi", "fr", "hi", "hr", "cs", "sv", "et", "ja" }; public static String[] default_op_title = { 
/*  40 */       "албанский", "английский", "арабский", "африканский", "белорусский", "болгарский", "валлийский", "венгерский", "вьетнамский", "галисийский", "голландский", "греческий", "датский", "иврит", "индонезийский", "ирландский", "исландский", "испанский", "итальянский", "каталанский", "китайский", "корейский", "латышский", "литовский", "македонский", "малайский", "мальтийский", "немецкий", "норвежский", "персидский", "польский", "португальский", "румынский", "русский", "сербский", "словацкий", "словенский", "суахили", "тагальский", "тайський", "турецкий", "украинский", "финский", "французский", "хинди", "хорватский", "чешский", "шведский", "эстонский", "японский" }; private String[] from_ind; private String[] from_title; private String[] to_ind; public Translator() { this.ok = new Command("Ok", 4, 1);
/*     */     this.back = new Command("Назад", 2, 2);
/*     */     this.ok2 = new Command("Ясно", 4, 1);
/*     */     this.fromc = new Command("Перевести с", 1, 2);
/*     */     this.toc = new Command("Перевести на", 1, 3);
/*     */     this.edit = new Command("Редактор", 1, 2);
/*     */     this.clear = new Command("Очистить", 1, 4);
/*     */     this.set = new Command("Настроить языки", 1, 5);
/*     */     this.from = 3;
/*     */     this.to = 33;
/*  50 */     readrms();
/*  51 */     this.error = new Alert("Упс!....", "Вы не ввели слово", null, AlertType.ERROR);
/*  52 */     this.error.setTimeout(-2);
/*  53 */     this.error.addCommand(this.ok2);
/*  54 */     this.error.setCommandListener(this);
/*     */     
/*  56 */     this.word = new TextBox("Перевести " + this.from_ind[this.from] + "->" + this.to_ind[this.to], "", 56320, 0);
/*  57 */     this.word.addCommand(this.ok);
/*  58 */     this.word.addCommand(this.back);
/*  59 */     this.word.addCommand(this.fromc);
/*  60 */     this.word.addCommand(this.toc);
/*  61 */     this.word.addCommand(this.clear);
/*  62 */     this.word.addCommand(this.set);
/*  63 */     this.word.setCommandListener(this);
/*     */     
/*  65 */     this.mesf = new Form(null);
/*  66 */     this.mesf.addCommand(this.ok2);
/*  67 */     this.mesf.addCommand(this.edit);
/*  68 */     this.mesf.setCommandListener(this); }
  • Вопрос задан
  • 62 просмотра
Подписаться 1 Средний 1 комментарий
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы