Beans Development Kit (BDK) Analysis (3)

zhaozj2021-02-16  55

3. Module introduction

The main module of BDK is divided into: Design panel, toolbar, property browser, tracker, and tool class. The top three are mainly the interface representation, and the tool class is a package, JAR file load, class compile, event monitor, and more.

Boot process

From the boot process of BDK, you can understand the starting order of each module, and the initialization process, understand the configuration of the resources, and the mating between the modules.

This is the class diagram of Beanboxframe, which is automatically generated by jbuilder8.

Through source code analysis, the following flowcharts can be obtained:

1. Initialization of BeanBoxFrame:

The interface of BeanboxFrame is as follows:

Through source code analysis, the following flowcharts can be obtained:

2. Toolbox initialization

The interface of Toolbox is as follows:

Through source code analysis, the initialization of the toolbar is mainly due to the following code:

IF (! beanboxframe.getquickstart ()) {

Vector jarnames = getjarnames ();

For (int i = 0; I

String name = (string) jarnames.elementat (i);

Try {

AddBeansinjar (Name);

} catch (throwable th) {

System.err.Println (Name ": Jar Load Failed:" TH);

Th.PrintStackTrace ();

}

}

}

// vector jarnames = getjarnames ();

Private static vector getjarnames () {

File CWD = New File (System.GetProperty ("User.dir");

File pwd = new file (cwd.getParent ());

File Jars = New File (PWD, "Jars");

IF (! jars.ioIRectory ()) {

System.err.println (Jars "Is Not a Directory !!");

}

Vector result = new vector ();

String names [];

Names = jars.list (New FileExtension (". jar"));

For (int i = 0; i

Result.addelement (jars.getpath () file.separatorchar names [i]);

}

Names = jars.list (New FileExtension (". jar"));

For (int i = 0; i

Result.addelement (jars.getpath () file.separatorchar names [i]);

}

// Addbeansinjar (Name);

Synchronized void addbeansinjar (String Jarfile) throws oException {

Jarloader.loadjardoonbean (Jarfile, Helper);

DOLAYOUT ();

3. Initialization of BeanBox

Through source code analysis, the following flowcharts can be obtained:

4. Initialization of PropertySheet

The interface of PropertySheet is as follows:

By source code analysis, the flowchart of the settarget method can be obtained:

转载请注明原文地址:https://www.9cbs.com/read-26502.html

New Post(0)