Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: com/trapezium/chisel/help/HelpWindow.java


1   /*
2    * @(#)HelpWindow.java
3    *
4    * Copyright (c) 1998 by Trapezium Development Company.  All Rights Reserved.
5    *
6    * The information in this file is the property of Trapezium Development
7    * Company and may be used only in accordance with the terms of the license
8    * granted by Trapezium.
9    *
10   */
11  package com.trapezium.chisel.help;
12  
13  import java.awt.*;
14  import java.util.ResourceBundle;
15  import java.util.MissingResourceException;
16  import java.io.*;
17  
18  import com.trapezium.chisel.ChiselResources;
19  import com.trapezium.chisel.gui.FontPool;
20  import com.trapezium.chisel.gui.PopupViewer;
21  
22  /** Help system main window */
23  public class HelpWindow extends PopupViewer {
24  
25      public HelpWindow(Frame frame) {
26        super(frame);
27      }
28  
29      protected Component createContent() {
30          ResourceBundle res = ChiselResources.getDefaultResourceBundle();
31          Container helpPanel;
32        if (JFCAvailable()) {
33            helpPanel = new HelpPanel(res);
34        } else {
35            helpPanel = new Panel();
36               helpPanel.setLayout(new BorderLayout());
37            Panel body = new Panel();
38            body.setLayout(new BorderLayout());
39            try {
40                Label header = new Label(res.getString("JFCNotFoundMessageHeader"));
41                header.setFont(FontPool.getHeaderFont(0));
42                helpPanel.add("Center", header);
43                Label body1 = new Label(res.getString("JFCNotFoundMessage1"));
44                body.add("North", body1);
45                Label body2 = new Label(res.getString("JFCNotFoundMessage2"));
46                body.add("North", body2);
47                Label body3 = new Label(res.getString("JFCNotFoundMessage3"));
48                body.add("North", body3);
49              } catch (MissingResourceException e) {
50              }
51               helpPanel.add("South", body);
52        }
53          return helpPanel;
54      }
55  
56      static final String jfcclassname = "javax.swing.JPanel";
57      static boolean JFCAvailable() {
58          try {
59              Class jfcclass = Class.forName(jfcclassname);
60              System.out.println("JFC detected");
61          } catch (ClassNotFoundException e) {
62              return false;
63          }
64          return false; // true;
65      }
66  
67  }