Open GregoBalu opened 8 years ago
The team agreed to disagree on naming of certain elements but accepted the following format:
...
state CompositeStateName {
state InnerState1, innerState2, InnerState3;
}
state OtherState;
...
class MyDiagram extends StateMachineDiagram<ClassName>
{
@Inside(CompositeStateName.class)
class MyDiagramForCompositeState extends Box //This is a visible Box
{
class Ph extends Box //This is an invisible Box (traditional phantom)
{
@East(val = InnerState2.class, from = InnerState3.class)
class L extends Layout {}
}
@North(val = InnerState1.class, from = Ph.class)
class L extends Layout {}
}
@Row({CompositeStateName.class, OtherState.class})
class L extends Layout {}
}
Or instead of name Box, we could use Phantom
for the invisible box and something else (?)
for the visible box.
First ever hierarchical diagram with txtUML Layout. Behold.
Using this layout:
class ProducerConsumerDiagram extends ClassDiagram {
class ContainerPhantom extends Box
{
@South(val = Item.class, from = Storage.class)
class PhantomLayout extends Layout{}
}
@Row({ Producer.class, ContainerPhantom.class, Consumer.class })
class ProducerConsumerLayout extends Layout {
}
}
Got this (textual version, because textual modelling is op):
* - - - - - - - - - *
| * - - - - - - - * |
| | # @ @ #
| | #Stora#
| | # # # @ - - - - *
# @ @ # # # @ # # @ # #
#Produ# + - - - - @Consu#
# # # # | # # # #
# # # # | # # # #
|
# # @ #
#Item #
# # # #
# # # #
It's far from perfect, but hey - it's something
Update:
# # # # # # #
# Storage # #
# # # # # # #
# # # # # # #
# # # # # # #
* - - - - - - - - - @ # # # # # @ - - - - - - *
| # @ # @ # @ # |
# # @ # | | | # @ # #
# Prod@ - - - - - - - - - * | * - - - - - - @ Cons#
# # # # | # # # #
# # # # | # # # #
|
|
|
|
# # @ #
# Item#
# # # #
# # # #
@ELTE-Soft/all *Most statements are scoped to their layer (in case of hierarchical diagrams). Should Spacing statement be the same? Then it would be possible to customize the diagram spacing of inner layers regardless of the outer. If no inner Spacing is present then the outer Spacing would be considered.
I think that's good. So if I specify a spacing on the outer box, it should affect the inner as well when the inner has no spacing. If the inner has spacing the outer has no effect on it any more.
Agree.
It would be nice to have a new Statement to our existing language that would encapsulate certain boxes and "hide" them with one outer bigger box. With this method we can sort of solve the:
The user would have to define a group of boxes and another box that will "contain" that group physically. The latter could be an in-model box or a phantom node as well:
This abstract name is debatable, but is not visible to the user. The front-end would get a small overhaul so it can support structuring (better readability) and could be something like these:
First version:
This version separates the diagram by levels, but comes with a price: We have to give that template parameter for the layout class every time, which is frustrating when only defining elements on the Top level (Top is a bit arbitrary value). This is most noticeable when defining Class diagrams where most (all) of the boxes are on top level.
Second version:
The second version would need less technical reconstruction and less writings (no template paramters) than the first one. On the other hand we had to give a name for the diagram inside CS (CSDiagram) which is not used.
The expected result of a Diagram using this encapsulation: