A simple Swing TreeModel
and TreeNode
implementations for exploring classes, generated by
KaitaiStruct java generator in debug mode.
How customized Viewer could look (in FlatLaf Dark theme):
Example file
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
ParamNode
is unused because it is impossible to distinguish between
parameters and instances without kaitai_struct_compiler#191.
classDiagram
TreeNode <|.. ValueNode
ValueNode <|-- ChunkNode
ChunkNode <|-- SimpleNode
ChunkNode <|-- StructNode
ChunkNode <|-- ListNode
ValueNode <|-- ParamNode
class TreeNode {
<<interface>>
}
class ValueNode {
<<abstract>>
+getValue()* Object
}
class ChunkNode {
<<abstract>>
+getSpan() Span
+isSequential() boolean
}
class SimpleNode {
+getValue() Object
+getValueClass() Class
}
class StructNode {
+getValue() KaitaiStruct
}
class ListNode {
+getValue() List
+getElementClass() Class
}