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/Papyrus User Guide"

(UML modeling)
(Code Generation Support)
(41 intermediate revisions by 6 users not shown)
Line 4: Line 4:
 
-->  
 
-->  
  
= Using UML modeling editors  =
+
= Using modeling editors  =
  
 
== UML modeling  ==
 
== UML modeling  ==
Line 128: Line 128:
 
=== Constraints in Papyrus ===
 
=== Constraints in Papyrus ===
  
==== Create constraints ====
+
==== Create and edit constraints ====
  
Do one of the following
+
[[Papyrus/UserGuide/Papyrus Constraints|Create and edit constraints]]
* Within a Papyrus diagram: All Papyrus diagrams support constraints. Select the constraint tool from the palette. Then, press the mouse button at the place where you want to create the constraint and resize the constraint while holding the mouse button down.
+
  
<center>
+
==== Validate OCL Constraints of a Profile ====
[[Image:Constraint_CreateViaDiagram.png]]<br>
+
The constraint tool in the palette
+
</center>
+
  
* Within the model explorer: From the model explorer, click right -> new child -> Create a new Constraint<br>
+
[[Papyrus/UserGuide/Profile Constraints|Define Profile Constraints]]
 
+
<center>
+
[[Image:Constraint_CreateViaME.png]]<br>
+
Create a constraint via the model explorer
+
</center>
+
 
+
==== Specify the context ====
+
 
+
 
+
Before editing a constraint body, it is important to specify the context of a constraint;
+
it can be for instance a stereotype or an operation (in fact, it can be any meta-model element that inherits from namespace).
+
 
+
Do one of the following
+
* Use the context-link-tool to create a visual link to the context element (Papyrus selects the context-link-tool automatically after creation of a constraint): if in two-click-mode
+
(connection tool preference), target the context-line towards the context element and click. If you are in one-click-mode, press mouse button on the constraint and keep it pressed until the context object is targeted.
+
 
+
<center>
+
[[Image:Constraint_ContextViaDiagram.png]]
+
</center>
+
 
+
* Use the property view to select the context via a dialog popup
+
 
+
<center>
+
[[Image:Constraint_ContextViaPropertyView.png]]
+
</center>
+
 
+
 
+
==== Define constraint specification ====
+
 
+
Each constraint has a specification containing a condition. Whereas it may be an arbitrary value specification,
+
such as a StringExpression or LiteralInteger, it is in most cases useful to define an opaque expression consisting
+
of a pair of language and body (a list of these pairs). The constraint body may be written into OCL, JAVA,
+
or natural language. In order to make constraints usable by the Papyrus,
+
constraint must be written in OCL or JAVA.
+
 
+
Select a constraint in a diagram or model explorer. Then do one of the following to edit a specification
+
 
+
* Open the default editor for constraints using the keyboard shortcut F2 or with a second click on an already selected constraint. All editors are using opaque expressions and support a specific language. This language is configured automatically within the opaque expression, the user edits directly the body. The default editor can be controlled via the preferences.
+
 
+
* Select a specific editor via the context menu, as shown in the following screenshot.
+
 
+
<center>
+
[[Image:Constraint_ChooseEditor.png]]<br>
+
Explicitly choose the editor for the constraint
+
</center>
+
 
+
Use the property view to create a new or open an existing specification, as shown in the following figure.
+
In the sequel, we assume that the specification is an opaque expression.
+
 
+
<center>
+
[[Image:Constraint_SpecViaPropertyView.png]]<br>
+
Open the specification via the property view
+
</center>
+
 
+
You can add the language, as in the following figure:<br>
+
 
+
<center>
+
[[Image:Constraint_OpaqueExpressionAddLang.png]]<br>
+
Specify a language.
+
</center>
+
 
+
<center>
+
[[Image:Constraint_OpaqueExpressionEdit.png]]<br>
+
Write the body of the opaque expression
+
</center>
+
 
+
This method is a bit more complicated, but gives the user full control over the opaque specification. In particular,
+
it is possible to enter more than one language, body pair (even if this is rarely needed).
+
  
 
== SysML Modeling  ==
 
== SysML Modeling  ==
Line 257: Line 185:
 
== Layer Support  ==
 
== Layer Support  ==
 
See [[Papyrus/UserGuide/Layers|Layers Guide]]
 
See [[Papyrus/UserGuide/Layers|Layers Guide]]
 +
 +
== Model Execution ==
 +
[[Papyrus/UserGuide/ModelExecution|Execute your fUML models with MOKA]]
  
 
== Automatic Layout Support  ==
 
== Automatic Layout Support  ==
Line 262: Line 193:
 
== Code Generation Support  ==
 
== Code Generation Support  ==
  
=== JAVA Code Generation  ===
+
=== Existing Code Generation Facilities ===
 +
Currently, Papyrus supports code generation for the following programming languages:
 +
* [http://wiki.eclipse.org/Java_Code_Generation Java code generation]
 +
* [http://wiki.eclipse.org/Papyrus/Codegen/Cpp_description C++ code generation]
  
=== C/C++ Code Generation  ===
+
=== Upcoming Code Generation Facilities ===
 +
Papyrus is going to support code generation for the following programming languages, which are in the experimental phase now, soon:
 +
* ADA code generation
 +
* C code generation
  
see [http://wiki.eclipse.org/Codegen_description Papyrus C++ code generation]
+
=== Adding a New Code Generator ===
 +
Apart from the aforementioned programming language, it is also possible to develop and integrate other code generators to Papyrus.
 +
To learn about how to add a new code generator to Papyrus, refer to the following [http://wiki.eclipse.org/Papyrus/Codegen/Adding_a_New_Code_Generator wikipage].
  
=== ADA Code Generation  ===
+
== Reverse Engineering ==
 +
 
 +
=== Java Reverse Engineering ===
 +
 
 +
see [http://wiki.eclipse.org/Java_reverse_engineering Java reverse engineering]
  
 
== Documentation Support  ==
 
== Documentation Support  ==
Line 276: Line 219:
 
=== Documentation Generation ===
 
=== Documentation Generation ===
  
 +
== Deploy your applications ==
 +
 +
see [http://wiki.eclipse.org/Papyrus_Qompass Qompass for Papyrus]
 +
 +
[[Category:Papyrus]]
 +
 +
= General Feature =
 +
 +
== Editors ==
 +
=== Palette ===
 +
The palette is available with any diagrams. But its content depends on the diagrams type.
 +
The standard palette ( the top container of the palette in red in the here-after capture) contents a standard selection tool (the white arrow), a zoom in and zoom out tool, and marquee selection tools.<br/>
 +
[[File:Palette1.JPG]] <br/>
 +
The standard palette is available for every diagram.
 +
==== Properties ====
 +
 +
See [http://wiki.eclipse.org/Papyrus_User_Guide/Palette/Properties Properties]
 +
 +
==== Standard Selection tool ====
 +
 +
See [http://wiki.eclipse.org/Papyrus_User_Guide/Palette/Standard_Selection_Tool Standard selection Tool]
 +
 +
==== Zoom Tools ====
 +
See [http://wiki.eclipse.org/Papyrus_User_Guide/Palette/Zoom_Tools Zoom Tools]
 +
 +
==== Marquee Selection Tools====
 +
See [http://wiki.eclipse.org/Papyrus_User_Guide/Palette/Marquee_Selection_Documentation Marquee Selection Tool]
 +
 +
=== Toolbars ===
 +
Papyrus has its own set of Toolbars. A Toolbar regroups a set of tools belonging to the same kind of activity.
 +
The different Toolbars can be shown or hide depending on the perspectives. <br/>
 +
The toolbars visibility can be customized from the menu Windows/Customize Perspectives. <br/>
 +
[[File:Customize_Perspective.JPG|frame|center|Alignment Perpective]]
 +
 +
==== Alignment ====
 +
See [http://wiki.eclipse.org/Papyrus_User_Guide/Toolbars/Alignment Alignment]
 +
 +
====Text alignment ====
 +
See [http://wiki.eclipse.org/Papyrus_User_Guide/Toolbars/TextAlignment Text alignment]
 +
 +
--[[User:Celine.Janssens.all4tec.net|Céline Janssens &#91;ALL4TEC&#93;]] ([[User talk:Celine.Janssens.all4tec.net|talk]]) 12:06, 28 August 2014 (EDT)
 
[[Category:Papyrus]]
 
[[Category:Papyrus]]

Revision as of 10:05, 14 October 2014


Contents

Using modeling editors

UML modeling

Getting Started

Papyrus Perspective

The Papyrus perspective contains :

  • Model Explorer view
  • Outline view
  • Multi diagram editor view
  • Properties view
  • Toolbar

Papyrus Perspective.png

Model Explorer View

The model explorer is used to navigate to the all model's elements and the diagrams.

Papyrus ModelExplorer.png

This action link the model explorer with the active diagram selection. This action works bidirectionally.

Papyrus ME Sync.png

This action allow to add new semantic element.

Papyrus ME NewChild.png

This action allow to add new diagram in current selection.

Papyrus ME NewDiagram.png

All actions are available on diagram item.

Papyrus ME DiagramMenu.png

The model explorer used Common Navigator Framework and provide facilities to customize view.

Papyrus ME CustomizeView.png

To customize the content of treeViewer:

Papyrus ME CustomizeView Content.png

To filter the content of treeViewer:

Papyrus ME CustomizeView Filters.png

Outline View

The Outline offers a thumbnail of the graphical representation and the list of semantic elements used in current diagram.

Papyrus OutLine.pngPapyrus OutLine All.pngPapyrus OutLine Tree.png

Tutorials on UML modeling with Papyrus

Model/Diagram creation wizard

Create a new Model.

Papyrus CreateNewModel.png


Choose the model file name and the first diagram to create.

Papyrus CreateNewModel-2.png Papyrus CreateNewModel-3.png

Create a diagram from an existing uml file

From your uml file, select the "Initialize Papyrus diagram" to access the creation wizard of Papyrus. Your Papyrus diagram will be linked with your existing model.

CreateDiagramFromModel.PNG


Apply a static profile
  • 1 - Select a package element (ie a Model or a Package).
  • 2 - Select the tab "Profile" on the "Properties" view
  • 3 - Click on the plug-in icon
  • 4 - Select your static profile
  • 5 - Choose profiles to apply

PapyrusApplyStaticProfil.PNG

Load an additionnal resource
Show additional resources in your model explorer view

Ensure that the filter for the additional resources is not checked on your model explorer view : PapyrusFilterAdditionalResources.PNG

Add an additional resource

Right click on an element of your model and select the menu "Load resource..."

PapyrusLoadResources.PNG


Table Documentation

See http://wiki.eclipse.org/Papyrus_User_Guide/Table_Documentation

Papyrus Zoo of UML Models

Composite Structure Diagram

CompositeSupport.PNG

The project is available here [1]

Constraints in Papyrus

Create and edit constraints

Create and edit constraints

Validate OCL Constraints of a Profile

Define Profile Constraints

SysML Modeling

Tutorials on SysML modeling with Papyrus

Papyrus Zoo of SysML Models

MARTE Modeling

Tutorials on MARTE modeling with Papyrus

Papyrus Zoo of MARTE Models

fUML and Alf Modeling

Using fUML and Alf to produce executable models

Developing custom DSL based editor with Papyrus

UML Profile Modeling

Define Profile Constraints

MetaModel Modeling

Additional Editor Integration (this section is for the Backone)

Diagram Editors Customizations

Specific Diagram Editors Creation

Diagram Editor Palette Customization

Here you can find the documentation describing palette customization: Doc

This document can also be found in Papyrus help section => User Guide => Palette customization

Property Editor Customization

Model Explorer Customization

Diagram Appearance Customization with CSS Stylesheets

CSS Stylesheets in Papyrus

Additional Utilities of Papyrus

Collaborative Work Support

Layer Support

See Layers Guide

Model Execution

Execute your fUML models with MOKA

Automatic Layout Support

Code Generation Support

Existing Code Generation Facilities

Currently, Papyrus supports code generation for the following programming languages:

Upcoming Code Generation Facilities

Papyrus is going to support code generation for the following programming languages, which are in the experimental phase now, soon:

  • ADA code generation
  • C code generation

Adding a New Code Generator

Apart from the aforementioned programming language, it is also possible to develop and integrate other code generators to Papyrus. To learn about how to add a new code generator to Papyrus, refer to the following wikipage.

Reverse Engineering

Java Reverse Engineering

see Java reverse engineering

Documentation Support

Documentation Modelling

Documentation Generation

Deploy your applications

see Qompass for Papyrus

General Feature

Editors

Palette

The palette is available with any diagrams. But its content depends on the diagrams type. The standard palette ( the top container of the palette in red in the here-after capture) contents a standard selection tool (the white arrow), a zoom in and zoom out tool, and marquee selection tools.
Palette1.JPG
The standard palette is available for every diagram.

Properties

See Properties

Standard Selection tool

See Standard selection Tool

Zoom Tools

See Zoom Tools

Marquee Selection Tools

See Marquee Selection Tool

Toolbars

Papyrus has its own set of Toolbars. A Toolbar regroups a set of tools belonging to the same kind of activity. The different Toolbars can be shown or hide depending on the perspectives.
The toolbars visibility can be customized from the menu Windows/Customize Perspectives.

Alignment Perpective

Alignment

See Alignment

Text alignment

See Text alignment

--Céline Janssens [ALL4TEC] (talk) 12:06, 28 August 2014 (EDT)

Back to the top