Double Click opens Edit Window

2007-04-30
2013-02-12
  • Matthias Ihmig

    Matthias Ihmig - 2007-04-30

    Hi, I have a question about how double click is implemented.

    I edit in MovieManagerCommandSelect.java the function below and replaced expand/collapse with the CommandEdit.execute().

    But on double click, the row is still expanded/collapsed.

    Is this behaviour implemented somewhere else??

    Thanks,

    Matthias

    -----
        public void mouseClicked(MouseEvent event) {

            /* If Button1 and more than 1 click the node is expanded/collapsed */
            if (SwingUtilities.isLeftMouseButton(event)) {
                if (event.getClickCount() >= 2 && isCtrlPressed(event)) {

    /*                JTree movieList = MovieManager.getDialog().getMoviesList();
                    int rowForLocation = movieList.getRowForLocation(event.getX(), event.getY());

                    if (movieList.isCollapsed(rowForLocation))
                        movieList.expandRow(rowForLocation);
                    else
                        movieList.collapseRow(rowForLocation);
    */
                    MovieManagerCommandEdit.execute();
                }
            }
        }

     
    • Matthias Ihmig

      Matthias Ihmig - 2007-04-30

      Actually, the secret lies in the  && isCtrlPressed().

      What was it originally meant for? Why is the expandRow and collapseRow only executed when Ctrl is pressed?

      Matthias

       
    • Matthias Ihmig

      Matthias Ihmig - 2007-04-30

      Now in CVS.

      Matthias

       
    • Bro

      Bro - 2007-04-30

      Hi

      I don't remember excactly as I wrote that a long time ago.
      The ctrl check has definitely something to do with the "Enable right click by ctrl-key in movielist" option in the preferences, but I believe it might be unecessary now.
      That option is for Mac users with a one-button mouse.

      It seems to work well!

      Bro

       

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks