JBoss Tools SVN: r13389 - in trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4: editor and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2009-01-29 15:59:24 -0500 (Thu, 29 Jan 2009)
New Revision: 13389
Added:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlEditor.java
Log:
make extending possible on the level of the editpart/editpartfactory
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlEditor.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlEditor.java 2009-01-29 20:57:45 UTC (rev 13388)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlEditor.java 2009-01-29 20:59:24 UTC (rev 13389)
@@ -4,13 +4,11 @@
import java.io.InputStream;
import java.io.OutputStream;
-import org.eclipse.gef.EditPartFactory;
import org.eclipse.gef.commands.CommandStack;
import org.eclipse.gef.palette.PaletteRoot;
import org.eclipse.ui.views.properties.IPropertySheetPage;
import org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor;
import org.jboss.tools.flow.common.editor.GenericModelEditor;
-import org.jboss.tools.flow.common.editpart.DefaultEditPartFactory;
import org.jboss.tools.flow.common.registry.ElementRegistry;
import org.jboss.tools.flow.common.wrapper.Wrapper;
import org.jboss.tools.flow.jpdl4.properties.JpdlPropertySheetPage;
@@ -19,13 +17,11 @@
public static String ID = "org.jboss.tools.flow.jpdl4.editor";
- protected EditPartFactory createEditPartFactory() {
- return new DefaultEditPartFactory();
- }
-
protected PaletteRoot createPalette() {
return new JpdlPaletteFactory().createPalette();
}
+
+
protected Object createModel() {
return ElementRegistry.createWrapper("org.jboss.tools.flow.jpdl4.process");
15 years, 11 months
JBoss Tools SVN: r13388 - in trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common: editpart and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2009-01-29 15:57:45 -0500 (Thu, 29 Jan 2009)
New Revision: 13388
Added:
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/EditPartFactory.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/NodeEditPart.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/IFigureFactory.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/NodeFigureFactory.java
Removed:
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/DefaultEditPartFactory.java
Modified:
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editor/GenericModelEditor.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/ElementRegistry.java
Log:
make extending possible on the level of the editpart/editpartfactory
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editor/GenericModelEditor.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editor/GenericModelEditor.java 2009-01-29 19:32:48 UTC (rev 13387)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editor/GenericModelEditor.java 2009-01-29 20:57:45 UTC (rev 13388)
@@ -36,7 +36,6 @@
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.gef.ContextMenuProvider;
import org.eclipse.gef.DefaultEditDomain;
-import org.eclipse.gef.EditPartFactory;
import org.eclipse.gef.KeyHandler;
import org.eclipse.gef.KeyStroke;
import org.eclipse.gef.LayerConstants;
@@ -73,7 +72,7 @@
import org.jboss.tools.flow.common.Activator;
import org.jboss.tools.flow.common.action.HorizontalAutoLayoutAction;
import org.jboss.tools.flow.common.action.VerticalAutoLayoutAction;
-import org.jboss.tools.flow.common.editpart.DefaultEditPartFactory;
+import org.jboss.tools.flow.common.editpart.EditPartFactory;
import org.jboss.tools.flow.common.registry.LanguageRegistry;
/**
@@ -204,8 +203,8 @@
getGraphicalViewer());
}
- protected EditPartFactory createEditPartFactory() {
- return new DefaultEditPartFactory();
+ protected org.eclipse.gef.EditPartFactory createEditPartFactory() {
+ return new EditPartFactory();
}
protected void initializeGraphicalViewer() {
Deleted: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/DefaultEditPartFactory.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/DefaultEditPartFactory.java 2009-01-29 19:32:48 UTC (rev 13387)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/DefaultEditPartFactory.java 2009-01-29 20:57:45 UTC (rev 13388)
@@ -1,27 +0,0 @@
-package org.jboss.tools.flow.common.editpart;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartFactory;
-import org.jboss.tools.flow.common.model.Element;
-import org.jboss.tools.flow.common.registry.ElementRegistry;
-import org.jboss.tools.flow.common.wrapper.ConnectionWrapper;
-import org.jboss.tools.flow.common.wrapper.Wrapper;
-
-public class DefaultEditPartFactory implements EditPartFactory {
-
- public EditPart createEditPart(EditPart context, Object model) {
- EditPart result = null;
- if (!(model instanceof Wrapper)) return result;
- Object element = ((Wrapper)model).getElement();
- if (element != null && element instanceof Element) {
- result = ElementRegistry.createEditPart((Element)element);
- } else if (model instanceof ConnectionWrapper) {
- result = new ConnectionEditPart();
- }
- if (result != null) {
- result.setModel(model);
- }
- return result;
- }
-
-}
Copied: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/EditPartFactory.java (from rev 12582, trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/DefaultEditPartFactory.java)
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/EditPartFactory.java (rev 0)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/EditPartFactory.java 2009-01-29 20:57:45 UTC (rev 13388)
@@ -0,0 +1,70 @@
+package org.jboss.tools.flow.common.editpart;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.gef.EditPart;
+import org.jboss.tools.flow.common.figure.IFigureFactory;
+import org.jboss.tools.flow.common.figure.NodeFigureFactory;
+import org.jboss.tools.flow.common.model.Element;
+import org.jboss.tools.flow.common.wrapper.ConnectionWrapper;
+import org.jboss.tools.flow.common.wrapper.Wrapper;
+
+public class EditPartFactory implements org.eclipse.gef.EditPartFactory {
+
+ public EditPart createEditPart(EditPart context, Object model) {
+ EditPart result = null;
+ if (!(model instanceof Wrapper)) return result;
+ Object element = ((Wrapper)model).getElement();
+ if (element != null && element instanceof Element) {
+ result = createEditPart((Element)element);
+ } else if (model instanceof ConnectionWrapper) {
+ result = new ConnectionEditPart();
+ }
+ if (result != null) {
+ result.setModel(model);
+ }
+ return result;
+ }
+
+ protected EditPart createEditPart(Element element) {
+ IConfigurationElement configurationElement =
+ (IConfigurationElement)element.getMetaData("configurationElement");
+ if (configurationElement == null) return null;
+ IConfigurationElement[] children = configurationElement.getChildren();
+ if (children.length != 1) return null;
+ String type = children[0].getName();
+ if ("flow".equals(type)) {
+ return createFlowEditPart(element);
+ } else if ("container".equals(type)) {
+ return createContainerEditPart(element);
+ } else if ("node".equals(type)) {
+ return createNodeEditPart(element);
+ } else if ("connection".equals(type)) {
+ return createConnectionEditPart(element);
+ } else {
+ return null;
+ }
+ }
+
+ public EditPart createFlowEditPart(Element element) {
+ return new RootEditPart();
+ }
+
+ public EditPart createContainerEditPart(Element element) {
+ return new ContainerEditPart();
+ }
+
+ public EditPart createNodeEditPart(Element element) {
+ IConfigurationElement configurationElement =
+ (IConfigurationElement)element.getMetaData("configurationElement");
+ if (configurationElement == null) return null;
+ NodeEditPart result = new NodeEditPart();
+ IFigureFactory figureFactory = new NodeFigureFactory(configurationElement);
+ result.setFigureFactory(figureFactory);
+ return result;
+ }
+
+ public EditPart createConnectionEditPart(Element element) {
+ return new ConnectionEditPart();
+ }
+
+}
Property changes on: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/EditPartFactory.java
___________________________________________________________________
Name: svn:mergeinfo
+
Added: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/NodeEditPart.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/NodeEditPart.java (rev 0)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/NodeEditPart.java 2009-01-29 20:57:45 UTC (rev 13388)
@@ -0,0 +1,21 @@
+package org.jboss.tools.flow.common.editpart;
+
+import org.eclipse.draw2d.IFigure;
+import org.jboss.tools.flow.common.figure.IFigureFactory;
+
+public class NodeEditPart extends ElementEditPart {
+
+ private IFigureFactory figureFactory;
+
+ protected IFigure createFigure() {
+ if (figureFactory != null) {
+ return figureFactory.createFigure();
+ }
+ return null;
+ }
+
+ public void setFigureFactory(IFigureFactory figureFactory) {
+ this.figureFactory = figureFactory;
+ }
+
+}
Added: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/IFigureFactory.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/IFigureFactory.java (rev 0)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/IFigureFactory.java 2009-01-29 20:57:45 UTC (rev 13388)
@@ -0,0 +1,9 @@
+package org.jboss.tools.flow.common.figure;
+
+import org.eclipse.draw2d.IFigure;
+
+public interface IFigureFactory {
+
+ IFigure createFigure();
+
+}
Added: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/NodeFigureFactory.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/NodeFigureFactory.java (rev 0)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/NodeFigureFactory.java 2009-01-29 20:57:45 UTC (rev 13388)
@@ -0,0 +1,117 @@
+package org.jboss.tools.flow.common.figure;
+
+import java.net.URL;
+import java.util.HashMap;
+import java.util.StringTokenizer;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Display;
+
+public class NodeFigureFactory implements IFigureFactory {
+
+ private static final HashMap<String, Image> imageMap = new HashMap<String, Image>();
+ private static final HashMap<String, Color> colorMap = new HashMap<String, Color>();
+
+ private IConfigurationElement configurationElement;
+
+ public NodeFigureFactory(IConfigurationElement configurationElement) {
+ this.configurationElement = configurationElement;
+ }
+
+ public IFigure createFigure() {
+ ElementFigure result = null;
+ IConfigurationElement figureElement = null;
+ IConfigurationElement[] children = configurationElement.getChildren("node");
+ if (children.length == 1) {
+ children = children[0].getChildren("figure");
+ if (children.length == 1) {
+ figureElement = children[0];
+ }
+ }
+ if (figureElement == null) {
+ return new RectangleElementFigure();
+ }
+ if (figureElement.getAttribute("class") != null) {
+ try {
+ return (IFigure)figureElement.createExecutableExtension("class");
+ }
+ catch (CoreException e) {
+ return null;
+ }
+ }
+ children = figureElement.getChildren();
+ if (children.length < 1) {
+ result = new RectangleElementFigure();
+ } else if ("ellipse".equals(children[0].getName())){
+ result = new EllipseElementFigure();
+ } else if ("rounded-rectangle".equals(children[0].getName())) {
+ result = new RoundedRectangleElementFigure();
+ } else {
+ result = new RectangleElementFigure();
+ }
+ if (figureElement.getAttribute("icon") != null) {
+ String iconPath = figureElement.getAttribute("icon");
+ URL url = Platform.getBundle(figureElement.getContributor().getName()).getEntry(iconPath);
+ Image icon = null;
+ if (imageMap.containsKey(url.getPath())) {
+ icon = imageMap.get(url.getPath());
+ } else {
+ icon = ImageDescriptor.createFromURL(url).createImage();
+ imageMap.put(url.getPath(), icon);
+ }
+ result.setIcon(icon);
+ } else if (configurationElement.getAttribute("figure") != null) {
+ String iconPath = configurationElement.getAttribute("figure");
+ URL url = Platform.getBundle(configurationElement.getContributor().getName()).getEntry(iconPath);
+ Image icon = null;
+ if (imageMap.containsKey(url.getPath())) {
+ icon = imageMap.get(url.getPath());
+ } else {
+ icon = ImageDescriptor.createFromURL(url).createImage();
+ imageMap.put(url.getPath(), icon);
+ }
+ result.setIcon(icon);
+ }
+ if (figureElement.getAttribute("color") != null) {
+ String colorString = figureElement.getAttribute("color");
+ Color color = null;
+ if (colorMap.containsKey(colorString)) {
+ color = colorMap.get(colorString);
+ } else {
+ try {
+ StringTokenizer tokenizer = new StringTokenizer(colorString, ",");
+ int[] rgb = new int[3];
+ int i = 0;
+ while (tokenizer.hasMoreTokens()) {
+ rgb[i++] = Integer.parseInt(tokenizer.nextToken());
+ }
+ color = new Color(Display.getCurrent(), rgb[0], rgb[1], rgb[2]);
+ colorMap.put(colorString, color);
+ } catch (NumberFormatException e) {}
+ }
+ result.setColor(color);
+ }
+ Dimension size = new Dimension(result.getSize());
+ if (figureElement.getAttribute("width") != null) {
+ try {
+ size.width = Integer.parseInt(figureElement.getAttribute("width"));
+ } catch (NumberFormatException e) {}
+ }
+ if (figureElement.getAttribute("height") != null) {
+ try {
+ size.height = Integer.parseInt(figureElement.getAttribute("height"));
+ } catch (NumberFormatException e) {}
+ }
+ result.setSize(size);
+ return result;
+ }
+
+
+}
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/ElementRegistry.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/ElementRegistry.java 2009-01-29 19:32:48 UTC (rev 13387)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/ElementRegistry.java 2009-01-29 20:57:45 UTC (rev 13388)
@@ -1,29 +1,12 @@
package org.jboss.tools.flow.common.registry;
-import java.net.URL;
import java.util.HashMap;
-import java.util.StringTokenizer;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.Platform;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.gef.EditPart;
import org.eclipse.gef.requests.CreationFactory;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
import org.jboss.tools.flow.common.Logger;
-import org.jboss.tools.flow.common.editpart.ConnectionEditPart;
-import org.jboss.tools.flow.common.editpart.ContainerEditPart;
-import org.jboss.tools.flow.common.editpart.ElementEditPart;
-import org.jboss.tools.flow.common.editpart.RootEditPart;
-import org.jboss.tools.flow.common.figure.ElementFigure;
-import org.jboss.tools.flow.common.figure.EllipseElementFigure;
-import org.jboss.tools.flow.common.figure.RectangleElementFigure;
-import org.jboss.tools.flow.common.figure.RoundedRectangleElementFigure;
import org.jboss.tools.flow.common.model.Connection;
import org.jboss.tools.flow.common.model.Container;
import org.jboss.tools.flow.common.model.Element;
@@ -40,8 +23,6 @@
public class ElementRegistry {
- private static final HashMap<String, Image> imageMap = new HashMap<String, Image>();
- private static final HashMap<String, Color> colorMap = new HashMap<String, Color>();
private static final String elementsExtensionPointId = "org.jboss.tools.flow.common.elements";
private static HashMap<String, IConfigurationElement> elementMap = null;
@@ -196,123 +177,103 @@
return result;
}
- public static EditPart createEditPart(Element element) {
- IConfigurationElement configurationElement =
- (IConfigurationElement)element.getMetaData("configurationElement");
- if (configurationElement == null) return null;
- IConfigurationElement[] children = configurationElement.getChildren();
- if (children.length != 1) return null;
- String type = children[0].getName();
- if ("flow".equals(type)) {
- return new RootEditPart();
- } else if ("container".equals(type)) {
- return new ContainerEditPart();
- } else if ("node".equals(type)) {
- return createNodeEditPart(configurationElement);
- } else if ("connection".equals(type)) {
- return createConnectionEditPart(configurationElement);
- } else {
- return null;
- }
- }
+// private static EditPart createConnectionEditPart(final IConfigurationElement configurationElement) {
+// return new ConnectionEditPart() {
+// };
+// }
+//
+// private static EditPart createNodeEditPart(final IConfigurationElement configurationElement) {
+// return new ElementEditPart() {
+// protected IFigure createFigure() {
+// ElementFigure result = null;
+// IConfigurationElement figureElement = null;
+// IConfigurationElement[] children = configurationElement.getChildren("node");
+// if (children.length == 1) {
+// children = children[0].getChildren("figure");
+// if (children.length == 1) {
+// figureElement = children[0];
+// }
+// }
+// if (figureElement == null) {
+// return new RectangleElementFigure();
+// }
+// if (figureElement.getAttribute("class") != null) {
+// try {
+// return (IFigure)figureElement.createExecutableExtension("class");
+// }
+// catch (CoreException e) {
+// return null;
+// }
+// }
+// children = figureElement.getChildren();
+// if (children.length < 1) {
+// result = new RectangleElementFigure();
+// } else if ("ellipse".equals(children[0].getName())){
+// result = new EllipseElementFigure();
+// } else if ("rounded-rectangle".equals(children[0].getName())) {
+// result = new RoundedRectangleElementFigure();
+// } else {
+// result = new RectangleElementFigure();
+// }
+// if (figureElement.getAttribute("icon") != null) {
+// String iconPath = figureElement.getAttribute("icon");
+// URL url = Platform.getBundle(figureElement.getContributor().getName()).getEntry(iconPath);
+// Image icon = null;
+// if (imageMap.containsKey(url.getPath())) {
+// icon = imageMap.get(url.getPath());
+// } else {
+// icon = ImageDescriptor.createFromURL(url).createImage();
+// imageMap.put(url.getPath(), icon);
+// }
+// result.setIcon(icon);
+// } else if (configurationElement.getAttribute("figure") != null) {
+// String iconPath = configurationElement.getAttribute("figure");
+// URL url = Platform.getBundle(configurationElement.getContributor().getName()).getEntry(iconPath);
+// Image icon = null;
+// if (imageMap.containsKey(url.getPath())) {
+// icon = imageMap.get(url.getPath());
+// } else {
+// icon = ImageDescriptor.createFromURL(url).createImage();
+// imageMap.put(url.getPath(), icon);
+// }
+// result.setIcon(icon);
+// }
+// if (figureElement.getAttribute("color") != null) {
+// String colorString = figureElement.getAttribute("color");
+// Color color = null;
+// if (colorMap.containsKey(colorString)) {
+// color = colorMap.get(colorString);
+// } else {
+// try {
+// StringTokenizer tokenizer = new StringTokenizer(colorString, ",");
+// int[] rgb = new int[3];
+// int i = 0;
+// while (tokenizer.hasMoreTokens()) {
+// rgb[i++] = Integer.parseInt(tokenizer.nextToken());
+// }
+// color = new Color(Display.getCurrent(), rgb[0], rgb[1], rgb[2]);
+// colorMap.put(colorString, color);
+// } catch (NumberFormatException e) {}
+// }
+// result.setColor(color);
+// }
+// Dimension size = new Dimension(result.getSize());
+// if (figureElement.getAttribute("width") != null) {
+// try {
+// size.width = Integer.parseInt(figureElement.getAttribute("width"));
+// } catch (NumberFormatException e) {}
+// }
+// if (figureElement.getAttribute("height") != null) {
+// try {
+// size.height = Integer.parseInt(figureElement.getAttribute("height"));
+// } catch (NumberFormatException e) {}
+// }
+// result.setSize(size);
+// return result;
+// }
+// };
+// }
- private static EditPart createConnectionEditPart(final IConfigurationElement configurationElement) {
- return new ConnectionEditPart() {
- };
- }
-
- private static EditPart createNodeEditPart(final IConfigurationElement configurationElement) {
- return new ElementEditPart() {
- protected IFigure createFigure() {
- ElementFigure result = null;
- IConfigurationElement figureElement = null;
- IConfigurationElement[] children = configurationElement.getChildren("node");
- if (children.length == 1) {
- children = children[0].getChildren("figure");
- if (children.length == 1) {
- figureElement = children[0];
- }
- }
- if (figureElement == null) {
- return new RectangleElementFigure();
- }
- if (figureElement.getAttribute("class") != null) {
- try {
- return (IFigure)figureElement.createExecutableExtension("class");
- }
- catch (CoreException e) {
- return null;
- }
- }
- children = figureElement.getChildren();
- if (children.length < 1) {
- result = new RectangleElementFigure();
- } else if ("ellipse".equals(children[0].getName())){
- result = new EllipseElementFigure();
- } else if ("rounded-rectangle".equals(children[0].getName())) {
- result = new RoundedRectangleElementFigure();
- } else {
- result = new RectangleElementFigure();
- }
- if (figureElement.getAttribute("icon") != null) {
- String iconPath = figureElement.getAttribute("icon");
- URL url = Platform.getBundle(figureElement.getContributor().getName()).getEntry(iconPath);
- Image icon = null;
- if (imageMap.containsKey(url.getPath())) {
- icon = imageMap.get(url.getPath());
- } else {
- icon = ImageDescriptor.createFromURL(url).createImage();
- imageMap.put(url.getPath(), icon);
- }
- result.setIcon(icon);
- } else if (configurationElement.getAttribute("figure") != null) {
- String iconPath = configurationElement.getAttribute("figure");
- URL url = Platform.getBundle(configurationElement.getContributor().getName()).getEntry(iconPath);
- Image icon = null;
- if (imageMap.containsKey(url.getPath())) {
- icon = imageMap.get(url.getPath());
- } else {
- icon = ImageDescriptor.createFromURL(url).createImage();
- imageMap.put(url.getPath(), icon);
- }
- result.setIcon(icon);
- }
- if (figureElement.getAttribute("color") != null) {
- String colorString = figureElement.getAttribute("color");
- Color color = null;
- if (colorMap.containsKey(colorString)) {
- color = colorMap.get(colorString);
- } else {
- try {
- StringTokenizer tokenizer = new StringTokenizer(colorString, ",");
- int[] rgb = new int[3];
- int i = 0;
- while (tokenizer.hasMoreTokens()) {
- rgb[i++] = Integer.parseInt(tokenizer.nextToken());
- }
- color = new Color(Display.getCurrent(), rgb[0], rgb[1], rgb[2]);
- colorMap.put(colorString, color);
- } catch (NumberFormatException e) {}
- }
- result.setColor(color);
- }
- Dimension size = new Dimension(result.getSize());
- if (figureElement.getAttribute("width") != null) {
- try {
- size.width = Integer.parseInt(figureElement.getAttribute("width"));
- } catch (NumberFormatException e) {}
- }
- if (figureElement.getAttribute("height") != null) {
- try {
- size.height = Integer.parseInt(figureElement.getAttribute("height"));
- } catch (NumberFormatException e) {}
- }
- result.setSize(size);
- return result;
- }
- };
- }
-
public static Wrapper createWrapper(String elementId) {
if (elementMap == null) {
initializeRegistry();
15 years, 11 months
JBoss Tools SVN: r13387 - trunk/ws/docs/reference/en/images.
by jbosstools-commits@lists.jboss.org
Author: abogachuk
Date: 2009-01-29 14:32:48 -0500 (Thu, 29 Jan 2009)
New Revision: 13387
Modified:
trunk/ws/docs/reference/en/images/jbossws_bottomup.png
Log:
Modified: trunk/ws/docs/reference/en/images/jbossws_bottomup.png
===================================================================
(Binary files differ)
15 years, 11 months
JBoss Tools SVN: r13386 - trunk/ws/docs/reference/en/images.
by jbosstools-commits@lists.jboss.org
Author: abogachuk
Date: 2009-01-29 14:29:02 -0500 (Thu, 29 Jan 2009)
New Revision: 13386
Modified:
trunk/ws/docs/reference/en/images/Jbossws_preference_new.png
Log:
Modified: trunk/ws/docs/reference/en/images/Jbossws_preference_new.png
===================================================================
(Binary files differ)
15 years, 11 months
JBoss Tools SVN: r13385 - trunk/ws/docs/reference/en/images.
by jbosstools-commits@lists.jboss.org
Author: abogachuk
Date: 2009-01-29 14:27:32 -0500 (Thu, 29 Jan 2009)
New Revision: 13385
Added:
trunk/ws/docs/reference/en/images/Jbossws_preference.png
Log:
Added: trunk/ws/docs/reference/en/images/Jbossws_preference.png
===================================================================
(Binary files differ)
Property changes on: trunk/ws/docs/reference/en/images/Jbossws_preference.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
15 years, 11 months
JBoss Tools SVN: r13384 - trunk/ws/docs/reference/en/images.
by jbosstools-commits@lists.jboss.org
Author: abogachuk
Date: 2009-01-29 14:27:06 -0500 (Thu, 29 Jan 2009)
New Revision: 13384
Removed:
trunk/ws/docs/reference/en/images/Jbossws_preference.png
Log:
Deleted: trunk/ws/docs/reference/en/images/Jbossws_preference.png
===================================================================
(Binary files differ)
15 years, 11 months
JBoss Tools SVN: r13383 - trunk/ws/docs/reference/en/images.
by jbosstools-commits@lists.jboss.org
Author: abogachuk
Date: 2009-01-29 14:24:52 -0500 (Thu, 29 Jan 2009)
New Revision: 13383
Added:
trunk/ws/docs/reference/en/images/jbossws_bottomup_5.png
Log:
Added: trunk/ws/docs/reference/en/images/jbossws_bottomup_5.png
===================================================================
(Binary files differ)
Property changes on: trunk/ws/docs/reference/en/images/jbossws_bottomup_5.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
15 years, 11 months
JBoss Tools SVN: r13382 - trunk/ws/docs/reference/en/images.
by jbosstools-commits@lists.jboss.org
Author: abogachuk
Date: 2009-01-29 14:24:29 -0500 (Thu, 29 Jan 2009)
New Revision: 13382
Removed:
trunk/ws/docs/reference/en/images/jbossws_bottomup_5.png
Log:
Deleted: trunk/ws/docs/reference/en/images/jbossws_bottomup_5.png
===================================================================
(Binary files differ)
15 years, 11 months
JBoss Tools SVN: r13381 - trunk/ws/docs/reference/en/images.
by jbosstools-commits@lists.jboss.org
Author: abogachuk
Date: 2009-01-29 14:18:12 -0500 (Thu, 29 Jan 2009)
New Revision: 13381
Added:
trunk/ws/docs/reference/en/images/jbossws_bottomup_6.png
Log:
Added: trunk/ws/docs/reference/en/images/jbossws_bottomup_6.png
===================================================================
(Binary files differ)
Property changes on: trunk/ws/docs/reference/en/images/jbossws_bottomup_6.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
15 years, 11 months
JBoss Tools SVN: r13380 - trunk/ws/docs/reference/en/images.
by jbosstools-commits@lists.jboss.org
Author: abogachuk
Date: 2009-01-29 14:17:48 -0500 (Thu, 29 Jan 2009)
New Revision: 13380
Removed:
trunk/ws/docs/reference/en/images/jbossws_bottomup_6.png
Log:
Deleted: trunk/ws/docs/reference/en/images/jbossws_bottomup_6.png
===================================================================
(Binary files differ)
15 years, 11 months