Graphic Rendering System 1.0
A Java-based graphic rendering system implementing various design patterns
Loading...
Searching...
No Matches
com.example.graphics.util.FileManager Class Reference
Collaboration diagram for com.example.graphics.util.FileManager:
Collaboration graph

Public Member Functions

 FileManager ()
List< ShapeloadDrawingBinary (String filePath) throws IOException, ClassNotFoundException
List< ShapeloadDrawingJson (String filePath) throws IOException
void saveDrawingBinary (Drawing drawing, String filePath) throws IOException
void saveDrawingJson (String jsonData, String filePath) throws IOException
void saveDrawingXml (String xmlData, String filePath) throws IOException

Private Attributes

final ShapeFactory shapeFactory

Detailed Description

文件管理器类,用于保存和加载图形

Definition at line 18 of file FileManager.java.

Constructor & Destructor Documentation

◆ FileManager()

com.example.graphics.util.FileManager.FileManager ( )
inline

构造函数

Definition at line 24 of file FileManager.java.

Member Function Documentation

◆ loadDrawingBinary()

List< Shape > com.example.graphics.util.FileManager.loadDrawingBinary ( String filePath) throws IOException, ClassNotFoundException
inline

从二进制文件加载图形

Parameters
filePath文件路径
Returns
加载的形状列表
Exceptions
IOException如果加载失败
ClassNotFoundException如果类找不到

Definition at line 50 of file FileManager.java.

References loadDrawingBinary().

Referenced by loadDrawingBinary().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadDrawingJson()

List< Shape > com.example.graphics.util.FileManager.loadDrawingJson ( String filePath) throws IOException
inline

从JSON文件加载图形

Parameters
filePath文件路径
Returns
加载的形状列表
Exceptions
IOException如果加载失败

Definition at line 72 of file FileManager.java.

References shapeFactory.

◆ saveDrawingBinary()

void com.example.graphics.util.FileManager.saveDrawingBinary ( Drawing drawing,
String filePath ) throws IOException
inline

将图形保存为二进制文件

Parameters
drawing要保存的图形
filePath文件路径
Exceptions
IOException如果保存失败

Definition at line 34 of file FileManager.java.

◆ saveDrawingJson()

void com.example.graphics.util.FileManager.saveDrawingJson ( String jsonData,
String filePath ) throws IOException
inline

将图形保存为JSON文件

Parameters
jsonDataJSON数据
filePath文件路径
Exceptions
IOException如果保存失败

Definition at line 62 of file FileManager.java.

◆ saveDrawingXml()

void com.example.graphics.util.FileManager.saveDrawingXml ( String xmlData,
String filePath ) throws IOException
inline

将图形保存为XML文件

Parameters
xmlDataXML数据
filePath文件路径
Exceptions
IOException如果保存失败

Definition at line 134 of file FileManager.java.

Member Data Documentation

◆ shapeFactory

final ShapeFactory com.example.graphics.util.FileManager.shapeFactory
private

Definition at line 19 of file FileManager.java.

Referenced by loadDrawingJson().


The documentation for this class was generated from the following file: