Back to index

wims  3.65+svn20090927
Public Member Functions | Static Public Member Functions | Static Public Attributes | Static Package Functions | Static Package Attributes | Private Attributes
SharpTools.HelpOp Class Reference

Code taken from http://www.inquiry.com/techtips/java_pro/answer.asp?pro=java_pro&docID=2282. More...

Collaboration diagram for SharpTools.HelpOp:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 HelpOp (URL url)

Static Public Member Functions

static JComponent createFunctionListComponent (JFrame frame, JTable table)

Static Public Attributes

static Properties translation = SharpTools.translation

Static Package Functions

static void showAboutBox (JFrame frame)

Static Package Attributes

static final String message = "<p>5/2009 Converted into an Applet for WIMS usage"

Private Attributes

JEditorPane htmlPane
JScrollPane scrollPane
JFrame frame
Container container
WindowListener exitListener
HyperlinkListener linkListener
URL url

Detailed Description

Code taken from http://www.inquiry.com/techtips/java_pro/answer.asp?pro=java_pro&docID=2282.

Code for HTML Browser originally from DisplayHTML.java by Daniel Savarese on 9/15/98. This html browser allows for the browsing of local help files.

Author:
Daniel Medina, Daniel Goldberg
Version:
Revision:
1.21

Definition at line 28 of file HelpOp.java.


Constructor & Destructor Documentation

SharpTools.HelpOp.HelpOp ( URL  url) [inline]

Definition at line 39 of file HelpOp.java.

                           {
       frame = new JFrame("Help Browser: " + url);
       container = frame.getContentPane();
       container.setLayout(new BorderLayout());  
       try {
           htmlPane = new JEditorPane(url);
       } catch(IOException e) {
           e.printStackTrace();
           return;
       }
       
       // We only want to display the file, not edit it.
       htmlPane.setEditable(false);
       
       linkListener = new HyperlinkListener() {
              public void hyperlinkUpdate(HyperlinkEvent e) {
                  URL newURL;
                  Document currentDocument;
                  
                  if(e.getEventType() != HyperlinkEvent.EventType.ACTIVATED)
         return;
                  
                  if((newURL = e.getURL()) == null)
                     return;
                  
                  currentDocument = htmlPane.getDocument();
                  
                  try {
                     htmlPane.setPage(newURL);
                  } catch(IOException ex) {
                     htmlPane.setDocument(currentDocument);
                  }
              }
           };
       
       htmlPane.addHyperlinkListener(linkListener);

       scrollPane = new JScrollPane(htmlPane);
       
       container.add(scrollPane);
       
       scrollPane.setPreferredSize(new Dimension(500, 500));
       
       exitListener = new WindowAdapter() {
              public void windowClosing(WindowEvent e) {
                  Window window = e.getWindow();
                  window.setVisible(false);
                  window.dispose();
              }
           };
       
       frame.addWindowListener(exitListener);
       
       frame.pack();
       frame.show();
    }

Member Function Documentation

static JComponent SharpTools.HelpOp.createFunctionListComponent ( JFrame  frame,
JTable  table 
) [inline, static]

Definition at line 119 of file HelpOp.java.

                                                                                     {

       JPanel comboxPanel = new JPanel();
       comboxPanel.setLayout(new BorderLayout());
       String[] funcNames = {          
           translation.getProperty("Functions") , "ABS", "AVERAGE", "COUNT", "E", "INT",
           "LOG", "MAX", "MEANDEV", "MEDIAN", "MIN", "PI", "RANGE", "ROUND",
           "SQRT", "SUM", "STDDEV",
           "SIN", "COS", "TAN", "ASIN", "ACOS", "ATAN"      
       };
       
       JComboBox funcList = new JComboBox(funcNames);
       Dimension combodim = funcList.getSize();
       funcList.setPreferredSize
           (new Dimension(100, (int)combodim.getHeight()));
       comboxPanel.add(funcList, BorderLayout.WEST);

       // if a cell is being edited then insert the function name into the cell
       funcList.addActionListener(new FunctionListListener(frame, table));
       return comboxPanel;
    }

Here is the caller graph for this function:

static void SharpTools.HelpOp.showAboutBox ( JFrame  frame) [inline, static, package]

Definition at line 108 of file HelpOp.java.

                                           {
       SharpOptionPane.showMessageDialog
           (frame,
            message,
            translation.getProperty("About_SharpTools"),               
            JOptionPane.INFORMATION_MESSAGE,
            SharpTools.getImageIcon("images/wims.gif")
            );
    }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Container SharpTools.HelpOp.container [private]

Definition at line 33 of file HelpOp.java.

WindowListener SharpTools.HelpOp.exitListener [private]

Definition at line 34 of file HelpOp.java.

JFrame SharpTools.HelpOp.frame [private]

Definition at line 32 of file HelpOp.java.

JEditorPane SharpTools.HelpOp.htmlPane [private]

Definition at line 30 of file HelpOp.java.

HyperlinkListener SharpTools.HelpOp.linkListener [private]

Definition at line 35 of file HelpOp.java.

final String SharpTools.HelpOp.message = "<p>5/2009 Converted into an Applet for WIMS usage" [static, package]

Definition at line 96 of file HelpOp.java.

JScrollPane SharpTools.HelpOp.scrollPane [private]

Definition at line 31 of file HelpOp.java.

Definition at line 29 of file HelpOp.java.

URL SharpTools.HelpOp.url [private]

Definition at line 36 of file HelpOp.java.


The documentation for this class was generated from the following file: