⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme.txt

📁 FuncPlotter is a combined Java application and applet for displaying two-dimensional plots of explic
💻 TXT
字号:
========================================================================FuncPlotter 2.0Source code notes========================================================================1  Building FuncPlotter from sourceTo compile FuncPlotter, you require JDK 6.0 or later, which is availablefrom http://java.sun.com/javase/downloads/index.jspThe source code distribution of FuncPlotter includes an Ant build file(build.xml) that contains targets for compiling, JARing and runningFuncPlotter.  (The latter assumes the existence of a FuncPlotterconfiguration file in a directory named config.)------------------------------------------------------------------------2  Organisation of the source codeThe source code for FuncPlotter falls into two categories: code thatbelongs to a named package and code that belongs to an unnamed (default)package.  The partial use of named packages results from my reuse of thepackages in other projects.  If you modify any of the code in thepackages, you could add an appropriate prefix to the package name(s) oryou could "flatten" the code by removing the package declaration -- andthe corresponding import declarations -- from the relevant compilationunits.The body of a class declaration is divided into sections, which areordered according to the following arbitrary scheme:  Constants  Enumeration types  Member classes  Static initialiser  Constructors  Class methods  Instance methods  Class variables  Instance variablesWithin sections, ordering is by access modifier:  public - protected - private------------------------------------------------------------------------3  Program structureI know that it's no substitute for a detailed UML class diagram ;-) buthere is a brief description of the structure of the program.FuncPlotter was designed to be used as both a Java application and aJava applet.  In order for it to be used as an applet, FuncPlotter'smain class (named FuncPlotter) is a subclass of java.applet.JApplet.The main class instantiates a singleton class, App, which is initialisedto perform either as an application or as an applet.FuncPlotter's document model is implemented by the classFunctionDocument.  The FuncPlotter applet has a single instance ofFunctionDocument whereas the FuncPlotter application has a list of up to64 documents, although only one document is displayed at a time.  Withinthe App class, each instance of FunctionDocument is associated with aninstance of FunctionView.When it is initialised as an application, App creates a frame of classMainWindow (a subclass of javax.swing.JFrame) whose content pane is setto an instance of TabbedPanel.  The tabbed panel is the container formultiple instances of the FunctionView class.  When it is initialised asan applet, App sets the content pane of the applet to an instance ofFunctionView.FunctionView displays plots of functions in an instance of PlotPanel,along with the GUI components that control the plot.Each command in the main menu, pop-up menu and function-related commandbuttons is implemented individually as a singleton subclass ofjavax.swing.Action.  Commands that are derived from AppCommand areperformed by the App.doCommand( ) method, while commands that arederived from DocumentCommand are performed byFunctionDocument.doCommand( ).  When they are performed, most documentcommands return a FunctionDocument.Edit object, which is added to thelist of the document's edits for use by the Undo and Redo commands.Configuration is performed by the singleton class AppConfig, whichaccesses a configuration file through the class ConfigFile.Expressions are parsed and the resulting expression tree is evaluatedwithin the class Expression.The reporting of exceptions is based on the class AppException in theexception package.  When an instance of AppException (or subclass) isthrown, it is constructed with an error identifier -- an instance of anenumeration type, ErrorId -- that is mapped to a message when anexception is reported.Classes that have the prefix "F", such as FComboBox, are wrappers forSwing components that initialise the component with the appropriatefont, enumerated by AppFont.------------------------------------------------------------------------4  Internationalisation and localisationI haven't availed myself of the Java localisation facilities whendisplaying numbers in FuncPlotter: the key numeric values (scalemarkings, cursor coordinates and interval endpoints) are all convertedto strings without regard to locale.  That is, the strings are composedof Western digit characters, '0'..'9', and the '.' radix point.I've made a half-hearted attempt at i18n by putting in place the code tohandle languages that have a horizontal, right-to-left orientation (eg,Arabic, Hebrew).  By itself, this is useless since the strings used byFuncPlotter are all hard-coded in English, but it's intended to makethings easier for anyone who wants to convert the source code for aright-to-left language.  Because I don't know the conventions forright-to-left locales, all I've done is to ensure that the GUI is laidout from right to left in a locale that is associated with aright-to-left language.  If configured to do so, the static methodApp.applyOrientationByLocale( ) applies locale-dependent orientation toa component and all of its descendants.For anyone who wants to translate the strings in the source code into alanguage other than English, the language-specific strings can be foundin three areas within a source file: static final variables in a"Constants" section, enum constants in an "Enumeration types" section,and final variables within a method.------------------------------------------------------------------------5  Documentation... or, rather, the lack of it.FuncPlotter was originally a tool for my personal use, and the sparselevel of comments within the source code reflects this.  (My policy onputting comments in code that I write for myself is to incorporate onlyenough of them to remind me of what the code does when I return to itafter a few months' absence.)  One particularly grave omission is thatthere are almost no Javadoc-type documentation comments in the sourcecode.------------------------------------------------------------------------6  Reporting bugsThe FuncPlotter project is hosted by SourceForge.net.  You can submitbug reports, requests for enhancements (RFEs) and suggestions forimprovements through the facilities on the FuncPlotter project page ofthe SourceForge website:  http://sourceforge.net/projects/funcplotter/Follow the links labelled "Bugs" or "RFE" / "Feature requests".When reporting a problem with FuncPlotter, please include enoughrelevant information to enable the problem to be reproduced.  You shouldinclude at least the following information: * FuncPlotter version number * platform and OS version number * Java version number * a description of the problem.A Java stack trace, if one is available, would be helpful.You can make comments about FuncPlotter by using the public OpenDiscussion forum, accessible through the FuncPlotter page of theSourceForge website.You must be logged in as a registered user of SourceForge in order toreport bugs, to request enhancements or to post a message to the forum.Registration for SourceForge, which isn't very onerous, offers a measureof protection against the abuse of their facilities.------------------------------------------------------------------------

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -