commit 2240cf8ad97202ed3125b340f7f461d44ae59424 from: marcus date: Tue Oct 25 10:25:04 2005 UTC reverted bad patch. does not work :/ commit - 3f722edaa3dd0dfeff64ef280d5bf587cfe645b7 commit + 2240cf8ad97202ed3125b340f7f461d44ae59424 blob - c88b0ff2bbf3f693b574fa4b2b8518ab75a0aa62 blob + c1f0734beaf8a5911f1508436d16774cc858a9dd --- de/mud/terminal/SwingTerminal.java +++ de/mud/terminal/SwingTerminal.java @@ -70,9 +70,6 @@ public class SwingTerminal extends Component /** the VDU buffer */ private VDUBuffer buffer; - - /** the VDU input handler */ - private VDUInput input; /** lightweight component definitions */ private final static long VDU_EVENTS = AWTEvent.KEY_EVENT_MASK @@ -228,14 +225,6 @@ public class SwingTerminal extends Component this.buffer = buffer; buffer.setDisplay(this); } - - /** - * Set a new terminal (VDU) input handler. - * @param input new input handler - */ - public void setVDUInput(VDUInput input) { - this.input = input; - } /** * Return the currently associated VDUBuffer. @@ -246,14 +235,6 @@ public class SwingTerminal extends Component } /** - * Return the currently associated VDUInput. - * @return the current input handler - */ - public VDUInput getVDUInput() { - return input; - } - - /** * Set new color set for the display. * @param colorset new color set */ @@ -829,8 +810,8 @@ public class SwingTerminal extends Component int xoffset = (super.getSize().width - buffer.width * charWidth) / 2; int yoffset = (super.getSize().height - buffer.height * charHeight) / 2; - if (input != null) { - input.mousePressed(xoffset, yoffset, evt.getModifiers()); + if (buffer instanceof VDUInput) { + ((VDUInput) buffer).mousePressed(xoffset, yoffset, evt.getModifiers()); } // looks like we get no modifiers here ... ... We do? -Marcus @@ -850,8 +831,8 @@ public class SwingTerminal extends Component int xoffset = (super.getSize().width - buffer.width * charWidth) / 2; int yoffset = (super.getSize().height - buffer.height * charHeight) / 2; - if (input != null) { - input.mousePressed(xoffset, yoffset, evt.getModifiers()); + if (buffer instanceof VDUInput) { + ((VDUInput) buffer).mousePressed(xoffset, yoffset, evt.getModifiers()); } if (buttonCheck(evt.getModifiers(), MouseEvent.BUTTON1_MASK)) { @@ -904,13 +885,13 @@ public class SwingTerminal extends Component } public void keyTyped(KeyEvent e) { - if (input != null) - input.keyTyped(e.getKeyCode(), e.getKeyChar(), getModifiers(e)); + if (buffer != null && buffer instanceof VDUInput) + ((VDUInput) buffer).keyTyped(e.getKeyCode(), e.getKeyChar(), getModifiers(e)); } public void keyPressed(KeyEvent e) { - if (input != null) - input.keyPressed(e.getKeyCode(), e.getKeyChar(), getModifiers(e)); + if (buffer != null && buffer instanceof VDUInput) + ((VDUInput) buffer).keyPressed(e.getKeyCode(), e.getKeyChar(), getModifiers(e)); } public void keyReleased(KeyEvent e) {