Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Papyrus/Mars Work Description/NewFeature/Shape customisation"

m (Review)
Line 177: Line 177:
 
== Border style ==
 
== Border style ==
  
The border style can be customize through CSS.  
+
The border style can be customized through CSS.  
 
Six styles are available: dash, dashDot, dashDotDot, dot, solid and custom.
 
Six styles are available: dash, dashDot, dashDotDot, dot, solid and custom.
 
With custom style you can set the customDash.
 
With custom style you can set the customDash.
Line 212: Line 212:
 
== Compartment top line length ==
 
== Compartment top line length ==
  
The top line length of compartments can be set.  
+
The top line length of compartments can be setted.  
  
 
=== CSS properties ===
 
=== CSS properties ===
Line 243: Line 243:
 
== Compartment top line position ==
 
== Compartment top line position ==
  
The position of line can be set, the default is center.
+
The position of line can be setted, the default is center.
  
 
=== CSS property ===
 
=== CSS property ===
Line 310: Line 310:
 
== Port position ==
 
== Port position ==
  
The port position can be set to inside, outside or on the line. The "onLine" option is the default value. The CSS property to applied on port is “portPosition”
+
The port position can be setted to inside, outside or on the line. The "onLine" option is the default value. The CSS property to applied on port is “portPosition”
  
 
=== CSS Property ===
 
=== CSS Property ===

Revision as of 10:21, 16 December 2014

DRAFT

Introduction

This new feature adds the possibility to have more option to customize nodes of diagrams. More, SVG symbol can be used for most of nodes. A floating label can also be added to be used with it.

Rounded Corner

The radius of corners can be set throught CSS.

CSS properties

Property name Value type Initial Value Comment
radiusWidth Integer 0 Set the radius width of corners
radiusHeight Integer 0 Set the radius height of corners

Result

Class {
	radiusWidth:150;
	radiusHeight:50;
}

RadiusResult.PNG

Oval shape setting

To force the figure to be an oval, even if it is resized, a specific CSS property has been added. The radius width and height will be not take into account anymore.

CSS property

Property name Value type Initial Value Comment
isOval Boolean false Set to true if you want to have an oval shape

Result

Class {
	isOval:true;
}

OvalResult.PNG

Floating Label

A floating label is now available on most nodes. It’s managed throws CSS properties.

CSS properties

Property name Value type Initial Value Comment
isFloatingLabelConstrained Boolean false Set to true if the floating label is constrained on eight position, you can move it manually.
labelConstrained Boolean false Forced the label to one position, by default(for port) it will placed according to the parent position.
position String EAST Set the forced position.
floatingLabelOffsetWidth Integer 0 Define the width offset of the label when it is not attached.
floatingLabelOffsetHeight Integer 0 Define the height offset of the label when it is not attached.
maskLabel List of String name Set the mask of the floating label.

Attibutes for the mask label:

Value Description!
name Style constant for name display in labels.
visibility Style constant for visibility display in labels.
derived Style constant for isDerive display in labels.
type Style constant for name display in labels.
multiplicity Style constant for multiplicity display in labels.
defaultValue Style constant for default value display in labels.
modifiers Style constant for modifiers display in labels.
multiline Style constant for carriage return in labels.
parametersDirection Style constant for operation#parameter direction display in labels.
direction Style constant for direction display in labels.
parametersName Style constant for operation#parameter name display in labels.
parametersType Style constant for operation#parameter type display in labels.
parametersMultiplicity Style constant for operation#parameter multiplicity display in labels.
parametersDefault Style constant for operation#parameter default value display in labels.
parametersModifiers Style constant for operation#parameter modifiers display in labels.
returnType Style constant for return type display in labels.
returnMultiplicity Style constant for return multiplicity display in labels.
conjugated Style constant for conjugated labels.

Result

Class> Label {
	visible:true;
}

FloatingLabelVisibleResult.PNG

Class {
	isFloatingLabelConstrained:true
}

FloatingLabelConstrained.PNG

Class{
	floatingLabelOffsetWidth:10;
	floatingLabelOffsetHeight:-30;	
}

FloatingLabelOffset.png

SVG symbol usage

SVG is available on symbol compartment like before. The maximum number of displayed symbols can now be set by CSS. Note: SVG Symbol don’t work with affixed Node as Port.

CSS property

Property name Value type Initial Value Comment
maxNumberOfSymbol Integer 10 Set the maximum number of of symbols to be displayed.

SVG color set

The color of the SVG symbol can be chosen. For that, set the CSS properties “useOriginalColors” of the element to false. The white color of the SVG image will be changed by the fill color of the element. The black color of the SVG image will be changed by the line color of the element. Gradient must be disabled.

CSS property

Property name Value type Initial Value Comment
useOriginalColors Boolean true Set if the SVG image use original colors.

Result

ColoredNodeExample.png

Border style

The border style can be customized through CSS. Six styles are available: dash, dashDot, dashDotDot, dot, solid and custom. With custom style you can set the customDash.

CSS properties

Property name Value type Initial Value Comment
borderStyle String solid Set the style of the border(dash, dashDot, dashDotDot, dot, solid, custom).
customDash Int[] [5,5] Set the custom style.

Result

Class {	
	borderStyle:dash; /*dashDot; dashDotDot; dot; */
	lineWidth:2;
}

DashLineStyle.pngDashDotLineStyle.pngDashDotDotLineStyle.pngDotLineStyle.png

Class {	
	borderStyle:custom;
	customDash:10 10;
	lineWidth:2;
}

CustomLineStyle.png

Compartment top line length

The top line length of compartments can be setted.

CSS properties

Property name Value type Initial Value Comment
lineLength int -1 Set the top line length of the compartment. By default the length is set to the width of the compartment.
lineLengthRatio String “1.0” Set the top line length ratio of the compartment.

Result

Figure 15: Default compartment top line

Class > Compartment{
	lineLength:40;
}

LineLengthTo40.png

Class > Compartment{
	lineLengthRatio:"0.80";
}

LineLengthRatioTo08.png

Compartment top line position

The position of line can be setted, the default is center.

CSS property

Property name Value type Initial Value Comment
linePosition String “center” Set the compartment top line position.Can be left, center, right.

Result

Class > Compartment{
	lineLengthRatio:"0.50";
	linePosition:"left"; /*center; right;*/
}

LinePositionToLeft.pngLinePositionToCenter.pngLinePositionToRight.png

Name position

The name position (left, middle, right) of named nodes can be chosen with the CSS property “namePosition”.

CSS property

Property name Value type Initial Value Comment
namePosition String “center” Set name the position of named node.

Result

Class{
	namePosition:"left"; /*center, right*/
}

NamePositionToLeft.pngNamePositionToCenter.pngNamePositionToRight.png

Add header

A header can be added to the figure at the top-left corner with the CSS attribute “displayHeader”.

CSS properties

Property name Value type Initial Value Comment
displayHeader Boolean true Set to true to add a header.

DisplayHeader.png

Result

Class{
	namePosition:"left";
	displayHeader:true;
}

Figure 20: Shape with a header

Port position

The port position can be setted to inside, outside or on the line. The "onLine" option is the default value. The CSS property to applied on port is “portPosition”

CSS Property

Property name Value type Initial Value Comment
portPosition String “onLine” Set the position of the port. Can be “inside”, “ouside” or “onLine”.

Result

Port{
	portPosition:"inside"; /*onLine, outside*/
}

PortInside.pngPortOnLine.pngPortOuside.png

Back to the top