https://github.com/mingun/kaitai_struct_model
Swing tree model for exploring https://kaitai.io generated structs
https://github.com/mingun/kaitai_struct_model
kaitai-struct swing visualizer
Last synced: about 1 year ago
JSON representation
Swing tree model for exploring https://kaitai.io generated structs
- Host: GitHub
- URL: https://github.com/mingun/kaitai_struct_model
- Owner: Mingun
- License: mit
- Created: 2020-01-08T19:50:05.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-02-28T00:59:55.000Z (over 3 years ago)
- Last Synced: 2025-01-31T15:40:15.663Z (over 1 year ago)
- Topics: kaitai-struct, swing, visualizer
- Language: Java
- Size: 41 KB
- Stars: 0
- Watchers: 4
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://jitpack.io/#Mingun/kaitai_struct_model)
[](https://opensource.org/licenses/MIT)
# kaitai_struct_model
A simple Swing `TreeModel` and `TreeNode` implementations for exploring classes, generated by
[KaitaiStruct](https://kaitai.io) java generator in debug mode.
How customized [Viewer](https://github.com/kaitai-io/kaitai_struct_gui) could look
(in [FlatLaf](https://github.com/JFormDesigner/FlatLaf) Dark theme):

Example file
```yaml
meta:
id: offsets
seq:
- id: padding
type: u1
- id: unsized
type: type
- id: sized
type: type
size: 10
instances:
parse:
pos: 5
size: 5
value_scalar:
value: 42
value_list:
value: '["42"]'
types:
type:
seq:
- id: padding
type: u1
- id: unsized_simple
type: u1
- id: sized_simple
size: 1
- id: unsized_array
type: elem
repeat: expr
repeat-expr: 2
- id: sized_array
type: elem
size: 3
repeat: expr
repeat-expr: 1
elem:
seq:
- id: padding
type: u1
- id: value
type: u1
```
## Class diagram of nodes
`ParamNode` is unused because it is impossible to distinguish between
parameters and instances without [kaitai_struct_compiler#191].
```mermaid
classDiagram
TreeNode <|.. ValueNode
ValueNode <|-- ChunkNode
ChunkNode <|-- SimpleNode
ChunkNode <|-- StructNode
ChunkNode <|-- ListNode
ValueNode <|-- ParamNode
class TreeNode {
<>
}
class ValueNode {
<>
+getValue()* Object
}
class ChunkNode {
<>
+getSpan() Span
+isSequential() boolean
}
class SimpleNode {
+getValue() Object
+getValueClass() Class
}
class StructNode {
+getValue() KaitaiStruct
}
class ListNode {
+getValue() List
+getElementClass() Class
}
```
[kaitai_struct_compiler#191]: https://github.com/kaitai-io/kaitai_struct_compiler/pull/191