forked from AlfrescoArchive/Activiti-Designer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
trademak
committed
Jun 3, 2011
1 parent
0b9e8f7
commit 2812547
Showing
470 changed files
with
51,025 additions
and
0 deletions.
There are no files selected for viewing
111 changes: 111 additions & 0 deletions
111
activiti-designer-5.6/com.alfresco.designer.gui/.classpath
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
8 changes: 8 additions & 0 deletions
8
activiti-designer-5.6/com.alfresco.designer.gui/.settings/org.eclipse.jdt.core.prefs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
25 changes: 25 additions & 0 deletions
25
activiti-designer-5.6/com.alfresco.designer.gui/META-INF/MANIFEST.MF
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
4 changes: 4 additions & 0 deletions
4
activiti-designer-5.6/com.alfresco.designer.gui/build.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
source.. = src/main/java/ | ||
output.. = bin/ | ||
bin.includes = META-INF/,\ | ||
. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
30 changes: 30 additions & 0 deletions
30
...gner-5.6/com.alfresco.designer.gui/src/main/java/com/alfresco/designer/gui/Activator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
|
||
} |
15 changes: 15 additions & 0 deletions
15
...er.gui/src/main/java/com/alfresco/designer/gui/features/AddAlfrescoScriptTaskFeature.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"; | ||
} | ||
} |
114 changes: 114 additions & 0 deletions
114
...er.gui/src/main/java/com/alfresco/designer/gui/features/AddAlfrescoStartEventFeature.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
|
||
} |
Oops, something went wrong.