View Javadoc

1   // Copyright 2005, FreeHEP.
2   package hep.wired.heprep.interaction;
3   
4   import java.awt.*;
5   import java.awt.event.*;
6   import java.awt.geom.*;
7   import javax.swing.*;
8   
9   import org.freehep.application.Application;
10  
11  import hep.wired.services.GraphicsPanel;
12  import hep.wired.services.RecordPlot;
13  import hep.wired.services.InteractionHandler;
14  import hep.wired.image.WiredBaseImage;
15  
16  import hep.wired.heprep.graphicspanel.ControlPanel;
17  
18  /***
19   *
20   * @author Mark Donszelmann
21   * @version $Id: Variables.java 2134 2005-07-29 17:06:53Z duns $
22   */
23  public class Variables extends RoutingInteractionHandler {
24  
25      private static Variables instance;
26      private VariablePanel panel;
27  
28      private Variables() {
29          super("Variables");
30          panel = new VariablePanel();
31          
32          // FIXME, NPE when this is not called.
33          panel.setInteractionHandler(null);                
34      }
35      
36      public static Variables getInstance() {
37          if (instance == null) {
38              instance = new Variables();
39          }
40          return instance;
41      }
42      
43      public Icon getIcon(int size) {
44          return WiredBaseImage.getIcon("Variable%w", size);
45      }    
46  
47      public String getDescription() {
48          return "Changing of variables.";
49      }
50  
51      public ControlPanel getPanel() {
52          return panel;
53      }
54      
55      public String toString() {
56          return "Variables";
57      }
58  }