Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

...

  1. If you have not already done so, create a Java Project (File -> New -> Java Project). TODO: Add naming guidelines.
  2. Add GFW and SwingUtil to your Eclipse project buildpath. You can do this either by including the GUIFramework and SwingUtil projects to your workspace, and then Importing importing them into your new project (File -> Import -> Project from Workspace), or File -> Import... -> CVS -> Projects from CVS, or by including their jar files from the production distribution location. E.g. GUIFramework.jar is in /usr/local/lcls/physics/GUIFramework/jar/GUIFramework.jar.
  3. Instantiate the custom components. For instance, if you have not yet created the main class, now you would do so. Note, that this class is likely to be in a different package to the User Interface package if you are separating UI components from application code.
  4. Create a BasicFrame or a ModelFrame instance of the GFW, e.g
    Code Block
    final BasicFrame myFrame = new BasicFrame("My Frame"); 
    
    or
    Code Block
    final ModelFrame myFrame = new ModelFrame("My Model Frame"); 
    
  5. Add custom components to various areas of the GFW frame, such as
    • Title Bar
      Code Block
      myFrame.addToTitleBar(myComponent);
      
    • Tab 1
      Code Block
      myFrame.addTopTab1(myComponent);
      
    • Tab 2
      Code Block
      myFrame.addTopTab2(myComponent);
      
    • New Tab
      Code Block
      myFrame.addTopTab(myComponent, "My Label");
      
    • Bottom ScrollPane
      Code Block
      myFrame.addToBottomScrollPane(myComponent);
      
  6. Set application version
    Code Block
    BasicFrame myFrame = ...; // see above
    JLabel appVersionLabel = myFrame.getBasicPanel().getStatusPanel().getAppVersionLabel();
    appVersionLabel.setText("my version"); //run in the GUI thread, of before displaying the frame
    
  7. #Add event listeners to the appropriate widgets
  8. Display the GFW frame
    Code Block
    SwingUtilities.invokeLater(new Runnable() {
    	public void run() {
    		myFrame.setVisible(true);
    	}
    });
    

...

  • Add your BasicFrameListener to your BasicFrameController.
    Q: To which method of your BasicFrameController do you add it.
  • it seems to me also that BasicFrameController is ambiguous - it's not clear whether the "basic" refers to the BasicFrame of Sergei's GFW, or one's own application's frame controller. It's hard to tell what's in the GFW, and what one is suppose to write.
    Code Block
    
    BasicFrameListener myFrameListener = new MyFrameListener();
    BasicFrameController myFrameController = new MyFrameController(myFrame);
    myFrameController.addBasicFrameListener(myFrameListener);
    

Set web help URL

If you want to provide help via the default GFW way, set the URL of your help website.

...