Two. Frame analysis
First, you have to analyze the framework of the source code, first get the source code, the download address of the source code is (http://java.sun.com/beans/). Directory introduction:
l Beanbox Directory: Beabox source program, class file, support lib, and execute files and compilation configurations.
l Demo Directory: Some example source code files used to demonstrate JavaBean.
l DOC Directory: About BDK documents and API manuals.
l Jars directory: Store JAR files that need to be loaded into the JavaBean of the toolbar.
llication: JAR files that support library methods tracking.
l gnumakefile file: Compile configuration file.
l Infobus.jar file: Support Infobus JAR file.
llicense.html file: license.
l Makefile file: Compile configuration file.
l Readme.html file: Readme file.
File structure
The directory structure is shown below:
Source code directory tree:
├ - SUN
│ ├─Beanbox
│ │ └─simpleresource
└ -SUNW
├─beanbox
├─demo
│ ├-buttons
│ ├─classfile
│ ├─delegator
│ ─CapsulatedEvents
│ ├─jelly
│ ├─juggler
│ ├─MethodTracer
│ ├─Misc
│ ├─molecule
│ ├─Quote
│ ├─Select
│ ├ --sort
│ ├─test
│ └ - TRANSITIONAL
└ -wrapper
Class introduction
For the convenience of understanding, the probably function of each class is first described, first let everyone have a preliminary understanding. For the framework to explain, the features of the class below the Demo directory are not introduced.
Sun.beanbox
l AboutDialog.java Beanbox About Dialog
l AppletClassGenerator automatically generates Applet class code for Applet
l AppletGenerator.java generates an applet's JAR file by combined Beans
l beanbox.java as a container of JavaBean
l Beanboxframe.java As a top frame to accommodate the Beanbox, manage menu and track the current focus
l ClassCompiler.java performs classes that compile Java source code, such as Sun.Tools.javac. *
l CustomizerDialog.java As an ordinary component editor, encapsulated a Dialog
l doonbean.java's interface to execute when creating beans
l EditedAdaptor.java Attribute Editing Adapters, implements the PropertyChangeListener interface
l ErrorDialog.java throws a modal error Dialog, inherits MessageDialog
l atTargetDialog.java Dialog box for custom events for focus beans
l FileExtension.java The class used to filter files, implements the hook between the FileNameFilter interface L hookupmanager.java management event source bean and the target bean, will generate a class for each hook, and is compiled as an adapter to ClassLoader.
l Ibsupport.java uses this class to support InfoBus mechanisms and bean communications
l IndentedStream.java This tool class is used to generate a source code file.
l InputStreamProducer.java This interface provides an input stream
l Jaraccess.java This class implements a tool that uses JAR file format to create a file.
l JARENTRYSOURCE.JAVA is used to request a JAR file
l Jarinfo.java represents a loaded JAR file that contains information about the file.
l JarLoader.java reads the contents of JAR files
l MakeAppdlg.java requires a dialog box for making applets
l Manifest.java represents the manifest information of the JAR file
l MessageDialog.java popped up the dialog box of the prompt information
l messageheader.java definition message head
l ObjectInputStreamLoader.java As the subclass of ObjectInputStream, the agent is loaded for the existing ClassLoader
l Ourlabel.java represents an invisible bean with a string
l Propertycanvas.java supports a property value on a CanvaS
l PropertyDialog.java holds attribute editor with a general editor
l PropertyHookupManager.java Use hooks between properties to facilitate changes in an object to be delivered to properties related to it.
l PropertyNameDialog.java Properties dialog The properties of a given source object
l PropertySelector.java to support the label selection of the attribute editor
l PropertySheet.java property Edit the table listing all properties that can be edited
l PropertyText.java used to support text input of the property editor
l Report.java Report from internal information from a given Bean class
l SimpleClassLoader.java inherits ClassLoader and is used by JarLoader to load classes and resources.
l StartFrame.java is used to display a welcome information at the beginning of Beanbox.
l Timer.java tool class for internal time operation
l Toolbox.java shows charts and ID strings for JavaBean available for Beanbox
l WindowCloser.java tool class, use to capture the closing event of the target window
l Wrapper.java is used to track each bean in the design window in Beanbox.
l WrappeReventinfo.java event listener hook information
l WrapperPropertyEventInfo.java inherits the WrappeReventInfo class for connecting to a specific attribute 2. Sun.beanbox.simpleresource
l Handler.java inherits the URLStreamHandler class, requested for resources
l SimpleResourceConnection.java inherits the URLConnection class for resources for resources and get
3. SUNW.Beanbox
l Appletsupport.java In the generated applet, you need to support Applet instantiation.
l PropertyHookup.java Management of hook information between properties to facilitate attribute changes to notify the relevant properties
4. SUNW.WRAPPER
l Beanwrapper.java inherited the Applet class, to support the bean that itself is not applet, so that they can display directly in the HTML documentation directly.
Basic framework
I am aimed at the understanding of the framework of BDK.
The program running interface is as follows: