Class LinkListener

All Implemented Interfaces:
FSMouseListener

public class LinkListener extends DefaultFSMouseListener
A LinkListener is used to respond to a user clicking Box elements in a BasicPanel, in particular to handle anchors and navigation. When a Box is clicked, if it has an anchor associated with it, the panel will be requested to navigate to that URI.
  • Constructor Details

    • LinkListener

      public LinkListener()
  • Method Details

    • linkClicked

      public void linkClicked(BasicPanel panel, String uri)
      Utility method to request the panel navigate to the given URI.
      Parameters:
      panel - the panel on which the listener is attached
      uri - the URI to navigate to
    • onMouseUp

      public void onMouseUp(BasicPanel panel, Box box)
      Triggers the click on a box. If the Box's element has an associated URI (e.g. is an anchor), notifies the panel to navigate to that URI.
      Specified by:
      onMouseUp in interface FSMouseListener
      Overrides:
      onMouseUp in class DefaultFSMouseListener
      Parameters:
      panel - the panel where the mouse button has been released.
      box - the box on which the mouse cursor is currently located