1 package rero.gui.windows; 2 3 import rero.gui.*; 4 import rero.gui.input.*; 5 import rero.gui.background.*; 6 import javax.swing.*; 7 import java.awt.*; 8 import java.awt.event.*; 9 10 import rero.client.*; 11 import java.util.HashMap ; 12 import rero.util.ClientUtils; 13 14 import rero.ircfw.*; 15 16 import rero.bridges.menu.*; 17 18 import text.*; 19 import rero.config.*; 20 21 import java.util.*; 22 import text.event.*; 23 24 public abstract class EmptyWindow extends StatusWindow implements ClientWindowListener 25 { 26 public void touch() 27 { 28 } 29 30 public void installCapabilities(Capabilities c) 31 { 32 capabilities = c; 33 menuManager = (MenuBridge)c.getDataStructure("menuBridge"); 34 35 init(); 36 } 37 38 public InputField getInput() 39 { 40 return null; 41 } 42 43 public WrappedDisplay getDisplay() 44 { 45 return null; 46 } 47 48 public WindowStatusBar getStatusBar() 49 { 50 return null; 51 } 52 53 public void init(ClientWindow _frame) 54 { 55 frame = _frame; 56 frame.addWindowListener(new ClientWindowStuff()); 57 frame.addWindowListener(this); 58 59 frame.setContentPane(this); 60 61 setTitle(getName()); 62 frame.setIcon(getImageIcon()); 63 } 64 65 public abstract void init(); 66 67 public String getQuery() 68 { 69 return "Nada"; 70 } 71 72 public void setQuery(String q) 73 { 74 } 75 76 public void setTitle(String title) 77 { 78 frame.setTitle(title); 79 } 80 81 public ClientWindow getWindow() 82 { 83 return frame; 84 } 85 86 public String getTitle() 87 { 88 return frame.getTitle(); 89 } 90 91 public abstract String getName(); 92 93 public abstract ImageIcon getImageIcon(); 94 95 public String getWindowType() 96 { 97 return "Other"; 98 } 99 100 public boolean isLegalWindow() 101 { 102 return false; 103 } 104 105 private boolean isOpen = true; 106 107 public boolean isOpen() 108 { 109 return isOpen; 110 } 111 112 public void onActive(ClientWindowEvent ev) { } 113 public void onOpen(ClientWindowEvent ev) { isOpen = true; } 114 public void onInactive(ClientWindowEvent ev) { } 115 public void onMinimize(ClientWindowEvent ev) { } 116 public void onClose(ClientWindowEvent ev) { isOpen = false; } 117 118 protected LinkedList listeners = new LinkedList(); 119 120 public void addClickListener(ClickListener l) 121 { 122 listeners.add(l); 123 } 124 125 public void fireClickEvent(String text, MouseEvent mev) 126 { 127 ClickEvent ev = new ClickEvent(text, getName(), mev); 128 129 ListIterator i = listeners.listIterator(); 130 while (i.hasNext() && !ev.isConsumed()) 131 { 132 ClickListener l = (ClickListener)i.next(); 133 l.wordClicked(ev); 134 } 135 } 136 137 public int compareWindowType() 138 { 139 return 4; 140 } 141 } 142 | Popular Tags |