Package java.awt.event

Examples of java.awt.event.MouseListener


    handlerIconPanel = new ProxyPanel();
   
    add("West", handlerIconPanel);
   
    handlerActivityPanel = new ProxyPanel();
    handlerActivityPanel.addMouseListener(new MouseListener(){

      public void mouseClicked(MouseEvent e) {
        ProcessDesigner.getInstance().getPropertyPanel().removeAll();
       
        ObjectType eventHandlerType;
        try {
         
         
          //find out which handler is selected. Either I know this is not that good code ;)
          int handlerIndex = getScopeActivity().getEventHandlers().length - e.getX() / 32;
          EventHandler theEventHandler = getScopeActivity().getEventHandlers()[handlerIndex];
          //
         
          eventHandlerType = new ObjectType(EventHandler.class);
         
          ObjectInstance eventHandlerInstance = (ObjectInstance)eventHandlerType.createInstance();
          eventHandlerInstance.setObject(theEventHandler);
         
          InputForm eventHandlerInputForm = new InputForm(eventHandlerType){
            public void onSaveOK(Instance rec, JDialog dialog){
             
            }         
            public void onUpdateOK(Instance rec, JDialog dialog){
              onSaveOK(rec, dialog);
            }
          };
                 
          eventHandlerInputForm.setInstance(eventHandlerInstance);
       
          JDialog dialog=new InputDialog(eventHandlerInputForm, ProcessDesigner.getInstance()){
            //do not clear the form
            public void onSaveOK(Instance rec){
              getInputForm().onSaveOK(rec, this);
            }
          };
         
          JPanel propertyPanel = InputDialog.createPanel(
              eventHandlerInputForm,
              null,
              "Apply",
              "Apply",
              "Cancel"
            );
          //dialog.show();
          //       
          ProcessDesigner.getInstance().getPropertyPanel().add("Center", propertyPanel);
          ProcessDesigner.getInstance().getPropertyPanel().revalidate();
        } catch (Exception e1) {
          // TODO Auto-generated catch block
          e1.printStackTrace();
        }
      }

      public void mouseEntered(MouseEvent e) {
        // TODO Auto-generated method stub
       
      }

      public void mouseExited(MouseEvent e) {
        // TODO Auto-generated method stub
       
      }

      public void mousePressed(MouseEvent e) {
        // TODO Auto-generated method stub
       
      }

      public void mouseReleased(MouseEvent e) {
        // TODO Auto-generated method stub
       
      }});
   
    handlerActivityPanel.setLayout(new BoxLayout(handlerActivityPanel, BoxLayout.Y_AXIS));
    handlerActivityPanel.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
    //setBorder(BorderFactory.createLineBorder(Color.GRAY, 1));
    //setBorder(BorderFactory.createTitledBorder("event handlers"));

    //setBackground(Color.LIGHT_GRAY);
    add("Center", handlerActivityPanel);
   
    handlerActivityPanel.addMouseListener(new MouseListener(){

      public void mouseClicked(MouseEvent e) {
        // TODO Auto-generated method stub
       
      }
View Full Code Here


    }

    setPreferredSize(originalSize);
   
    //setBorder(BorderFactory.createLineBorder(Color.ORANGE, 1));
    addMouseListener(new MouseListener(){

      public void mouseClicked(MouseEvent e) {
        // TODO Auto-generated method stub
      }
View Full Code Here

//      public void adjustmentValueChanged(AdjustmentEvent arg0) {
//        System.err.println("Scrolling");
//      }
//         
//        });
        sb.addMouseListener(new MouseListener(){

      public void mouseClicked(MouseEvent arg0) {}

      public void mouseEntered(MouseEvent arg0) {
        scrolling = true;
View Full Code Here

  {
    setBackground(new Color(149, 230, 190));
    setLayout(new FlowLayout(FlowLayout.LEADING, 5, 5));

    // Clears the current selection when the background is clicked
    addMouseListener(new MouseListener()
    {

      /*
       * (non-Javadoc)
       * @see java.awt.event.MouseListener#mousePressed(java.awt.event.MouseEvent)
View Full Code Here

    entry.setIconTextGap(0);

    entry.setToolTipText(name);
    entry.setText(name);

    entry.addMouseListener(new MouseListener()
    {

      /*
       * (non-Javadoc)
       * @see java.awt.event.MouseListener#mousePressed(java.awt.event.MouseEvent)
View Full Code Here

        {
        }
      }
    }

    MouseListener scrollUpListener = new Up();
    upButton.addMouseListener( scrollUpListener );

    add( upButton );
    downButton = new JButton( UISupport.createImageIcon( "/down_arrow.gif" ) );
    downButton.setPreferredSize( d );
    downButton.setBorderPainted( false );
    downButton.setFocusPainted( false );

    class Down extends MouseAdapter
    {
      /**
       * When mouse enters over the downbutton, timerDown starts the
       * scrolling downwards.
       *
       * @param e
       *           MouseEvent
       */
      public void mouseEntered( MouseEvent e )
      {
        try
        {
          timerDown.start();
        }
        catch( Exception ekas )
        {
        }
      }

      /**
       * When mouse exites the downbutton, timerDown stops.
       *
       * @param e
       *           MouseEvent
       */
      public void mouseExited( MouseEvent e )
      {
        try
        {
          timerDown.stop();
        }
        catch( Exception ekas )
        {
        }
      }
    }

    MouseListener scrollDownListener = new Down();
    downButton.addMouseListener( scrollDownListener );
    add( downButton, subMenus.size() + 1 );
    setHorizontalAlignment( SwingConstants.LEFT );
  }
View Full Code Here

        {
        }
      }
    }

    MouseListener scrollUpListener = new Up();
    upButton.addMouseListener( scrollUpListener );

    add( upButton );
    downButton = new JButton( UISupport.createImageIcon( "/down_arrow.gif" ) );
    downButton.setPreferredSize( d );
    downButton.setBorderPainted( false );
    downButton.setFocusPainted( false );

    class Down extends MouseAdapter
    {
      /**
       * When mouse enters over the downbutton, timerDown starts the
       * scrolling downwards.
       *
       * @param e
       *           MouseEvent
       */
      public void mouseEntered( MouseEvent e )
      {
        try
        {
          timerDown.start();
        }
        catch( Exception ekas )
        {
        }
      }

      /**
       * When mouse exites the downbutton, timerDown stops.
       *
       * @param e
       *           MouseEvent
       */
      public void mouseExited( MouseEvent e )
      {
        try
        {
          timerDown.stop();
        }
        catch( Exception ekas )
        {
        }
      }
    }

    MouseListener scrollDownListener = new Down();
    downButton.addMouseListener( scrollDownListener );
    add( downButton, 1 + subMenus.size() );
  }
View Full Code Here

    this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    setLF(); // set default look and feel
    analyzedResultsList.setCellRenderer(new MyListCellRenderer());

    // doubleclicking on document shows the annotated result
    MouseListener mouseListener = new ListMouseAdapter();
    // styleMapFile, analyzedResultsList,
    // inputDirPath,typeSystem , typesToDisplay ,
    // javaViewerRB , javaViewerUCRB ,xmlRB ,
    // viewerDirectory , this);
View Full Code Here

      public void mouseMoved(MouseEvent e) {
        setMouseTarget(new Point2d(e.getX(), e.getY()));
      }     
    });
   
    this.world.addMouseListener(new MouseListener() {
      public void mouseClicked(MouseEvent e) {
        //
      }
      public void mouseEntered(MouseEvent e) {
        setMouseTarget(new Point2d(e.getX(), e.getY()));
View Full Code Here

      public void mouseMoved(MouseEvent e) {
        setMouseTarget(new Point2d(e.getX(), e.getY()));
      }     
    });
   
    this.world.addMouseListener(new MouseListener() {
      public void mouseClicked(MouseEvent e) {
        //
      }
      public void mouseEntered(MouseEvent e) {
        setMouseTarget(new Point2d(e.getX(), e.getY()));
View Full Code Here

TOP

Related Classes of java.awt.event.MouseListener

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.