Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
trademak committed Jun 3, 2011
1 parent 0b9e8f7 commit 2812547
Show file tree
Hide file tree
Showing 470 changed files with 51,025 additions and 0 deletions.
111 changes: 111 additions & 0 deletions activiti-designer-5.6/com.alfresco.designer.gui/.classpath

Large diffs are not rendered by default.

45 changes: 45 additions & 0 deletions activiti-designer-5.6/com.alfresco.designer.gui/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.alfresco.designer.gui</name>
<comment>NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
<linkedResources>
<link>
<name>jdi.jar</name>
<type>1</type>
<location>/Users/tijsrademakers/.m2/repository/.cache/tycho/org.eclipse.jdt.debug-3.6.1.v20100715_r361.jar/jdi.jar</location>
</link>
<link>
<name>jdimodel.jar</name>
<type>1</type>
<location>/Users/tijsrademakers/.m2/repository/.cache/tycho/org.eclipse.jdt.debug-3.6.1.v20100715_r361.jar/jdimodel.jar</location>
</link>
<link>
<name>junit.jar</name>
<type>1</type>
<location>/Users/tijsrademakers/.m2/repository/.cache/tycho/org.junit-4.8.1.v4_8_1_v20100427-1100.jar/junit.jar</location>
</link>
</linkedResources>
</projectDescription>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#Tue May 17 19:01:05 CEST 2011
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Activiti Designer - Alfresco GUI
Bundle-SymbolicName: com.alfresco.designer.gui;singleton:=true
Bundle-Version: 5.6
Bundle-Activator: com.alfresco.designer.gui.Activator
Bundle-Vendor: Alfresco
Require-Bundle: org.eclipse.core.runtime,
org.activiti.designer.model,
org.eclipse.graphiti,
org.activiti.designer.util,
org.eclipse.graphiti.ui,
org.eclipse.jface,
org.eclipse.ui.views.properties.tabbed,
org.eclipse.gef,
org.activiti.designer.eclipse,
org.eclipse.emf.transaction
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Export-Package: com.alfresco.designer.gui.features,
com.alfresco.designer.gui.property
Bundle-ClassPath: .,
jdi.jar,
jdimodel.jar,
junit.jar
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
source.. = src/main/java/
output.. = bin/
bin.includes = META-INF/,\
.
5 changes: 5 additions & 0 deletions activiti-designer-5.6/com.alfresco.designer.gui/plugin.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>

</plugin>
17 changes: 17 additions & 0 deletions activiti-designer-5.6/com.alfresco.designer.gui/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.activiti.designer</groupId>
<artifactId>org.activiti.designer.parent</artifactId>
<version>5.6</version>
<relativePath>../org.activiti.designer.parent/pom.xml</relativePath>
</parent>

<groupId>org.activiti.designer</groupId>
<artifactId>com.alfresco.designer.gui</artifactId>
<version>5.6</version>
<packaging>eclipse-plugin</packaging>
<name>Activiti Designer - Alfresco GUI</name>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.alfresco.designer.gui;

import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;

public class Activator implements BundleActivator {

private static BundleContext context;

static BundleContext getContext() {
return context;
}

/*
* (non-Javadoc)
* @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext bundleContext) throws Exception {
Activator.context = bundleContext;
}

/*
* (non-Javadoc)
* @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
*/
public void stop(BundleContext bundleContext) throws Exception {
Activator.context = null;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.alfresco.designer.gui.features;

import org.eclipse.emf.ecore.EObject;
import org.eclipse.graphiti.features.IFeatureProvider;

public class AddAlfrescoScriptTaskFeature extends AddAlfrescoTaskFeature {

public AddAlfrescoScriptTaskFeature(IFeatureProvider fp) {
super(fp);
}

protected String getIcon(EObject bo) {
return "org.activiti.designer.scripttask";
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
package com.alfresco.designer.gui.features;

import org.activiti.designer.util.eclipse.ActivitiUiUtil;
import org.activiti.designer.util.style.StyleUtil;
import org.eclipse.bpmn2.EndEvent;
import org.eclipse.bpmn2.Event;
import org.eclipse.bpmn2.SubProcess;
import org.eclipse.graphiti.features.IFeatureProvider;
import org.eclipse.graphiti.features.context.IAddContext;
import org.eclipse.graphiti.features.impl.AbstractAddShapeFeature;
import org.eclipse.graphiti.mm.algorithms.Ellipse;
import org.eclipse.graphiti.mm.algorithms.Image;
import org.eclipse.graphiti.mm.pictograms.BoxRelativeAnchor;
import org.eclipse.graphiti.mm.pictograms.ContainerShape;
import org.eclipse.graphiti.mm.pictograms.Diagram;
import org.eclipse.graphiti.mm.pictograms.PictogramElement;
import org.eclipse.graphiti.mm.pictograms.Shape;
import org.eclipse.graphiti.services.Graphiti;
import org.eclipse.graphiti.services.IGaService;
import org.eclipse.graphiti.services.IPeCreateService;

public class AddAlfrescoStartEventFeature extends AbstractAddShapeFeature {

private static final int IMAGE_SIZE = 16;

public AddAlfrescoStartEventFeature(IFeatureProvider fp) {
super(fp);
}

@Override
public PictogramElement add(IAddContext context) {
final Event addedEvent = (Event) context.getNewObject();
final ContainerShape parent = context.getTargetContainer();

// CONTAINER SHAPE WITH CIRCLE
final IPeCreateService peCreateService = Graphiti.getPeCreateService();
final ContainerShape containerShape = peCreateService.createContainerShape(parent, true);

// check whether the context has a size (e.g. from a create feature)
// otherwise define a default size for the shape
final int width = context.getWidth() <= 0 ? 35 : context.getWidth();
final int height = context.getHeight() <= 0 ? 35 : context.getHeight();

final IGaService gaService = Graphiti.getGaService();

Ellipse circle;
{
final Ellipse invisibleCircle = gaService.createEllipse(containerShape);
invisibleCircle.setFilled(false);
invisibleCircle.setLineVisible(false);
gaService.setLocationAndSize(invisibleCircle, context.getX(), context.getY(), width, height);

// create and set visible circle inside invisible circle
circle = gaService.createEllipse(invisibleCircle);
circle.setParentGraphicsAlgorithm(invisibleCircle);
circle.setStyle(StyleUtil.getStyleForEvent(getDiagram()));
if (addedEvent instanceof EndEvent == true) {
circle.setLineWidth(3);
}
gaService.setLocationAndSize(circle, 0, 0, width, height);

// if addedClass has no resource we add it to the resource of the
// diagram
// in a real scenario the business model would have its own resource
if (addedEvent.eResource() == null) {
Object parentObject = getBusinessObjectForPictogramElement(parent);
if (parentObject instanceof SubProcess) {
((SubProcess) parentObject).getFlowElements().add(addedEvent);
} else {
getDiagram().eResource().getContents().add(addedEvent);
}
}

// create link and wire it
link(containerShape, addedEvent);
}

{
final Shape shape = peCreateService.createShape(containerShape, false);
final Image image = gaService.createImage(shape, "org.activiti.designer.alfresco.logo");

gaService.setLocationAndSize(image, 10, 10, IMAGE_SIZE, IMAGE_SIZE);
}

// add a chopbox anchor to the shape
peCreateService.createChopboxAnchor(containerShape);

// create an additional box relative anchor at middle-right
final BoxRelativeAnchor boxAnchor = peCreateService.createBoxRelativeAnchor(containerShape);
boxAnchor.setRelativeWidth(1.0);
boxAnchor.setRelativeHeight(0.51);
boxAnchor.setReferencedGraphicsAlgorithm(circle);
final Ellipse ellipse = ActivitiUiUtil.createInvisibleEllipse(boxAnchor, gaService);
gaService.setLocationAndSize(ellipse, 0, 0, 0, 0);

layoutPictogramElement(containerShape);

return containerShape;
}

@Override
public boolean canAdd(IAddContext context) {
if (context.getNewObject() instanceof Event) {

Object parentObject = getBusinessObjectForPictogramElement(context.getTargetContainer());

if (context.getTargetContainer() instanceof Diagram || parentObject instanceof SubProcess) {
return true;
}
}
return false;
}

}
Loading

0 comments on commit 2812547

Please sign in to comment.