Getting Started
Getting Started
Getting Started
Formula One
Analytical spreadsheet reporting tool for distributed computing environments Version 7.0
Information in this document is subject to change without notice. Companies, names, and data used in examples herein are fictitious unless otherwise noted. No part of this document may be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose, without the express written permission of Tidestone Technologies, Inc. This program is not fault-tolerant and is not designed, manufactured or intended for use or resale in the on-line control of nuclear facilities, aircraft navigation or communication system, air traffic control, direct life support machines or weapons systems in which the failure of the Program could lead directly to death, personal injury or severe physical or environmental damage. 1999 Tidestone Technologies, Inc. All rights reserved. Formula One is a registered trademark and Tidestone Technologies, First Impression, and VisualSpeller are trademarks of Tidestone Technologies, Inc. Java, 100% Pure Java, and all Java-based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. Microsoft, MS, MS-DOS, and Windows are registered trademarks and Microsoft Access and Microsoft Excel are trademarks of Microsoft Corporation in the USA and other countries. TrueType is a registered trademark of Apple Computer, Inc. Visual Cafe for Java is a registered trademark of Symantec Corporation. JBuilder is a registered trademark of Inprise Corp. All other product names are trademarks of their respective companies. The Tidestone License Agreement, included with the product, specifies the permitted and prohibited uses of the product. Any unauthorized reproduction or use of the product, or breach of the terms and conditions of the License Agreement, is forbidden. The Tidestone License Agreement sets forth the only warranties applicable to the product and documentation. All warranty disclaimers and exclusions set forth therein apply to the information contained in this document. Published by Tidestone Technologies, Inc. 12980 Metcalf Avenue, Suite 300 Overland Park, Kansas 66213 phone 913-851-2200 toll-free 1-800-884-8665 fax 913-851-1390 www.tidestone.com www.f1j.com
iii
Contents
First Things First . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Formula Ones AWT and Swing Components . . . . . . . . . . . . . . Installing Formula One . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . About the Workbook Designer . . . . . . . . . . . . . . . . . . . . . . . . . . Using Formula One as a JavaBean . . . . . . . . . . . . . . . . . . . . . . Getting Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using Formula One with AWT . . . . . . . . . . . . . . . . . . . . . . . . . . . . Required Files for Formula One AWT Deployment . . . . . . . . The Formula One AWT API . . . . . . . . . . . . . . . . . . . . . . . . . . . Sample Formula One AWT Application and Applet . . . . . . . . Formula One AWT Demos . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using Formula One with Swing . . . . . . . . . . . . . . . . . . . . . . . . . . Required Files for Formula One Swing Deployment . . . . . . . . The Formula One Swing API . . . . . . . . . . . . . . . . . . . . . . . . . . Sample Formula One Swing Application and Applet . . . . . . . . Formula One Swing Demos . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1 2 8 11 12 14 14 14 17 20 23 23 24 27 30
Upgrading to Formula One 7.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 Upgrading to Formula Ones 7.0 AWT Component . . . . . . . . 32 Upgrading to Formula Ones 7.0 Swing Component . . . . . . . . 33 Licensing Formula One . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 Software License Agreement . . . . . . . . . . . . . . . . . . . . . . . . . . 36 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Tidestone
JAR files. To deploy a project using Formula Ones Swing component, developers need to include F1J7Swing.jar. To deploy using the AWT component, developers need to include either F1J7AWT.jar or F1J7AWTDesign.jar. (To deploy Formula One on a database or application server, specialized JAR files can be created from these standard JAR files. See the Technical Guide for more information.) For more information, see Formula One JAR files on page 5.
Main class. The main class you use to display Formula Ones Swing component is com.f1j.swing.JBook. The main class in Formula Ones AWT component is com.f1j.View. For more information, see Formula One AWT Primary Classes on page 15 and Formula One Swing Primary Classes on page 25.
Workbook Designer differences. The Workbook Designer (Formula Ones user interface for displaying and editing spreadsheets) looks and acts differently depending on whether its deployed as an AWT or Swing component. The Swing Designer offers more features than the AWT Designer. For more information, see About the Workbook Designer on page 8.
Upgrading. Upgrading from Formula One 5.5 to the 7.0 AWT component is straightforward, but upgrading to the 7.0 Swing component is more involved. For more information, see Upgrading to Formula One 7.0 on page 32.
Platforms Tested
Formula One has been extensively tested and is known to run reliably on Windows 95, Windows 98, Windows NT 4.0, Solaris 2.6, and Macintosh OS 8.5. Other platforms that support JDK 1.1.5 or better should be capable of running Formula One.
System Requirements
Depending on your system, Formula One 7.0 requires about 25 MB of space on the computers hard drive. Because it is Java software, Formula One also requires that a Java Virtual Machine (JVM) be installed on the host computer.
This table shows Formula Ones support for different versions of the JVM.
JVMs JVM 1.1.5 and later JVM 1.1.8 and later Formula Ones AWT component Yes Yes Formula Ones Swing component No Yes
a Windows self-extracting executable program. a class file for installing on all other platforms. (See special instructions for using this class file on Macintosh.) a shell script for UNIX customers who install Formula One from the CD. (Due to technical problems, this shell script is not available in the Internet download.)
The Formula One installer requires that a Java platform be located on your path. While the installer will run on JVMs back to the 1.1.5 version, we recommend using Java 2. For information on how to set up your path, please visit www.tidestone.com and follow the links to the Support section.
The installer lets you identify the components you want to install, select a directory to hold the program files, and choose a folder in which to place the program on your desktop. It then copies the files to your hard disk. Note Previous versions of the Formula One installer installed documentation files in PDF format along with the software. Tidestone has removed the PDFs from the 7.0 installer to make the download smaller. You may download these PDFs free from the documentation page on the Tidestone website at www.tidestone.com. They are also available on the CD.
4. Follow the instructions in the installation wizard to complete the installation process.
4. Follow the instructions in the installation wizard to complete the installation process.
1. Launch JBindery. 2. In the Command panel of the JBindery dialog, in the Class Name field, enter the following command:
setup
3. Click on the Classpath icon to display the Classpath panel, then click Add .zip file. 4. In the navigation dialog, locate the setup.class file on your system. Select it and click Open.
5. Click Run to start the installation. 6. Follow the instructions in the installation wizard to complete the installation process.
The Swing version of the Formula One JavaBean, applet, and application. The AWT version of the Formula One JavaBean, applet, and application. The AWT version of the Formula One JavaBean and applet (but not the application).
F1J7AWTDesign.jar
F1J7AWT.jar
The Java classes for the InfoBus Java extension. Some of these classes may be called from the Formula One API. The Java classes that run the JavaHelp system. You must use this JAR file if you want to view the online help through the Swing Workbook Designer. The help content files are stored in F1Help.jar (see below).
jh.jar
Documentation
These files and directories contain the various types of documentation in the software download. For more information on documentation, see Getting Help on page 12.
F1Help.jar
Formula One user documentation help set in the JavaHelp format. Includes the contents of the Users Guide and Function Reference in HTML and XML. Directory that includes PDF files of this Getting Started guide as well as the Users Guide, Function Reference, and Technical Guide. Directory containing Javadoc-generated API documentation for Formula Ones AWT component in HTML format. Directory containing Javadoc-generated API documentation for Formula Ones Swing component in HTML format. Basic information on installation and known bugs and limitations of the product.
help/
help/awtdoc help/swingdoc
readme.html
with Excel.
chart_types.html
A list of the Excel 3D chart types and the type of chart they will be converted to in Formula One. A list of issues involving worksheet function compatibility with Excel. The license agreement for Formula One. Licensing Formula One on page 36 is a copy of this document. A list of the new and enhanced features of Formula Ones 7.0 version.
function_readme.html
F1JLicen.html
features.html
Utilities
These files help with the installation, deployment, and uninstallation of Formula One.
F1JSplit.class
A class file that optimizes applet deployment by separating the classes in F1J7Swing.jar into eight groups, then putting each group into its own JAR file. (installed on Windows only) A Windows executable that launches the Formula One application. A Windows-specific log file the Windows uninstaller uses to remove the software from the computer.
F1J7.exe
Uninst.isu
Charting Undo and redo menu options and the ability to change the number of undos
Access to Designer Help, online user help for the Workbook Designer and for the worksheet functions A changeable look and feel Ability to zoom in or out when viewing a worksheet A Window menu that allows users to cascade and tile multiple windows and make different windows active More print options (print orientation, paper size, and restart page numbering) The ability to apply fill patterns to cells Lotus-style formula evaluation Toolbar buttons for find/replace, undo, redo, sorting, online help, and inserting picture objects
s s s
s s s s
The AWT Workbook Designer displays a status bar. The Swing Designer doesnt.
Select a worksheet cell and press F3. The Workbook Designer will appear in a new window.
To provide access to the Workbook Designer, ship the appropriate Formula One JAR file: F1J7Swing.jar for the Swing Workbook Designer, F1J7AWTDesign.jar for the AWT designer. This JAR file must be on the applications classpath for the software to work. You can also choose to restrict users from accessing the Designer. To restrict Workbook Designer access, ship a different JAR file. For AWT developers, ship F1J7AWT.jar. Swing developers may use the F1JSplit.class file to split up the classes in F1J7Swing.jar into 12 separate JAR files. The resulting JAR file containing Workbook Designer functionality is F1J7Design.jar, so to restrict Workbook Designer access, dont ship F1J7Design.jar. You may choose among the remaining JAR files to provide the functionality your application needs. For more information on splitting F1J7Swing.jar and how to use the resulting JAR files, see the Technical Guide. You may also restrict access to the Workbook Designer through the API.
10
Locate and double-click on the F1J7.exe file. or Click the Start button and choose the Formula One menu item from the Programs menu list.
Note On Solaris and other UNIX platforms, replace the semicolons (;) in this command with colons (:).
11
classes. JBindery is provided with the Mac OS Runtime for Java (MRJ) SDK. The SDK can be downloaded from the Apple website at devworld.apple.com/java/. 1. Launch JBindery. 2. In the Command panel of the JBindery dialog, enter the following string in the Class Name field.
com.f1j.designer.Designer
3. Click on the Classpath icon to display the Classpath panel. 4. Click Add .zip file. 5. In the navigation dialog, locate the F1J7AWTDesign.jar file on your system. Select it and click Open. 6. In the JBindery dialog, click Save Settings. 7. In the Save Settings dialog, enter the name you want to give to your launchable application. Then click Desktop to save the application to the desktop. 8. Click Save to save the launchable application. 9. In the JBindery dialog, click Run. A clickable icon for the Workbook Designer appears on the desktop. You can leave the icon on the desktop or place it in any folder on your system.
12
The process of accessing Formula Ones JavaBean functionality in an application varies slightly from one IDE to another. In most cases it consists of:
s s
adding the JavaBean to your project selecting the component and drawing the control on a frame or in a window
f1bean.html,
For detailed instructions on adding the JavaBean to your IDE, see the file located in the download, on the CD, or on Tidestones website (www.tidestone.com).
Note When Formula One is used as a JavaBean, only a small set of its API is available through the IDEs windows and menu options. Most developers will find that they have to access other parts of the Formula One API within the Java code to take advantage of Formula Ones many features.
Getting Help
Formula One offers many choices for documentation. End-users, developers, and software reviewers will all find printed, online, and web-based options. This table lists the Formula One help sources and where to find them.
Help Source Users Guide Audience Users Contents Format(s) Location and file name Press the Help button in the Workbook Designer. On Tidestones website at www.tidestone.com. Comes with the CD or can be ordered from Tidestone. Press the Help button in the Workbook Designer On Tidestones website at www.tidestone.com. Comes with the CD or can be ordered from Tidestone.
How to use the Workbook JavaHelp Designer: entering and editing data and formulas, formatting, graphical objects, PDF charts, printing. printed
Function Reference
Users
Alphabetical listing of the JavaHelp 325 worksheet functions detailing proper usage. Shows syntax, examples, and PDF related functions. printed
13
Deploying Formula One in PDF applets and applications, Java security issues, data access printed using JDBC and InfoBus, attach methods, creating addin functions, performance tuning, and specifications. Two Javadoc-generated guides to the public classes: one for the AWT component and one for the Swing component. Displays tree structure and describes how classes and methods should be implemented. HTML
API Help
Developers
[installdir]\help\awtdoc\index.html [installdir]\help\swingdoc\index.html
ReadMes
Covers installation, known HTML problems, and how to contact Tidestone. Linked files detail compatibility issues with Microsoft Excel.
[installdir]chart_types.html [installdir]excel_compatibility.html [installdir]f1bean.html [installdir]features.html [installdir]function_readme.html [installdir]readme.html On Tidestone's website at www.tidestone.com. Follow the Demo links to the Java demos. [installdir]\examples and [installdir]servlets
Demos
Developers
Applications and applets Java applets written in Java that and demonstrate various pieces of applications Formula Ones functionality. For descriptions of each demo, see Formula One AWT Demos on page 20 and Formula One Swing Demos on page 30. A database of frequently Database asked technical questions from the Tidestone developer services database. Solutions, explanations, workarounds, code samples.
KnowledgeBase
Developers
On the Tidestone website at www.tidestone.com. Follow the Support links to the Online KnowledgeBase.
14
Description Use this file if you are deploying just the View class, not the Workbook Designer. Designer from within your application or applet.
F1J7AWTDesign.jar Use this file if you want users to be able to access the Workbook
Note Other deployment and documentation files installed with the product (e.g. F1J7Swing.jar, F1Help.jar, etc.) cant be used reliably with JDKs prior to 1.1.8; therefore, theyre not mentioned here.
Description
Primary Classes
This package contains the classes that make up View the bulk of the API. Most of the classes used for HTMLWriter JDBC basic spreadsheet tasks, like data population, cell formatting, graphical objects, JDBC, etc., CellFormat F1Exception are found in this package. See the tables below for more information on these basic classes. This package contains the abstract class Func, Func which can be extended to create custom worksheet functions that can be accessed from the spreadsheet.
com.f1j.addin
15
Description
Primary Classes
This package contains the Database class, which Database enables data extraction from one part of a spreadsheet to another.
Designer
Workbook Designer, an AWT-based application that provides Excel-like menus, toolbars, and dialogs for spreadsheet data entry and formatting. This package is not in F1J7AWT.jar.
com.f1j.dialog
This package contains classes to display AWT- FindReplaceDlg, based dialog boxes to collect information from FormatCellsDlg, the user. This package is not in F1J7AWT.jar. SaveFileDlg, etc. This package contains classes to access the spreadsheet model.
Book
com.f1j.ss
Description AWT-based spreadsheet component. This class can be instantiated from an applet, servlet, or application, or can be used in an IDE form-builder environment. This class provides methods for manipulating the spreadsheet contents. AWT-based Workbook Designer. This Java application provides menus, toolbars, and dialogs on top of the com.f1j.View spreadsheet component to help the user create, modify, and format spreadsheet files.
com.f1j.designer.Designer
16
Description This class provides static methods to convert a spreadsheet to an HTML table.
com.f1j.JDBC These two classes provide methods to extract data from a com.f1j.JDBCQueryObj JDBC ResultSet and populate a spreadsheet with values and
formatting.
Description This is the model portion of the View class. Developers can use this class to bypass the View methods when building the spreadsheet model. This class is used to set/get formatting information in/from the spreadsheet cells. These two classes represent the graphical objects on the spreadsheet. find/replace operation called.
com.f1j.CellFormat
com.f1j.GRObject com.f1j.GRObjectPos
This class represents the custom formats stored in the spreadsheet. This class represents a range of cells. This class represents a cell.
com.f1j.RangeRef com.f1j.CellRef
17
Description This event is fired when the user exits in-cell editing mode by pressing the Esc key. This event is fired when the user exits in-cell editing mode by normal means (pressing Enter, using the arrow keys or mouse to move to another cell, etc.). This event is fired after the spreadsheet has completed its recalculation cycle. This event is fired when the spreadsheets data or formatting changes. This event is fired when the user interacts with a graphical object.
com.f1j.SelectionChangedEvent This event is fired each time the cell selection com.f1j.SelectionChangedListenerchanges. com.f1j.StartEditEvent com.f1j.StartEditListener com.f1j.StartRecalcEvent com.f1j.StartRecalcListener com.f1j.UpdateEvent com.f1j.UpdateListener
This event is fired when the user enters in-cell editing mode. This event is fired when the recalculation cycle is about to begin. This event is fired when the component has repainted the spreadsheet.
com.f1j.ValidationFailedEvent This event is fired when a validation rule fails. com.f1j.ValidationFailedListener com.f1j.ViewChangedEvent com.f1j.ViewChangedListener
This event is fired when the visible part of the spreadsheet changes (e.g. scrolling, tab selection, window resize, etc.)
18
public class WelcomeA extends Applet static View view1 = new View(); public WelcomeA() { } //Initialize the applet public void init() { setLayout(null); setSize(400,300); view1.setBounds(24,24,375,182); add(view1);
try { // Call the Formula One setText API to place text into a cell view1.setText(2, 0, "Welcome to Formula One for Java: "+ "The Internet Spreadsheet"); // Add a format to the cell com.f1j.CellFormat CellFormat1; CellFormat1 = view1.getCellFormat(); CellFormat1.setHorizontalAlignment( CellFormat1.eHorizontalAlignmentCenterAcrossCells); CellFormat1.setFontBold(true); CellFormat1.setFontItalic(true); CellFormat1.setFontSize(210); view1.setCellFormat(CellFormat1,2,0,2,6); } catch (com.f1j.F1Exception e) { // catch any exceptions in case something fails setting the // text System.out.println(e.getMessage()); } } public static void main(String args[]){ // Create a Frame to place our application in. Frame myFrame = new Frame ("Getting Started"); myFrame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent event) { System.exit(0); }
19
Then you can execute the resulting class within your IDE or from a command prompt using the Java command java. If WelcomeA.class is in the same directory as F1J7AWTDesign.jar, open the command prompt, change to that directory, then type in the following Java command:
java -cp .;F1J7AWTDesign.jar WelcomeA
20
This HTML will only work if WelcomeA.class and F1J7AWT.jar are in the same directory. The <APPLET> tags ARCHIVE parameter references Formula Ones F1J7AWT.jar file. You may choose to reference the F1J7AWTDesign.jar file if you want applet users to be able to access the Workbook Designer. However, since F1J7AWTDesign.jar is a much larger JAR file, the browser will take longer to download it. For more information, see Using the Workbook Designers in Applications and Applets on page 9.
21
freezepanes.java
Populating a spreadsheet to show that loading cells from the bottom up is faster than loading from the top down.
setentryoptimization.java
setEntry setNumber
setValidationRule setValidationText
22
examples\awt\customdesigner. This demo shows how to extend the com.f1j.designer.Designer class to create a custom version of the Workbook Designer. In this example, a custom menu item is added to the standard Workbook Designer menu set. examples\awt\edi. This demo shows Formula One reading in external data (EDI-formatted addresses stored in VTS, XLS, and TXT file formats) and merging that data with a template spreadsheet. Each of the files EastRegion.*, WestRegion.*, and MidwestRegion.* has address information for 9 customers in the first 9 rows of the file (first column for spreadsheet formats). As the user scrolls though each of the customers, the names are extracted from the data files, merged with the spreadsheet template (Default.vts), recalculated, and displayed. examples\awt\format. This demo shows how to use the formatting API (specifically, the CellFormat object) to set borders, text colors, background colors, etc. The application displays several buttons next to a Formula One worksheet. It formats the worksheet data differently based on the button pressed. This action is similar to the AutoFormat feature of Excel. examples\awt\hr. This demo is a human resources application designed to collect time sheet information stored in VTS files (Formula Ones native file format). It illustrates how to programmatically create, delete, and display worksheets. examples\awt\worksheet. This applet-servlet demo shows how Formula One data can be transferred to and from a servlet. Clients log in with their own user names and passwords to ensure data security, then use a web browser to access, edit, and save spreadsheets on the server. To run this demo, install WorksheetServlet on your web server servlets directory and WorksheetApplet and supporting files in the public directories. See the demos readme for specific information about its classes and how to set them up on a server.
23
examples\awt\welcome. The code in Sample Formula One AWT Application and Applet on page 17 of this guide. examples\oracle\webtogo\vacation. This servlet accesses an Oracle database to track employee vacation requests made both on and offline and route the requests to the appropriate manager for approval. Formula One is used to retrieve the data from the database via JDBC, place the data into a worksheet, summarize it using worksheet functions, then write this summary information out in response to the browser request. Although this demo uses Formula Ones Swing component JAR file (F1J7Swing.jar), the code inside it has no GUI references, so you can replace the JAR file with one of the AWT JAR files and it should run equally well.
Description This file contains all of Formula Ones Swing functionality, including access to the Workbook Designer. Developers who are concerned about download times may not want to deploy this large JAR file. For these cases, Formula One allows you to split F1J7Swing.jar into eight smaller JAR files and deploy whichever of those files suits your situation. For more information about this deployment option, see the Formula One Technical Guide. (optional) Developers who provide access to the Workbook Designer and want to include the Designer Help online help system should deploy their applications using these two files as well.
24
Description This package contains the abstract class Func, which can be extended to create custom worksheet functions that can be accessed from the spreadsheet.
Primary Classes
Func
com.f1j.calc
Database This package contains the Database class, which enables data extraction from one part of a spreadsheet to another. InfoBusBook This applet class allows developers to share spreadsheet data within the context of a browser using the InfoBus technology. The infobus.jar file must be available for compiling code that references this package.
com.f1j.infobus
com.f1j.jdbc
Contains the JDBC class for database connectivity. This package contains UI-generic classes to save spreadsheets as HTML, format cells, and access the spreadsheet model directly without using the JBook class. This package contains the Swing components of Formula One. the Workbook Designer, a Swing-based application that provides Excel-like menus, toolbars, and dialogs for spreadsheet data entry and formatting.
JDBC
com.f1j.ss
com.f1j.swing
com.f1j.swing.ss
This package contains classes to display Swing-based dialog boxes to collect information from the user. This package contains the Formula One exception class.
FormatCellsDlg, PageSetupDlg,
etc.
F1Exception
com.f1j.util
25
Description Swing-based spreadsheet component. This class can be instantiated from an applet, servlet, or application, or can be used in an IDE formbuilder environment. This class provides methods for manipulating the spreadsheet contents. application provides menus, toolbars, and dialogs on top of the com.f1j.swing.JBook spreadsheet component to help the user create, modify, and format spreadsheet files.
Description This class provides static methods to convert a spreadsheet to an HTML table.
com.f1j.jdbc.JDBC These two classes provide methods to extract data from a com.f1j.jdbc.JDBCQueryObj JDBC ResultSet and populate a spreadsheet with values
and formatting.
Description This is the model portion of the JBook class. Developers can use this class to bypass the JBook methods when building the spreadsheet model. This class is used to set/get formatting information from the spreadsheet cells. These two classes represent the graphical objects on the spreadsheet. find/replace operation called.
com.f1j.ss.CellFormat
com.f1j.ss.GRObject com.f1j.ss.GRObjectPos
26
Description This class represents the custom formats stored in the spreadsheet. This class represents a range of cells. This class represents a cell.
com.f1j.ss.RangeRef com.f1j.ss.CellRef
Description This event is fired when the user exits in-cell editing mode by pressing the Esc key. This event is fired when the user exits in-cell editing mode by normal means (pressing Enter, using the arrow keys or mouse to move to another cell, etc.). This event is fired after the spreadsheet has completed its recalculation cycle. This event is fired when the spreadsheets data or formatting changes. This event is fired when the user interacts with a graphical object.
com.f1j.ss.SelectionChangedEvent This event is fired each time the cell com.f1j.ss.SelectionChangedListener selection changes. com.f1j.ss.StartEditEvent com.f1j.ss.StartEditListener com.f1j.ss.StartRecalcEvent com.f1j.ss.StartRecalcListener com.f1j.ss.UpdateEvent com.f1j.ss.UpdateListener
This event is fired when the user enters incell editing mode. This event is fired when the recalculation cycle is about to begin. This event is fired when the component has repainted the spreadsheet.
com.f1j.ss.ValidationFailedEvent This event is fired when a validation rule com.f1j.ss.ValidationFailedListener fails. com.f1j.ss.ViewChangedEvent com.f1j.ss.ViewChangedListener
This event is fired when the visible part of the spreadsheet changes (e.g. scrolling, tab selection, window resize, etc.)
27
public class Welcome extends JApplet { static JBook jBook1 = new JBook(); public void Welcome1() { } //Initialize the applet public void init() { this.setSize(new Dimension(400,300)); try { // Call the Formula One setText API to place text // into a cell jBook1.setText(2, 0, "Welcome to Formula One for Java: " + "The Internet Spreadsheet"); // Add a format to the cell com.f1j.ss.CellFormat CellFormat1; CellFormat1 = jBook1.getCellFormat(); CellFormat1.setHorizontalAlignment( CellFormat1.eHorizontalAlignmentCenterAcrossCell s); CellFormat1.setFontBold(true); CellFormat1.setFontItalic(true); CellFormat1.setFontSize(210); jBook1.setCellFormat(CellFormat1, 2, 0, 2, 6); } catch (com.f1j.util.F1Exception e) { // catch any exceptions in case something fails setting t he // text System.out.println(e.getMessage()); } this.getContentPane().add(jBook1, BorderLayout.CENTER);
28
Then you can execute the resulting class within your IDE or from a command prompt using the Java command java. If Welcome.class is in the same directory as F1J7Swing.jar, open the command prompt, change to that directory, then type in the following Java command:
java -cp .;F1J7Swing.jar Welcome
29
your <APPLET> tags to the appropriate IE and Netscape-specific tags. You can download this utility at http://java.sun.com/products/plugin/1.2/features.html. Following is sample HTML code to display the applet using the <APPLET> tag. (This code assumes Welcome.class and F1J7Swing.jar are in the same directory.)
<HTML> <HEAD> <TITLE>Live Spreadsheet Page</TITLE> </HEAD> <BODY> <APPLET CODE="Welcome.class" ARCHIVE="F1J7Swing.jar" WIDTH=400 HEIGHT=300></APPLET> </BODY> </HTML>
Following is that same HTML code after being run through Suns HTML Converter.
<HTML> <HEAD> <TITLE>Live Spreadsheet Page</TITLE> </HEAD> <BODY> <!--"CONVERTED_APPLET"--> <!-- CONVERTER VERSION 1.0 --> <OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = 400 HEIGHT = 300 codebase="http://java.sun.com/products/plugin/1.2/jinstall-12win32.cab#Version=1,2,0,0"> <PARAM NAME = CODE VALUE = "Welcome.class" > <PARAM NAME = ARCHIVE VALUE = "F1J7Swing.jar" > <PARAM NAME="type" VALUE="application/x-java-applet;version=1.2"> <COMMENT> <EMBED type="application/x-java-applet;version=1.2" java_CODE = "Welcome.class" java_ARCHIVE = "F1J7Swing.jar" WIDTH = 400 HEIGHT = 300 pluginspage="http://java.sun.com/products/plugin/1.2/plugininstall.html"><NOEMBED></COMMENT> </NOEMBED></EMBED> </OBJECT> <!-<APPLET
CODE = "Welcome.class" ARCHIVE = "F1J7Swing.jar" WIDTH = 400 HEIGHT = 300 > </APPLET> --> <!--"END_CONVERTED_APPLET"--> </BODY> </HTML>
30
The <APPLET> tag has been replaced with code containing the <OBJECT> tag (used by Internet Explorer) and the <EMBED> tag (used by Netscape Navigator). Netscape ignores IEs <OBJECT> tag, while IE ignores anything within <COMMENT> tags. Opening this converted HTML file in a browser will display the spreadsheet. Note about the Java plug-in This HTML code contains the parameter pluginspage. This refers to the Java Plug-in, another Sun Microsystems utility that you must use if you want to run Swing applets in current browsers. The plugin is necessary because Internet Explorer and Netscape Navigator do not contain the latest version of the JVM. When users whose computers dont already have the latest JVM encounter a web page containing an applet that uses Swing Java software, they must download and install the Java Plug-in software before they can run that applet. The plug-in automatically substitutes a more recent version of the Java Virtual Machine for the browsers older versions. For information about downloading and using the Java Plug-in, see Sun Microsystems web site at java.sun.com.
examples\swing\demos\amortization. This demo shows how to use Formula One in a simple web-based application. It converts spreadsheets to HTML or JPG files on the fly using servlet and page-compilation technology. examples\swing\demos\calculate. This page compilation demo shows how to call the JBook API from within a JHTML page. It displays a form and asks the user for a formula. That formula is passed to JBook, calculated, and returned to the user. examples\swing\samples\add-in\concat. This demo shows two ways to handle threading issues in add-in functions. The demonstration functions concatenate strings.
31
examples\swing\samples\add-in\iseven. This demo shows how to write a simple add-in function that determines whether the entry in a worksheet cell is even or odd. examples\swing\samples\add-in\mydosum. This demo shows how to write an add-in function that accesses a range of cells in a spreadsheet to perform a simple sum. It demonstrates how to handle cell references and ranges in an add-in function. examples\swing\samples\apps\edi. This demo shows Formula One reading in external data (EDI-formatted addresses stored in VTS, XLS, and TXT file formats) and merging that data with a template spreadsheet. Each of the files EastRegion.*, WestRegion.*, and MidwestRegion.* has address information for 9 customers in the first 9 rows of the file (first column for spreadsheet formats). As the user scrolls though each of the customers, the names are extracted from the data files, merged with the spreadsheet template (Default.vts), recalculated, and displayed. examples\swing\samples\apps\format. This demo shows how to use the formatting API (specifically, the CellFormat object) to set borders, text colors, background colors, etc. The application displays several buttons next to a Formula One worksheet. It formats the worksheet data differently based on the button pressed. This action is similar to the AutoFormat feature of Excel. examples\swing\samples\apps\hr. This demo is a human resources application designed to collect time sheet information stored in VTS files (Formula Ones native file format). It illustrates how to programmatically create, delete, and display worksheets. examples\swing\welcome. The code in Sample Formula One Swing Application and Applet on page 27 of this guide. examples\oracle\webtogo\vacation. This servlet accesses an Oracle database to track employee vacation requests made both on and offline and route the requests to the appropriate manager for approval. Formula One is used to retrieve the data from the database via JDBC, place the data into a worksheet, summarize it using worksheet functions, then write this summary information out in response to the browser request.
32
33
the Java code the JAR file referenced by your IDE HTML pages that contain Formula One applets
Not available.
f1j.swing.ss.ClearDlg
34
35
7.0 Formula One API (Swing-based) Does not exist. Instead use:
JFrame f= new JFrame(); f.getContentPane().add(Jbook1);
36
This is your proof of license. Tidestone License Agreement IMPORTANT - READ CAREFULLY: This is a legal agreement between You (either an individual or an entity), and Tidestone Technologies, Inc. ("Tidestone") for the Tidestone software product identified above, which includes computer software and may include associated media, printed materials, and electronic documentation ("Software"). Please read these terms carefully. By opening the sealed media package, installing, copying or otherwise using the Software, You agree to be bound to the terms of this agreement completely. If you do not agree to the terms of this Agreement, do not install or use the Software and promptly return the product to Tidestone for a full refund. LICENSE AGREEMENT 1. GRANT OF LICENSE. Tidestone grants to You a personal, non-exclusive, non-transferable license to use the Software in the quantity indicated above. A Developer License is required for each computer on which the Software is installed or run for development purposes. You may store or install a copy of the Software on a storage device, such as a network server, used only to install or run the Software on your other computers over an internal network; however, you must have a license for each separate computer on which the Software is installed or run from the storage device. A license for the Software may not be shared or used concurrently on different computers. COPYRIGHT. The Software and accompanying documentation is owned by Tidestone and is protected by United States copyright laws and international treaty provisions. Therefore, You must treat the Software and accompanying documentation like any other copyrighted material (e.g. a book or musical recording), and may be legally responsible for copyright infringement. OTHER RESTRICTIONS. This License Agreement is Your proof of license to exercise the rights granted herein and must be retained by You. You may not loan, rent, lease, transfer or sublicense the Software or any copy. You may not modify, alter, reverse engineer, decompile or disassemble the Software. You may not at any time disclose or disseminate the Software to any person who does not need to attain access thereto consistent with Your rights under this license. When installing the Java version of the Software, Sun Microsystems Java Runtime Environment software (JRE) may be installed on Your computer. When it is installed, you are subject to the terms and conditions of Suns license agreement for the JRE, which is installed with the Software and can be found in the file Sunlicen.txt, or at http://java.sun.com/products/jdk/1.1/jre/license.
2.
3.
37
LIMITED WARRANTY. This Software is licensed AS IS without warranty of any kind; if for any reason you are dissatisfied with it, return the software, including all materials, to Tidestone within 30 days of the date of purchase for a full refund. If any materials or media in this package are defective, under normal use, return them within 90 days of the original date of purchase, and Tidestone will replace them at no charge. These warranties are in lieu of any other warranties, express or implied, including the implied warranties of merchantability and fitness for a particular purpose, which are expressly disclaimed. This limited warranty gives You specific legal rights. You may have other rights, which vary from state to state. Tidestone hereby limits the duration of any implied warranties to the periods set forth above. Some states do not allow limitations on the duration of an implied warranty, so the above limitations may not apply to You. NO LIABILITY FOR CONSEQUENTIAL DAMAGES. In no event shall Tidestone be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use or inability to use this product, even if Tidestone has been advised of the possibility of such damages. Because some states/jurisdictions do not allow the exclusion or limitation of liability for consequential or incidental damages, the above limitation may not apply to You. U.S. GOVERNMENT RESTRICTED RIGHTS The Software and documentation are provided with Restricted Rights. Use, duplication, or disclosure by the Government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of The Rights in Technical Data and Computer Software clause at DFARS 252.227- 7013, or subparagraphs (c)(1) and (2) of the Commercial Computer Software - Restricted Rights at 48 CFR 52.227-19, as applicable. Contractor/manufacturer is Tidestone Technologies, Inc., at the address below. MISCELLANEOUS If you acquired this product in the United States, this Agreement shall be governed by the laws of the State of Kansas. If this product was acquired outside the United States, then local law may apply. Should you have any questions concerning the Software or this license agreement, please contact the Tidestone subsidiary serving your country or write to Tidestone Technologies, Inc., 12980 Metcalf Avenue, Suite 300, Overland Park, Kansas 66213.
Tidestone
39
Index
A
API documentation for 6, 13 of Formula One AWT component 1417 of Formula One Swing component 2426 <APPLET> tag 20, 29, 30, 33, 35 AWT 1 AWT component, of Formula One 1, 1423 API 1417 API documentation 6, 13 demos of 6, 2023 upgrading to 3233 Workbook Designer for 8
D
Database class 15, 24, 33 Demos file locations 6 of Formula Ones AWT component 2023 of Formula Ones Swing component 3031 Designer class 15, 22, 24, 25 Dialog classes, and upgrading Formula One 33 Documentation 4, 1213 file locations 67 in the JavaHelp system 6 javadoc output 6, 13
B
Book class 15, 16, 24, 25 Browsers and Formula One 3, 30
E
<EMBED> tag 30, 35 Events and upgrading Formula One 35 in Formula Ones AWT component 17 in Formula Ones Swing component 26 Examples, of code file locations 6 HTML 19, 29 Java 1719, 2023, 2728, 3031 Exceptions in Formula Ones AWT component 16 in Formula Ones Swing component 26
C
CellFormat class 14, 16, 20, 24, 25, 33 CellRef class 16, 26, 33 Charting 7, 8 Classes for Formula Ones AWT component 1516 for Formula Ones Swing component 2526 when upgrading Formula One 3335 ClassFactory class 33 Classpath, for running the Workbook Designer 10 com.f1j package 14 com.f1j.addin package 14, 24 com.f1j.calc package 15, 24 com.f1j.demo package 20 com.f1j.designer package 15 com.f1j.dialog package 15 com.f1j.infobus package 24 com.f1j.jdbc package 24 com.f1j.ss package 24 com.f1j.swing package 24 com.f1j.swing.designer package 24 com.f1j.swing.ss package 24 com.f1j.util package 24 components of Formula One 1, 2
F
F1Exception class 14, 16, 24, 34 F1Help.jar file 6, 10, 23 F1J7.exe file 7, 10 F1J7AWT.jar file 5, 14, 15, 20 F1J7AWTDesign.jar file 5, 11, 14, 20 F1J7Setup.exe file 4 F1J7Swing.jar file 5, 10, 23 splitting 7, 9 F1JSplit.class file 7, 9 FindReplaceInfo class 16, 25, 34, 35 Formula One application 811 browser compatibility 3, 30 bugs and limitations of 6
40
Formula One (continued) compatibility with Microsoft Excel 7 components of 1, 2 documentation. See Documentation example code. See Examples, Demos files 57, 32 installing 35 JavaBean 1112, 32, 35 licensing 3637 obtaining 2 server deployment 1 uninstalling 7 upgrading 3235 Func class 14, 24 Function Reference 6, 12
K
Knowledgebase 13
G
GRObject class 16, 25, 34 GRObjectPos class 16, 25, 34 GUI, displaying 1
L
License agreement 3637 Listeners and upgrading Formula One 35 in Formula Ones AWT component 17 in Formula Ones Swing component 26
H
HTML and upgrading Formula One 33, 35 code examples 19, 29 HTML Converter utility 28, 35 HTMLWriter class 14, 16, 24, 25, 35
M
Macintosh installing Formula One on 5 launching the Workbook Designer on 10 Microsoft Excel compatibility 7
I
IDE (integrated development environment) 1112 and upgrading Formula One 32, 35 Import statements, and upgrading Formula One 33 InfoBus 6, 24 infobus.jar file 6 InfoBusBook class 24 Installing Formula One 35
N
NumberFormat class 16, 26, 35
O
<OBJECT> tag 30, 35 OpenFileDlg class 34
J
JAR files, for Formula One 1, 5 Java Plug-in 3, 30, 35 JavaBean, Formula One as 1112, 32, 35 Javadoc 6, 13 JavaHelp 6 JBindery 5
P
Packages for Formula Ones AWT component 1415 for Formula Ones Swing component 24 when upgrading Formula One 3335
Index
41
R
RangeRef class 16, 26, 34 readme.html file 6, 13
W
Windows installing Formula One on 4 launching the Workbook Designer on 10 Workbook Designer 811 documentation on 12 Worksheet functions 12
S
SaveFileDlg class 34 Server, deploying Formula One on 1 Servlet, example code for 6 setup.sh file 4 Sheet class 24 Solaris installing Formula One on 4 launching the Workbook Designer on 10 Swing 1 Swing component, of Formula One 1, 2331 API 2426 API documentation 6, 13 demos of 6, 3031 upgrading to 3335 Workbook Designer for 8 System requirements of Formula One 2
T
Technical Guide 6, 13
U
Uninst.isu file 7 Uninstalling Formula One 7 UNIX installing Formula One on 4 launching the Workbook Designer on 10 Upgrading Formula One 3235 Users Guide 6, 12
V
View class 14, 15, 20 and upgrading Formula One 34 Visual Cafe 11 See also IDE Visual J++ 11 See also IDE VTS files, and upgrading 32