Module tvbrowser

Class ProgramMouseEventHandler

  • All Implemented Interfaces:
    java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.MouseWheelListener, java.util.EventListener

    public class ProgramMouseEventHandler
    extends java.awt.event.MouseAdapter
    A class that handles mouse interactions on programs. Use this in your Plugin if you want to react to mouse events like the program table.

    Since:
    3.3.1
    Author:
    René Mach
    • Constructor Detail

      • ProgramMouseEventHandler

        public ProgramMouseEventHandler​(ProgramMouseAndContextMenuListener listener,
                                        ContextMenuIf owner)
        Create a new instance of this class to handle mouse events on programs.

        Parameters:
        listener - The listener to react to.
        owner - The ContextMenuIf that wants to react on mouse events.
    • Method Detail

      • setOwner

        public void setOwner​(ContextMenuIf owner)
        Parameters:
        owner - The ContextMenuIf that wants to react on mouse events.
      • mouseClicked

        public void mouseClicked​(java.awt.event.MouseEvent e)
        Specified by:
        mouseClicked in interface java.awt.event.MouseListener
        Overrides:
        mouseClicked in class java.awt.event.MouseAdapter
      • mousePressed

        public void mousePressed​(java.awt.event.MouseEvent e)
        Specified by:
        mousePressed in interface java.awt.event.MouseListener
        Overrides:
        mousePressed in class java.awt.event.MouseAdapter
      • mouseReleased

        public void mouseReleased​(java.awt.event.MouseEvent e)
        Specified by:
        mouseReleased in interface java.awt.event.MouseListener
        Overrides:
        mouseReleased in class java.awt.event.MouseAdapter
      • handleProgramClick

        public static void handleProgramClick​(Program program,
                                              ContextMenuIf caller,
                                              boolean singleClick,
                                              java.awt.event.MouseEvent e)
        Handles a program mouse click.

        Parameters:
        program - The program to handle.
        caller - The ContextMenuIf that caused the event.
        singleClick - true if it was a single click, false otherwise.
        e - The event that was triggered with a mouse interaction.
      • handleAction

        public static void handleAction​(Program program,
                                        ActionMenu menu)
      • handleAction

        public static void handleAction​(Program program,
                                        ActionMenu menu,
                                        int actionId)