How to set the width of Swimlanes in PlantUML activity diagram? - uml

I am using PlantUML to draw a activity diagram and I am using the new activity diagram syntax (beta).
I am not able to set the width of the swimlanes. I have tried using the following
skinparam swimlaneWidth 400
and
skinparam swimlaneWidth same
but these do not work. I have attached a sample diagram that shows the problem.
using
skinparam wrapWidth 100
I have been able to control when the activity text wraps to the next line, but that does not help with the swimlane width.
How do I set the width of the swimlanes? Happy to use a workaround if one exists.
Here is the full sample.
#startuml
skinparam wrapWidth 100
|Swimlane1|
start
:foo1;
|#AntiqueWhite|Swimlane2|
:foo2;
:Long Activity Name;
|Swimlane1|
:Very Very Very Long Activity Name;
|Swimlane2|
:foo5;
stop
#enduml
and the image this generates
.

There is a workaround: set spaces in the title of the swimlane. Doing this it is only possible to enlarge it, not to shrink it.

Related

Unity2D: Add text to rigidbody2D element

I'm new to Unity and I started with the Catch Game Tutorial to learn to create a 2D game. Everything is working now but for my needs, I would like to add different textboxes to each of the fallen elements (in the tutorial the bowling balls) Those texts should move with the objects. I know I can change text dynamically in the code, but I couldn't figure out how to correctly add the element.
I tried to add a text object as a child of the gameobject and also tried to create a new gameobject which contains a text, but I can't position the element in front of the background and above my wished element (I can't choose a sorting layer for this)
Imagine this is the object which has to be collected and I would like to show a text like this:
My Questions are:
1. How can I add a text to be displayed in the correct position (GUIText, text in a gameobject, only text or something else?
2. How can I make this text dynamically move with the fallen object?
3. Can I set a background to my text as displayed above?
Thank you in advance!
I found a solution for my problem and did the following thing:
I created a Sprite with my wished background (black rectangle) and added it to the scene
I created a 3D Text and added it as a child to the created Sprite (and scaled it and positioned it)
I added a Script to the 3d Text with the following content:
void Start () {
this.gameObject.GetComponent<Renderer>().sortingLayerName = "[MyLayerName]";
this.gameObject.GetComponent<Renderer>().sortingOrder = 3;
}
I added the Sprite (with the text as child) to my gameObject (ananas)
A renewed the object in the Prefabs folder
Maybe my solution helps other people facing a similar problem.

Resizing a custom XYChart in an FXML Tab Pane

This question related to Java-FX and its charting capabilities and resizing.
My problem is that I wanted to create a custom candlestick chart and I managed to get that done by going through the Ensemble application source code which was quite helpful.
The code for generating the candlestick is here:
http://javafx-ui-hxzon.googlecode.com/svn-history/r13/trunk/ChartsSampler/chartssampler/CandleStickChart.java
However, when I run my application, I seem to be stuck with a chart size that is fixed and does not resize according to my Tab Pane (the parent) resizing in my GUI. I've gone through the code, fiddled with it, changed the value of the minWidth and minHeight to USE_PREF_WIDTH AND USE_COMPUTE_WIDTH both but I cannot get it to fit to the parent Tab pane.
What am I missing?
I call AdvCandleStickChartSample in my controller as follows:
AdvCandleStickChartSample adv=new AdvCandleStickChartSample();
candleTab.setContent(adv);//candleTab has been predefined in an FXML file
My guess is I need to resize based on an event-handler? Am I correct in assuming this? Or am I not overriding a specific method that handles the resizing? When I create a dummy linechart and fill it with data and "run" it, it resizes fine along with the window.
Please help!
Never mind.
I found the answer. I simply had to override the layoutChildren() method by implementing the Pane superclass.
In the Ensemble application they accomplish this by implementing a "Sample" class which overrides the Pane super-class's layoutChildren() method

Rational Software Architect - missing icon for Class element in palette window?

I have been trying to create a Class diagram in UML 2.0 using Rational Architect.
However when I look at the palette options there is no icon for Class to click and position a class item on the diagram.
Screenshot:
Following this example here , on page 2 you can clearly see the palette has an icon for "Class"
Why can I not find it? Is it a specific type of project or model I have to use ?
Thanks
Problem solved,
Was in "Use-case" view instead of "Model" view.

Rating screen using LWUIT

I want to create a MIDlet from where I call the class.In the class there is an Image Array which contain 10 images and default ration is 0.Now I want to know how to create the class when the MIDlet call the class suppose iRating=new Rating(3),where Rating is the class name.when I show() the form at that moment only 3 image will be highlighted rest are not,if I put 4 then 4 image will highlighted.Please help me how to do
the output will be as follow.
when we click the 3rd star then first three star will be highlighted rest are not.please suggest me how to do that.
I suggest you use a checkbox or toggle button (checkbox with setToggle(true)) and set the images appropriately. To place 5 of these just add them all into a horizontal layout container.

StarUML defining interface methods and attributes in the interface icon?

I'm just using StarUML to create my UML Class diagram and something is bothering me. I create an interface representation, which is a circle, however, there is no room to add which methods and attributes the interface defines. Is this normal UML practice?
If not, how do you know (say a class implements this interface and has 4 methods defined) which of the 4 methods came from the interface and which didnt?
Solved:
Ok just incase someone else has this problem- there are two notations, both are possible in StarUML but only one explicitly (the dot notation). To create the <> notation, enter the name as <> IInterface_Name and then draw a realisation line between the implementing classes. Be sure to manually delete the old (wrong) relationship you had by right clicking the class, collection editor and then relations.
It is very simple:
If you need just show method of interface - right click on interface and un-select Format/Suppress operation (see blue circle on picture)
If you need to display instead of circle just squared form of interface (on my picture it is ISome) use Format/Stereotype Display/Decoration (see red circle on picture bellow)

Resources