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/Toolbars/Alignment"

(General Case)
(Alignment Tool)
Line 1: Line 1:
 
= Alignment Tool =
 
= Alignment Tool =
 
== Introduction ==
 
== Introduction ==
Alignment Tool is availbale in the Papyrus toolbar:<br/>
+
Alignment Tool is available in the Papyrus toolbar:<br/>
 
[[File:Alignment_Toolbar.JPG]]<br/>
 
[[File:Alignment_Toolbar.JPG]]<br/>
 
Alignment allows to align the different objects of the model based on a reference object.
 
Alignment allows to align the different objects of the model based on a reference object.
Line 27: Line 27:
 
These types can be disable if the alignment is not possible.
 
These types can be disable if the alignment is not possible.
 
Here is the different rules on which the alignment is based:
 
Here is the different rules on which the alignment is based:
#The alignment is available only if the selected object can be fully aligned on the reference
+
#The alignment is available only if the selected object can be moved on the reference
 
#When an object and one or several children should be aligned on a third object, only the parent is aligned
 
#When an object and one or several children should be aligned on a third object, only the parent is aligned
 
#An object can only be aligned inside of its container's bounds.(In order to avoid scrollbar and invisible objects)  
 
#An object can only be aligned inside of its container's bounds.(In order to avoid scrollbar and invisible objects)  
 
#An object cannot be aligned on one of its children.
 
#An object cannot be aligned on one of its children.
  
 +
 
== Using of Alignment Tool ==
 
== Using of Alignment Tool ==
 
Here under, some examples of using of alignment tool. <br/>
 
Here under, some examples of using of alignment tool. <br/>
 
=== General Case ===
 
=== General Case ===
Basically, alignment is used in order to make the model easier to be read and more aesthetic.
+
Basically, alignment is used in order to make the model easier to be read and more aesthetical.
 
To align objects:
 
To align objects:
 
:* Select the object to be aligned
 
:* Select the object to be aligned
:* Clic on the align tool button [[File:Align_button.JPG]]   
+
:* Click on the align tool button [[File:Align_button.JPG]]   
 
:* Choose the proper type of alignment  
 
:* Choose the proper type of alignment  
 
<br/>
 
<br/>
Line 84: Line 85:
 
[[File:Hierarchy_Align3_limitation.JPG]]
 
[[File:Hierarchy_Align3_limitation.JPG]]
 
=== Label ===
 
=== Label ===
The extremities (source or target)of a connection cannot be aligned on any Labels of this connection.
+
The extremities (source or target )of a connection cannot be aligned on any Labels of this connection.
 
[[File:Label_Align3_limitation.JPG]]
 
[[File:Label_Align3_limitation.JPG]]
 
=== Edge ===
 
=== Edge ===
 
To make the edge alignment available, the edge handles should correspond to the same direction (horizontal or vertical).
 
To make the edge alignment available, the edge handles should correspond to the same direction (horizontal or vertical).
In the following case, source handle is on TOP and target handle is on LEFT. It is then impossible to align the edge.
+
In the following case, source handle is on TOP and target handle is on LEFT. it is then impossible to align the edge.
 
[[File:Link_Align2_Limitation.JPG]]
 
[[File:Link_Align2_Limitation.JPG]]

Revision as of 04:17, 29 August 2014

Alignment Tool

Introduction

Alignment Tool is available in the Papyrus toolbar:
Alignment Toolbar.JPG
Alignment allows to align the different objects of the model based on a reference object. The reference object is basically the last object selected (primary selection) and can be identified with the handles color:

Normal Selection
Primary Selection


To implement Alignment, some rules have been defined.

General Rules

Alignment Types

The Alignment Tools allows 6 types of alignment:

  • Horizontally
    • Left
    • Center
    • Right
  • Vertically
    • Top
    • Middle
    • Bottom


These types can be disable if the alignment is not possible. Here is the different rules on which the alignment is based:

  1. The alignment is available only if the selected object can be moved on the reference
  2. When an object and one or several children should be aligned on a third object, only the parent is aligned
  3. An object can only be aligned inside of its container's bounds.(In order to avoid scrollbar and invisible objects)
  4. An object cannot be aligned on one of its children.


Using of Alignment Tool

Here under, some examples of using of alignment tool.

General Case

Basically, alignment is used in order to make the model easier to be read and more aesthetical. To align objects:

  • Select the object to be aligned
  • Click on the align tool button Align button.JPG
  • Choose the proper type of alignment


  1. Example A: Standard alignment
    General Align1 before.JPG
    General Align1 after.JPG
    In this case the reference object is the right one.
  2. Example B: Parent alignment
    In this second example, the object (the Class ) is aligned on his parent (the Package), the unauthorized alignment appears disable (in grey)
    General Align2 before.JPG
    General Align2 after.JPG

Hierarchy

In this section, some examples of alignment in case of hierarchy between objects (parent / children).

  1. Example A: Only the parent is aligned
    Hierarchy Align1 before.JPG
    As shown in the result screenshot below , only the parent (the Package) has been aligned.
    Hierarchy Align1 after.JPG
  2. Example B: Alignment inside the Container bounds is available
    Hierarchy Align2 before.JPG
    In the align options list, only the ones that keep the objects inside his container are enable.
    Hierarchy Align2 after.JPG

Labels

In this section, some examples of labels alignments.

  1. Example A: Standard label alignment
    Label Align1 before.JPG
    Label Align1 after.JPG
  2. Example B: Dependency with another selected object
    Label Align2 before.JPG
    As shown in the result screenshot below, only the class is aligned. The label moves according to the connection move.
    Label Align2 after.JPG

Edges

Edges alignment could sound not realistic. Actually, edge alignment is an alignment between the extremities of the edge, to make the edge horizontal or vertical. Example: Standard edge alignment

Link Align1 before.JPG

The extremities are alignment in order to have an horizontal connection. The connection handles remained at the same place on the object

Link Align1 after.JPG

Limitation

This section will describe some limitations of the alignment tool.

Hierarchy

A parent cannot be aligned on one of his child: Hierarchy Align3 limitation.JPG

Label

The extremities (source or target )of a connection cannot be aligned on any Labels of this connection. Label Align3 limitation.JPG

Edge

To make the edge alignment available, the edge handles should correspond to the same direction (horizontal or vertical). In the following case, source handle is on TOP and target handle is on LEFT. it is then impossible to align the edge. Link Align2 Limitation.JPG

Back to the top