View Javadoc

1   // Copyright 2003-2005, FreeHEP.
2   package hep.wired.interaction;
3   
4   import java.awt.*;
5   import java.awt.event.*;
6   
7   import hep.wired.services.RecordPlot;
8   import hep.wired.services.GraphicsPanel;
9   
10  /***
11   *
12   * @author Mark Donszelmann
13   * @version $Id: NullInteractionHandler.java 682 2005-03-14 02:24:52Z duns $
14   */
15  public class NullInteractionHandler extends AbstractInteractionHandler {
16  
17      private static NullInteractionHandler instance;
18  
19      protected NullInteractionHandler() {
20          super("No Interaction");
21      }
22      
23      public static NullInteractionHandler getInstance() {
24          if (instance == null) {
25              instance = new NullInteractionHandler();
26          }
27          return instance;
28      }
29  
30      public String getDescription() {
31          return "No Interaction.";
32      } 
33      
34      public boolean isSupportedBy(GraphicsPanel panel) {
35          return true;
36      }
37      
38      public void changeCursor(RecordPlot plot, InputEvent event) {
39          plot.setCursor(Cursor.getDefaultCursor());
40      }    
41  
42      public void mouseEntered(RecordPlot plot, MouseEvent event) {
43          plot.requestFocusInWindow();
44          changeCursor(plot, event);
45      }    
46  }