diff options
11 files changed, 131 insertions, 4 deletions
diff --git a/plugins/doc/org.eclipse.papyrus.infra.gmfdiag.common.doc/plugin.xml b/plugins/doc/org.eclipse.papyrus.infra.gmfdiag.common.doc/plugin.xml index 2c89b466847..fc6e0dfff5d 100644 --- a/plugins/doc/org.eclipse.papyrus.infra.gmfdiag.common.doc/plugin.xml +++ b/plugins/doc/org.eclipse.papyrus.infra.gmfdiag.common.doc/plugin.xml @@ -26,6 +26,22 @@ <toc file="target/generated-eclipse-help/connectionDecorationCustomization-toc.xml" primary="false"> + </toc> + <toc + file="target/generated-eclipse-help/diagramPreferences-devDoc-main-toc.xml" + primary="false"> + </toc> + <toc + file="target/generated-eclipse-help/diagramPreferences-devDoc-toc.xml" + primary="false"> + </toc> + <toc + file="target/generated-eclipse-help/diagramPreferences-userDoc-main-toc.xml" + primary="false"> + </toc> + <toc + file="target/generated-eclipse-help/diagramPreferences-userDoc-toc.xml" + primary="false"> </toc> </extension> </plugin> diff --git a/plugins/doc/org.eclipse.papyrus.infra.gmfdiag.common.doc/resource/diagramPreferences-devDoc-main-toc.xml b/plugins/doc/org.eclipse.papyrus.infra.gmfdiag.common.doc/resource/diagramPreferences-devDoc-main-toc.xml new file mode 100755 index 00000000000..def616b42d8 --- /dev/null +++ b/plugins/doc/org.eclipse.papyrus.infra.gmfdiag.common.doc/resource/diagramPreferences-devDoc-main-toc.xml @@ -0,0 +1,6 @@ +<?xml version='1.0' encoding='utf-8' ?> +<toc label="Diagrams" link_to="../org.eclipse.papyrus.infra.doc/toc.xml#PapyrusDocDev"> + <topic label="Diagram's Preferences"> + <link toc="target/generated-eclipse-help/diagramPreferences-devDoc-toc.xml"/> + </topic> +</toc> diff --git a/plugins/doc/org.eclipse.papyrus.infra.gmfdiag.common.doc/resource/diagramPreferences-devDoc.mediawiki b/plugins/doc/org.eclipse.papyrus.infra.gmfdiag.common.doc/resource/diagramPreferences-devDoc.mediawiki new file mode 100755 index 00000000000..b98234309a2 --- /dev/null +++ b/plugins/doc/org.eclipse.papyrus.infra.gmfdiag.common.doc/resource/diagramPreferences-devDoc.mediawiki @@ -0,0 +1,22 @@ +=Diagram Preferences= +Many preferences are available for the diagrams. This page will be completed as arises. +*The list of the diagram preferences key is provided by the class <code>org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper</code>. +**This class provides methods to calculate the <code>String</code> key for a given preference, represented by an <code>int</code> according to the context: +***all diagrams +***a specific diagram +***a specific UML element + +The preference values are generally stored in the PreferenceStore provided by <code>org.eclipse.papyrus.infra.gmfdiag.common.Activator</code>. + +The default value of preferences are generally done by classes extending <code>org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer</code> or by a static method in a PreferencePage, like it is done with <code>org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer</code> + + +==Connection Preference== +===Connection Bendpoints=== +*'''Draw Common Bendpoints''': +**the <code>int</code> value is provided by <code>org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.DRAW_CONNECTION_POINT</code> +**the suffix's key is provided by <code>org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.DRAW_CONNECTION_POINT_CONSTANT</code> +**the default value for this preference is <code>false</code>. +**the class <code>org.eclipse.papyrus.infra.gmfdiag.common.figure.edge.PapyrusEdgeFigure</code> is in charge to draw the bendpoints through the method <code>drawCommonbendpoints(Graphics)</code>, when the preference is set to <code>true</code>, but we need to override the method <code>org.eclipse.papyrus.infra.gmfdiag.common.figure.edge.PapyrusEdgeFigure.getDrawBendpointPreferenceValue()</code> to get this behavior. +**The subclass <code>org.eclipse.papyrus.uml.diagram.common.figure.edge.CommonEdgeFigure</code> override the previous method to be able to draw the bendpoints according to the preference value. +**The algorithm used to find the bendpoints to draw is tested by a JUnit test provided by the class <code>org.eclipse.papyrus.uml.diagram.common.tests.tests.CommonBendpointsTest</code>. diff --git a/plugins/doc/org.eclipse.papyrus.infra.gmfdiag.common.doc/resource/diagramPreferences-userDoc-main-toc.xml b/plugins/doc/org.eclipse.papyrus.infra.gmfdiag.common.doc/resource/diagramPreferences-userDoc-main-toc.xml new file mode 100755 index 00000000000..99a02c96617 --- /dev/null +++ b/plugins/doc/org.eclipse.papyrus.infra.gmfdiag.common.doc/resource/diagramPreferences-userDoc-main-toc.xml @@ -0,0 +1,7 @@ +<?xml version='1.0' encoding='utf-8' ?> +<toc label="Papyrus Modeling Tools" link_to="../org.eclipse.papyrus.infra.doc/toc.xml#PapyrusTipsAndTricks"> + <topic label="Diagram Preferences"> + + <link toc="target/generated-eclipse-help/diagramPreferences-userDoc-toc.xml"/> +</topic> +</toc> diff --git a/plugins/doc/org.eclipse.papyrus.infra.gmfdiag.common.doc/resource/diagramPreferences-userDoc.mediawiki b/plugins/doc/org.eclipse.papyrus.infra.gmfdiag.common.doc/resource/diagramPreferences-userDoc.mediawiki new file mode 100755 index 00000000000..a1dab4ec435 --- /dev/null +++ b/plugins/doc/org.eclipse.papyrus.infra.gmfdiag.common.doc/resource/diagramPreferences-userDoc.mediawiki @@ -0,0 +1,22 @@ +=Diagram Preferences= +Many preferences are available for the diagrams. This page will be completed as arises. +The Papyrus diagrams preferences are available doing '''Window > Preferences > Papyrus > Diagrams'''. +Under the '''Diagram''' page, you will found each Papyrus Diagram with each preferences. + +The page for the diagram preferences: +[[File:images/diagramPreferences/diagramPreferences.png]] + + +==Connection Group== +===Connection Bendpoints=== +This group provides the preferences concerning the connections' bendpoints. +*'''Draw Common Bendpoints''' +**This preference is only available on the page '''Window > Preferences > Papyrus > Diagrams''' because it is applied to all existing diagrams. +**This preference allows to draw plain circle at the beginning and ending of a connection segment shared between several link representing the same type of UML Element and connected to the same source or target. +**This preference is not available through the CSS. +**This preference is set to <code>false</code> by default. +**Known trouble: +***print a diagram as image is not able to render the drawn bendpoints +**Example of represented common bendpoints: +[[File:images/diagramPreferences/drawCommonBendpoints.png]] + diff --git a/plugins/doc/org.eclipse.papyrus.infra.gmfdiag.common.doc/resource/images/diagramPreferences/diagramPreferences.png b/plugins/doc/org.eclipse.papyrus.infra.gmfdiag.common.doc/resource/images/diagramPreferences/diagramPreferences.png Binary files differnew file mode 100755 index 00000000000..3090c47633c --- /dev/null +++ b/plugins/doc/org.eclipse.papyrus.infra.gmfdiag.common.doc/resource/images/diagramPreferences/diagramPreferences.png diff --git a/plugins/doc/org.eclipse.papyrus.infra.gmfdiag.common.doc/resource/images/diagramPreferences/drawCommonBendpoints.png b/plugins/doc/org.eclipse.papyrus.infra.gmfdiag.common.doc/resource/images/diagramPreferences/drawCommonBendpoints.png Binary files differnew file mode 100755 index 00000000000..8e48667c5bf --- /dev/null +++ b/plugins/doc/org.eclipse.papyrus.infra.gmfdiag.common.doc/resource/images/diagramPreferences/drawCommonBendpoints.png diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/messages/Messages.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/messages/Messages.java index 008ea30b78b..78aabeb1b22 100644 --- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/messages/Messages.java +++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/messages/Messages.java @@ -23,6 +23,10 @@ public class Messages extends NLS { public static String ApplyValueOnPreferenceKeyDialog_ELEMENT; + public static String EditorConnectionGroup_ConnectionBendpoints; + + public static String EditorConnectionGroup_DrawCommonBendpoint_EditorLabel; + public static String LabelGroup_Labels_To_Display; public static String RulersAndGridGroup_GridColor; diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/messages/messages.properties b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/messages/messages.properties index 3e0fced99b2..6fb1965cc30 100644 --- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/messages/messages.properties +++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/messages/messages.properties @@ -4,6 +4,8 @@ RulersAndGridGroup_GridInFront=Grid In Front RulersAndGridGroup_GridStyle=Grid Style ApplyValueOnPreferenceKeyDialog_DIAGRAM=DIAGRAM ApplyValueOnPreferenceKeyDialog_ELEMENT=ELEMENT +EditorConnectionGroup_ConnectionBendpoints=Connection Bendpoints +EditorConnectionGroup_DrawCommonBendpoint_EditorLabel=Draw Common Bendpoints RulersAndGridGroup_GridColor=Grid Color RulersAndGridGroup_GridInFront=Grid In Front RulersAndGridGroup_GridStyle=Grid Style diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/pages/PapyrusAllDiagramsPreferencePage.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/pages/PapyrusAllDiagramsPreferencePage.java index eddc3fa29e3..4fe48c19827 100644..100755 --- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/pages/PapyrusAllDiagramsPreferencePage.java +++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/pages/PapyrusAllDiagramsPreferencePage.java @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2008 Atos Origin. + * Copyright (c) 2008, 2018 Atos Origin. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -10,6 +10,7 @@ * Thibault Landre (Atos Origin) - Initial API and implementation * Patrick Tessier (CEA LIST)- modifications * Fanch Bonnabesse (ALL4TEC) fanch.bonnabesse@alltec.net - Bug 419357 + * Vincent LORENZO (CEA LIST) vincent.lorenzo@cea.fr - Bug 531729 * *****************************************************************************/ package org.eclipse.papyrus.infra.gmfdiag.preferences.pages; @@ -46,7 +47,7 @@ import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Group; /** - * The default preference page all element of diagrams + * The default preference page all elements of diagrams * */ public class PapyrusAllDiagramsPreferencePage extends AbstractPapyrusPreferencePage { @@ -139,6 +140,9 @@ public class PapyrusAllDiagramsPreferencePage extends AbstractPapyrusPreferenceP RestoreElementGroup.initDefaults(store); ExternalReferenceGroup.initDefaults(store); + + //the default value for the Draw connection point preference + store.setDefault(PreferencesConstantsHelper.getPapyrusEditorConstant(PreferencesConstantsHelper.DRAW_CONNECTION_POINT),Boolean.FALSE); } }); diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/editor/EditorConnectionGroup.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/editor/EditorConnectionGroup.java index f028b0a3344..80393344892 100644 --- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/editor/EditorConnectionGroup.java +++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.preferences/src/org/eclipse/papyrus/infra/gmfdiag/preferences/ui/editor/EditorConnectionGroup.java @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (c) 2010 CEA LIST. + * Copyright (c) 2010, 2018 CEA LIST. * * * All rights reserved. This program and the accompanying materials @@ -9,21 +9,33 @@ * * Contributors: * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation + * Vincent LORENZO (CEA LIST) vincent.lorenzo@cea.fr - Bug 531729 * *****************************************************************************/ package org.eclipse.papyrus.infra.gmfdiag.preferences.ui.editor; import org.eclipse.jface.dialogs.DialogPage; +import org.eclipse.jface.preference.BooleanFieldEditor; import org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper; +import org.eclipse.papyrus.infra.gmfdiag.preferences.messages.Messages; import org.eclipse.papyrus.infra.gmfdiag.preferences.ui.ConnectionGroup; +import org.eclipse.swt.SWT; +import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Group; /** - * The Class EditorConnectionGroup : ac onnection group specialized for the editor level + * The Class EditorConnectionGroup : a connection group specialized for the editor level */ public class EditorConnectionGroup extends ConnectionGroup { /** + * the title of the boolean field editor used to edit the draw common bendpoints label + */ + private static final String DRAW_COMMON_BENDPOINTS_EDITOR_LABEL = Messages.EditorConnectionGroup_DrawCommonBendpoint_EditorLabel; + + /** * Instantiates a new editor connection group. * * @param parent @@ -46,4 +58,36 @@ public class EditorConnectionGroup extends ConnectionGroup { protected String getPreferenceConstant(int preferenceType) { return PreferencesConstantsHelper.getPapyrusEditorConstant(preferenceType); } + + + + /** + * @see org.eclipse.papyrus.infra.gmfdiag.preferences.ui.ConnectionGroup#createContent(org.eclipse.swt.widgets.Composite) + * + * @param parent + */ + @Override + public void createContent(final Composite parent) { + super.createContent(parent); + + // we are looking for the connection group created in the super class + Group group = null; + for (final Control current : parent.getChildren()) { + if (current instanceof Group && org.eclipse.papyrus.infra.gmfdiag.preferences.Messages.AbstractPapyrusLinkPreferencePage_Connection.equals(((Group) current).getText())) { + group = (Group) current; + break; + } + } + + // we don't add this group in the super class, because this preference is currently applied on all links and for all diagrams + if (null != group) { + Group group1 = new Group(group, SWT.NONE); + group1.setText(Messages.EditorConnectionGroup_ConnectionBendpoints); + group1.setLayout(new GridLayout()); + final BooleanFieldEditor drawConnectionBenpoints = new BooleanFieldEditor(getPreferenceConstant(PreferencesConstantsHelper.DRAW_CONNECTION_POINT), DRAW_COMMON_BENDPOINTS_EDITOR_LABEL, group1); + addFieldEditor(drawConnectionBenpoints); + } + } + + } |