Logo Search packages:      
Sourcecode: wims version File versions  Download package

void GenericGraphApplet::init (  )  [inline]

The init() method is called by the system to set up the applet. If the applet does not appear as a button, then init() creates the main panel of the applet and calls setUpMainPanel to set it up. If any error occurs during calls to setUpParser(), setUpExampleMenu(), or setUpMainPanel(), then the applet will just show an error message, and stack trace will be printed to standard output.

Reimplemented in DataPlotApplet.

Definition at line 122 of file GenericGraphApplet.java.

References frameTitle, getParameter(), mainPanel, setUpMainPanel(), and setUpParameterDefaults().

      frameTitle = getParameter("FrameTitle");
      if (frameTitle == null) {
         frameTitle = this.getClass().getName();
         int pos = frameTitle.lastIndexOf('.');
         if (pos > -1)
            frameTitle =  frameTitle.substring(pos+1);
      setLayout(new BorderLayout());
      int height = getSize().height;
      launchButtonName = getParameter("LaunchButtonName");
      if ( (height > 0 && height < 100) || launchButtonName != null) {
          if (launchButtonName == null)
               launchButtonName = "Launch " + frameTitle;
          launchButton = new Button(launchButtonName);
          add(launchButton, BorderLayout.CENTER);
      else {
          mainPanel = new JCMPanel();
          try {
             add(mainPanel, BorderLayout.CENTER);
          catch (Exception e) {
             System.out.println("Error while opening applet:");
             TextArea message = new TextArea("An error occurred while setting up the applet:\n\n");
             add(message, BorderLayout.CENTER);

Generated by  Doxygen 1.6.0   Back to index