Skip to content

Commit

Permalink
[releng] Update Sirius
Browse files Browse the repository at this point in the history
It also updates to GMF 1.16.1 and GEF 3.17

Signed-off-by: Laurent Fasani <laurent.fasani@obeo.fr>
Signed-off-by: Philippe DUL <philippe.dul@thalesgroup.com>
  • Loading branch information
lfasani authored and pdulth committed Oct 2, 2023
1 parent b9d7631 commit 5b4810d
Show file tree
Hide file tree
Showing 3 changed files with 433 additions and 429 deletions.
@@ -1,77 +1,81 @@
/*******************************************************************************
* Copyright (c) 2016, 2020 THALES GLOBAL SERVICES.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Thales - initial API and implementation
*******************************************************************************/
package org.polarsys.capella.core.sirius.analysis.editpart;

import org.eclipse.draw2d.geometry.Point;
import org.eclipse.gef.Request;
import org.eclipse.gef.commands.Command;
import org.eclipse.gef.commands.CompoundCommand;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.sirius.diagram.DNodeContainer;
import org.eclipse.sirius.diagram.ui.business.api.view.SiriusLayoutDataManager;
import org.eclipse.sirius.diagram.ui.business.internal.view.AbstractLayoutData;
import org.eclipse.sirius.diagram.ui.business.internal.view.RootLayoutData;
import org.eclipse.sirius.diagram.ui.internal.edit.parts.DNodeContainerViewNodeContainerCompartment2EditPart;
import org.eclipse.sirius.ext.base.Option;
import org.polarsys.capella.core.data.capellacommon.Region;

public class StackCompartment2EditPart extends DNodeContainerViewNodeContainerCompartment2EditPart {

public StackCompartment2EditPart(View view) {
super(view);
}

protected class ModeFromRegionLayoutData extends Command {

@Override
public void execute() {
super.execute();

try {
// When we create a port inside a region, the location is stored according to the region.
// We also add a layout according to the owning Mode
Option<AbstractLayoutData> result = SiriusLayoutDataManager.INSTANCE.getData();
if (result.some() && result.get() instanceof RootLayoutData) {
RootLayoutData data = (RootLayoutData) result.get();
if (data.getTarget() instanceof DNodeContainer
&& ((DNodeContainer) data.getTarget()).getTarget() instanceof Region) {
Point parentOrigin = StackCompartment2EditPart.this.getFigure().getBounds().getTopLeft().getCopy();
RootLayoutData rData = new RootLayoutData(StackCompartment2EditPart.this.getParent().getParent(),
new Point(data.getLocation().x + parentOrigin.x, data.getLocation().y + parentOrigin.y),
data.getSize());
SiriusLayoutDataManager.INSTANCE.addData(rData);
}
}
} catch (Exception e) {
// We can't add a layout for the region, entry point will be created on top-left
}

}
}

public Command getCommand(Request request) {
if (REQ_CREATE.equals(request.getType())) {
Command command = super.getCommand(request);
if (command instanceof CompoundCommand) {
CompoundCommand ccommand = ((CompoundCommand) command);
if (ccommand.size() > 0) {
// We add a command after the Create Command
ccommand.getCommands().add(ccommand.size() - 1, new ModeFromRegionLayoutData());
}
}
return command;
}
return super.getCommand(request);
}

}
/*******************************************************************************
* Copyright (c) 2016, 2020 THALES GLOBAL SERVICES.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Thales - initial API and implementation
*******************************************************************************/
package org.polarsys.capella.core.sirius.analysis.editpart;

import java.util.List;

import org.eclipse.draw2d.geometry.Point;
import org.eclipse.gef.Request;
import org.eclipse.gef.commands.Command;
import org.eclipse.gef.commands.CompoundCommand;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.sirius.diagram.DNodeContainer;
import org.eclipse.sirius.diagram.ui.business.api.view.SiriusLayoutDataManager;
import org.eclipse.sirius.diagram.ui.business.internal.view.AbstractLayoutData;
import org.eclipse.sirius.diagram.ui.business.internal.view.RootLayoutData;
import org.eclipse.sirius.diagram.ui.internal.edit.parts.DNodeContainerViewNodeContainerCompartment2EditPart;
import org.eclipse.sirius.ext.base.Option;
import org.polarsys.capella.core.data.capellacommon.Region;

public class StackCompartment2EditPart extends DNodeContainerViewNodeContainerCompartment2EditPart {

public StackCompartment2EditPart(View view) {
super(view);
}

protected class ModeFromRegionLayoutData extends Command {

@Override
public void execute() {
super.execute();

try {
// When we create a port inside a region, the location is stored according to the region.
// We also add a layout according to the owning Mode
Option<AbstractLayoutData> result = SiriusLayoutDataManager.INSTANCE.getData();
if (result.some() && result.get() instanceof RootLayoutData) {
RootLayoutData data = (RootLayoutData) result.get();
if (data.getTarget() instanceof DNodeContainer
&& ((DNodeContainer) data.getTarget()).getTarget() instanceof Region) {
Point parentOrigin = StackCompartment2EditPart.this.getFigure().getBounds().getTopLeft().getCopy();
RootLayoutData rData = new RootLayoutData(StackCompartment2EditPart.this.getParent().getParent(),
new Point(data.getLocation().x + parentOrigin.x, data.getLocation().y + parentOrigin.y),
data.getSize());
SiriusLayoutDataManager.INSTANCE.addData(rData);
}
}
} catch (Exception e) {
// We can't add a layout for the region, entry point will be created on top-left
}

}
}

@Override
public Command getCommand(Request request) {
if (REQ_CREATE.equals(request.getType())) {
Command command = super.getCommand(request);
if (command instanceof CompoundCommand) {
CompoundCommand ccommand = ((CompoundCommand) command);
if (ccommand.size() > 0) {
// We add a command after the Create Command
List commands = ccommand.getCommands();
commands.add(ccommand.size() - 1, new ModeFromRegionLayoutData());
}
}
return command;
}
return super.getCommand(request);
}

}
Expand Up @@ -21,12 +21,12 @@ location GMF-Notation-1.13.1 "https://download.eclipse.org/modeling/gmp/gmf-nota
org.eclipse.gmf.runtime.notation.sdk.feature.group lazy
}

location GMF-Runtime-1.16 "https://download.eclipse.org/modeling/gmp/gmf-runtime/updates/releases/R202305230839/" {
location GMF-Runtime-1.16 "https://download.eclipse.org/modeling/gmp/gmf-runtime/updates/releases/R202309010720/" {
org.eclipse.gmf.runtime.sdk.feature.group lazy
org.eclipse.gmf.runtime.thirdparty.feature.group lazy
}

location GEF-Classic "https://download.eclipse.org/tools/gef/classic/releases/3.16.0" {
location GEF-Classic "https://download.eclipse.org/tools/gef/classic/releases/3.17.0" {
org.eclipse.gef.feature.group lazy
org.eclipse.gef.source.feature.group
org.eclipse.gef.sdk.feature.group lazy
Expand Down Expand Up @@ -66,7 +66,7 @@ location "https://download.eclipse.org/tools/orbit/downloads/2023-03/" {
ch.qos.logback.slf4j
}

location sirius "https://download.eclipse.org/sirius/updates/releases/7.2.0/2023-03" {
location sirius "https://download.eclipse.org/sirius/updates/stable/7.3.0-S20230929-065140/2023-03" {
org.eclipse.sirius.doc.feature.feature.group
org.eclipse.sirius.doc.feature.source.feature.group
org.eclipse.sirius.runtime.source.feature.group
Expand Down

0 comments on commit 5b4810d

Please sign in to comment.