-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add node types #8
Comments
Yeah, I likes the idea. Actually, I created this project for using in the kaitai_struct_gui, but unfortunately Kaitai team are very slow in reaction. Current generated classes has some fundamental restrictions that does not allow to correctly determine their spans in the input in some cases.
This already should be possible using
One specific thing that now is not working is a correct handling of Parameters could be supported once kaitai-io/kaitai_struct_compiler#191 will be merged.
Yes, it is probably need to add a new property to the classDiagram
TreeNode <|.. ValueNode
ValueNode <|-- ChunkNode
ChunkNode <|-- SimpleNode
ChunkNode <|-- StructNode
ChunkNode <|-- ListNode
ValueNode <|-- ValueInstanceNode
ValueNode <|-- ParamNode
class TreeNode {
<<interface>>
}
class ValueNode {
<<abstract>>
}
class ChunkNode {
<<abstract>>
isSequential(): boolean
}
That should be already possible. Feel free to fill an issue or send a PR if you found something that is not enough. |
I see you did a lot of work two years ago on both the KaitaiStruct compiler and runtime, but nothing has been merged, that is frustrating! You are right, I used I will keep in mind the bug about In this issue kaitai-io/kaitai_struct_java_runtime#26 you included screenshots of kaitai_struct_model integrated into kaitai_struct_gui:
I didn't know GitHub can render class diagrams, that is cool! Here's a link for reference... https://mermaid-js.github.io/mermaid/#/./classDiagram Are there any other possibilities for "location in KSY file" aside from field and instance? If no, adding If value instances and parameters are the only things that do not have length, then the proposed class diagram looks good to me. |
Sure: https://github.com/Mingun/kaitai_struct_gui/tree/struct-model
Only that two |
Thanks, I only checked the master branch of your fork!
I think it doesn't work if the SimpleNode |
I think this issue can be closed
|
Those nodes was removed in 1451bbd because I found that this is too inconvenient when you need to constantly expand deep structures. I do not recommend use such grouping, it is better to use different styles to differentiate them |
OK, good to know, thank you |
I want to use kaitai_struct_model in my fork of kaitai_struct_gui to make colored icons for different types of tree nodes.
The idea is inspired by IDEs, for example this Java file:
Produces these trees in different IDEs:
Links to what the different icons mean in different IDEs:
To change icons in a
JTree
it looks like we use aTreeCellRenderer
, which is separate from aTreeModel
. So I think the icons implementation can't be a part of the kaitai_struct_model project. But I want kaitai_struct_model to distinguish different types of entries so an external TreeCellRenderer can check the node types.Here's a demonstration of colored icons from my fork:
StructNode
ListNode
SimpleNode
Here's the KSY file I am using:
Any suggestions for things to add to the test ksy file? I know it does not include params.
I can think of two dimensions for the icons:
What do you think?
The text was updated successfully, but these errors were encountered: