From e756973eb8c6fa76c0f676c28d26d1b21e092347 Mon Sep 17 00:00:00 2001 From: Martin Fleck Date: Mon, 27 May 2024 12:33:40 +0200 Subject: [PATCH] Add Resizable with 'resizeLocations' to shape elements - Use string for GResizeLocation - Fix issue with issue severity not being of type string - Fix minor issue with wrong EClass mapping for weighted edge --- .../WorkflowDiagramConfiguration.java | 3 +- .../handler/CreateDecisionNodeHandler.java | 2 + .../handler/CreateMergeNodeHandler.java | 15 ++ .../model/glsp-graph.ecore | 8 +- .../model/glsp-graph.genmodel | 3 + .../org/eclipse/glsp/graph/GIssue.java | 9 +- .../org/eclipse/glsp/graph/GResizable.java | 52 ++++++ .../org/eclipse/glsp/graph/GShapeElement.java | 2 +- .../org/eclipse/glsp/graph/GraphFactory.java | 9 + .../org/eclipse/glsp/graph/GraphPackage.java | 149 +++++++++++++++- .../eclipse/glsp/graph/impl/GButtonImpl.java | 54 ++++++ .../glsp/graph/impl/GCompartmentImpl.java | 55 ++++++ .../eclipse/glsp/graph/impl/GIssueImpl.java | 17 +- .../glsp/graph/impl/GIssueMarkerImpl.java | 55 ++++++ .../eclipse/glsp/graph/impl/GLabelImpl.java | 54 ++++++ .../eclipse/glsp/graph/impl/GNodeImpl.java | 54 ++++++ .../eclipse/glsp/graph/impl/GPortImpl.java | 54 ++++++ .../glsp/graph/impl/GResizableImpl.java | 166 ++++++++++++++++++ .../glsp/graph/impl/GraphFactoryImpl.java | 13 ++ .../glsp/graph/impl/GraphPackageImpl.java | 40 ++++- .../glsp/graph/util/GraphAdapterFactory.java | 19 ++ .../eclipse/glsp/graph/util/GraphSwitch.java | 36 ++++ .../eclipse/glsp/graph/GResizeLocation.java | 39 ++++ .../graph/builder/GShapeElementBuilder.java | 11 ++ .../graph/builder/impl/GIssueBuilder.java | 6 +- 25 files changed, 897 insertions(+), 28 deletions(-) create mode 100644 plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/GResizable.java create mode 100644 plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/impl/GResizableImpl.java create mode 100644 plugins/org.eclipse.glsp.graph/src/org/eclipse/glsp/graph/GResizeLocation.java diff --git a/examples/org.eclipse.glsp.example.workflow/src/org/eclipse/glsp/example/workflow/WorkflowDiagramConfiguration.java b/examples/org.eclipse.glsp.example.workflow/src/org/eclipse/glsp/example/workflow/WorkflowDiagramConfiguration.java index 116d6ae4..aa5f894f 100644 --- a/examples/org.eclipse.glsp.example.workflow/src/org/eclipse/glsp/example/workflow/WorkflowDiagramConfiguration.java +++ b/examples/org.eclipse.glsp.example.workflow/src/org/eclipse/glsp/example/workflow/WorkflowDiagramConfiguration.java @@ -56,7 +56,7 @@ public Map getTypeMappings() { mappings.put(LABEL_TEXT, GraphPackage.Literals.GLABEL); mappings.put(COMP_HEADER, GraphPackage.Literals.GCOMPARTMENT); mappings.put(LABEL_ICON, GraphPackage.Literals.GLABEL); - mappings.put(WEIGHTED_EDGE, GraphPackage.Literals.GEDGE); + mappings.put(WEIGHTED_EDGE, WfgraphPackage.Literals.WEIGHTED_EDGE); mappings.put(ICON, WfgraphPackage.Literals.ICON); mappings.put(ACTIVITY_NODE, WfgraphPackage.Literals.ACTIVITY_NODE); mappings.put(TASK, WfgraphPackage.Literals.TASK_NODE); @@ -105,7 +105,6 @@ public List getEdgeTypeHints() { return edgeHints; } - @Override public ServerLayoutKind getLayoutKind() { return ServerLayoutKind.MANUAL; } diff --git a/examples/org.eclipse.glsp.example.workflow/src/org/eclipse/glsp/example/workflow/handler/CreateDecisionNodeHandler.java b/examples/org.eclipse.glsp.example.workflow/src/org/eclipse/glsp/example/workflow/handler/CreateDecisionNodeHandler.java index da4a9b38..29872738 100644 --- a/examples/org.eclipse.glsp.example.workflow/src/org/eclipse/glsp/example/workflow/handler/CreateDecisionNodeHandler.java +++ b/examples/org.eclipse.glsp.example.workflow/src/org/eclipse/glsp/example/workflow/handler/CreateDecisionNodeHandler.java @@ -22,6 +22,7 @@ import org.eclipse.glsp.example.workflow.utils.WorkflowBuilder.ActivityNodeBuilder; import org.eclipse.glsp.graph.GNode; import org.eclipse.glsp.graph.GPoint; +import org.eclipse.glsp.graph.GResizeLocation; import org.eclipse.glsp.graph.builder.impl.GLayoutOptions; public class CreateDecisionNodeHandler extends CreateActivityNodeHandler { @@ -36,6 +37,7 @@ protected GNode createNode(final Optional point, final Map point, final Map args) { + String nodeType = ModelTypes.toNodeType(getElementTypeId()); + return new ActivityNodeBuilder(getElementTypeId(), nodeType) // + .position(point.orElse(null)) // + .resizeLocations(GResizeLocation.CROSS) // + .build(); + } } diff --git a/plugins/org.eclipse.glsp.graph/model/glsp-graph.ecore b/plugins/org.eclipse.glsp.graph/model/glsp-graph.ecore index f11b8509..c891f93b 100644 --- a/plugins/org.eclipse.glsp.graph/model/glsp-graph.ecore +++ b/plugins/org.eclipse.glsp.graph/model/glsp-graph.ecore @@ -15,7 +15,7 @@ + eSuperTypes="#//GModelElement #//GBoundsAware #//GLayoutable #//GResizable"/> + eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString" defaultValueLiteral="info"/> @@ -132,4 +132,8 @@ + + + diff --git a/plugins/org.eclipse.glsp.graph/model/glsp-graph.genmodel b/plugins/org.eclipse.glsp.graph/model/glsp-graph.genmodel index 10500c49..9bff5f0e 100644 --- a/plugins/org.eclipse.glsp.graph/model/glsp-graph.genmodel +++ b/plugins/org.eclipse.glsp.graph/model/glsp-graph.genmodel @@ -105,5 +105,8 @@ + + + diff --git a/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/GIssue.java b/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/GIssue.java index e85f2ba2..3141255a 100644 --- a/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/GIssue.java +++ b/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/GIssue.java @@ -39,28 +39,25 @@ public interface GIssue extends EObject { /** * Returns the value of the 'Severity' attribute. * The default value is "info". - * The literals are from the enumeration {@link org.eclipse.glsp.graph.GSeverity}. * * * @return the value of the 'Severity' attribute. - * @see org.eclipse.glsp.graph.GSeverity - * @see #setSeverity(GSeverity) + * @see #setSeverity(String) * @see org.eclipse.glsp.graph.GraphPackage#getGIssue_Severity() * @model default="info" required="true" * @generated */ - GSeverity getSeverity(); + String getSeverity(); /** * Sets the value of the '{@link org.eclipse.glsp.graph.GIssue#getSeverity Severity}' attribute. * * * @param value the new value of the 'Severity' attribute. - * @see org.eclipse.glsp.graph.GSeverity * @see #getSeverity() * @generated */ - void setSeverity(GSeverity value); + void setSeverity(String value); /** * Returns the value of the 'Message' attribute. diff --git a/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/GResizable.java b/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/GResizable.java new file mode 100644 index 00000000..92059c84 --- /dev/null +++ b/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/GResizable.java @@ -0,0 +1,52 @@ +/** + * Copyright (c) 2019-2022 EclipseSource and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * https://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + * ******************************************************************************** + */ +package org.eclipse.glsp.graph; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'GResizable'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.glsp.graph.GResizable#getResizeLocations Resize Locations}
  • + *
+ * + * @see org.eclipse.glsp.graph.GraphPackage#getGResizable() + * @model + * @generated + */ +public interface GResizable extends EObject { + /** + * Returns the value of the 'Resize Locations' attribute list. + * The list contents are of type {@link java.lang.String}. + * + * + * @return the value of the 'Resize Locations' attribute list. + * @see org.eclipse.glsp.graph.GraphPackage#getGResizable_ResizeLocations() + * @model + * @generated + */ + EList getResizeLocations(); + +} // GResizable diff --git a/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/GShapeElement.java b/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/GShapeElement.java index 9a968582..2be41c2f 100644 --- a/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/GShapeElement.java +++ b/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/GShapeElement.java @@ -26,4 +26,4 @@ * @model interface="true" abstract="true" * @generated */ -public interface GShapeElement extends GModelElement, GBoundsAware, GLayoutable {} // GShapeElement +public interface GShapeElement extends GModelElement, GBoundsAware, GLayoutable, GResizable {} // GShapeElement diff --git a/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/GraphFactory.java b/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/GraphFactory.java index a4ecfa30..0f71633f 100644 --- a/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/GraphFactory.java +++ b/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/GraphFactory.java @@ -215,6 +215,15 @@ public interface GraphFactory extends EFactory { */ GLayoutable createGLayoutable(); + /** + * Returns a new object of class 'GResizable'. + * + * + * @return a new object of class 'GResizable'. + * @generated + */ + GResizable createGResizable(); + /** * Returns the package supported by this factory. * diff --git a/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/GraphPackage.java b/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/GraphPackage.java index ea8ee2f6..5cdac0ff 100644 --- a/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/GraphPackage.java +++ b/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/GraphPackage.java @@ -299,6 +299,15 @@ public interface GraphPackage extends EPackage { */ int GSHAPE_ELEMENT__LAYOUT_OPTIONS = GMODEL_ELEMENT_FEATURE_COUNT + 2; + /** + * The feature id for the 'Resize Locations' attribute list. + * + * + * @generated + * @ordered + */ + int GSHAPE_ELEMENT__RESIZE_LOCATIONS = GMODEL_ELEMENT_FEATURE_COUNT + 3; + /** * The number of structural features of the 'GShape Element' class. * @@ -306,7 +315,7 @@ public interface GraphPackage extends EPackage { * @generated * @ordered */ - int GSHAPE_ELEMENT_FEATURE_COUNT = GMODEL_ELEMENT_FEATURE_COUNT + 3; + int GSHAPE_ELEMENT_FEATURE_COUNT = GMODEL_ELEMENT_FEATURE_COUNT + 4; /** * The number of operations of the 'GShape Element' class. @@ -662,6 +671,15 @@ public interface GraphPackage extends EPackage { */ int GNODE__LAYOUT_OPTIONS = GSHAPE_ELEMENT__LAYOUT_OPTIONS; + /** + * The feature id for the 'Resize Locations' attribute list. + * + * + * @generated + * @ordered + */ + int GNODE__RESIZE_LOCATIONS = GSHAPE_ELEMENT__RESIZE_LOCATIONS; + /** * The feature id for the 'Edge Placement' containment reference. * @@ -943,6 +961,15 @@ public interface GraphPackage extends EPackage { */ int GCOMPARTMENT__LAYOUT_OPTIONS = GSHAPE_ELEMENT__LAYOUT_OPTIONS; + /** + * The feature id for the 'Resize Locations' attribute list. + * + * + * @generated + * @ordered + */ + int GCOMPARTMENT__RESIZE_LOCATIONS = GSHAPE_ELEMENT__RESIZE_LOCATIONS; + /** * The feature id for the 'Layout' attribute. * @@ -1125,6 +1152,15 @@ public interface GraphPackage extends EPackage { */ int GLABEL__LAYOUT_OPTIONS = GALIGNABLE_FEATURE_COUNT + 10; + /** + * The feature id for the 'Resize Locations' attribute list. + * + * + * @generated + * @ordered + */ + int GLABEL__RESIZE_LOCATIONS = GALIGNABLE_FEATURE_COUNT + 11; + /** * The feature id for the 'Text' attribute. * @@ -1132,7 +1168,7 @@ public interface GraphPackage extends EPackage { * @generated * @ordered */ - int GLABEL__TEXT = GALIGNABLE_FEATURE_COUNT + 11; + int GLABEL__TEXT = GALIGNABLE_FEATURE_COUNT + 12; /** * The number of structural features of the 'GLabel' class. @@ -1141,7 +1177,7 @@ public interface GraphPackage extends EPackage { * @generated * @ordered */ - int GLABEL_FEATURE_COUNT = GALIGNABLE_FEATURE_COUNT + 12; + int GLABEL_FEATURE_COUNT = GALIGNABLE_FEATURE_COUNT + 13; /** * The number of operations of the 'GLabel' class. @@ -1252,6 +1288,15 @@ public interface GraphPackage extends EPackage { */ int GISSUE_MARKER__LAYOUT_OPTIONS = GSHAPE_ELEMENT__LAYOUT_OPTIONS; + /** + * The feature id for the 'Resize Locations' attribute list. + * + * + * @generated + * @ordered + */ + int GISSUE_MARKER__RESIZE_LOCATIONS = GSHAPE_ELEMENT__RESIZE_LOCATIONS; + /** * The feature id for the 'Issues' containment reference list. * @@ -1379,6 +1424,15 @@ public interface GraphPackage extends EPackage { */ int GPORT__LAYOUT_OPTIONS = GSHAPE_ELEMENT__LAYOUT_OPTIONS; + /** + * The feature id for the 'Resize Locations' attribute list. + * + * + * @generated + * @ordered + */ + int GPORT__RESIZE_LOCATIONS = GSHAPE_ELEMENT__RESIZE_LOCATIONS; + /** * The number of structural features of the 'GPort' class. * @@ -1497,6 +1551,15 @@ public interface GraphPackage extends EPackage { */ int GBUTTON__LAYOUT_OPTIONS = GSHAPE_ELEMENT__LAYOUT_OPTIONS; + /** + * The feature id for the 'Resize Locations' attribute list. + * + * + * @generated + * @ordered + */ + int GBUTTON__RESIZE_LOCATIONS = GSHAPE_ELEMENT__RESIZE_LOCATIONS; + /** * The feature id for the 'Enabled' attribute. * @@ -2338,6 +2401,43 @@ public interface GraphPackage extends EPackage { */ int STRING_TO_OBJECT_MAP_ENTRY_OPERATION_COUNT = 0; + /** + * The meta object id for the '{@link org.eclipse.glsp.graph.impl.GResizableImpl GResizable}' class. + * + * + * @see org.eclipse.glsp.graph.impl.GResizableImpl + * @see org.eclipse.glsp.graph.impl.GraphPackageImpl#getGResizable() + * @generated + */ + int GRESIZABLE = 26; + + /** + * The feature id for the 'Resize Locations' attribute list. + * + * + * @generated + * @ordered + */ + int GRESIZABLE__RESIZE_LOCATIONS = 0; + + /** + * The number of structural features of the 'GResizable' class. + * + * + * @generated + * @ordered + */ + int GRESIZABLE_FEATURE_COUNT = 1; + + /** + * The number of operations of the 'GResizable' class. + * + * + * @generated + * @ordered + */ + int GRESIZABLE_OPERATION_COUNT = 0; + /** * The meta object id for the '{@link org.eclipse.glsp.graph.GSeverity GSeverity}' enum. * @@ -2346,7 +2446,7 @@ public interface GraphPackage extends EPackage { * @see org.eclipse.glsp.graph.impl.GraphPackageImpl#getGSeverity() * @generated */ - int GSEVERITY = 26; + int GSEVERITY = 27; /** * Returns the meta object for class '{@link org.eclipse.glsp.graph.GModelElement GModel Element}'. @@ -3072,6 +3172,27 @@ public interface GraphPackage extends EPackage { */ EReference getGLayoutable_LayoutOptions(); + /** + * Returns the meta object for class '{@link org.eclipse.glsp.graph.GResizable GResizable}'. + * + * + * @return the meta object for class 'GResizable'. + * @see org.eclipse.glsp.graph.GResizable + * @generated + */ + EClass getGResizable(); + + /** + * Returns the meta object for the attribute list '{@link org.eclipse.glsp.graph.GResizable#getResizeLocations Resize Locations}'. + * + * + * @return the meta object for the attribute list 'Resize Locations'. + * @see org.eclipse.glsp.graph.GResizable#getResizeLocations() + * @see #getGResizable() + * @generated + */ + EAttribute getGResizable_ResizeLocations(); + /** * Returns the meta object for enum '{@link org.eclipse.glsp.graph.GSeverity GSeverity}'. * @@ -3696,11 +3817,29 @@ interface Literals { /** * The meta object literal for the 'Layout Options' map feature. * - * + * * @generated */ EReference GLAYOUTABLE__LAYOUT_OPTIONS = eINSTANCE.getGLayoutable_LayoutOptions(); + /** + * The meta object literal for the '{@link org.eclipse.glsp.graph.impl.GResizableImpl GResizable}' class. + * + * + * @see org.eclipse.glsp.graph.impl.GResizableImpl + * @see org.eclipse.glsp.graph.impl.GraphPackageImpl#getGResizable() + * @generated + */ + EClass GRESIZABLE = eINSTANCE.getGResizable(); + + /** + * The meta object literal for the 'Resize Locations' attribute list feature. + * + * + * @generated + */ + EAttribute GRESIZABLE__RESIZE_LOCATIONS = eINSTANCE.getGResizable_ResizeLocations(); + /** * The meta object literal for the '{@link org.eclipse.glsp.graph.GSeverity GSeverity}' enum. * diff --git a/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/impl/GButtonImpl.java b/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/impl/GButtonImpl.java index c444bc22..6d2638b7 100644 --- a/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/impl/GButtonImpl.java +++ b/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/impl/GButtonImpl.java @@ -42,6 +42,7 @@ import org.eclipse.glsp.graph.GLayoutable; import org.eclipse.glsp.graph.GModelElement; import org.eclipse.glsp.graph.GPoint; +import org.eclipse.glsp.graph.GResizable; import org.eclipse.glsp.graph.GraphPackage; /** @@ -61,6 +62,7 @@ *
  • {@link org.eclipse.glsp.graph.impl.GButtonImpl#getPosition Position}
  • *
  • {@link org.eclipse.glsp.graph.impl.GButtonImpl#getSize Size}
  • *
  • {@link org.eclipse.glsp.graph.impl.GButtonImpl#getLayoutOptions Layout Options}
  • + *
  • {@link org.eclipse.glsp.graph.impl.GButtonImpl#getResizeLocations Resize Locations}
  • *
  • {@link org.eclipse.glsp.graph.impl.GButtonImpl#isEnabled Enabled}
  • * * @@ -177,6 +179,16 @@ public class GButtonImpl extends GArgumentableImpl implements GButton { */ protected EMap layoutOptions; + /** + * The cached value of the '{@link #getResizeLocations() Resize Locations}' attribute list. + * + * + * @see #getResizeLocations() + * @generated + * @ordered + */ + protected EList resizeLocations; + /** * The default value of the '{@link #isEnabled() Enabled}' attribute. * @@ -465,6 +477,19 @@ public EMap getLayoutOptions() { return layoutOptions; } + /** + * + * + * @generated + */ + @Override + public EList getResizeLocations() { + if (resizeLocations == null) { + resizeLocations = new EDataTypeUniqueEList(String.class, this, GraphPackage.GBUTTON__RESIZE_LOCATIONS); + } + return resizeLocations; + } + /** * * @@ -571,6 +596,8 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) { return getLayoutOptions(); else return getLayoutOptions().map(); + case GraphPackage.GBUTTON__RESIZE_LOCATIONS: + return getResizeLocations(); case GraphPackage.GBUTTON__ENABLED: return isEnabled(); } @@ -615,6 +642,10 @@ public void eSet(int featureID, Object newValue) { case GraphPackage.GBUTTON__LAYOUT_OPTIONS: ((EStructuralFeature.Setting) getLayoutOptions()).set(newValue); return; + case GraphPackage.GBUTTON__RESIZE_LOCATIONS: + getResizeLocations().clear(); + getResizeLocations().addAll((Collection) newValue); + return; case GraphPackage.GBUTTON__ENABLED: setEnabled((Boolean) newValue); return; @@ -657,6 +688,9 @@ public void eUnset(int featureID) { case GraphPackage.GBUTTON__LAYOUT_OPTIONS: getLayoutOptions().clear(); return; + case GraphPackage.GBUTTON__RESIZE_LOCATIONS: + getResizeLocations().clear(); + return; case GraphPackage.GBUTTON__ENABLED: setEnabled(ENABLED_EDEFAULT); return; @@ -690,6 +724,8 @@ public boolean eIsSet(int featureID) { return size != null; case GraphPackage.GBUTTON__LAYOUT_OPTIONS: return layoutOptions != null && !layoutOptions.isEmpty(); + case GraphPackage.GBUTTON__RESIZE_LOCATIONS: + return resizeLocations != null && !resizeLocations.isEmpty(); case GraphPackage.GBUTTON__ENABLED: return enabled != ENABLED_EDEFAULT; } @@ -721,6 +757,14 @@ public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { return -1; } } + if (baseClass == GResizable.class) { + switch (derivedFeatureID) { + case GraphPackage.GBUTTON__RESIZE_LOCATIONS: + return GraphPackage.GRESIZABLE__RESIZE_LOCATIONS; + default: + return -1; + } + } return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); } @@ -749,6 +793,14 @@ public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { return -1; } } + if (baseClass == GResizable.class) { + switch (baseFeatureID) { + case GraphPackage.GRESIZABLE__RESIZE_LOCATIONS: + return GraphPackage.GBUTTON__RESIZE_LOCATIONS; + default: + return -1; + } + } return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); } @@ -771,6 +823,8 @@ public String toString() { result.append(trace); result.append(", type: "); result.append(type); + result.append(", resizeLocations: "); + result.append(resizeLocations); result.append(", enabled: "); result.append(enabled); result.append(')'); diff --git a/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/impl/GCompartmentImpl.java b/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/impl/GCompartmentImpl.java index 11048aeb..16059785 100644 --- a/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/impl/GCompartmentImpl.java +++ b/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/impl/GCompartmentImpl.java @@ -43,6 +43,7 @@ import org.eclipse.glsp.graph.GLayouting; import org.eclipse.glsp.graph.GModelElement; import org.eclipse.glsp.graph.GPoint; +import org.eclipse.glsp.graph.GResizable; import org.eclipse.glsp.graph.GraphPackage; /** @@ -62,6 +63,7 @@ *
  • {@link org.eclipse.glsp.graph.impl.GCompartmentImpl#getPosition Position}
  • *
  • {@link org.eclipse.glsp.graph.impl.GCompartmentImpl#getSize Size}
  • *
  • {@link org.eclipse.glsp.graph.impl.GCompartmentImpl#getLayoutOptions Layout Options}
  • + *
  • {@link org.eclipse.glsp.graph.impl.GCompartmentImpl#getResizeLocations Resize Locations}
  • *
  • {@link org.eclipse.glsp.graph.impl.GCompartmentImpl#getLayout Layout}
  • * * @@ -178,6 +180,16 @@ public class GCompartmentImpl extends GArgumentableImpl implements GCompartment */ protected EMap layoutOptions; + /** + * The cached value of the '{@link #getResizeLocations() Resize Locations}' attribute list. + * + * + * @see #getResizeLocations() + * @generated + * @ordered + */ + protected EList resizeLocations; + /** * The default value of the '{@link #getLayout() Layout}' attribute. * @@ -488,6 +500,20 @@ public EMap getLayoutOptions() { return layoutOptions; } + /** + * + * + * @generated + */ + @Override + public EList getResizeLocations() { + if (resizeLocations == null) { + resizeLocations = new EDataTypeUniqueEList(String.class, this, + GraphPackage.GCOMPARTMENT__RESIZE_LOCATIONS); + } + return resizeLocations; + } + /** * * @@ -573,6 +599,8 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) { return getLayoutOptions(); else return getLayoutOptions().map(); + case GraphPackage.GCOMPARTMENT__RESIZE_LOCATIONS: + return getResizeLocations(); case GraphPackage.GCOMPARTMENT__LAYOUT: return getLayout(); } @@ -617,6 +645,10 @@ public void eSet(int featureID, Object newValue) { case GraphPackage.GCOMPARTMENT__LAYOUT_OPTIONS: ((EStructuralFeature.Setting) getLayoutOptions()).set(newValue); return; + case GraphPackage.GCOMPARTMENT__RESIZE_LOCATIONS: + getResizeLocations().clear(); + getResizeLocations().addAll((Collection) newValue); + return; case GraphPackage.GCOMPARTMENT__LAYOUT: setLayout((String) newValue); return; @@ -659,6 +691,9 @@ public void eUnset(int featureID) { case GraphPackage.GCOMPARTMENT__LAYOUT_OPTIONS: getLayoutOptions().clear(); return; + case GraphPackage.GCOMPARTMENT__RESIZE_LOCATIONS: + getResizeLocations().clear(); + return; case GraphPackage.GCOMPARTMENT__LAYOUT: setLayout(LAYOUT_EDEFAULT); return; @@ -692,6 +727,8 @@ public boolean eIsSet(int featureID) { return size != null; case GraphPackage.GCOMPARTMENT__LAYOUT_OPTIONS: return layoutOptions != null && !layoutOptions.isEmpty(); + case GraphPackage.GCOMPARTMENT__RESIZE_LOCATIONS: + return resizeLocations != null && !resizeLocations.isEmpty(); case GraphPackage.GCOMPARTMENT__LAYOUT: return LAYOUT_EDEFAULT == null ? layout != null : !LAYOUT_EDEFAULT.equals(layout); } @@ -723,6 +760,14 @@ public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { return -1; } } + if (baseClass == GResizable.class) { + switch (derivedFeatureID) { + case GraphPackage.GCOMPARTMENT__RESIZE_LOCATIONS: + return GraphPackage.GRESIZABLE__RESIZE_LOCATIONS; + default: + return -1; + } + } if (baseClass == GLayouting.class) { switch (derivedFeatureID) { case GraphPackage.GCOMPARTMENT__LAYOUT: @@ -759,6 +804,14 @@ public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { return -1; } } + if (baseClass == GResizable.class) { + switch (baseFeatureID) { + case GraphPackage.GRESIZABLE__RESIZE_LOCATIONS: + return GraphPackage.GCOMPARTMENT__RESIZE_LOCATIONS; + default: + return -1; + } + } if (baseClass == GLayouting.class) { switch (baseFeatureID) { case GraphPackage.GLAYOUTING__LAYOUT: @@ -789,6 +842,8 @@ public String toString() { result.append(trace); result.append(", type: "); result.append(type); + result.append(", resizeLocations: "); + result.append(resizeLocations); result.append(", layout: "); result.append(layout); result.append(')'); diff --git a/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/impl/GIssueImpl.java b/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/impl/GIssueImpl.java index 8ba56be7..23c49ddd 100644 --- a/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/impl/GIssueImpl.java +++ b/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/impl/GIssueImpl.java @@ -24,7 +24,6 @@ import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; import org.eclipse.glsp.graph.GIssue; -import org.eclipse.glsp.graph.GSeverity; import org.eclipse.glsp.graph.GraphPackage; /** @@ -50,7 +49,7 @@ public class GIssueImpl extends MinimalEObjectImpl.Container implements GIssue { * @generated * @ordered */ - protected static final GSeverity SEVERITY_EDEFAULT = GSeverity.INFO; + protected static final String SEVERITY_EDEFAULT = "info"; /** * The cached value of the '{@link #getSeverity() Severity}' attribute. @@ -60,7 +59,7 @@ public class GIssueImpl extends MinimalEObjectImpl.Container implements GIssue { * @generated * @ordered */ - protected GSeverity severity = SEVERITY_EDEFAULT; + protected String severity = SEVERITY_EDEFAULT; /** * The default value of the '{@link #getMessage() Message}' attribute. @@ -107,7 +106,7 @@ protected EClass eStaticClass() { * @generated */ @Override - public GSeverity getSeverity() { return severity; } + public String getSeverity() { return severity; } /** * @@ -115,9 +114,9 @@ protected EClass eStaticClass() { * @generated */ @Override - public void setSeverity(GSeverity newSeverity) { - GSeverity oldSeverity = severity; - severity = newSeverity == null ? SEVERITY_EDEFAULT : newSeverity; + public void setSeverity(String newSeverity) { + String oldSeverity = severity; + severity = newSeverity; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, GraphPackage.GISSUE__SEVERITY, oldSeverity, severity)); } @@ -168,7 +167,7 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) { public void eSet(int featureID, Object newValue) { switch (featureID) { case GraphPackage.GISSUE__SEVERITY: - setSeverity((GSeverity) newValue); + setSeverity((String) newValue); return; case GraphPackage.GISSUE__MESSAGE: setMessage((String) newValue); @@ -204,7 +203,7 @@ public void eUnset(int featureID) { public boolean eIsSet(int featureID) { switch (featureID) { case GraphPackage.GISSUE__SEVERITY: - return severity != SEVERITY_EDEFAULT; + return SEVERITY_EDEFAULT == null ? severity != null : !SEVERITY_EDEFAULT.equals(severity); case GraphPackage.GISSUE__MESSAGE: return MESSAGE_EDEFAULT == null ? message != null : !MESSAGE_EDEFAULT.equals(message); } diff --git a/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/impl/GIssueMarkerImpl.java b/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/impl/GIssueMarkerImpl.java index 5788107c..ad752565 100644 --- a/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/impl/GIssueMarkerImpl.java +++ b/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/impl/GIssueMarkerImpl.java @@ -44,6 +44,7 @@ import org.eclipse.glsp.graph.GLayoutable; import org.eclipse.glsp.graph.GModelElement; import org.eclipse.glsp.graph.GPoint; +import org.eclipse.glsp.graph.GResizable; import org.eclipse.glsp.graph.GraphPackage; /** @@ -63,6 +64,7 @@ *
  • {@link org.eclipse.glsp.graph.impl.GIssueMarkerImpl#getPosition Position}
  • *
  • {@link org.eclipse.glsp.graph.impl.GIssueMarkerImpl#getSize Size}
  • *
  • {@link org.eclipse.glsp.graph.impl.GIssueMarkerImpl#getLayoutOptions Layout Options}
  • + *
  • {@link org.eclipse.glsp.graph.impl.GIssueMarkerImpl#getResizeLocations Resize Locations}
  • *
  • {@link org.eclipse.glsp.graph.impl.GIssueMarkerImpl#getIssues Issues}
  • * * @@ -179,6 +181,16 @@ public class GIssueMarkerImpl extends GArgumentableImpl implements GIssueMarker */ protected EMap layoutOptions; + /** + * The cached value of the '{@link #getResizeLocations() Resize Locations}' attribute list. + * + * + * @see #getResizeLocations() + * @generated + * @ordered + */ + protected EList resizeLocations; + /** * The cached value of the '{@link #getIssues() Issues}' containment reference list. * @@ -458,6 +470,20 @@ public EMap getLayoutOptions() { return layoutOptions; } + /** + * + * + * @generated + */ + @Override + public EList getResizeLocations() { + if (resizeLocations == null) { + resizeLocations = new EDataTypeUniqueEList(String.class, this, + GraphPackage.GISSUE_MARKER__RESIZE_LOCATIONS); + } + return resizeLocations; + } + /** * * @@ -558,6 +584,8 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) { return getLayoutOptions(); else return getLayoutOptions().map(); + case GraphPackage.GISSUE_MARKER__RESIZE_LOCATIONS: + return getResizeLocations(); case GraphPackage.GISSUE_MARKER__ISSUES: return getIssues(); } @@ -602,6 +630,10 @@ public void eSet(int featureID, Object newValue) { case GraphPackage.GISSUE_MARKER__LAYOUT_OPTIONS: ((EStructuralFeature.Setting) getLayoutOptions()).set(newValue); return; + case GraphPackage.GISSUE_MARKER__RESIZE_LOCATIONS: + getResizeLocations().clear(); + getResizeLocations().addAll((Collection) newValue); + return; case GraphPackage.GISSUE_MARKER__ISSUES: getIssues().clear(); getIssues().addAll((Collection) newValue); @@ -645,6 +677,9 @@ public void eUnset(int featureID) { case GraphPackage.GISSUE_MARKER__LAYOUT_OPTIONS: getLayoutOptions().clear(); return; + case GraphPackage.GISSUE_MARKER__RESIZE_LOCATIONS: + getResizeLocations().clear(); + return; case GraphPackage.GISSUE_MARKER__ISSUES: getIssues().clear(); return; @@ -678,6 +713,8 @@ public boolean eIsSet(int featureID) { return size != null; case GraphPackage.GISSUE_MARKER__LAYOUT_OPTIONS: return layoutOptions != null && !layoutOptions.isEmpty(); + case GraphPackage.GISSUE_MARKER__RESIZE_LOCATIONS: + return resizeLocations != null && !resizeLocations.isEmpty(); case GraphPackage.GISSUE_MARKER__ISSUES: return issues != null && !issues.isEmpty(); } @@ -709,6 +746,14 @@ public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { return -1; } } + if (baseClass == GResizable.class) { + switch (derivedFeatureID) { + case GraphPackage.GISSUE_MARKER__RESIZE_LOCATIONS: + return GraphPackage.GRESIZABLE__RESIZE_LOCATIONS; + default: + return -1; + } + } return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); } @@ -737,6 +782,14 @@ public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { return -1; } } + if (baseClass == GResizable.class) { + switch (baseFeatureID) { + case GraphPackage.GRESIZABLE__RESIZE_LOCATIONS: + return GraphPackage.GISSUE_MARKER__RESIZE_LOCATIONS; + default: + return -1; + } + } return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); } @@ -759,6 +812,8 @@ public String toString() { result.append(trace); result.append(", type: "); result.append(type); + result.append(", resizeLocations: "); + result.append(resizeLocations); result.append(')'); return result.toString(); } diff --git a/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/impl/GLabelImpl.java b/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/impl/GLabelImpl.java index f305eaff..41159923 100644 --- a/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/impl/GLabelImpl.java +++ b/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/impl/GLabelImpl.java @@ -45,6 +45,7 @@ import org.eclipse.glsp.graph.GLayoutable; import org.eclipse.glsp.graph.GModelElement; import org.eclipse.glsp.graph.GPoint; +import org.eclipse.glsp.graph.GResizable; import org.eclipse.glsp.graph.GShapeElement; import org.eclipse.glsp.graph.GraphPackage; @@ -67,6 +68,7 @@ *
  • {@link org.eclipse.glsp.graph.impl.GLabelImpl#getPosition Position}
  • *
  • {@link org.eclipse.glsp.graph.impl.GLabelImpl#getSize Size}
  • *
  • {@link org.eclipse.glsp.graph.impl.GLabelImpl#getLayoutOptions Layout Options}
  • + *
  • {@link org.eclipse.glsp.graph.impl.GLabelImpl#getResizeLocations Resize Locations}
  • *
  • {@link org.eclipse.glsp.graph.impl.GLabelImpl#getText Text}
  • * * @@ -203,6 +205,16 @@ public class GLabelImpl extends GAlignableImpl implements GLabel { */ protected EMap layoutOptions; + /** + * The cached value of the '{@link #getResizeLocations() Resize Locations}' attribute list. + * + * + * @see #getResizeLocations() + * @generated + * @ordered + */ + protected EList resizeLocations; + /** * The default value of the '{@link #getText() Text}' attribute. * @@ -555,6 +567,19 @@ public EMap getLayoutOptions() { return layoutOptions; } + /** + * + * + * @generated + */ + @Override + public EList getResizeLocations() { + if (resizeLocations == null) { + resizeLocations = new EDataTypeUniqueEList(String.class, this, GraphPackage.GLABEL__RESIZE_LOCATIONS); + } + return resizeLocations; + } + /** * * @@ -672,6 +697,8 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) { return getLayoutOptions(); else return getLayoutOptions().map(); + case GraphPackage.GLABEL__RESIZE_LOCATIONS: + return getResizeLocations(); case GraphPackage.GLABEL__TEXT: return getText(); } @@ -722,6 +749,10 @@ public void eSet(int featureID, Object newValue) { case GraphPackage.GLABEL__LAYOUT_OPTIONS: ((EStructuralFeature.Setting) getLayoutOptions()).set(newValue); return; + case GraphPackage.GLABEL__RESIZE_LOCATIONS: + getResizeLocations().clear(); + getResizeLocations().addAll((Collection) newValue); + return; case GraphPackage.GLABEL__TEXT: setText((String) newValue); return; @@ -770,6 +801,9 @@ public void eUnset(int featureID) { case GraphPackage.GLABEL__LAYOUT_OPTIONS: getLayoutOptions().clear(); return; + case GraphPackage.GLABEL__RESIZE_LOCATIONS: + getResizeLocations().clear(); + return; case GraphPackage.GLABEL__TEXT: setText(TEXT_EDEFAULT); return; @@ -807,6 +841,8 @@ public boolean eIsSet(int featureID) { return size != null; case GraphPackage.GLABEL__LAYOUT_OPTIONS: return layoutOptions != null && !layoutOptions.isEmpty(); + case GraphPackage.GLABEL__RESIZE_LOCATIONS: + return resizeLocations != null && !resizeLocations.isEmpty(); case GraphPackage.GLABEL__TEXT: return TEXT_EDEFAULT == null ? text != null : !TEXT_EDEFAULT.equals(text); } @@ -872,6 +908,14 @@ public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { return -1; } } + if (baseClass == GResizable.class) { + switch (derivedFeatureID) { + case GraphPackage.GLABEL__RESIZE_LOCATIONS: + return GraphPackage.GRESIZABLE__RESIZE_LOCATIONS; + default: + return -1; + } + } if (baseClass == GShapeElement.class) { switch (derivedFeatureID) { default: @@ -940,6 +984,14 @@ public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { return -1; } } + if (baseClass == GResizable.class) { + switch (baseFeatureID) { + case GraphPackage.GRESIZABLE__RESIZE_LOCATIONS: + return GraphPackage.GLABEL__RESIZE_LOCATIONS; + default: + return -1; + } + } if (baseClass == GShapeElement.class) { switch (baseFeatureID) { default: @@ -968,6 +1020,8 @@ public String toString() { result.append(trace); result.append(", type: "); result.append(type); + result.append(", resizeLocations: "); + result.append(resizeLocations); result.append(", text: "); result.append(text); result.append(')'); diff --git a/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/impl/GNodeImpl.java b/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/impl/GNodeImpl.java index d7e30730..c6da4e01 100644 --- a/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/impl/GNodeImpl.java +++ b/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/impl/GNodeImpl.java @@ -45,6 +45,7 @@ import org.eclipse.glsp.graph.GModelElement; import org.eclipse.glsp.graph.GNode; import org.eclipse.glsp.graph.GPoint; +import org.eclipse.glsp.graph.GResizable; import org.eclipse.glsp.graph.GraphPackage; /** @@ -64,6 +65,7 @@ *
  • {@link org.eclipse.glsp.graph.impl.GNodeImpl#getPosition Position}
  • *
  • {@link org.eclipse.glsp.graph.impl.GNodeImpl#getSize Size}
  • *
  • {@link org.eclipse.glsp.graph.impl.GNodeImpl#getLayoutOptions Layout Options}
  • + *
  • {@link org.eclipse.glsp.graph.impl.GNodeImpl#getResizeLocations Resize Locations}
  • *
  • {@link org.eclipse.glsp.graph.impl.GNodeImpl#getEdgePlacement Edge Placement}
  • *
  • {@link org.eclipse.glsp.graph.impl.GNodeImpl#getLayout Layout}
  • * @@ -181,6 +183,16 @@ public class GNodeImpl extends GArgumentableImpl implements GNode { */ protected EMap layoutOptions; + /** + * The cached value of the '{@link #getResizeLocations() Resize Locations}' attribute list. + * + * + * @see #getResizeLocations() + * @generated + * @ordered + */ + protected EList resizeLocations; + /** * The cached value of the '{@link #getEdgePlacement() Edge Placement}' containment reference. * @@ -549,6 +561,19 @@ public EMap getLayoutOptions() { return layoutOptions; } + /** + * + * + * @generated + */ + @Override + public EList getResizeLocations() { + if (resizeLocations == null) { + resizeLocations = new EDataTypeUniqueEList(String.class, this, GraphPackage.GNODE__RESIZE_LOCATIONS); + } + return resizeLocations; + } + /** * * @@ -636,6 +661,8 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) { return getLayoutOptions(); else return getLayoutOptions().map(); + case GraphPackage.GNODE__RESIZE_LOCATIONS: + return getResizeLocations(); case GraphPackage.GNODE__EDGE_PLACEMENT: return getEdgePlacement(); case GraphPackage.GNODE__LAYOUT: @@ -682,6 +709,10 @@ public void eSet(int featureID, Object newValue) { case GraphPackage.GNODE__LAYOUT_OPTIONS: ((EStructuralFeature.Setting) getLayoutOptions()).set(newValue); return; + case GraphPackage.GNODE__RESIZE_LOCATIONS: + getResizeLocations().clear(); + getResizeLocations().addAll((Collection) newValue); + return; case GraphPackage.GNODE__EDGE_PLACEMENT: setEdgePlacement((GEdgePlacement) newValue); return; @@ -727,6 +758,9 @@ public void eUnset(int featureID) { case GraphPackage.GNODE__LAYOUT_OPTIONS: getLayoutOptions().clear(); return; + case GraphPackage.GNODE__RESIZE_LOCATIONS: + getResizeLocations().clear(); + return; case GraphPackage.GNODE__EDGE_PLACEMENT: setEdgePlacement((GEdgePlacement) null); return; @@ -763,6 +797,8 @@ public boolean eIsSet(int featureID) { return size != null; case GraphPackage.GNODE__LAYOUT_OPTIONS: return layoutOptions != null && !layoutOptions.isEmpty(); + case GraphPackage.GNODE__RESIZE_LOCATIONS: + return resizeLocations != null && !resizeLocations.isEmpty(); case GraphPackage.GNODE__EDGE_PLACEMENT: return edgePlacement != null; case GraphPackage.GNODE__LAYOUT: @@ -796,6 +832,14 @@ public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { return -1; } } + if (baseClass == GResizable.class) { + switch (derivedFeatureID) { + case GraphPackage.GNODE__RESIZE_LOCATIONS: + return GraphPackage.GRESIZABLE__RESIZE_LOCATIONS; + default: + return -1; + } + } if (baseClass == GEdgeLayoutable.class) { switch (derivedFeatureID) { case GraphPackage.GNODE__EDGE_PLACEMENT: @@ -840,6 +884,14 @@ public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { return -1; } } + if (baseClass == GResizable.class) { + switch (baseFeatureID) { + case GraphPackage.GRESIZABLE__RESIZE_LOCATIONS: + return GraphPackage.GNODE__RESIZE_LOCATIONS; + default: + return -1; + } + } if (baseClass == GEdgeLayoutable.class) { switch (baseFeatureID) { case GraphPackage.GEDGE_LAYOUTABLE__EDGE_PLACEMENT: @@ -878,6 +930,8 @@ public String toString() { result.append(trace); result.append(", type: "); result.append(type); + result.append(", resizeLocations: "); + result.append(resizeLocations); result.append(", layout: "); result.append(layout); result.append(')'); diff --git a/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/impl/GPortImpl.java b/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/impl/GPortImpl.java index 1f1d29c8..a1f7283a 100644 --- a/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/impl/GPortImpl.java +++ b/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/impl/GPortImpl.java @@ -42,6 +42,7 @@ import org.eclipse.glsp.graph.GModelElement; import org.eclipse.glsp.graph.GPoint; import org.eclipse.glsp.graph.GPort; +import org.eclipse.glsp.graph.GResizable; import org.eclipse.glsp.graph.GraphPackage; /** @@ -61,6 +62,7 @@ *
  • {@link org.eclipse.glsp.graph.impl.GPortImpl#getPosition Position}
  • *
  • {@link org.eclipse.glsp.graph.impl.GPortImpl#getSize Size}
  • *
  • {@link org.eclipse.glsp.graph.impl.GPortImpl#getLayoutOptions Layout Options}
  • + *
  • {@link org.eclipse.glsp.graph.impl.GPortImpl#getResizeLocations Resize Locations}
  • * * * @generated @@ -176,6 +178,16 @@ public class GPortImpl extends GArgumentableImpl implements GPort { */ protected EMap layoutOptions; + /** + * The cached value of the '{@link #getResizeLocations() Resize Locations}' attribute list. + * + * + * @see #getResizeLocations() + * @generated + * @ordered + */ + protected EList resizeLocations; + /** * * @@ -443,6 +455,19 @@ public EMap getLayoutOptions() { return layoutOptions; } + /** + * + * + * @generated + */ + @Override + public EList getResizeLocations() { + if (resizeLocations == null) { + resizeLocations = new EDataTypeUniqueEList(String.class, this, GraphPackage.GPORT__RESIZE_LOCATIONS); + } + return resizeLocations; + } + /** * * @@ -528,6 +553,8 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) { return getLayoutOptions(); else return getLayoutOptions().map(); + case GraphPackage.GPORT__RESIZE_LOCATIONS: + return getResizeLocations(); } return super.eGet(featureID, resolve, coreType); } @@ -570,6 +597,10 @@ public void eSet(int featureID, Object newValue) { case GraphPackage.GPORT__LAYOUT_OPTIONS: ((EStructuralFeature.Setting) getLayoutOptions()).set(newValue); return; + case GraphPackage.GPORT__RESIZE_LOCATIONS: + getResizeLocations().clear(); + getResizeLocations().addAll((Collection) newValue); + return; } super.eSet(featureID, newValue); } @@ -609,6 +640,9 @@ public void eUnset(int featureID) { case GraphPackage.GPORT__LAYOUT_OPTIONS: getLayoutOptions().clear(); return; + case GraphPackage.GPORT__RESIZE_LOCATIONS: + getResizeLocations().clear(); + return; } super.eUnset(featureID); } @@ -639,6 +673,8 @@ public boolean eIsSet(int featureID) { return size != null; case GraphPackage.GPORT__LAYOUT_OPTIONS: return layoutOptions != null && !layoutOptions.isEmpty(); + case GraphPackage.GPORT__RESIZE_LOCATIONS: + return resizeLocations != null && !resizeLocations.isEmpty(); } return super.eIsSet(featureID); } @@ -668,6 +704,14 @@ public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { return -1; } } + if (baseClass == GResizable.class) { + switch (derivedFeatureID) { + case GraphPackage.GPORT__RESIZE_LOCATIONS: + return GraphPackage.GRESIZABLE__RESIZE_LOCATIONS; + default: + return -1; + } + } return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); } @@ -696,6 +740,14 @@ public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { return -1; } } + if (baseClass == GResizable.class) { + switch (baseFeatureID) { + case GraphPackage.GRESIZABLE__RESIZE_LOCATIONS: + return GraphPackage.GPORT__RESIZE_LOCATIONS; + default: + return -1; + } + } return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); } @@ -718,6 +770,8 @@ public String toString() { result.append(trace); result.append(", type: "); result.append(type); + result.append(", resizeLocations: "); + result.append(resizeLocations); result.append(')'); return result.toString(); } diff --git a/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/impl/GResizableImpl.java b/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/impl/GResizableImpl.java new file mode 100644 index 00000000..25adedce --- /dev/null +++ b/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/impl/GResizableImpl.java @@ -0,0 +1,166 @@ +/** + * Copyright (c) 2019-2022 EclipseSource and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * https://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + * ******************************************************************************** + */ +package org.eclipse.glsp.graph.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; + +import org.eclipse.emf.ecore.util.EDataTypeUniqueEList; + +import org.eclipse.glsp.graph.GResizable; +import org.eclipse.glsp.graph.GraphPackage; + +/** + * + * An implementation of the model object 'GResizable'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.glsp.graph.impl.GResizableImpl#getResizeLocations Resize Locations}
    • + *
    + * + * @generated + */ +public class GResizableImpl extends MinimalEObjectImpl.Container implements GResizable { + /** + * The cached value of the '{@link #getResizeLocations() Resize Locations}' attribute list. + * + * + * @see #getResizeLocations() + * @generated + * @ordered + */ + protected EList resizeLocations; + + /** + * + * + * @generated + */ + public GResizableImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return GraphPackage.Literals.GRESIZABLE; + } + + /** + * + * + * @generated + */ + @Override + public EList getResizeLocations() { + if (resizeLocations == null) { + resizeLocations = new EDataTypeUniqueEList(String.class, this, + GraphPackage.GRESIZABLE__RESIZE_LOCATIONS); + } + return resizeLocations; + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case GraphPackage.GRESIZABLE__RESIZE_LOCATIONS: + return getResizeLocations(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case GraphPackage.GRESIZABLE__RESIZE_LOCATIONS: + getResizeLocations().clear(); + getResizeLocations().addAll((Collection) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case GraphPackage.GRESIZABLE__RESIZE_LOCATIONS: + getResizeLocations().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case GraphPackage.GRESIZABLE__RESIZE_LOCATIONS: + return resizeLocations != null && !resizeLocations.isEmpty(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (resizeLocations: "); + result.append(resizeLocations); + result.append(')'); + return result.toString(); + } + +} //GResizableImpl diff --git a/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/impl/GraphFactoryImpl.java b/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/impl/GraphFactoryImpl.java index 29f5a668..743b95e5 100644 --- a/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/impl/GraphFactoryImpl.java +++ b/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/impl/GraphFactoryImpl.java @@ -114,6 +114,8 @@ public EObject create(EClass eClass) { return (EObject) createStringToObjectMapEntry(); case GraphPackage.GLAYOUTABLE: return createGLayoutable(); + case GraphPackage.GRESIZABLE: + return createGResizable(); default: throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); } @@ -379,6 +381,17 @@ public GLayoutable createGLayoutable() { return gLayoutable; } + /** + * + * + * @generated + */ + @Override + public GResizable createGResizable() { + GResizableImpl gResizable = new GResizableImpl(); + return gResizable; + } + /** * * diff --git a/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/impl/GraphPackageImpl.java b/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/impl/GraphPackageImpl.java index f0e879c8..969ecd16 100644 --- a/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/impl/GraphPackageImpl.java +++ b/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/impl/GraphPackageImpl.java @@ -49,6 +49,7 @@ import org.eclipse.glsp.graph.GPoint; import org.eclipse.glsp.graph.GPort; import org.eclipse.glsp.graph.GPreRenderedElement; +import org.eclipse.glsp.graph.GResizable; import org.eclipse.glsp.graph.GSeverity; import org.eclipse.glsp.graph.GShapeElement; import org.eclipse.glsp.graph.GShapePreRenderedElement; @@ -244,6 +245,13 @@ public class GraphPackageImpl extends EPackageImpl implements GraphPackage { */ private EClass gLayoutableEClass = null; + /** + * + * + * @generated + */ + private EClass gResizableEClass = null; + /** * * @@ -895,6 +903,24 @@ public EReference getGLayoutable_LayoutOptions() { return (EReference) gLayoutableEClass.getEStructuralFeatures().get(0); } + /** + * + * + * @generated + */ + @Override + public EClass getGResizable() { return gResizableEClass; } + + /** + * + * + * @generated + */ + @Override + public EAttribute getGResizable_ResizeLocations() { + return (EAttribute) gResizableEClass.getEStructuralFeatures().get(0); + } + /** * * @@ -1025,6 +1051,9 @@ public void createPackageContents() { gLayoutableEClass = createEClass(GLAYOUTABLE); createEReference(gLayoutableEClass, GLAYOUTABLE__LAYOUT_OPTIONS); + gResizableEClass = createEClass(GRESIZABLE); + createEAttribute(gResizableEClass, GRESIZABLE__RESIZE_LOCATIONS); + // Create enums gSeverityEEnum = createEEnum(GSEVERITY); } @@ -1062,6 +1091,7 @@ public void initializePackageContents() { gShapeElementEClass.getESuperTypes().add(this.getGModelElement()); gShapeElementEClass.getESuperTypes().add(this.getGBoundsAware()); gShapeElementEClass.getESuperTypes().add(this.getGLayoutable()); + gShapeElementEClass.getESuperTypes().add(this.getGResizable()); gGraphEClass.getESuperTypes().add(this.getGModelRoot()); gGraphEClass.getESuperTypes().add(this.getGBoundsAware()); gGraphEClass.getESuperTypes().add(this.getGLayoutable()); @@ -1223,8 +1253,8 @@ public void initializePackageContents() { !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(gIssueEClass, GIssue.class, "GIssue", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getGIssue_Severity(), this.getGSeverity(), "severity", "info", 1, 1, GIssue.class, !IS_TRANSIENT, - !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getGIssue_Severity(), ecorePackage.getEString(), "severity", "info", 1, 1, GIssue.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getGIssue_Message(), ecorePackage.getEString(), "message", null, 0, 1, GIssue.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); @@ -1256,6 +1286,12 @@ public void initializePackageContents() { -1, GLayoutable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEClass(gResizableEClass, GResizable.class, "GResizable", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getGResizable_ResizeLocations(), ecorePackage.getEString(), "resizeLocations", null, 0, -1, + GResizable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, + IS_ORDERED); + // Initialize enums and add enum literals initEEnum(gSeverityEEnum, GSeverity.class, "GSeverity"); addEEnumLiteral(gSeverityEEnum, GSeverity.ERROR); diff --git a/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/util/GraphAdapterFactory.java b/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/util/GraphAdapterFactory.java index 05775e25..58ab6b86 100644 --- a/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/util/GraphAdapterFactory.java +++ b/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/util/GraphAdapterFactory.java @@ -212,6 +212,11 @@ public Adapter caseGLayoutable(GLayoutable object) { return createGLayoutableAdapter(); } + @Override + public Adapter caseGResizable(GResizable object) { + return createGResizableAdapter(); + } + @Override public Adapter defaultCase(EObject object) { return createEObjectAdapter(); @@ -595,6 +600,20 @@ public Adapter createGLayoutableAdapter() { return null; } + /** + * Creates a new adapter for an object of class '{@link org.eclipse.glsp.graph.GResizable GResizable}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.glsp.graph.GResizable + * @generated + */ + public Adapter createGResizableAdapter() { + return null; + } + /** * Creates a new adapter for the default case. * diff --git a/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/util/GraphSwitch.java b/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/util/GraphSwitch.java index d0b5cbfe..5bc199b6 100644 --- a/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/util/GraphSwitch.java +++ b/plugins/org.eclipse.glsp.graph/src-gen/org/eclipse/glsp/graph/util/GraphSwitch.java @@ -100,6 +100,8 @@ protected T doSwitch(int classifierID, EObject theEObject) { result = caseGBoundsAware(gShapeElement); if (result == null) result = caseGLayoutable(gShapeElement); + if (result == null) + result = caseGResizable(gShapeElement); if (result == null) result = caseGArgumentable(gShapeElement); if (result == null) @@ -149,6 +151,8 @@ protected T doSwitch(int classifierID, EObject theEObject) { result = caseGBoundsAware(gNode); if (result == null) result = caseGLayoutable(gNode); + if (result == null) + result = caseGResizable(gNode); if (result == null) result = caseGArgumentable(gNode); if (result == null) @@ -179,6 +183,8 @@ protected T doSwitch(int classifierID, EObject theEObject) { result = caseGBoundsAware(gCompartment); if (result == null) result = caseGLayoutable(gCompartment); + if (result == null) + result = caseGResizable(gCompartment); if (result == null) result = caseGArgumentable(gCompartment); if (result == null) @@ -200,6 +206,8 @@ protected T doSwitch(int classifierID, EObject theEObject) { result = caseGBoundsAware(gLabel); if (result == null) result = caseGLayoutable(gLabel); + if (result == null) + result = caseGResizable(gLabel); if (result == null) result = caseGArgumentable(gLabel); if (result == null) @@ -217,6 +225,8 @@ protected T doSwitch(int classifierID, EObject theEObject) { result = caseGBoundsAware(gIssueMarker); if (result == null) result = caseGLayoutable(gIssueMarker); + if (result == null) + result = caseGResizable(gIssueMarker); if (result == null) result = caseGArgumentable(gIssueMarker); if (result == null) @@ -234,6 +244,8 @@ protected T doSwitch(int classifierID, EObject theEObject) { result = caseGBoundsAware(gPort); if (result == null) result = caseGLayoutable(gPort); + if (result == null) + result = caseGResizable(gPort); if (result == null) result = caseGArgumentable(gPort); if (result == null) @@ -251,6 +263,8 @@ protected T doSwitch(int classifierID, EObject theEObject) { result = caseGBoundsAware(gButton); if (result == null) result = caseGLayoutable(gButton); + if (result == null) + result = caseGResizable(gButton); if (result == null) result = caseGArgumentable(gButton); if (result == null) @@ -383,6 +397,13 @@ protected T doSwitch(int classifierID, EObject theEObject) { result = defaultCase(theEObject); return result; } + case GraphPackage.GRESIZABLE: { + GResizable gResizable = (GResizable) theEObject; + T result = caseGResizable(gResizable); + if (result == null) + result = defaultCase(theEObject); + return result; + } default: return defaultCase(theEObject); } @@ -778,6 +799,21 @@ public T caseGLayoutable(GLayoutable object) { return null; } + /** + * Returns the result of interpreting the object as an instance of 'GResizable'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'GResizable'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseGResizable(GResizable object) { + return null; + } + /** * Returns the result of interpreting the object as an instance of 'EObject'. * diff --git a/plugins/org.eclipse.glsp.graph/src/org/eclipse/glsp/graph/GResizeLocation.java b/plugins/org.eclipse.glsp.graph/src/org/eclipse/glsp/graph/GResizeLocation.java new file mode 100644 index 00000000..d7005406 --- /dev/null +++ b/plugins/org.eclipse.glsp.graph/src/org/eclipse/glsp/graph/GResizeLocation.java @@ -0,0 +1,39 @@ +/******************************************************************************** + * Copyright (c) 2019-2021 EclipseSource and others. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * https://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the Eclipse + * Public License v. 2.0 are satisfied: GNU General Public License, version 2 + * with the GNU Classpath Exception which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + ********************************************************************************/ +package org.eclipse.glsp.graph; + +import java.util.Arrays; +import java.util.stream.Stream; + +public final class GResizeLocation { + public static final String TOP_LEFT = "top-left"; + public static final String TOP = "top"; + public static final String TOP_RIGHT = "top-right"; + public static final String RIGHT = "right"; + public static final String BOTTOM_RIGHT = "bottom-right"; + public static final String BOTTOM = "bottom"; + public static final String BOTTOM_LEFT = "bottom-left"; + public static final String LEFT = "left"; + + public static final String[] CORNERS = new String[] { TOP_LEFT, TOP_RIGHT, BOTTOM_RIGHT, BOTTOM_LEFT }; + public static final String[] CROSS = new String[] { TOP, RIGHT, BOTTOM, LEFT }; + public static final String[] ALL = Stream.concat(Arrays.stream(CORNERS), Arrays.stream(CROSS)) + .toArray(String[]::new); + + private GResizeLocation() { + // utility class + } +} diff --git a/plugins/org.eclipse.glsp.graph/src/org/eclipse/glsp/graph/builder/GShapeElementBuilder.java b/plugins/org.eclipse.glsp.graph/src/org/eclipse/glsp/graph/builder/GShapeElementBuilder.java index 395771b9..994f09ef 100644 --- a/plugins/org.eclipse.glsp.graph/src/org/eclipse/glsp/graph/builder/GShapeElementBuilder.java +++ b/plugins/org.eclipse.glsp.graph/src/org/eclipse/glsp/graph/builder/GShapeElementBuilder.java @@ -15,6 +15,8 @@ ********************************************************************************/ package org.eclipse.glsp.graph.builder; +import java.util.List; + import org.eclipse.glsp.graph.GDimension; import org.eclipse.glsp.graph.GPoint; import org.eclipse.glsp.graph.GShapeElement; @@ -25,6 +27,7 @@ public abstract class GShapeElementBuilder resizeLocations; public GShapeElementBuilder(String type) { super(type); @@ -48,11 +51,19 @@ public E position(double x, double y) { return position(GraphUtil.point(x, y)); } + public E resizeLocations(String... locations) { + this.resizeLocations = List.of(locations); + return self(); + } + @Override protected void setProperties(T element) { super.setProperties(element); element.setSize(size); element.setPosition(position); + if (this.resizeLocations != null) { + element.getResizeLocations().addAll(this.resizeLocations); + } } } diff --git a/plugins/org.eclipse.glsp.graph/src/org/eclipse/glsp/graph/builder/impl/GIssueBuilder.java b/plugins/org.eclipse.glsp.graph/src/org/eclipse/glsp/graph/builder/impl/GIssueBuilder.java index 30b9a37b..5bf4ec8f 100644 --- a/plugins/org.eclipse.glsp.graph/src/org/eclipse/glsp/graph/builder/impl/GIssueBuilder.java +++ b/plugins/org.eclipse.glsp.graph/src/org/eclipse/glsp/graph/builder/impl/GIssueBuilder.java @@ -21,10 +21,14 @@ import org.eclipse.glsp.graph.builder.GBuilder; public class GIssueBuilder extends GBuilder { - private GSeverity severity; + private String severity; private String message; public GIssueBuilder severity(GSeverity severity) { + return this.severity(severity.getLiteral()); + } + + public GIssueBuilder severity(String severity) { this.severity = severity; return this; }