Package org.beryl.gui

Examples of org.beryl.gui.GUIEvent


  public void addListener(String event, final String name, final GUIEventListener listener) throws GUIException {
    if ("command".equals(event)) {
      console.addCommandListener(new CommandListener() {
        public void onCommand(CommandEvent e) {
          listener.eventOccured(new GUIEvent(Console.this, name, e));
        }
      });
    } else {
      super.addListener(event, name, listener);
    }
View Full Code Here


      for (Iterator i = closeListeners.keySet().iterator(); i.hasNext();) {
        final String name = (String) i.next();
        final GUIEventListener listener = (GUIEventListener) closeListeners.get(name);
        dialog.addWindowListener(new WindowAdapter() {
          public void windowClosing(WindowEvent e) {
            listener.eventOccured(new GUIEvent(Dialog.this, name, e));
          }
        });
      }
    } else
      throw new GUIException("Initialize dialog first!");
View Full Code Here

  public void addListener(String event, final String name, final GUIEventListener listener) throws GUIException {
    if ("rightclick".equals(event)) {
      list.addMouseListener(new MouseAdapter() {
        public void mousePressed(MouseEvent me) {
          if (me.isPopupTrigger()) {
            listener.eventOccured(new GUIEvent(List.this, name, me));
          }
        }

        public void mouseReleased(MouseEvent me) {
          mousePressed(me);
        }
      });
    } else if (event.equals("doubleclick")) {
      list.addMouseListener(new MouseAdapter() {
        public void mousePressed(MouseEvent me) {
          if (me.getClickCount() == 2) {
            listener.eventOccured(new GUIEvent(List.this, name, me));
          }
        }
      });
    } else {
      super.addListener(event, name, listener);
View Full Code Here

  public void addListener(String event, final String name, final GUIEventListener listener) throws GUIException {
    if ("selected".equals(event)) {
      menuItem.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          listener.eventOccured(new GUIEvent(MenuItem.this, name, e));
        }
      });
    } else {
      super.addListener(event, name, listener);
    }
View Full Code Here

  public void addListener(String event, final String name, final GUIEventListener listener) throws GUIException {
    if ("close".equals(event)) {
      frame.addWindowListener(new WindowAdapter() {
        public void windowClosing(WindowEvent e) {
          listener.eventOccured(new GUIEvent(Frame.this, name, e));
        }
      });
    } else {
      super.addListener(event, name, listener);
    }
View Full Code Here

  public void addListener(String event, final String name, final GUIEventListener listener) throws GUIException {
    if ("clicked".equals(event)) {
      button.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          listener.eventOccured(new GUIEvent(Button.this, name, e));
        }
      });
    } else {
      super.addListener(event, name, listener);
    }
View Full Code Here

  public void addListener(String event, final String name, final GUIEventListener listener) throws GUIException {
    if ("rightclick".equals(event)) {
      table.addMouseListener(new MouseAdapter() {
        public void mousePressed(MouseEvent me) {
          if (me.isPopupTrigger() && message == null) {
            listener.eventOccured(new GUIEvent(Table.this, name, me));
          }
        }

        public void mouseReleased(MouseEvent me) {
          mousePressed(me);
        }
      });
    } else if (event.equals("doubleclick")) {
      table.addMouseListener(new MouseAdapter() {
        public void mousePressed(MouseEvent me) {
          if (me.getClickCount() == 2 && message == null) {
            listener.eventOccured(new GUIEvent(Table.this, name, me));
          }
        }
      });
    } else {
      super.addListener(event, name, listener);
View Full Code Here

  public void addListener(String event, final String name, final GUIEventListener listener) throws GUIException {
    if ("activated".equals(event)) {
      textField.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          listener.eventOccured(new GUIEvent(TextField.this, name, e));
        }
      });
    } else {
      super.addListener(event, name, listener);
    }
View Full Code Here

  public void addListener(String event, final String name, final GUIEventListener listener) throws GUIException {
    if (event.equals("rightclick")) {
      tree.addMouseListener(new MouseAdapter() {
        public void mousePressed(MouseEvent me) {
          if (me.isPopupTrigger()) {
            listener.eventOccured(new GUIEvent(Tree.this, name, me));
          }
        }

        public void mouseReleased(MouseEvent me) {
          mousePressed(me);
        }
      });
    } else if (event.equals("doubleclick")) {
      tree.addMouseListener(new MouseAdapter() {
        public void mousePressed(MouseEvent me) {
          if (me.getClickCount() == 2) {
            listener.eventOccured(new GUIEvent(Tree.this, name, me));
          }
        }
      });
    } else {
      super.addListener(event, name, listener);
View Full Code Here

  public void addListener(String event, final String name, final GUIEventListener listener) throws GUIException {
    if ("selected".equals(event)) {
      iconView.addListSelectionListener(new ListSelectionListener() {
        public void valueChanged(ListSelectionEvent e) {
          int index = e.getFirstIndex();
          listener.eventOccured(new GUIEvent(IconView.this, name, e));
        }
      });
    } else {
      super.addListener(event, name, listener);
    }
View Full Code Here

TOP

Related Classes of org.beryl.gui.GUIEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.