binjr 项目使用教程
binjr A Time Series Data Browser项目地址:https://gitcode.com/gh_mirrors/bi/binjr
1. 项目的目录结构及介绍
binjr 项目的目录结构如下:
binjr/
├── binjr-core/
├── binjr-adapters/
├── binjr-demo-adapter/
├── binjr-desktop/
├── binjr-site/
├── binjr-docs/
├── binjr-tests/
├── build.gradle
├── settings.gradle
└── README.md
目录介绍
- binjr-core: 核心模块,包含项目的基本功能和核心类。
- binjr-adapters: 适配器模块,用于连接不同的数据源。
- binjr-demo-adapter: 演示适配器,提供示例数据源。
- binjr-desktop: 桌面应用模块,包含用户界面和交互逻辑。
- binjr-site: 网站模块,用于生成项目文档和网站内容。
- binjr-docs: 文档模块,包含项目的详细文档。
- binjr-tests: 测试模块,包含项目的单元测试和集成测试。
- build.gradle: Gradle 构建文件,用于配置项目的构建过程。
- settings.gradle: Gradle 设置文件,用于配置项目的模块和依赖。
- README.md: 项目说明文件,包含项目的基本介绍和使用说明。
2. 项目的启动文件介绍
binjr 项目的启动文件位于 binjr-desktop
模块中,主要文件为 MainApp.java
。
MainApp.java
package eu.binjr.desktop;
import eu.binjr.core.preferences.UserPreferences;
import eu.binjr.core.controllers.MainViewController;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
public class MainApp extends Application {
@Override
public void start(Stage primaryStage) throws Exception {
FXMLLoader loader = new FXMLLoader(getClass().getResource("/fxml/MainView.fxml"));
Parent root = loader.load();
MainViewController controller = loader.getController();
controller.setStage(primaryStage);
Scene scene = new Scene(root);
primaryStage.setScene(scene);
primaryStage.setTitle("binjr");
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}
启动文件介绍
- MainApp.java: 这是 binjr 项目的入口类,继承自
javafx.application.Application
。在start
方法中,加载主界面 FXML 文件并初始化主控制器,然后创建并显示主窗口。
3. 项目的配置文件介绍
binjr 项目的配置文件主要位于 binjr-core
模块中,主要文件为 UserPreferences.java
。
UserPreferences.java
package eu.binjr.core.preferences;
import eu.binjr.core.logging.Logger;
import eu.binjr.core.data.exceptions.DataAdapterException;
import eu.binjr.core.data.adapters.DataAdapter;
import eu.binjr.core.data.adapters.DemoDataAdapter;
import eu.binjr.core.data.adapters.FileDataAdapter;
import eu.binjr.core.data.adapters.HttpDataAdapter;
import eu.binjr.core.data.adapters.JrdsDataAdapter;
import eu.binjr.core.data.adapters.NetDataAdapter;
import eu.binjr.core.data.adapters.Rrd4jDataAdapter;
import eu.binjr.core.data.adapters.RrdToolDataAdapter;
import eu.binjr.core.data.adapters.TcpDataAdapter;
import eu.binjr.core.data.adapters.UdpDataAdapter;
import eu.binjr.core.data.adapters.WebSocketDataAdapter;
import eu.binjr.core.data.sources.DataSource;
import eu.binjr.core.data.sources.FileDataSource;
import eu.binjr.core.data.sources.HttpDataSource;
import eu.binjr.core.data.sources.J
binjr A Time Series Data Browser项目地址:https://gitcode.com/gh_mirrors/bi/binjr