You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@taverna.apache.org by st...@apache.org on 2015/03/06 23:33:57 UTC
[01/50] [abbrv] incubator-taverna-workbench git commit: Removed model
map (replaced by selection manager).
Repository: incubator-taverna-workbench
Updated Branches:
refs/heads/master 961faf19b -> 4357f05ec
Removed model map (replaced by selection manager).
git-svn-id: https://taverna.googlecode.com/svn/taverna/utils/net.sf.taverna.t2.lang/trunk@15897 bf327186-88b3-11dd-a302-d386e5130c1c
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/commit/434e47fc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/tree/434e47fc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/diff/434e47fc
Branch: refs/heads/master
Commit: 434e47fc05f4d8d1d71b956d9a7b755ff1eb32e3
Parents: 39f97ee
Author: david@mygrid.org.uk <da...@bf327186-88b3-11dd-a302-d386e5130c1c>
Authored: Mon Jul 22 13:47:16 2013 +0000
Committer: david@mygrid.org.uk <da...@bf327186-88b3-11dd-a302-d386e5130c1c>
Committed: Mon Jul 22 13:47:16 2013 +0000
----------------------------------------------------------------------
.../net/sf/taverna/t2/lang/ui/ModelMap.java | 180 -------------------
1 file changed, 180 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/434e47fc/ui/src/main/java/net/sf/taverna/t2/lang/ui/ModelMap.java
----------------------------------------------------------------------
diff --git a/ui/src/main/java/net/sf/taverna/t2/lang/ui/ModelMap.java b/ui/src/main/java/net/sf/taverna/t2/lang/ui/ModelMap.java
deleted file mode 100644
index 5b5d0b7..0000000
--- a/ui/src/main/java/net/sf/taverna/t2/lang/ui/ModelMap.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.lang.ui;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import net.sf.taverna.t2.lang.observer.MultiCaster;
-import net.sf.taverna.t2.lang.observer.Observable;
-import net.sf.taverna.t2.lang.observer.Observer;
-import net.sf.taverna.t2.lang.ui.ModelMap.ModelMapEvent;
-
-import org.apache.log4j.Logger;
-
-/**
- * Map of the models present in the workbench associated with their names,
- * together with the ability to manipulate this. Contains, from version 1.5
- * onwards, methods to set and notify components of changes to the underlying
- * set of named models.
- *
- * A 'model' can be any Object that has an effect on the UI.
- *
- * @author Stuart Owen
- * @author Tom Oinn
- * @author Stian Soiland-Reyes
- *
- */
-public class ModelMap implements Observable<ModelMapEvent> {
-
- private static ModelMap instance = new ModelMap();
-
- private static Logger logger = Logger.getLogger(ModelMap.class);
-
- public static ModelMap getInstance() {
- return instance;
- }
-
- /**
- * At any given time there are zero or more named model objects over which
- * the workbench UI is acting.
- */
- private Map<String, Object> modelMap = Collections
- .synchronizedMap(new HashMap<String, Object>());
-
- protected MultiCaster<ModelMapEvent> multiCaster = new MultiCaster<ModelMapEvent>(
- this);
-
- private ModelMap() {
- }
-
-
- public void addObserver(Observer<ModelMapEvent> observer) {
- multiCaster.addObserver(observer);
- }
-
-
- public Object getModel(String modelName) {
- return modelMap.get(modelName);
- }
-
- public List<Observer<ModelMapEvent>> getObservers() {
- return multiCaster.getObservers();
- }
-
- public void removeObserver(Observer<ModelMapEvent> observer) {
- multiCaster.removeObserver(observer);
- }
-
- /**
- * Manipulate the current model map
- *
- * @param modelName
- * name of the model to act on
- * @param model
- * null to destroy the model or a reference to the new model to
- * set. If it didn't already exist a modelCreated event will be
- * fired otherwise modelChanged is called.
- */
- public synchronized void setModel(String modelName, Object model) {
- // FIXME: What happens if a listener changes a model midthrough?
- logger.debug("setModel " + modelName + "=" + model);
- if (!modelMap.containsKey(modelName)) {
- if (model != null) {
- // Create new model object
- modelMap.put(modelName, model);
- modelCreated(modelName, model);
- }
- } else {
- if (model == null) {
- // Destroy model object
- Object oldModel = modelMap.get(modelName);
- modelMap.remove(modelMap.get(modelName));
- modelDestroyed(modelName, oldModel);
- } else {
- Object oldModel = modelMap.get(modelName);
- if (oldModel != model) {
- // Update model object
- modelMap.put(modelName, model);
- modelChanged(modelName, oldModel, model);
- }
- }
- }
- }
-
- private void modelChanged(String modelName, Object oldModel, Object newModel) {
- multiCaster
- .notify(new ModelChangedEvent(modelName, oldModel, newModel));
- }
-
- private void modelCreated(String modelName, Object model) {
- multiCaster.notify(new ModelCreatedEvent(modelName, model));
- }
-
- private void modelDestroyed(String modelName, Object oldModel) {
- multiCaster.notify(new ModelDestroyedEvent(modelName, oldModel));
- }
-
- public static class ModelChangedEvent extends ModelMapEvent {
- ModelChangedEvent(String modelName, Object oldModel, Object newModel) {
- super(modelName, oldModel, newModel);
- }
- }
-
- public static class ModelCreatedEvent extends ModelMapEvent {
- ModelCreatedEvent(String modelName, Object newModel) {
- super(modelName, null, newModel);
- }
- }
-
- public static class ModelDestroyedEvent extends ModelMapEvent {
- ModelDestroyedEvent(String modelName, Object oldModel) {
- super(modelName, oldModel, null);
- }
- }
-
- public static abstract class ModelMapEvent {
- private final String modelName;
- private final Object newModel;
- private final Object oldModel;
-
- ModelMapEvent(String modelName, Object oldModel, Object newModel) {
- this.modelName = modelName;
- this.oldModel = oldModel;
- this.newModel = newModel;
- }
-
- public String getModelName() {
- return modelName;
- }
-
- public Object getNewModel() {
- return newModel;
- }
-
- public Object getOldModel() {
- return oldModel;
- }
- }
-
-}
[25/50] [abbrv] incubator-taverna-workbench git commit: travis
Posted by st...@apache.org.
travis
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/commit/699d0080
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/tree/699d0080
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/diff/699d0080
Branch: refs/heads/master
Commit: 699d00807b7b3dd10bcef86b2714cf8bfa7ea27a
Parents: c72fc140
Author: Stian Soiland-Reyes <so...@cs.manchester.ac.uk>
Authored: Thu May 15 15:11:23 2014 +0100
Committer: Stian Soiland-Reyes <so...@cs.manchester.ac.uk>
Committed: Thu May 15 15:11:23 2014 +0100
----------------------------------------------------------------------
.travis.yml | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/699d0080/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..dff5f3a
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1 @@
+language: java
[43/50] [abbrv] incubator-taverna-workbench git commit: taverna-*
Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-io/src/main/java/net/sf/taverna/t2/lang/io/StreamCopier.java
----------------------------------------------------------------------
diff --git a/taverna-io/src/main/java/net/sf/taverna/t2/lang/io/StreamCopier.java b/taverna-io/src/main/java/net/sf/taverna/t2/lang/io/StreamCopier.java
new file mode 100644
index 0000000..b0d600d
--- /dev/null
+++ b/taverna-io/src/main/java/net/sf/taverna/t2/lang/io/StreamCopier.java
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.lang.io;
+
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import org.apache.log4j.Logger;
+
+/**
+ * Copies an InputStream to an OutputStream.
+ *
+ * @author Tom Oinn
+ */
+public class StreamCopier extends Thread {
+
+ private static Logger logger = Logger
+ .getLogger(StreamCopier.class);
+
+ InputStream is;
+
+ OutputStream os;
+
+ /**
+ * Create a new StreamCopier which will, when started, copy the specified
+ * InputStream to the specified OutputStream
+ */
+ public StreamCopier(InputStream is, OutputStream os) {
+ super("StreamCopier");
+ this.is = is;
+ this.os = os;
+ }
+
+ /**
+ * Start copying the stream, exits when the InputStream runs out of data
+ */
+ public void run() {
+ try {
+ byte[] buffer = new byte[1024];
+ int bytesRead;
+ while ((bytesRead = is.read(buffer)) != -1) {
+ os.write(buffer, 0, bytesRead);
+ }
+ os.flush();
+ os.close();
+ } catch (Exception ex) {
+ logger.error("Could not copy stream", ex);
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-io/src/main/java/net/sf/taverna/t2/lang/io/StreamDevourer.java
----------------------------------------------------------------------
diff --git a/taverna-io/src/main/java/net/sf/taverna/t2/lang/io/StreamDevourer.java b/taverna-io/src/main/java/net/sf/taverna/t2/lang/io/StreamDevourer.java
new file mode 100644
index 0000000..8495e27
--- /dev/null
+++ b/taverna-io/src/main/java/net/sf/taverna/t2/lang/io/StreamDevourer.java
@@ -0,0 +1,106 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.lang.io;
+
+import java.io.BufferedReader;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+
+import org.apache.log4j.Logger;
+
+/**
+ * Devours an input stream and allows the contents to be read as a String once
+ * the stream has completed.
+ *
+ * @author Tom Oinn
+ * @author Alan R Williams
+ */
+public class StreamDevourer extends Thread {
+
+ private static Logger logger = Logger.getLogger(StreamDevourer.class);
+
+ private static byte[] newLine = System.getProperty("line.separator").getBytes();
+
+ BufferedReader br;
+
+ ByteArrayOutputStream output;
+
+ /**
+ * Returns the current value of the internal ByteArrayOutputStream
+ */
+ @Override
+ public String toString() {
+ return output.toString();
+ }
+
+ /**
+ * Waits for the stream to close then returns the String representation of
+ * its contents (this is equivalent to doing a join then calling toString)
+ */
+ public String blockOnOutput() {
+ try {
+ this.join();
+ return output.toString();
+ } catch (InterruptedException ie) {
+ logger.error("Interrupted", ie);
+ interrupt();
+ return "";
+ }
+ }
+
+ /**
+ * Create the StreamDevourer and point it at an InputStream to consume
+ */
+ public StreamDevourer(InputStream is) {
+ super("StreamDevourer");
+ this.br = new BufferedReader(new InputStreamReader(is));
+ this.output = new ByteArrayOutputStream();
+ }
+
+ /**
+ * When started this Thread will copy all data from the InputStream into a
+ * ByteArrayOutputStream via a BufferedReader. Because of the use of the
+ * BufferedReader this is only really appropriate for streams of textual
+ * data
+ */
+ @Override
+ public void run() {
+ try {
+ String line = null;
+ while ((line = br.readLine()) != null) {
+ // && line.endsWith("</svg>") == false) {
+ if (line.endsWith("\\") && !line.endsWith("\\\\")) {
+ line = line.substring(0, line.length() - 1);
+ output.write(line.getBytes());
+ } else {
+ output.write(line.getBytes());
+ output.write(newLine);
+ }
+ }
+ br.close();
+ } catch (IOException ioe) {
+ logger.error(ioe);
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-partition/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-partition/pom.xml b/taverna-partition/pom.xml
new file mode 100644
index 0000000..ba5088a
--- /dev/null
+++ b/taverna-partition/pom.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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>net.sf.taverna.t2</groupId>
+ <artifactId>lang</artifactId>
+ <version>2.0.1-SNAPSHOT</version>
+ </parent>
+ <groupId>net.sf.taverna.t2.lang</groupId>
+ <artifactId>partition</artifactId>
+ <packaging>bundle</packaging>
+ <name>Partition</name>
+ <description>API for recursive subset partitioning</description>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>${junit.version}</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-partition/src/main/java/net/sf/taverna/t2/partition/HashSetModel.java
----------------------------------------------------------------------
diff --git a/taverna-partition/src/main/java/net/sf/taverna/t2/partition/HashSetModel.java b/taverna-partition/src/main/java/net/sf/taverna/t2/partition/HashSetModel.java
new file mode 100644
index 0000000..3a66eb0
--- /dev/null
+++ b/taverna-partition/src/main/java/net/sf/taverna/t2/partition/HashSetModel.java
@@ -0,0 +1,116 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.partition;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * Implementation of SetModel based on a HashSet
+ *
+ * @author Tom Oinn
+ */
+public class HashSetModel<ItemType> extends HashSet<ItemType> implements
+ SetModel<ItemType> {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 5763277571663880941L;
+ // Listeners for set change events
+ private List<SetModelChangeListener<ItemType>> changeListeners;
+
+ /**
+ * Default constructor, creates a set model based on a HashSet
+ */
+ public HashSetModel() {
+ super();
+ changeListeners = new ArrayList<SetModelChangeListener<ItemType>>();
+ }
+
+ /**
+ * Implements SetModel
+ */
+ public synchronized void addSetModelChangeListener(
+ SetModelChangeListener<ItemType> listener) {
+ changeListeners.add(listener);
+ }
+
+ /**
+ * Implements SetModel
+ */
+ public synchronized void removeSetModelChangeListener(
+ SetModelChangeListener<ItemType> listener) {
+ changeListeners.remove(listener);
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public synchronized void clear() {
+ notifyRemoval((Set<Object>) this);
+ super.clear();
+ }
+
+ @Override
+ public synchronized boolean add(ItemType item) {
+ if (super.add(item)) {
+ notifyAddition(Collections.singleton(item));
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public synchronized boolean remove(Object item) {
+ if (super.remove(item)) {
+ notifyRemoval(Collections.singleton(item));
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Push addition notification to listeners
+ *
+ * @param itemsAdded
+ */
+ private synchronized void notifyAddition(Set<ItemType> itemsAdded) {
+ for (SetModelChangeListener<ItemType> listener : new ArrayList<SetModelChangeListener<ItemType>>(
+ changeListeners)) {
+ listener.itemsWereAdded(itemsAdded);
+ }
+ }
+
+ /**
+ * Push removal notification to listeners
+ *
+ * @param itemsRemoved
+ */
+ private synchronized void notifyRemoval(Set<Object> itemsRemoved) {
+ for (SetModelChangeListener<ItemType> listener : new ArrayList<SetModelChangeListener<ItemType>>(
+ changeListeners)) {
+ listener.itemsWereRemoved(itemsRemoved);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-partition/src/main/java/net/sf/taverna/t2/partition/Partition.java
----------------------------------------------------------------------
diff --git a/taverna-partition/src/main/java/net/sf/taverna/t2/partition/Partition.java b/taverna-partition/src/main/java/net/sf/taverna/t2/partition/Partition.java
new file mode 100644
index 0000000..e1e5819
--- /dev/null
+++ b/taverna-partition/src/main/java/net/sf/taverna/t2/partition/Partition.java
@@ -0,0 +1,441 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.partition;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+
+import javax.swing.event.TreeModelEvent;
+import javax.swing.tree.TreePath;
+
+/**
+ * A partition represents a set of items which can be exclusively classified
+ * into one or more distinct subsets along with the algorithm to perform this
+ * subset operation.
+ *
+ * @author Tom Oinn
+ *
+ * @param <ItemType>
+ * all items in the underlying set of which this is a subset are
+ * instances of this type or can be cast to it according to
+ * conventional java language rules.
+ * @param <PartitionValueType>
+ * the partition value type used by the parent partition algorithm to
+ * create this partition object. As an example, if this partition
+ * object represented all those entries with a particular host
+ * institution this would be a String or possibly URL.
+ * @param <ChildPartitionValueType>
+ * the partition value type used by this partition's partition
+ * algorithm to create sub-partitions, it's used in the signature
+ * here because ordering of children is done based on these values.
+ * Any child partition will have a getPartitionValue return type
+ * cast-able to this type.
+ */
+public class Partition<ItemType extends Comparable, PartitionValueType, ChildPartitionValueType> {
+
+ // A comparator operating over the value type of the child partitions and
+ // used to order them as created or to re-order on a change of this property
+ private Comparator<ChildPartitionValueType> childPartitionOrder = null;
+
+ // Back reference to the root partition of which this is a direct or
+ // indirect sub-partition. If this *is* the root partition this points to
+ // self
+ protected RootPartition<ItemType> root;
+
+ // A subset of the parent's member set containing items which have been
+ // allocated to this partition by the parent's partition algorithm. The
+ // partition is specified by the partitionValue field.
+ private List<ItemType> members;
+
+ // The parent partition of which this is a subset
+ private Partition<ItemType, ?, PartitionValueType> parent;
+
+ // Specification of the partition in terms of the parent's partitioning
+ // algorithm
+ private PartitionValueType partitionValue;
+
+ // List of partitioning algorithms to be applied to this subset to create
+ // further partitions, the algorithm at index 0 is the one used for this
+ // partition, all others are passed in to the constructors for
+ // sub-partitions
+ protected List<PartitionAlgorithm<?>> partitionAlgorithms;
+
+ // An initially empty list of sub-partitions created by the head element of
+ // the partition algorithm list
+ protected List<Partition<ItemType, ChildPartitionValueType, ?>> children;
+
+ // Path from this node back to the root, initialised on first access and
+ // cached
+ private List<Partition<ItemType, ?, ?>> partitionPath = null;
+
+ // For leaf partitions this is equal to the number of items in the member
+ // set, for all other partitions it is the sum of the item count of all
+ // child partitions
+ protected int itemCount = 0;
+
+ /**
+ * Construct a new Partition, this is used by the RootPartition and by this
+ * class to construct the recursively sub-divided partition structure based
+ * on the rules encapsulated by the partition algorithm list.
+ *
+ * @param parent
+ * parent partition of which this is a subset
+ * @param pa
+ * partition algorithm list, with the algorithm used to create
+ * child partitions of this one at position 0, if this list is
+ * empty this is a leaf partition.
+ * @param root
+ * reference to the RootPartition acting as the externally
+ * visible front-end to this structure
+ * @param pv
+ * the value which the parent's partition algorithm has assigned
+ * to this partition. This must be interpreted in the context of
+ * the parent's first partition algorithm for display and other
+ * purposes
+ */
+ protected Partition(Partition<ItemType, ?, PartitionValueType> parent,
+ List<PartitionAlgorithm<?>> pa, RootPartition<ItemType> root,
+ PartitionValueType pv) {
+ this.root = root;
+ this.members = new ArrayList<ItemType>();
+ this.parent = parent;
+ this.partitionValue = pv;
+ this.partitionAlgorithms = pa;
+ this.children = new ArrayList<Partition<ItemType, ChildPartitionValueType, ?>>();
+ }
+
+ /**
+ * Return the number of items below this node in the partition tree; in the
+ * case of leaf partitions this is the number of items in the member set,
+ * for non-leaf partitions it is the sum of the item count for all immediate
+ * child partitions.
+ */
+ public int getItemCount() {
+ return this.itemCount;
+ }
+
+ /**
+ * Sub-partitions of this partition are ordered based on a comparator over
+ * the child partition value type.
+ *
+ * @return a comparator over child partition value types, or null if no
+ * comparator has been specified (by default this returns null)
+ */
+ public Comparator<ChildPartitionValueType> getChildPartitionOrder() {
+ return this.childPartitionOrder;
+ }
+
+ /**
+ * Set a comparator for child partition ordering - if the supplied
+ * comparator is different to the current one this will also trigger a
+ * re-order of all child partitions and corresponding events in the root
+ * partition's tree view. In the current implementation this is the very
+ * broad 'tree structure changed' event for this node in the tree view.
+ *
+ * @param order
+ * a new comparator to order child partitions
+ */
+ public void setChildPartitionOrder(Comparator<ChildPartitionValueType> order) {
+ if (!order.equals(childPartitionOrder)) {
+ childPartitionOrder = order;
+ sortChildPartitions();
+ }
+ }
+
+ /**
+ * Return the parent partition of which this is a sub-partition, or null if
+ * this is the root partition.
+ */
+ public Partition<ItemType, ?, PartitionValueType> getParent() {
+ return this.parent;
+ }
+
+ /**
+ * The parent partition created this partition based on a particular value
+ * of a property of the members of the sub-partition. This returns that
+ * value, and is the result returned from the parent partition's first
+ * partition algorithm when run on all members of this partition or its
+ * direct or indirect sub-partitions.
+ */
+ public PartitionValueType getPartitionValue() {
+ return this.partitionValue;
+ }
+
+ @Override
+ public String toString() {
+ if (getParent() != null) {
+ // query type
+ String string = this.getParent().getPartitionAlgorithms().get(0)
+ .toString();
+ // result of query
+ String string2 = this.partitionValue.toString();
+ return string2 + " (" + getItemCount() + ")";
+ } else {
+ // This is for a root partition, loop through its children to return
+ // the correct number when running a new query
+ int items = 0;
+ for (Partition child : children) {
+ items = items + child.getItemCount();
+ }
+ String queryType = getPartitionAlgorithms().get(0).toString();
+ // return "Activities which match query = " + getItemCount();
+ return "Available activities (" + items + ")";
+ //+ ", query by "
+ // + queryType;
+ }
+ }
+
+ /**
+ * Return a list of Partition objects from the root (at index 0) to this
+ * node at the final position in the list. Computes the first time then
+ * caches, as it should be impossible for this to be modified without
+ * recreation of the entire structure from scratch.
+ */
+ public synchronized List<Partition<ItemType, ?, ?>> getPartitionPath() {
+ if (partitionPath == null) {
+ List<Partition<ItemType, ?, ?>> al = new ArrayList<Partition<ItemType, ?, ?>>();
+ Partition<ItemType, ?, ?> activePartition = this;
+ al.add(activePartition);
+ while (activePartition.getParent() != null) {
+ al.add(0, activePartition.getParent());
+ activePartition = activePartition.getParent();
+ }
+ partitionPath = al;
+ }
+ return partitionPath;
+ }
+
+ /**
+ * If this is a leaf partition, defined as one with an empty list of
+ * partition algorithms, then this method returns the set of all items which
+ * have been classified as belonging to this leaf partition. For non-leaf
+ * partitions it will return an empty set.
+ */
+ public final List<ItemType> getMembers() {
+ return Collections.unmodifiableList(this.members);
+ }
+
+ /**
+ * The list of partition algorithms applicable to this node (at index 0) and
+ * subsequent downstream sub-partitions of it. If this is empty then the
+ * partition is a leaf partition.
+ */
+ public final List<PartitionAlgorithm<?>> getPartitionAlgorithms() {
+ return Collections.unmodifiableList(partitionAlgorithms);
+ }
+
+ /**
+ * Sub-partitions of this partition defined by the partition algorithm at
+ * index 0 of the list. If this is a leaf partition this will always be
+ * empty.
+ */
+ public final List<Partition<ItemType, ChildPartitionValueType, ?>> getChildren() {
+ return Collections.unmodifiableList(children);
+ }
+
+ /**
+ * Inject an item into this partition, if there are partition algorithms in
+ * the partition algorithm list (i.e. this is not a leaf) this will
+ * recursively call the same method on child partitions or create new
+ * partitions where there are none that match the value from the partition
+ * algorithm. If this is a leaf partition the item is added to the member
+ * set. The list is sorted when adding an item and it is inserted in the
+ * appropriate place
+ *
+ * @param item
+ * the item to add to the partition structure.
+ */
+ @SuppressWarnings("unchecked")
+ protected synchronized void addItem(ItemType item) {
+ if (partitionAlgorithms.isEmpty()) {
+ // itemCount = 0;
+ // Allocate directly to member set, no further partitioning
+ members.add(item);
+ Collections.sort(members);
+ int indexOf = members.indexOf(item);
+ // root.treeNodesInserted(new TreeModelEvent(this, getTreePath(),
+ // new int[] { members.size() - 1 }, new Object[] { item }));
+ root.treeNodesInserted(new TreeModelEvent(this, getTreePath(),
+ new int[] { indexOf }, new Object[] { item }));
+ // Increment item count for all partitions in the partition path
+ for (Partition<ItemType, ?, ?> p : getPartitionPath()) {
+ synchronized (p) {
+ p.itemCount++;
+ root.treeNodesChanged(new TreeModelEvent(this, p
+ .getTreePath()));
+ }
+ }
+
+ // Cache the storage of this item to this partition in the root
+ // partition for more efficient removal if required (saves having to
+ // search the entire partition tree, although that wouldn't be too
+ // painful if it was required this is faster at the cost of a few
+ // bytes of memory)
+ root.itemStoredAt(item, this);
+ // TODO - when the tree model covers items on the leaf nodes we'll
+ // want to message it here as well.
+ } else {
+ PartitionAlgorithm<ChildPartitionValueType> pa;
+ pa = (PartitionAlgorithm<ChildPartitionValueType>) partitionAlgorithms
+ .get(0);
+ ChildPartitionValueType pvalue = pa.allocate(item, root
+ .getPropertyExtractorRegistry());
+ // FIXME not sure how to do this since you seem to have to add the
+ // items to the partition if you want to then search them again,
+ // maybe you need a non-showing partition or something?
+ // //if it is a failed search then don't bother adding to the
+ // partition
+ // if (pvalue.toString().equalsIgnoreCase("No match")) {
+ // return;
+ // }
+ // See if there's a partition with this value already in the child
+ // partition list
+ for (Partition<ItemType, ChildPartitionValueType, ?> potentialChild : children) {
+ if (potentialChild.getPartitionValue().equals(pvalue)) {
+ potentialChild.addItem(item);
+ return;
+ }
+ }
+ // If not we have to create a new sub-partition
+ List<PartitionAlgorithm<?>> tail = new ArrayList<PartitionAlgorithm<?>>();
+ for (int i = 1; i < partitionAlgorithms.size(); i++) {
+ tail.add(partitionAlgorithms.get(i));
+ }
+ Partition<ItemType, ChildPartitionValueType, ?> newPartition = new Partition(
+ this, tail, this.root, pvalue);
+ // Insert the new partition in the correct place according to the
+ // comparator currently installed, or at the end if none exists or
+ // the list is empty
+ if (childPartitionOrder == null || children.isEmpty()) {
+ children.add(newPartition);
+ root.treeNodesInserted(new TreeModelEvent(this, getTreePath(),
+ new int[] { children.indexOf(newPartition) },
+ new Object[] { newPartition }));
+ } else {
+ boolean foundIndex = false;
+ for (int i = 0; i < children.size(); i++) {
+ ChildPartitionValueType existingPartitionValue = children
+ .get(i).getPartitionValue();
+ if (childPartitionOrder.compare(pvalue,
+ existingPartitionValue) < 0) {
+ children.add(i, newPartition);
+ root.treeNodesInserted(new TreeModelEvent(this,
+ getTreePath(), new int[] { i },
+ new Object[] { newPartition }));
+ if (i != 0) {
+ root.treeStructureChanged(new TreeModelEvent(this,
+ getTreePath()));
+ }
+ foundIndex = true;
+ break;
+ }
+ }
+ if (!foundIndex) {
+ // Fallen off the end of the array without finding something
+ // with greater index than the new partition so we add it at
+ // the
+ // end (by definition this is the largest value according to
+ // the
+ // comparator)
+ children.add(newPartition);
+ root.treeNodesInserted(new TreeModelEvent(this,
+ getTreePath(), new int[] { children
+ .indexOf(newPartition) },
+ new Object[] { newPartition }));
+ }
+ }
+ // Add the item to the new partition to trigger creation of any
+ // sub-partitions required
+ newPartition.addItem(item);
+ }
+ }
+
+ /**
+ * Remove an item from the member set
+ *
+ * @param item
+ * the item to remove
+ */
+ protected void removeMember(ItemType item) {
+ this.members.remove(item);
+ }
+
+ /**
+ * Re-order the child partitions based on the comparator, if no comparator
+ * has been defined this method does nothing. Tree structure changed
+ * messages are fired from this node in the tree view if the comparator is
+ * defined even if no nodes have been changed (lazy but not too much of an
+ * issue I suspect)
+ */
+ protected synchronized final void sortChildPartitions() {
+ if (this.childPartitionOrder == null) {
+ // Can't do anything unless the comparator is set appropriately
+ return;
+ }
+ Comparator<Partition<ItemType, ChildPartitionValueType, ?>> comparator = new Comparator<Partition<ItemType, ChildPartitionValueType, ?>>() {
+ public int compare(
+ Partition<ItemType, ChildPartitionValueType, ?> o1,
+ Partition<ItemType, ChildPartitionValueType, ?> o2) {
+ // FIXME is this really safe to do? It's fairly specific to our
+ // case. Doesn't seem very generic
+ if (o1.getPartitionValue().toString().equalsIgnoreCase(
+ "no value")) {
+ // No value so put it to the end
+ return 1;
+ }
+ return childPartitionOrder.compare(o1.getPartitionValue(), o2
+ .getPartitionValue());
+ }
+ };
+ Collections.<Partition<ItemType, ChildPartitionValueType, ?>> sort(
+ children, comparator);
+ // Message the root that the node structure under this node has changed
+ // (this is a bit lazy and we could almost certainly be more clever here
+ // as the nodes have been removed and added to re-order them)
+ root.treeStructureChanged(new TreeModelEvent(this, getTreePath()));
+ }
+
+ /**
+ * Return a TreePath object with this node as the final entry in the path
+ */
+ protected final synchronized TreePath getTreePath() {
+ return new TreePath(getPartitionPath().toArray());
+ }
+
+ // public void sortItems() {
+ // System.out.println("sorting the items");
+ // synchronized (members) {
+ // List<ItemType> oldOrder = new ArrayList<ItemType>(members);
+ // Collections.sort(oldOrder);
+ //
+ // for (ItemType item : oldOrder) {
+ // removeMember(item);
+ // }
+ // for (ItemType item : oldOrder) {
+ // addItem(item);
+ // }
+ // }
+ //
+ // }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-partition/src/main/java/net/sf/taverna/t2/partition/PartitionAlgorithm.java
----------------------------------------------------------------------
diff --git a/taverna-partition/src/main/java/net/sf/taverna/t2/partition/PartitionAlgorithm.java b/taverna-partition/src/main/java/net/sf/taverna/t2/partition/PartitionAlgorithm.java
new file mode 100644
index 0000000..b7b80f6
--- /dev/null
+++ b/taverna-partition/src/main/java/net/sf/taverna/t2/partition/PartitionAlgorithm.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.partition;
+
+/**
+ * Interface for classes which can partition a set of objects into subsets according
+ * to some embedded partitioning rule
+ *
+ * @author Tom Oinn
+ * @author Stuart Owen
+ *
+ * @param ValueType
+ * the java type of values used to represent the distinct partitions
+ * created by this algorithm, in many cases these will be primitive
+ * java types such as String but they could represent ranges of
+ * values in the case of binning of continuous quantities etc.
+ */
+public interface PartitionAlgorithm<ValueType> {
+
+ /**
+ * Given an object to classify return the value of the partition into which
+ * the object falls.
+ *
+ * @param newItem
+ * @return
+ */
+ ValueType allocate(Object newItem, PropertyExtractorRegistry reg);
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-partition/src/main/java/net/sf/taverna/t2/partition/PartitionAlgorithmSetSPI.java
----------------------------------------------------------------------
diff --git a/taverna-partition/src/main/java/net/sf/taverna/t2/partition/PartitionAlgorithmSetSPI.java b/taverna-partition/src/main/java/net/sf/taverna/t2/partition/PartitionAlgorithmSetSPI.java
new file mode 100644
index 0000000..330a11a
--- /dev/null
+++ b/taverna-partition/src/main/java/net/sf/taverna/t2/partition/PartitionAlgorithmSetSPI.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.partition;
+
+import java.util.Set;
+
+/**
+ * An SPI interface that provides access to a Set of partition algorithms.
+ *
+ * @author Stuart Owen
+ *
+ */
+public interface PartitionAlgorithmSetSPI {
+ /**
+ * @return a Set of PartitionAlgorithms
+ */
+ public Set<PartitionAlgorithm<?>> getPartitionAlgorithms();
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-partition/src/main/java/net/sf/taverna/t2/partition/PropertyExtractorRegistry.java
----------------------------------------------------------------------
diff --git a/taverna-partition/src/main/java/net/sf/taverna/t2/partition/PropertyExtractorRegistry.java b/taverna-partition/src/main/java/net/sf/taverna/t2/partition/PropertyExtractorRegistry.java
new file mode 100644
index 0000000..229aa87
--- /dev/null
+++ b/taverna-partition/src/main/java/net/sf/taverna/t2/partition/PropertyExtractorRegistry.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.partition;
+
+import java.util.Map;
+
+/**
+ * Convenience to allow caching of property extractors. Implementations should
+ * scan for available PropertyExtractorSPI implementations and use these to get
+ * the properties for each target, caching as applicable.
+ *
+ * @author Tom Oinn
+ *
+ */
+public interface PropertyExtractorRegistry {
+
+ public Map<String, Object> getAllPropertiesFor(Object target);
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-partition/src/main/java/net/sf/taverna/t2/partition/PropertyExtractorSPI.java
----------------------------------------------------------------------
diff --git a/taverna-partition/src/main/java/net/sf/taverna/t2/partition/PropertyExtractorSPI.java b/taverna-partition/src/main/java/net/sf/taverna/t2/partition/PropertyExtractorSPI.java
new file mode 100644
index 0000000..130f2b7
--- /dev/null
+++ b/taverna-partition/src/main/java/net/sf/taverna/t2/partition/PropertyExtractorSPI.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.partition;
+
+import java.util.Map;
+
+/**
+ * SPI for classes which can extract or infer a set of named properties from a
+ * target object.
+ *
+ * @author Tom Oinn
+ *
+ */
+public interface PropertyExtractorSPI {
+
+ /**
+ * Given a target object extract or infer the property map from it. If the
+ * target is one which this plugin cannot act on then simply return an empty
+ * map.
+ *
+ * @param target
+ * @return
+ */
+ Map<String, Object> extractProperties(Object target);
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-partition/src/main/java/net/sf/taverna/t2/partition/Query.java
----------------------------------------------------------------------
diff --git a/taverna-partition/src/main/java/net/sf/taverna/t2/partition/Query.java b/taverna-partition/src/main/java/net/sf/taverna/t2/partition/Query.java
new file mode 100644
index 0000000..c8f3cb6
--- /dev/null
+++ b/taverna-partition/src/main/java/net/sf/taverna/t2/partition/Query.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.partition;
+
+import java.util.Date;
+
+/**
+ * Defines a query which can be re-run and which presents a set view on its
+ * results. The Query is intended to represent both the old Taverna scavenger
+ * class (which were queries in all but name) and new integration with external
+ * search-able repositories in which case the term 'query' is a more literal
+ * description.
+ *
+ * @author Tom Oinn
+ *
+ * @param <ItemType>
+ * the parameterised type of the result set of the query
+ */
+public interface Query<ItemType> extends SetModel<ItemType> {
+
+ /**
+ * Run the query. The query has internal state from any previous runs
+ * (including the initial empty state) and will notify all listeners from
+ * the SetModel interface of any items that are present in the new query
+ * result and not in the old state or vice versa. It also updates the query
+ * time to be the current time.
+ */
+ public void doQuery();
+
+ /**
+ * Returns the time at which the query was last invoked, or null if the
+ * query has not been invoked yet.
+ *
+ * @return time of last call to doQuery or null if this hasn't happened yet.
+ */
+ public Date getLastQueryTime();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-partition/src/main/java/net/sf/taverna/t2/partition/RootPartition.java
----------------------------------------------------------------------
diff --git a/taverna-partition/src/main/java/net/sf/taverna/t2/partition/RootPartition.java b/taverna-partition/src/main/java/net/sf/taverna/t2/partition/RootPartition.java
new file mode 100644
index 0000000..64edfd8
--- /dev/null
+++ b/taverna-partition/src/main/java/net/sf/taverna/t2/partition/RootPartition.java
@@ -0,0 +1,394 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.partition;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.swing.SwingUtilities;
+import javax.swing.event.TreeModelEvent;
+import javax.swing.event.TreeModelListener;
+import javax.swing.tree.TreeModel;
+import javax.swing.tree.TreePath;
+
+/**
+ * Subclass of Partition acting as the public access point for the partition
+ * structure. Exposes a TreeModel for use with a UI.
+ *
+ * @author Tom Oinn
+ *
+ * @param <ItemType>
+ * all items added to this partition must cast to this type
+ */
+public class RootPartition<ItemType extends Comparable> extends
+ Partition<ItemType, Object, Object> implements TreeModel {
+
+ // Used to track where we ended up putting items with the addOrUpdateItem
+ // method, this makes checking for duplicate items, reclassification and
+ // removal of partitions much faster at the expense of a few bytes of memory
+ private Map<ItemType, Partition<ItemType, ?, ?>> itemToLeafPartition;
+
+ private PropertyExtractorRegistry propertyExtractorRegistry;
+
+ private final SetModelChangeListener<ItemType> setChangeListener = new SetModelChangeListener<ItemType>() {
+
+ private List<Query<?>> queryList = new ArrayList<Query<?>>();
+
+ public void itemsWereAdded(Set<ItemType> newItems) {
+ for (ItemType item : newItems) {
+ addOrUpdateItem(item);
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ public void itemsWereRemoved(Set<Object> itemsRemoved) {
+ for (Object item : itemsRemoved) {
+ try {
+ removeItem((ItemType) item);
+ } catch (ClassCastException cce) {
+ // Obviously wasn't the right type of item but that means it
+ // couldn't have been added in the first place so we can
+ // safely ignore this.
+ }
+ }
+ }
+
+ public void addQuery(Query<?> query) {
+ queryList.add(query);
+ }
+
+ public List<Query<?>> getQueries() {
+ return queryList;
+ }
+
+ };
+
+ /**
+ * Build a new empty root partition with the specified list of partition
+ * algorithm implementations used to recursively allocate new data items to
+ * the sub-partitions below this one on addition
+ *
+ * @param pa
+ */
+ public RootPartition(List<PartitionAlgorithm<?>> pa,
+ PropertyExtractorRegistry per) {
+ super(null, pa, null, null);
+ this.root = this;
+ this.propertyExtractorRegistry = per;
+ this.itemToLeafPartition = new HashMap<ItemType, Partition<ItemType, ?, ?>>();
+ }
+
+ /**
+ * The root partition comes with a convenience implementation of
+ * SetModelChangeListener which can be used to attach it to a compliant
+ * instance of SetModel (assuming the item types match). This allows the
+ * SetModel to act as the backing data store for the partition - as Query
+ * and the various subset / set union operators also implement this it
+ * provides a relatively simple mechanism to link multiple sets of data to
+ * this partition.
+ */
+ public SetModelChangeListener<ItemType> getSetModelChangeListener() {
+ return this.setChangeListener;
+ }
+
+ /**
+ * Alter the list of partition algorithms which drive the construction of
+ * the partitions. Calling this effectively forces a complete rebuild of the
+ * tree structure which is an expensive operation so be careful when you use
+ * it.
+ *
+ * @param pa
+ * a new list of PartitionAlgorithmSPI instances to use as the
+ * basis for the partition structure.
+ */
+ public synchronized void setPartitionAlgorithmList(
+ List<PartitionAlgorithm<?>> pa) {
+ if (pa.equals(this.partitionAlgorithms)) {
+ // At the least this checks for reference equality, although I'm not
+ // sure it does much more than that. TODO - replace this with a
+ // smarter check to see whether the list has really changed, doing a
+ // full re-build is expensive.
+ return;
+ }
+ // First create a copy of the keyset containing all the items we've
+ // added to this point.
+ Set<ItemType> itemsToAdd = new HashSet<ItemType>(itemToLeafPartition
+ .keySet());
+ this.partitionAlgorithms = pa;
+ this.children.clear();
+ this.itemToLeafPartition.clear();
+ treeStructureChanged(new TreeModelEvent(this, getTreePath()));
+ for (ItemType item : itemsToAdd) {
+ addOrUpdateItem(item);
+ }
+ sortChildPartitions();
+ }
+
+ /**
+ * Add a new item to the partition structure. If the item already exists
+ * this is interpreted as a request to reclassify according to properties
+ * which may have changed. This is not the same as a reclassification due to
+ * modification of the partition algorithm list, and just refers to the
+ * specified item. If the item exists already and its classification is
+ * changed the model will be notified with a removal event from the previous
+ * location and the item will be added as usual immediately afterwards.
+ */
+ public synchronized void addOrUpdateItem(ItemType item) {
+ // First check whether the item is already stored
+ if (itemToLeafPartition.containsKey(item)) {
+ // request to reclassify item.
+ List<Partition<ItemType, ?, ?>> partitions = itemToLeafPartition
+ .get(item).getPartitionPath();
+ // partitions[i].getPartitionValue is the result of running
+ // getPartitionAlgorithms[i-1] on the item, we run through the array
+ // until either we hit the end (no reclassification) or the item
+ // classifies differently in which case we remove and re-add it.
+ for (int i = 1; i < partitions.size(); i++) {
+ PartitionAlgorithm<?> pa = getPartitionAlgorithms().get(
+ i - 1);
+ Object existingValue = partitions.get(i).getPartitionValue();
+ Object reclassifiedValue = pa.allocate(item,
+ getPropertyExtractorRegistry());
+ if (existingValue.equals(reclassifiedValue) == false) {
+ // Items classify differently, remove it
+ removeItem(item);
+ // ...and add it back again, forcing reclassification
+ super.addItem(item);
+ return;
+ }
+ }
+ // return as the item wasn't changed.
+ return;
+ } else {
+ // Value wasn't already in the map so we just add it as usual
+ super.addItem(item);
+ }
+
+ }
+
+ /**
+ * Remove an item from the partition structure, if this leaves any
+ * partitions with zero item count they are removed as well to keep things
+ * tidy.
+ *
+ * @param item
+ * the item to remove from the partition structure. If this isn't
+ * present in the structure this method does nothing along the
+ * lines of the collections API.
+ */
+ public synchronized void removeItem(ItemType item) {
+ Partition<ItemType, ?, ?> partition = itemToLeafPartition.get(item);
+ if (partition != null) {
+ // Remove the item from the leaf partition
+ int previousIndex = partition.getMembers().indexOf(item);
+ TreePath pathToPartition = partition.getTreePath();
+ //partition.removeMember(item);
+ for (Partition<ItemType, ?, ?> parentPathElement : partition
+ .getPartitionPath()) {
+ // Notify path to root that the number of members
+ // has changed and it should update the renderers of
+ // any attached trees
+ treeNodesChanged(new TreeModelEvent(this, parentPathElement
+ .getTreePath()));
+ }
+ partition.removeMember(item);
+ treeNodesRemoved(new TreeModelEvent(this, pathToPartition,
+ new int[] { previousIndex }, new Object[] { item }));
+ // Traverse up the partition path and decrement the item count. If
+ // any item count becomes zero we mark this as a partition to
+ // remove, then at the end we remove the highest level one (so we
+ // only have to send a single delete event to the tree view)
+ for (Partition<ItemType, ?, ?> p : partition.getPartitionPath()) {
+ synchronized (p) {
+ p.itemCount--;
+ if (p.getItemCount() == 0 && p != this) {
+ // Can remove this node, all nodes after this will by
+ // definition have item count of zero. The exception is
+ // if this is the root node, in which case we just
+ // ignore it and move on to the next child. This avoids
+ // deleting the root, which is generally not a smart
+ // thing to do to a tree.
+ Partition<ItemType, ?, ?> parent = p.getParent();
+ int indexInParent = getIndexOfChild(parent, p);
+ parent.children.remove(indexInParent);
+ treeNodesRemoved(new TreeModelEvent(this, parent
+ .getTreePath(), new int[] { indexInParent },
+ new Object[] { p }));
+
+ break;
+ }
+ }
+ }
+ itemToLeafPartition.remove(item);
+ }
+ treeStructureChanged(new TreeModelEvent(this,getTreePath()));
+ }
+
+ /**
+ * Called by a leaf Partition when it has stored an item in its member set,
+ * used to keep track of where items have been stored to make removal more
+ * efficient.
+ */
+ void itemStoredAt(ItemType item, Partition<ItemType, ?, ?> partition) {
+ itemToLeafPartition.put(item, partition);
+ }
+
+ // ---------------------//
+ // TreeModel interfaces //
+ // ---------------------//
+ private List<TreeModelListener> treeListeners = new ArrayList<TreeModelListener>();
+
+ @SuppressWarnings("unchecked")
+ public synchronized Object getChild(Object parent, int index) {
+ if (parent instanceof Partition) {
+ Partition<ItemType, ?, ?> p = (Partition<ItemType, ?, ?>) parent;
+ if (p.getMembers().isEmpty() == false) {
+ if (index < 0 || index >= p.getMembers().size()) {
+ return null;
+ } else {
+ return p.getMembers().get(index);
+ }
+ } else {
+ if (index < 0 || index >= p.getChildren().size()) {
+ return null;
+ } else {
+ return p.getChildren().get(index);
+ }
+ }
+ }
+ return null;
+ }
+
+ @SuppressWarnings("unchecked")
+ public synchronized int getChildCount(Object parent) {
+ if (parent instanceof Partition) {
+ Partition<ItemType, ?, ?> p = (Partition<ItemType, ?, ?>) parent;
+ if (p.getMembers().isEmpty() == false) {
+ return p.getMembers().size();
+ }
+ return p.getChildren().size();
+ }
+ return 0;
+ }
+
+ @SuppressWarnings("unchecked")
+ public synchronized int getIndexOfChild(Object parent, Object child) {
+ if (parent != null && child != null && parent instanceof Partition
+ && child instanceof Partition) {
+ Partition<ItemType, ?, ?> p = (Partition<ItemType, ?, ?>) parent;
+ Partition<ItemType, ?, ?> c = (Partition<ItemType, ?, ?>) child;
+ if (p.root == c.root && p.root == this) {
+ // Parent and child must both be members of this tree structure
+ return p.getChildren().indexOf(child);
+ }
+ } else if (parent != null && child != null
+ && parent instanceof Partition) {
+ Partition<ItemType, ?, ?> p = (Partition<ItemType, ?, ?>) parent;
+ return p.getMembers().indexOf(child);
+ }
+ return -1;
+
+ }
+
+ public Object getRoot() {
+ // The root partition is also the root of the tree model
+ return this;
+ }
+
+ public boolean isLeaf(Object node) {
+ // No leaves at the moment as we're only considering partitions which
+ // are by definition not leaves (the items within the last partition are
+ // but at the moment we're not including them in the tree model)
+ return (!(node instanceof Partition));
+ }
+
+ public void removeTreeModelListener(TreeModelListener l) {
+ treeListeners.remove(l);
+ }
+
+ public void addTreeModelListener(TreeModelListener l) {
+ if (treeListeners.contains(l) == false) {
+ treeListeners.add(l);
+ }
+ }
+
+ public void valueForPathChanged(TreePath path, Object newValue) {
+ // Ignore this, the tree values are never changed by the user in this
+ // implementation so we don't have to do anything
+ }
+
+ // -------------------------------------------------------//
+ // Tree event forwarding helper methods used by Partition //
+ // -------------------------------------------------------//
+
+ void treeNodesChanged(final TreeModelEvent e) {
+ SwingUtilities.invokeLater(new Runnable() {
+ public void run() {
+ for (TreeModelListener listener : new ArrayList<TreeModelListener>(
+ treeListeners)) {
+ listener.treeNodesChanged(e);
+ }
+ }
+ });
+ }
+
+ void treeNodesInserted(final TreeModelEvent e) {
+ SwingUtilities.invokeLater(new Runnable() {
+ public void run() {
+ for (TreeModelListener listener : new ArrayList<TreeModelListener>(
+ treeListeners)) {
+ listener.treeNodesInserted(e);
+ }
+ }
+ });
+ }
+
+ void treeNodesRemoved(final TreeModelEvent e) {
+ SwingUtilities.invokeLater(new Runnable() {
+ public void run() {
+ for (TreeModelListener listener : new ArrayList<TreeModelListener>(
+ treeListeners)) {
+ listener.treeNodesRemoved(e);
+ }
+ }
+ });
+ }
+
+ void treeStructureChanged(final TreeModelEvent e) {
+ SwingUtilities.invokeLater(new Runnable() {
+ public void run() {
+ for (TreeModelListener listener : new ArrayList<TreeModelListener>(
+ treeListeners)) {
+ listener.treeStructureChanged(e);
+ }
+ }
+ });
+ }
+
+ public PropertyExtractorRegistry getPropertyExtractorRegistry() {
+ return this.propertyExtractorRegistry;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-partition/src/main/java/net/sf/taverna/t2/partition/SetModel.java
----------------------------------------------------------------------
diff --git a/taverna-partition/src/main/java/net/sf/taverna/t2/partition/SetModel.java b/taverna-partition/src/main/java/net/sf/taverna/t2/partition/SetModel.java
new file mode 100644
index 0000000..393d697
--- /dev/null
+++ b/taverna-partition/src/main/java/net/sf/taverna/t2/partition/SetModel.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.partition;
+
+import java.util.Set;
+
+/**
+ * Extension of the java Set interface with the addition of change listener
+ * support. Intended to be plugged into the RootPartition class so the partition
+ * is synchronized with the set membership.
+ *
+ * @author Tom Oinn
+ *
+ * @param <ItemType>
+ * the parameterised type of the set
+ */
+public interface SetModel<ItemType> extends Set<ItemType> {
+
+ /**
+ * Add a listener to be notified of change events on the set's membership
+ *
+ * @param listener
+ */
+ public void addSetModelChangeListener(
+ SetModelChangeListener<ItemType> listener);
+
+ /**
+ * Remove a previously registered change listener
+ *
+ * @param listener
+ */
+ public void removeSetModelChangeListener(
+ SetModelChangeListener<ItemType> listener);
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-partition/src/main/java/net/sf/taverna/t2/partition/SetModelChangeListener.java
----------------------------------------------------------------------
diff --git a/taverna-partition/src/main/java/net/sf/taverna/t2/partition/SetModelChangeListener.java b/taverna-partition/src/main/java/net/sf/taverna/t2/partition/SetModelChangeListener.java
new file mode 100644
index 0000000..176eb7c
--- /dev/null
+++ b/taverna-partition/src/main/java/net/sf/taverna/t2/partition/SetModelChangeListener.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.partition;
+
+import java.util.List;
+import java.util.Set;
+
+/**
+ * Handler for change events on a SetModel instance
+ *
+ * @author Tom Oinn
+ *
+ */
+public interface SetModelChangeListener<ItemType> {
+
+ public void itemsWereAdded(Set<ItemType> newItems);
+
+ public void itemsWereRemoved(Set<Object> itemsRemoved);
+
+ public List<Query<?>> getQueries();
+
+ public void addQuery(Query<?> query);
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-partition/src/main/java/net/sf/taverna/t2/partition/algorithms/CustomPartitionAlgorithm.java
----------------------------------------------------------------------
diff --git a/taverna-partition/src/main/java/net/sf/taverna/t2/partition/algorithms/CustomPartitionAlgorithm.java b/taverna-partition/src/main/java/net/sf/taverna/t2/partition/algorithms/CustomPartitionAlgorithm.java
new file mode 100644
index 0000000..b6a3eea
--- /dev/null
+++ b/taverna-partition/src/main/java/net/sf/taverna/t2/partition/algorithms/CustomPartitionAlgorithm.java
@@ -0,0 +1,98 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.partition.algorithms;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import net.sf.taverna.t2.partition.PartitionAlgorithm;
+import net.sf.taverna.t2.partition.PropertyExtractorRegistry;
+
+/**
+ * Takes a custom search term and checks against the properties eg
+ * "operation" of each of the available items. Adds the item to the activity
+ * palette if it matches
+ *
+ * @author Ian Dunlop
+ *
+ */
+public class CustomPartitionAlgorithm implements PartitionAlgorithm<Object> {
+
+ private String searchValue;
+ private List<String> properties;
+ private static String NO_SEARCH = "No match";
+ private static String MATCHING_ITEMS = "Activities with a matching property";
+
+ public String getSearchValue() {
+ return searchValue;
+ }
+
+ public void setSearchValue(String searchValue) {
+ this.searchValue = searchValue;
+ }
+
+ public CustomPartitionAlgorithm() {
+ properties = new ArrayList<String>();
+ }
+
+ public CustomPartitionAlgorithm(String searchValue) {
+ super();
+ this.searchValue = searchValue;
+ // this.propertyName = propertyName;
+ properties = new ArrayList<String>();
+ }
+
+ public void addProperty(String propertyValue) {
+ properties.add(propertyValue);
+ }
+
+ /**
+ * Checks against the items property to see if it contains the search term.
+ * Search each of the properties in {@link #properties} in turn
+ */
+ public Object allocate(Object newItem, PropertyExtractorRegistry reg) {
+ for (String property : properties) {
+ Object propertyValue = reg.getAllPropertiesFor(newItem).get(
+ property);
+ String itemString = newItem.toString();
+ //search all the properties first
+ if (propertyValue != null) {
+ if (((String) propertyValue).contains(getSearchValue()
+ .toLowerCase())) {
+ return MATCHING_ITEMS;
+ }
+ }
+ //then the name of the item
+ if (itemString.toLowerCase().contains(
+ getSearchValue().toLowerCase())) {
+ return MATCHING_ITEMS;
+ }
+ }
+ return NO_SEARCH;
+
+ }
+
+ @Override
+ public String toString() {
+ return "search term=" + this.searchValue;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-partition/src/main/java/net/sf/taverna/t2/partition/algorithms/LiteralValuePartitionAlgorithm.java
----------------------------------------------------------------------
diff --git a/taverna-partition/src/main/java/net/sf/taverna/t2/partition/algorithms/LiteralValuePartitionAlgorithm.java b/taverna-partition/src/main/java/net/sf/taverna/t2/partition/algorithms/LiteralValuePartitionAlgorithm.java
new file mode 100644
index 0000000..b703d40
--- /dev/null
+++ b/taverna-partition/src/main/java/net/sf/taverna/t2/partition/algorithms/LiteralValuePartitionAlgorithm.java
@@ -0,0 +1,106 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.partition.algorithms;
+
+import net.sf.taverna.t2.partition.PartitionAlgorithm;
+import net.sf.taverna.t2.partition.PropertyExtractorRegistry;
+
+/**
+ * A naive partition algorithm that simply returns the property value it's been
+ * configured to use from the property getter.
+ *
+ * @author Tom
+ *
+ */
+public class LiteralValuePartitionAlgorithm implements
+ PartitionAlgorithm<Object> {
+
+ private String propertyName = null;
+
+ private static String NO_PROPERTY = "No value";
+
+ /**
+ * Default constructor. The property name defaults to null, and needs setting using getPropertyName
+ */
+ public LiteralValuePartitionAlgorithm() {
+
+ }
+
+ /**
+ * Constructor that initialised the LiteralValuePartitionAlgorithm with a property name
+ *
+ * @param propertyName
+ */
+ public LiteralValuePartitionAlgorithm(String propertyName) {
+ super();
+ this.propertyName = propertyName;
+ }
+
+ public Object allocate(Object newItem, PropertyExtractorRegistry reg) {
+ if (propertyName == null) {
+ return NO_PROPERTY;
+ }
+ else {
+ Object propertyValue = reg.getAllPropertiesFor(newItem).get(propertyName);
+ if (propertyValue == null) {
+ return NO_PROPERTY;
+ }
+ else {
+ return propertyValue;
+ }
+ }
+ }
+
+ public String getPropertyName() {
+ return propertyName;
+ }
+
+ public void setPropertyName(String propertyName) {
+ this.propertyName = propertyName;
+ }
+
+
+
+ /**
+ * @return true if obj is a LiteralValuePartionAlgorithm and the property names match
+ */
+ @Override
+ public boolean equals(Object obj) {
+ if (obj instanceof LiteralValuePartitionAlgorithm) {
+ LiteralValuePartitionAlgorithm alg = (LiteralValuePartitionAlgorithm)obj;
+ return getPropertyName().equals(alg.getPropertyName());
+ }
+ else {
+ return false;
+ }
+ }
+
+ @Override
+ public int hashCode() {
+ return getPropertyName().hashCode();
+ }
+
+ @Override
+ public String toString() {
+ return this.propertyName;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-partition/src/main/java/net/sf/taverna/t2/partition/ui/PartitionAlgorithmListEditor.java
----------------------------------------------------------------------
diff --git a/taverna-partition/src/main/java/net/sf/taverna/t2/partition/ui/PartitionAlgorithmListEditor.java b/taverna-partition/src/main/java/net/sf/taverna/t2/partition/ui/PartitionAlgorithmListEditor.java
new file mode 100644
index 0000000..9c05c44
--- /dev/null
+++ b/taverna-partition/src/main/java/net/sf/taverna/t2/partition/ui/PartitionAlgorithmListEditor.java
@@ -0,0 +1,224 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.partition.ui;
+
+import javax.swing.JComponent;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+
+import net.sf.taverna.t2.partition.PartitionAlgorithm;
+
+import java.awt.BasicStroke;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
+import java.awt.geom.GeneralPath;
+import java.util.List;
+
+public class PartitionAlgorithmListEditor extends JPanel {
+
+ // Serial version ID
+ private static final long serialVersionUID = 8206805090698009524L;
+
+ // Index of currently selected 'tab' or -1 if none selected
+ private int selectedIndex = 1;
+
+ // List of partition algorithm instances acting as the model for this
+ // component
+ private List<PartitionAlgorithm<?>> paList;
+
+ private int cornerSep = 8;
+ private int labelHorizontalPad = 10;
+ private int labelBottomPad = 2;
+ private int labelTopPad = 4;
+ private float selectedStrokeWidth = 3f;
+
+ public List<PartitionAlgorithm<?>> getPartitionAlgorithmList() {
+ return null;
+ }
+
+ @Override
+ public Dimension getPreferredSize() {
+ if (paList.isEmpty()) {
+ return new Dimension(0, 16 + labelBottomPad + labelTopPad);
+ } else {
+ return new Dimension(0, (int) new Tab(getLabelForPA(paList.get(0)))
+ .getPreferredSize().getHeight());
+ }
+ }
+
+ public PartitionAlgorithmListEditor(
+ List<PartitionAlgorithm<?>> currentState) {
+ super();
+ this.paList = currentState;
+ }
+
+ protected JLabel getLabelForPA(PartitionAlgorithm<?> pa) {
+ return new JLabel("Test...");
+ }
+
+ protected Color getBorderColorForPA(PartitionAlgorithm<?> pa) {
+ return Color.black;
+ }
+
+ @Override
+ protected void paintComponent(Graphics g) {
+ Graphics2D g2d = (Graphics2D) g.create();
+ // Enable anti-aliasing for the curved lines
+ g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
+ RenderingHints.VALUE_ANTIALIAS_ON);
+
+ int selectedStartsAt = 0;
+ int selectedEndsAt = 0;
+ Color frameColor = null;
+ int cumulativeTranslation = 0;
+
+ super.paintComponent(g2d);
+
+ for (int i = 0; i < paList.size(); i++) {
+
+ Tab t = new Tab(getLabelForPA(paList.get(i)));
+ t.setBackground(new Color(150, 150, 255));
+ t.setSelected(i == selectedIndex);
+ int width = (int) (t.getPreferredSize()).getWidth();
+ t.setSize(new Dimension(width, getHeight()));
+ t.paint(g2d);
+
+ if (i < selectedIndex) {
+ selectedStartsAt += width;
+ } else if (i == selectedIndex) {
+ selectedEndsAt = selectedStartsAt + width;
+ frameColor = t.getBackground();
+ }
+ cumulativeTranslation += width;
+ g2d.translate(width, 0);
+ }
+
+
+ // Reset the transform
+ g2d.translate(-cumulativeTranslation, 0);
+ if (selectedIndex > 0) {
+ g2d.setStroke(new BasicStroke(selectedStrokeWidth, BasicStroke.CAP_BUTT,
+ BasicStroke.JOIN_MITER));
+ int height = (int)(getHeight() - selectedStrokeWidth/2);
+ // Render the selected index line...
+ if (frameColor != null) {
+ g2d.setPaint(frameColor.darker());
+ }
+ GeneralPath path = new GeneralPath();
+ path.moveTo(0, height);
+ path.lineTo(selectedStartsAt, height);
+ path.lineTo(selectedStartsAt, cornerSep);
+ path.curveTo(selectedStartsAt, cornerSep / 2, selectedStartsAt
+ + cornerSep / 2, 0, selectedStartsAt + cornerSep, 0);
+ path.lineTo(selectedEndsAt - cornerSep, 0);
+ path.curveTo(selectedEndsAt - cornerSep / 2, 0, selectedEndsAt,
+ cornerSep / 2, selectedEndsAt, cornerSep);
+ path.lineTo(selectedEndsAt, height);
+ path.lineTo(getWidth(), height);
+
+ g2d.draw(path);
+ }
+ g2d.dispose();
+ }
+
+ @SuppressWarnings("serial")
+ // Renderer for a single tab in the partition algorithm list, used as a
+ // rubber stamp for a single tab in the tab list.
+ class Tab extends JComponent {
+
+ // Label to use to render tab contents
+ private JLabel label;
+
+ // If this is selected then we don't draw the stroke as it'll be drawn
+ // on later.
+ private boolean selected = false;
+
+ @Override
+ // Always false as we don't render the corners
+ public boolean isOpaque() {
+ return false;
+ }
+
+ public void setSelected(boolean b) {
+ this.selected = b;
+
+ }
+
+ @Override
+ public Dimension getPreferredSize() {
+ Dimension d = label.getPreferredSize();
+ return new Dimension((int) (d.getWidth()) + labelHorizontalPad * 2,
+ ((int) d.getHeight()) + labelBottomPad + labelTopPad);
+ }
+
+ protected Tab(JLabel label) {
+ super();
+ this.label = label;
+ }
+
+ @Override
+ public void setBackground(Color colour) {
+ label.setBackground(colour);
+ }
+
+ @Override
+ public Color getBackground() {
+ return label.getBackground();
+ }
+
+ @Override
+ protected void paintComponent(Graphics g) {
+ Graphics2D g2d = (Graphics2D) g.create();
+
+ int width = getWidth();
+ int height = getHeight();
+
+ // Create a general path to draw the tab shape
+ g2d.setPaint(label.getBackground());
+ GeneralPath path = new GeneralPath();
+ path.moveTo(0, height);
+ path.lineTo(0, cornerSep);
+ path.curveTo(0, cornerSep / 2, cornerSep / 2, 0, cornerSep, 0);
+ path.lineTo(width - cornerSep, 0);
+ path.curveTo(width - cornerSep / 2, 0, width, cornerSep / 2, width,
+ cornerSep);
+ path.lineTo(width, height);
+ path.closePath();
+ g2d.fill(path);
+ if (!selected) {
+ g2d.setPaint(label.getBackground().darker());
+ g2d.draw(path);
+ }
+
+ label.setSize(width - labelHorizontalPad * 2, height
+ - (labelBottomPad + labelTopPad));
+ g2d.translate(labelHorizontalPad, labelTopPad);
+ label.paint(g2d);
+ g2d.translate(-labelHorizontalPad, -labelTopPad);
+
+ g2d.dispose();
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-partition/src/main/java/net/sf/taverna/t2/partition/ui/TableTreeNodeColumn.java
----------------------------------------------------------------------
diff --git a/taverna-partition/src/main/java/net/sf/taverna/t2/partition/ui/TableTreeNodeColumn.java b/taverna-partition/src/main/java/net/sf/taverna/t2/partition/ui/TableTreeNodeColumn.java
new file mode 100644
index 0000000..c6b4b36
--- /dev/null
+++ b/taverna-partition/src/main/java/net/sf/taverna/t2/partition/ui/TableTreeNodeColumn.java
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.partition.ui;
+
+import java.awt.Color;
+import java.awt.Component;
+
+/**
+ * A column used in the tree part of the table tree node renderer
+ *
+ * @author Tom Oinn
+ *
+ */
+public interface TableTreeNodeColumn {
+
+ /**
+ * Get a string to use as the header text
+ *
+ * @return
+ */
+ public String getShortName();
+
+ /**
+ * Get a descriptive string for tooltips etc.
+ *
+ * @return
+ */
+ public String getDescription();
+
+ /**
+ * Given a node value render the appropriate property for this column
+ *
+ * @param value
+ * @return
+ */
+ public Component getCellRenderer(Object value);
+
+ /**
+ * Return the width in pixels for this column
+ *
+ * @return
+ */
+ public int getColumnWidth();
+
+ /**
+ * Get a header colour - the actual column colour will be a stripe of the
+ * result of applying the lighter operator twice and once to this colour.
+ */
+ public Color getColour();
+
+}
[29/50] [abbrv] incubator-taverna-workbench git commit: don't use
commonactivities here
Posted by st...@apache.org.
don't use commonactivities here
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/commit/6c3dca2a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/tree/6c3dca2a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/diff/6c3dca2a
Branch: refs/heads/master
Commit: 6c3dca2af97373038bf5220b2b1f994d2e6ebd6a
Parents: 961faf1
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Fri Mar 6 17:35:29 2015 +0000
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Fri Mar 6 17:35:29 2015 +0000
----------------------------------------------------------------------
pom.xml | 2 ++
1 file changed, 2 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/6c3dca2a/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 4b90159..925cd4a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -16,7 +16,9 @@
<taverna.language.version>0.15.0-incubating-SNAPSHOT</taverna.language.version>
<taverna.osgi.version>0.2.0-incubating-SNAPSHOT</taverna.osgi.version>
<taverna.engine.version>3.1.0-incubating-SNAPSHOT</taverna.engine.version>
+ <!-- should not use:
<taverna.commonactivities.version>2.1.0-incubating-SNAPSHOT</taverna.commonactivities.version>
+ -->
</properties>
<modules>
<module>taverna-dataflow-activity-ui</module>
[24/50] [abbrv] incubator-taverna-workbench git commit: commons-ui
should be from spring
Posted by st...@apache.org.
commons-ui should be from spring
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/commit/c72fc140
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/tree/c72fc140
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/diff/c72fc140
Branch: refs/heads/master
Commit: c72fc1407ebffca5aa88e1ea5a495b1ed4b738e5
Parents: 66452d9
Author: Stian Soiland-Reyes <so...@cs.manchester.ac.uk>
Authored: Thu May 15 14:47:38 2014 +0100
Committer: Stian Soiland-Reyes <so...@cs.manchester.ac.uk>
Committed: Thu May 15 14:47:38 2014 +0100
----------------------------------------------------------------------
ui/pom.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/c72fc140/ui/pom.xml
----------------------------------------------------------------------
diff --git a/ui/pom.xml b/ui/pom.xml
index 4e77d66..d0b8895 100644
--- a/ui/pom.xml
+++ b/ui/pom.xml
@@ -23,8 +23,8 @@
<version>${jedit.syntax.version}</version>
</dependency>
<dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>com.springsource.org.apache.commons.io</artifactId>
<version>${commons.io.version}</version>
</dependency>
<dependency>
[14/50] [abbrv] incubator-taverna-workbench git commit: still
taverna-parent 2.5-SNAPSHOT for now
Posted by st...@apache.org.
still taverna-parent 2.5-SNAPSHOT for now
git-svn-id: https://taverna.googlecode.com/svn/taverna/utils/net.sf.taverna.t2.lang/branches/maintenance@16875 bf327186-88b3-11dd-a302-d386e5130c1c
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/commit/52f29604
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/tree/52f29604
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/diff/52f29604
Branch: refs/heads/master
Commit: 52f296048af9857b84babc269697ac0ef2eb24f1
Parents: df96ceb
Author: stian@mygrid.org.uk <st...@bf327186-88b3-11dd-a302-d386e5130c1c>
Authored: Wed Mar 19 16:19:53 2014 +0000
Committer: stian@mygrid.org.uk <st...@bf327186-88b3-11dd-a302-d386e5130c1c>
Committed: Wed Mar 19 16:19:53 2014 +0000
----------------------------------------------------------------------
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52f29604/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 53b03a0..4d525c7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>net.sf.taverna</groupId>
<artifactId>taverna-parent</artifactId>
- <version>2.6-SNAPSHOT</version>
+ <version>2.5-SNAPSHOT</version>
<relativePath>../../taverna-parent/pom.xml</relativePath>
</parent>
[34/50] [abbrv] incubator-taverna-workbench git commit:
org.apache.taverna.* updates for poms
Posted by st...@apache.org.
org.apache.taverna.* updates for poms
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/commit/c19de831
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/tree/c19de831
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/diff/c19de831
Branch: refs/heads/master
Commit: c19de831a8db81be4d158e5e01a8d5424bf22bed
Parents: 4d2409a
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Fri Mar 6 22:06:52 2015 +0000
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Fri Mar 6 22:06:52 2015 +0000
----------------------------------------------------------------------
taverna-disabled-activity-ui/pom.xml | 14 ++++++-------
taverna-stringconstant-activity-ui/pom.xml | 16 +++++++-------
taverna-unrecognized-activity-ui/pom.xml | 4 ++--
taverna-workbench-activity-icons-api/pom.xml | 2 +-
taverna-workbench-activity-palette-api/pom.xml | 6 +++---
taverna-workbench-activity-palette-impl/pom.xml | 2 +-
taverna-workbench-activity-palette-ui/pom.xml | 12 +++++------
taverna-workbench-activity-tools/pom.xml | 6 +++---
taverna-workbench-configuration-impl/pom.xml | 6 +++---
taverna-workbench-contextual-views-api/pom.xml | 16 +++++++-------
taverna-workbench-contextual-views-impl/pom.xml | 6 +++---
taverna-workbench-contextual-views/pom.xml | 8 +++----
taverna-workbench-credential-manager-ui/pom.xml | 6 +++---
.../pom.xml | 4 ++--
taverna-workbench-design-ui/pom.xml | 10 ++++-----
taverna-workbench-edits-api/pom.xml | 2 +-
taverna-workbench-edits-impl/pom.xml | 8 +++----
taverna-workbench-file-api/pom.xml | 2 +-
taverna-workbench-file-impl/pom.xml | 18 ++++++++--------
taverna-workbench-graph-model/pom.xml | 12 +++++------
taverna-workbench-graph-view/pom.xml | 16 +++++++-------
taverna-workbench-helper-api/pom.xml | 2 +-
taverna-workbench-helper/pom.xml | 2 +-
taverna-workbench-httpproxy-config/pom.xml | 2 +-
taverna-workbench-iteration-strategy-ui/pom.xml | 10 ++++-----
taverna-workbench-loop-ui/pom.xml | 16 +++++++-------
taverna-workbench-menu-api/pom.xml | 2 +-
taverna-workbench-menu-impl/pom.xml | 6 +++---
taverna-workbench-menu-items/pom.xml | 16 +++++++-------
taverna-workbench-monitor-view/pom.xml | 8 +++----
taverna-workbench-parallelize-ui/pom.xml | 8 +++----
.../pom.xml | 12 +++++------
taverna-workbench-perspective-design/pom.xml | 22 ++++++++++----------
.../pom.xml | 6 +++---
taverna-workbench-perspective-results/pom.xml | 8 +++----
taverna-workbench-plugin-manager/pom.xml | 4 ++--
taverna-workbench-plugins-gui/pom.xml | 4 ++--
taverna-workbench-reference-ui/pom.xml | 6 +++---
taverna-workbench-renderers-exts/pom.xml | 4 ++--
taverna-workbench-renderers-impl/pom.xml | 2 +-
taverna-workbench-report-api/pom.xml | 4 ++--
taverna-workbench-report-explainer/pom.xml | 14 ++++++-------
taverna-workbench-report-impl/pom.xml | 6 +++---
taverna-workbench-report-view/pom.xml | 18 ++++++++--------
taverna-workbench-results-view/pom.xml | 8 +++----
taverna-workbench-retry-ui/pom.xml | 8 +++----
taverna-workbench-run-ui/pom.xml | 10 ++++-----
taverna-workbench-selection-api/pom.xml | 4 ++--
taverna-workbench-selection-impl/pom.xml | 6 +++---
taverna-workbench-update-manager/pom.xml | 2 +-
taverna-workbench-workbench-impl/pom.xml | 16 +++++++-------
taverna-workbench-workflow-explorer/pom.xml | 20 +++++++++---------
taverna-workbench-workflow-view/pom.xml | 14 ++++++-------
53 files changed, 223 insertions(+), 223 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/c19de831/taverna-disabled-activity-ui/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-disabled-activity-ui/pom.xml b/taverna-disabled-activity-ui/pom.xml
index b02dd87..528ebcf 100644
--- a/taverna-disabled-activity-ui/pom.xml
+++ b/taverna-disabled-activity-ui/pom.xml
@@ -29,32 +29,32 @@
<name>Taverna 2 Disabled Activity UI</name>
<dependencies>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>activity-icons-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>menu-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>report-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-impl</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>contextual-views-impl</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>activity-tools</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-components</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>workflow-view</artifactId>
<version>${project.parent.version}</version>
</dependency>
@@ -74,7 +74,7 @@
<version>${t2.lang.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-impl</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>helper</artifactId>
<version>${project.parent.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/c19de831/taverna-stringconstant-activity-ui/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-stringconstant-activity-ui/pom.xml b/taverna-stringconstant-activity-ui/pom.xml
index ced319e..d48fb57 100644
--- a/taverna-stringconstant-activity-ui/pom.xml
+++ b/taverna-stringconstant-activity-ui/pom.xml
@@ -29,27 +29,27 @@
<name>Taverna 2 StringConstant Activity UI</name>
<dependencies>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>activity-icons-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>activity-palette-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>menu-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>contextual-views-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-components</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>workflow-view</artifactId>
<version>${project.parent.version}</version>
</dependency>
@@ -72,18 +72,18 @@
<scope>test</scope>
</dependency>
<!-- <dependency>
- <groupId>net.sf.taverna.t2.ui-impl</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>activity-palette-impl</artifactId>
<version>${project.parent.version}</version>
<scope>test</scope>
</dependency> -->
<!-- <dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>activity-tools</artifactId>
<version>${project.parent.version}</version>
</dependency> -->
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>activity-tools</artifactId>
<version>${project.parent.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/c19de831/taverna-unrecognized-activity-ui/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-unrecognized-activity-ui/pom.xml b/taverna-unrecognized-activity-ui/pom.xml
index c69f4b4..05349a8 100644
--- a/taverna-unrecognized-activity-ui/pom.xml
+++ b/taverna-unrecognized-activity-ui/pom.xml
@@ -29,12 +29,12 @@
<name>Taverna 2 Unrecognized Activity UI</name>
<dependencies>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>configuration-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-impl</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>contextual-views-impl</artifactId>
<version>${project.parent.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/c19de831/taverna-workbench-activity-icons-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-activity-icons-api/pom.xml b/taverna-workbench-activity-icons-api/pom.xml
index 94f41b0..6f73b2f 100644
--- a/taverna-workbench-activity-icons-api/pom.xml
+++ b/taverna-workbench-activity-icons-api/pom.xml
@@ -29,7 +29,7 @@
<dependencies>
<dependency>
- <groupId>uk.org.taverna.scufl2</groupId>
+ <groupId>org.apache.taverna.language</groupId>
<artifactId>scufl2-api</artifactId>
</dependency>
</dependencies>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/c19de831/taverna-workbench-activity-palette-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-activity-palette-api/pom.xml b/taverna-workbench-activity-palette-api/pom.xml
index 56ed37b..1ba3c41 100644
--- a/taverna-workbench-activity-palette-api/pom.xml
+++ b/taverna-workbench-activity-palette-api/pom.xml
@@ -44,12 +44,12 @@
</build>
<dependencies>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>workbench-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>edits-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
@@ -63,7 +63,7 @@
<artifactId>taverna-configuration-api</artifactId>
</dependency>
<dependency>
- <groupId>uk.org.taverna.scufl2</groupId>
+ <groupId>org.apache.taverna.language</groupId>
<artifactId>scufl2-api</artifactId>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/c19de831/taverna-workbench-activity-palette-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-activity-palette-impl/pom.xml b/taverna-workbench-activity-palette-impl/pom.xml
index 38178ec..bed75bb 100644
--- a/taverna-workbench-activity-palette-impl/pom.xml
+++ b/taverna-workbench-activity-palette-impl/pom.xml
@@ -29,7 +29,7 @@
<description>Activity Palette Implementation</description>
<dependencies>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>activity-palette-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/c19de831/taverna-workbench-activity-palette-ui/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-activity-palette-ui/pom.xml b/taverna-workbench-activity-palette-ui/pom.xml
index fb25d1e..23d6fff 100644
--- a/taverna-workbench-activity-palette-ui/pom.xml
+++ b/taverna-workbench-activity-palette-ui/pom.xml
@@ -29,32 +29,32 @@
<description>Activity Palette UI</description>
<dependencies>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>activity-icons-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>activity-palette-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>workbench-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>menu-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>helper-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-components</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>workflow-view</artifactId>
<version>${project.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/c19de831/taverna-workbench-activity-tools/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-activity-tools/pom.xml b/taverna-workbench-activity-tools/pom.xml
index 4524c47..a3d9ded 100644
--- a/taverna-workbench-activity-tools/pom.xml
+++ b/taverna-workbench-activity-tools/pom.xml
@@ -29,17 +29,17 @@
<description>Tools useful for ui-activitys</description>
<dependencies>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>menu-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>workbench-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>uk.org.taverna.scufl2</groupId>
+ <groupId>org.apache.taverna.language</groupId>
<artifactId>scufl2-api</artifactId>
</dependency>
</dependencies>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/c19de831/taverna-workbench-configuration-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-configuration-impl/pom.xml b/taverna-workbench-configuration-impl/pom.xml
index 3e94509..3665c8c 100644
--- a/taverna-workbench-configuration-impl/pom.xml
+++ b/taverna-workbench-configuration-impl/pom.xml
@@ -30,17 +30,17 @@
<dependencies>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>menu-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>helper-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>configuration-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/c19de831/taverna-workbench-contextual-views-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-contextual-views-api/pom.xml b/taverna-workbench-contextual-views-api/pom.xml
index 7a75d4b..e396c15 100644
--- a/taverna-workbench-contextual-views-api/pom.xml
+++ b/taverna-workbench-contextual-views-api/pom.xml
@@ -29,37 +29,37 @@
<description>Contextual views for the activities</description>
<dependencies>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>activity-icons-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>activity-palette-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>configuration-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>edits-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>file-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>helper-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>workbench-api</artifactId>
<version>${project.version}</version>
</dependency>
@@ -73,7 +73,7 @@
<artifactId>observer</artifactId>
</dependency>
<dependency>
- <groupId>uk.org.taverna.scufl2</groupId>
+ <groupId>org.apache.taverna.language</groupId>
<artifactId>scufl2-api</artifactId>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/c19de831/taverna-workbench-contextual-views-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-contextual-views-impl/pom.xml b/taverna-workbench-contextual-views-impl/pom.xml
index c36e1e5..bb078e4 100644
--- a/taverna-workbench-contextual-views-impl/pom.xml
+++ b/taverna-workbench-contextual-views-impl/pom.xml
@@ -29,17 +29,17 @@
<description>Contextual views for the activities</description>
<dependencies>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>contextual-views-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>selection-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>uk.org.taverna.scufl2</groupId>
+ <groupId>org.apache.taverna.language</groupId>
<artifactId>scufl2-api</artifactId>
<version>${scufl2.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/c19de831/taverna-workbench-contextual-views/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-contextual-views/pom.xml b/taverna-workbench-contextual-views/pom.xml
index dbcd271..5985cfe 100644
--- a/taverna-workbench-contextual-views/pom.xml
+++ b/taverna-workbench-contextual-views/pom.xml
@@ -28,22 +28,22 @@
<name>Contextual views</name>
<dependencies>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>contextual-views-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>edits-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>file-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>selection-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/c19de831/taverna-workbench-credential-manager-ui/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-credential-manager-ui/pom.xml b/taverna-workbench-credential-manager-ui/pom.xml
index ca06780..7b8fa18 100644
--- a/taverna-workbench-credential-manager-ui/pom.xml
+++ b/taverna-workbench-credential-manager-ui/pom.xml
@@ -31,17 +31,17 @@
</description>
<dependencies>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>menu-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>helper-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>workbench-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/c19de831/taverna-workbench-data-management-config-ui/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-data-management-config-ui/pom.xml b/taverna-workbench-data-management-config-ui/pom.xml
index 355cc5f..654865f 100644
--- a/taverna-workbench-data-management-config-ui/pom.xml
+++ b/taverna-workbench-data-management-config-ui/pom.xml
@@ -33,12 +33,12 @@
<version>${t2.lang.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>helper-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<!--<dependency>
- <groupId>net.sf.taverna.t2.ui-components</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>run-ui</artifactId>
<version>${project.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/c19de831/taverna-workbench-design-ui/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-design-ui/pom.xml b/taverna-workbench-design-ui/pom.xml
index 77533da..9046a52 100644
--- a/taverna-workbench-design-ui/pom.xml
+++ b/taverna-workbench-design-ui/pom.xml
@@ -28,22 +28,22 @@
<packaging>bundle</packaging>
<dependencies>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>activity-icons-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>edits-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>contextual-views-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>selection-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
@@ -53,7 +53,7 @@
<version>${t2.lang.version}</version>
</dependency>
<dependency>
- <groupId>uk.org.taverna.scufl2</groupId>
+ <groupId>org.apache.taverna.language</groupId>
<artifactId>scufl2-api</artifactId>
</dependency>
</dependencies>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/c19de831/taverna-workbench-edits-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-edits-api/pom.xml b/taverna-workbench-edits-api/pom.xml
index 59fab76..178b077 100644
--- a/taverna-workbench-edits-api/pom.xml
+++ b/taverna-workbench-edits-api/pom.xml
@@ -29,7 +29,7 @@
<description>API for doing workflow edits and undo.</description>
<dependencies>
<dependency>
- <groupId>uk.org.taverna.scufl2</groupId>
+ <groupId>org.apache.taverna.language</groupId>
<artifactId>scufl2-api</artifactId>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/c19de831/taverna-workbench-edits-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-edits-impl/pom.xml b/taverna-workbench-edits-impl/pom.xml
index 8e5c6a4..0e3e072 100644
--- a/taverna-workbench-edits-impl/pom.xml
+++ b/taverna-workbench-edits-impl/pom.xml
@@ -31,17 +31,17 @@
</description>
<dependencies>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>edits-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>menu-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>selection-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
@@ -51,7 +51,7 @@
<version>${t2.lang.version}</version>
</dependency>
<dependency>
- <groupId>uk.org.taverna.scufl2</groupId>
+ <groupId>org.apache.taverna.language</groupId>
<artifactId>scufl2-api</artifactId>
<version>${scufl2.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/c19de831/taverna-workbench-file-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-file-api/pom.xml b/taverna-workbench-file-api/pom.xml
index 0e4aa55..197cabf 100644
--- a/taverna-workbench-file-api/pom.xml
+++ b/taverna-workbench-file-api/pom.xml
@@ -40,7 +40,7 @@
<artifactId>observer</artifactId>
</dependency>
<dependency>
- <groupId>uk.org.taverna.scufl2</groupId>
+ <groupId>org.apache.taverna.language</groupId>
<artifactId>scufl2-api</artifactId>
</dependency>
</dependencies>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/c19de831/taverna-workbench-file-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-file-impl/pom.xml b/taverna-workbench-file-impl/pom.xml
index 4be85f1..c96712b 100644
--- a/taverna-workbench-file-impl/pom.xml
+++ b/taverna-workbench-file-impl/pom.xml
@@ -32,27 +32,27 @@
</description>
<dependencies>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>file-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>edits-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>helper-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>menu-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>workbench-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
@@ -67,7 +67,7 @@
<version>${taverna.configuration.version}</version>
</dependency>
<dependency>
- <groupId>uk.org.taverna.scufl2</groupId>
+ <groupId>org.apache.taverna.language</groupId>
<artifactId>scufl2-api</artifactId>
<version>${scufl2.version}</version>
</dependency>
@@ -99,19 +99,19 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-impl</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>edits-impl</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>uk.org.taverna.scufl2</groupId>
+ <groupId>org.apache.taverna.language</groupId>
<artifactId>scufl2-t2flow</artifactId>
<version>${scufl2.version}</version>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>uk.org.taverna.scufl2</groupId>
+ <groupId>org.apache.taverna.language</groupId>
<artifactId>scufl2-rdfxml</artifactId>
<version>${scufl2.version}</version>
<scope>test</scope>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/c19de831/taverna-workbench-graph-model/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-graph-model/pom.xml b/taverna-workbench-graph-model/pom.xml
index 88ee714..26dd8a2 100644
--- a/taverna-workbench-graph-model/pom.xml
+++ b/taverna-workbench-graph-model/pom.xml
@@ -82,27 +82,27 @@
</build>
<dependencies>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>configuration-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>edits-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>menu-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>selection-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-impl</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>configuration-impl</artifactId>
<version>${project.parent.version}</version>
</dependency>
@@ -117,7 +117,7 @@
<version>${t2.lang.version}</version>
</dependency>
<dependency>
- <groupId>uk.org.taverna.scufl2</groupId>
+ <groupId>org.apache.taverna.language</groupId>
<artifactId>scufl2-api</artifactId>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/c19de831/taverna-workbench-graph-view/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-graph-view/pom.xml b/taverna-workbench-graph-view/pom.xml
index efdd637..dcb0d3b 100644
--- a/taverna-workbench-graph-view/pom.xml
+++ b/taverna-workbench-graph-view/pom.xml
@@ -28,37 +28,37 @@
<name>Graph View</name>
<dependencies>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>workbench-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>configuration-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>file-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>menu-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-components</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>design-ui</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-components</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>workflow-view</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-components</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>graph-model</artifactId>
<version>${project.version}</version>
</dependency>
@@ -82,7 +82,7 @@
<artifactId>taverna-services-api</artifactId>
</dependency>
<dependency>
- <groupId>uk.org.taverna.scufl2</groupId>
+ <groupId>org.apache.taverna.language</groupId>
<artifactId>scufl2-api</artifactId>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/c19de831/taverna-workbench-helper-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-helper-api/pom.xml b/taverna-workbench-helper-api/pom.xml
index 4da2343..4b40e30 100644
--- a/taverna-workbench-helper-api/pom.xml
+++ b/taverna-workbench-helper-api/pom.xml
@@ -42,7 +42,7 @@
</build>
<dependencies>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>workbench-api</artifactId>
<version>${project.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/c19de831/taverna-workbench-helper/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-helper/pom.xml b/taverna-workbench-helper/pom.xml
index 2ad3e43..bdf1641 100644
--- a/taverna-workbench-helper/pom.xml
+++ b/taverna-workbench-helper/pom.xml
@@ -27,7 +27,7 @@
<name>Help System (legacy dependency)</name>
<dependencies>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>helper-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/c19de831/taverna-workbench-httpproxy-config/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-httpproxy-config/pom.xml b/taverna-workbench-httpproxy-config/pom.xml
index 5ed865b..9513f1c 100644
--- a/taverna-workbench-httpproxy-config/pom.xml
+++ b/taverna-workbench-httpproxy-config/pom.xml
@@ -38,7 +38,7 @@
<version>${taverna.configuration.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>helper-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/c19de831/taverna-workbench-iteration-strategy-ui/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-iteration-strategy-ui/pom.xml b/taverna-workbench-iteration-strategy-ui/pom.xml
index a61fe99..f143153 100644
--- a/taverna-workbench-iteration-strategy-ui/pom.xml
+++ b/taverna-workbench-iteration-strategy-ui/pom.xml
@@ -39,27 +39,27 @@
<version>${t2.lang.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>workbench-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>contextual-views-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>edits-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>file-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>helper-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/c19de831/taverna-workbench-loop-ui/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-loop-ui/pom.xml b/taverna-workbench-loop-ui/pom.xml
index 1250986..36130b4 100644
--- a/taverna-workbench-loop-ui/pom.xml
+++ b/taverna-workbench-loop-ui/pom.xml
@@ -28,24 +28,24 @@
<name>Loop layer contextual view</name>
<dependencies>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>contextual-views-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>file-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>edits-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>helper-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
@@ -56,26 +56,26 @@
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-impl</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>edits-impl</artifactId>
<version>${project.parent.version}</version>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-impl</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>file-impl</artifactId>
<version>${project.parent.version}</version>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-impl</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>contextual-views-impl</artifactId>
<version>${project.parent.version}</version>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-impl</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>selection-impl</artifactId>
<version>${project.parent.version}</version>
<scope>test</scope>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/c19de831/taverna-workbench-menu-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-menu-api/pom.xml b/taverna-workbench-menu-api/pom.xml
index 90130b8..1758bfe 100644
--- a/taverna-workbench-menu-api/pom.xml
+++ b/taverna-workbench-menu-api/pom.xml
@@ -30,7 +30,7 @@
<dependencies>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>selection-api</artifactId>
<version>${project.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/c19de831/taverna-workbench-menu-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-menu-impl/pom.xml b/taverna-workbench-menu-impl/pom.xml
index 33df6ea..b9898ed 100644
--- a/taverna-workbench-menu-impl/pom.xml
+++ b/taverna-workbench-menu-impl/pom.xml
@@ -43,17 +43,17 @@
</build>
<dependencies>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>workbench-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>menu-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>helper-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/c19de831/taverna-workbench-menu-items/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-menu-items/pom.xml b/taverna-workbench-menu-items/pom.xml
index dc4c66c..07566e2 100644
--- a/taverna-workbench-menu-items/pom.xml
+++ b/taverna-workbench-menu-items/pom.xml
@@ -28,37 +28,37 @@
<name>Additional menu items</name>
<dependencies>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>menu-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>report-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>selection-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>workbench-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-components</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>design-ui</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-components</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>graph-view</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-components</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>workflow-view</artifactId>
<version>${project.parent.version}</version>
</dependency>
@@ -80,7 +80,7 @@
</dependency>
<!-- TODO remove dependencies on implementations -->
<dependency>
- <groupId>net.sf.taverna.t2.ui-impl</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>contextual-views-impl</artifactId>
<version>${project.parent.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/c19de831/taverna-workbench-monitor-view/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-monitor-view/pom.xml b/taverna-workbench-monitor-view/pom.xml
index 70762ad..2e3b3f6 100644
--- a/taverna-workbench-monitor-view/pom.xml
+++ b/taverna-workbench-monitor-view/pom.xml
@@ -28,22 +28,22 @@
<name>Monitor View</name>
<dependencies>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>workbench-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-components</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>graph-model</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-components</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>results-view</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-components</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>graph-view</artifactId>
<version>${project.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/c19de831/taverna-workbench-parallelize-ui/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-parallelize-ui/pom.xml b/taverna-workbench-parallelize-ui/pom.xml
index 799de45..e74c474 100644
--- a/taverna-workbench-parallelize-ui/pom.xml
+++ b/taverna-workbench-parallelize-ui/pom.xml
@@ -28,22 +28,22 @@
<name>Parallelize layer contextual view</name>
<dependencies>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>contextual-views-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>menu-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>edits-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>selection-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/c19de831/taverna-workbench-perspective-biocatalogue/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-perspective-biocatalogue/pom.xml b/taverna-workbench-perspective-biocatalogue/pom.xml
index 3750fda..f967fc4 100644
--- a/taverna-workbench-perspective-biocatalogue/pom.xml
+++ b/taverna-workbench-perspective-biocatalogue/pom.xml
@@ -38,7 +38,7 @@
</repositories>
<dependencies>
- <!-- <dependency> <groupId>net.sf.taverna.t2.ui-api</groupId> <artifactId>perspective-core</artifactId>
+ <!-- <dependency> <groupId>${project.parent.groupId}</groupId> <artifactId>perspective-core</artifactId>
<version>${project.parent.version}</version> </dependency> -->
<dependency>
<groupId>net.sf.taverna.t2.core</groupId>
@@ -46,12 +46,12 @@
<version>${t2.core.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>menu-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>file-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
@@ -63,7 +63,7 @@
<!-- required for providing contextual views in the bottom-left area of
Design perspective -->
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>contextual-views-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
@@ -81,13 +81,13 @@
</dependency>
<!-- required for inserting a processor into the current workflow -->
<dependency>
- <groupId>net.sf.taverna.t2.ui-components</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>workflow-view</artifactId>
<version>${project.parent.version}</version>
</dependency>
<!-- required registering with and opening help window -->
<dependency>
- <groupId>net.sf.taverna.t2.ui-impl</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>helper</artifactId>
<version>${project.parent.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/c19de831/taverna-workbench-perspective-design/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-perspective-design/pom.xml b/taverna-workbench-perspective-design/pom.xml
index eadee0f..627c52c 100644
--- a/taverna-workbench-perspective-design/pom.xml
+++ b/taverna-workbench-perspective-design/pom.xml
@@ -28,52 +28,52 @@
<name>Design perspective</name>
<dependencies>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>edits-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>file-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>menu-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>report-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>selection-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>workbench-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-components</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>activity-palette-ui</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-components</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>graph-view</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-components</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>workflow-explorer</artifactId>
<version>${project.parent.version}</version>
</dependency>
<!-- <dependency>
- <groupId>net.sf.taverna.t2.ui-components</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>report-view</artifactId>
<version>${project.parent.version}</version>
</dependency> -->
@@ -84,7 +84,7 @@
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-impl</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>contextual-views-impl</artifactId>
<version>${project.parent.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/c19de831/taverna-workbench-perspective-myexperiment/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-perspective-myexperiment/pom.xml b/taverna-workbench-perspective-myexperiment/pom.xml
index 370cc97..82dded6 100644
--- a/taverna-workbench-perspective-myexperiment/pom.xml
+++ b/taverna-workbench-perspective-myexperiment/pom.xml
@@ -51,17 +51,17 @@
<dependencies>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>menu-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>workbench-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>file-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/c19de831/taverna-workbench-perspective-results/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-perspective-results/pom.xml b/taverna-workbench-perspective-results/pom.xml
index a00d1ac..44ee583 100644
--- a/taverna-workbench-perspective-results/pom.xml
+++ b/taverna-workbench-perspective-results/pom.xml
@@ -30,22 +30,22 @@
intermediate and final results, as well as previous workflow runs.</description>
<dependencies>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>selection-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>workbench-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-components</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>monitor-view</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-components</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>results-view</artifactId>
<version>${project.parent.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/c19de831/taverna-workbench-plugin-manager/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-plugin-manager/pom.xml b/taverna-workbench-plugin-manager/pom.xml
index 9168aa3..dc996d1 100644
--- a/taverna-workbench-plugin-manager/pom.xml
+++ b/taverna-workbench-plugin-manager/pom.xml
@@ -28,12 +28,12 @@
<name>Taverna Workbench Plugin Manager</name>
<dependencies>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>menu-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>workbench-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/c19de831/taverna-workbench-plugins-gui/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-plugins-gui/pom.xml b/taverna-workbench-plugins-gui/pom.xml
index 2d5b3dd..d3eca15 100644
--- a/taverna-workbench-plugins-gui/pom.xml
+++ b/taverna-workbench-plugins-gui/pom.xml
@@ -27,12 +27,12 @@
<name>Raven plugin manager GUI</name>
<dependencies>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>workbench-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>helper-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/c19de831/taverna-workbench-reference-ui/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-reference-ui/pom.xml b/taverna-workbench-reference-ui/pom.xml
index 2e3e223..cd6153e 100644
--- a/taverna-workbench-reference-ui/pom.xml
+++ b/taverna-workbench-reference-ui/pom.xml
@@ -34,17 +34,17 @@
<dependencies>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>report-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-components</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>graph-view</artifactId>
<version>${project.version}</version>
</dependency>
<!-- <dependency>
- <groupId>net.sf.taverna.t2.ui-components</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>report-view</artifactId>
<version>${project.version}</version>
</dependency> -->
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/c19de831/taverna-workbench-renderers-exts/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-renderers-exts/pom.xml b/taverna-workbench-renderers-exts/pom.xml
index aa2b0f3..3bfa11e 100644
--- a/taverna-workbench-renderers-exts/pom.xml
+++ b/taverna-workbench-renderers-exts/pom.xml
@@ -27,12 +27,12 @@
<name>Renderers extensions</name>
<dependencies>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>renderers-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-impl</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>workbench-impl</artifactId>
<version>${project.parent.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/c19de831/taverna-workbench-renderers-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-renderers-impl/pom.xml b/taverna-workbench-renderers-impl/pom.xml
index a49783e..2355130 100644
--- a/taverna-workbench-renderers-impl/pom.xml
+++ b/taverna-workbench-renderers-impl/pom.xml
@@ -42,7 +42,7 @@
</build>
<dependencies>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>renderers-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/c19de831/taverna-workbench-report-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-report-api/pom.xml b/taverna-workbench-report-api/pom.xml
index bc5f75e..a692450 100644
--- a/taverna-workbench-report-api/pom.xml
+++ b/taverna-workbench-report-api/pom.xml
@@ -36,11 +36,11 @@
<artifactId>taverna-configuration-api</artifactId>
</dependency>
<dependency>
- <groupId>uk.org.taverna.scufl2</groupId>
+ <groupId>org.apache.taverna.language</groupId>
<artifactId>scufl2-api</artifactId>
</dependency>
<dependency>
- <groupId>uk.org.taverna.scufl2</groupId>
+ <groupId>org.apache.taverna.language</groupId>
<artifactId>scufl2-validation</artifactId>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/c19de831/taverna-workbench-report-explainer/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-report-explainer/pom.xml b/taverna-workbench-report-explainer/pom.xml
index 09ef9d6..cf9f5ac 100644
--- a/taverna-workbench-report-explainer/pom.xml
+++ b/taverna-workbench-report-explainer/pom.xml
@@ -31,12 +31,12 @@
</description>
<dependencies>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>report-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-exts</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>retry-ui</artifactId>
<version>${project.version}</version>
</dependency>
@@ -71,27 +71,27 @@
<version>${t2.core.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>edits-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>file-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-impl</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>configuration-impl</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-components</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>report-view</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-components</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>design-ui</artifactId>
<version>${project.parent.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/c19de831/taverna-workbench-report-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-report-impl/pom.xml b/taverna-workbench-report-impl/pom.xml
index 8a88a89..ee86323 100644
--- a/taverna-workbench-report-impl/pom.xml
+++ b/taverna-workbench-report-impl/pom.xml
@@ -33,17 +33,17 @@
<version>${t2.core.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>report-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>file-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>edits-api</artifactId>
<version>${project.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/c19de831/taverna-workbench-report-view/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-report-view/pom.xml b/taverna-workbench-report-view/pom.xml
index f095fad..c130d57 100644
--- a/taverna-workbench-report-view/pom.xml
+++ b/taverna-workbench-report-view/pom.xml
@@ -41,47 +41,47 @@
<version>${t2.lang.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>edits-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>report-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>file-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>helper-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>menu-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>workbench-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<!-- <dependency>
- <groupId>net.sf.taverna.t2.ui-impl</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>workbench-impl</artifactId>
<version>${project.parent.version}</version>
</dependency>
--> <dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>configuration-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-components</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>workflow-view</artifactId>
<version>${project.parent.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/c19de831/taverna-workbench-results-view/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-results-view/pom.xml b/taverna-workbench-results-view/pom.xml
index e576519..941ec9b 100644
--- a/taverna-workbench-results-view/pom.xml
+++ b/taverna-workbench-results-view/pom.xml
@@ -52,22 +52,22 @@
<version>${t2.baclava.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>menu-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>workbench-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>renderers-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-components</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>graph-view</artifactId>
<version>${project.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/c19de831/taverna-workbench-retry-ui/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-retry-ui/pom.xml b/taverna-workbench-retry-ui/pom.xml
index 5345c61..6a21450 100644
--- a/taverna-workbench-retry-ui/pom.xml
+++ b/taverna-workbench-retry-ui/pom.xml
@@ -28,22 +28,22 @@
<name>Retry layer contextual view</name>
<dependencies>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>contextual-views-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>menu-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>edits-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>selection-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/c19de831/taverna-workbench-run-ui/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-run-ui/pom.xml b/taverna-workbench-run-ui/pom.xml
index 79c5cac..20dcd95 100644
--- a/taverna-workbench-run-ui/pom.xml
+++ b/taverna-workbench-run-ui/pom.xml
@@ -28,27 +28,27 @@
<name>Results UI</name>
<dependencies>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>menu-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>report-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>workbench-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>file-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-components</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>reference-ui</artifactId>
<version>${project.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/c19de831/taverna-workbench-selection-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-selection-api/pom.xml b/taverna-workbench-selection-api/pom.xml
index 33bf821..7697433 100644
--- a/taverna-workbench-selection-api/pom.xml
+++ b/taverna-workbench-selection-api/pom.xml
@@ -30,13 +30,13 @@
<dependencies>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>workbench-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>uk.org.taverna.scufl2</groupId>
+ <groupId>org.apache.taverna.language</groupId>
<artifactId>scufl2-api</artifactId>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/c19de831/taverna-workbench-selection-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-selection-impl/pom.xml b/taverna-workbench-selection-impl/pom.xml
index 6adac93..627ed8d 100644
--- a/taverna-workbench-selection-impl/pom.xml
+++ b/taverna-workbench-selection-impl/pom.xml
@@ -28,17 +28,17 @@
<name>Selection Implementation</name>
<dependencies>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>edits-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>file-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>selection-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/c19de831/taverna-workbench-update-manager/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-update-manager/pom.xml b/taverna-workbench-update-manager/pom.xml
index 392f9be..b7b724e 100644
--- a/taverna-workbench-update-manager/pom.xml
+++ b/taverna-workbench-update-manager/pom.xml
@@ -29,7 +29,7 @@
<name>Taverna Workbench Update Manager</name>
<dependencies>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>menu-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/c19de831/taverna-workbench-workbench-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-workbench-impl/pom.xml b/taverna-workbench-workbench-impl/pom.xml
index c6fb5dd..6200015 100644
--- a/taverna-workbench-workbench-impl/pom.xml
+++ b/taverna-workbench-workbench-impl/pom.xml
@@ -43,37 +43,37 @@
</build>
<dependencies>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>workbench-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>edits-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>configuration-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>file-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>helper-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>menu-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>selection-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
@@ -103,7 +103,7 @@
<version>${taverna.configuration.version}</version>
</dependency>
<dependency>
- <groupId>uk.org.taverna.scufl2</groupId>
+ <groupId>org.apache.taverna.language</groupId>
<artifactId>scufl2-api</artifactId>
<version>${scufl2.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/c19de831/taverna-workbench-workflow-explorer/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-workflow-explorer/pom.xml b/taverna-workbench-workflow-explorer/pom.xml
index 36c14b0..855e1f3 100644
--- a/taverna-workbench-workflow-explorer/pom.xml
+++ b/taverna-workbench-workflow-explorer/pom.xml
@@ -29,47 +29,47 @@
<description>Workflow Explorer</description>
<dependencies>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>workbench-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>file-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>report-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-impl</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>menu-impl</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>activity-icons-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-components</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>design-ui</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-impl</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>helper</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-impl</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>workbench-impl</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-components</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>workflow-view</artifactId>
<version>${project.version}</version>
</dependency>
@@ -78,7 +78,7 @@
<artifactId>taverna-services-api</artifactId>
</dependency>
<dependency>
- <groupId>uk.org.taverna.scufl2</groupId>
+ <groupId>org.apache.taverna.language</groupId>
<artifactId>scufl2-api</artifactId>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/c19de831/taverna-workbench-workflow-view/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-workflow-view/pom.xml b/taverna-workbench-workflow-view/pom.xml
index c80d7b5..4147d56 100644
--- a/taverna-workbench-workflow-view/pom.xml
+++ b/taverna-workbench-workflow-view/pom.xml
@@ -43,32 +43,32 @@
<version>${t2.lang.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>workbench-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>edits-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>activity-palette-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>contextual-views-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>activity-tools</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-components</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>design-ui</artifactId>
<version>${project.version}</version>
</dependency>
@@ -77,7 +77,7 @@
<artifactId>taverna-services-api</artifactId>
</dependency>
<dependency>
- <groupId>uk.org.taverna.scufl2</groupId>
+ <groupId>org.apache.taverna.language</groupId>
<artifactId>scufl2-api</artifactId>
</dependency>
[45/50] [abbrv] incubator-taverna-workbench git commit: taverna-*
Posted by st...@apache.org.
taverna-*
.. and observer goes, as it's already in taverna-engine
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/commit/f676ef35
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/tree/f676ef35
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/diff/f676ef35
Branch: refs/heads/master
Commit: f676ef352e740a17bcc03aee32f72c98276c3c47
Parents: f0af04e
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Fri Mar 6 22:28:07 2015 +0000
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Fri Mar 6 22:28:07 2015 +0000
----------------------------------------------------------------------
README.md | 3 -
beans/pom.xml | 21 -
.../t2/lang/beans/PropertyAnnotated.java | 74 ---
.../t2/lang/beans/PropertyAnnotation.java | 109 ---
.../lang/beans/PropertyAnnotationExtractor.java | 202 ------
io/pom.xml | 21 -
.../net/sf/taverna/t2/lang/io/StreamCopier.java | 69 --
.../sf/taverna/t2/lang/io/StreamDevourer.java | 106 ---
observer/pom.xml | 28 -
.../taverna/t2/lang/observer/MultiCaster.java | 93 ---
.../sf/taverna/t2/lang/observer/Observable.java | 56 --
.../sf/taverna/t2/lang/observer/Observer.java | 44 --
.../t2/lang/observer/SwingAwareObserver.java | 51 --
.../taverna/t2/lang/observer/package-info.java | 73 ---
.../taverna/t2/lang/observer/ObserverTest.java | 133 ----
partition/pom.xml | 23 -
.../sf/taverna/t2/partition/HashSetModel.java | 116 ----
.../net/sf/taverna/t2/partition/Partition.java | 441 -------------
.../t2/partition/PartitionAlgorithm.java | 47 --
.../t2/partition/PartitionAlgorithmSetSPI.java | 36 -
.../t2/partition/PropertyExtractorRegistry.java | 37 --
.../t2/partition/PropertyExtractorSPI.java | 44 --
.../java/net/sf/taverna/t2/partition/Query.java | 56 --
.../sf/taverna/t2/partition/RootPartition.java | 394 -----------
.../net/sf/taverna/t2/partition/SetModel.java | 53 --
.../t2/partition/SetModelChangeListener.java | 42 --
.../algorithms/CustomPartitionAlgorithm.java | 98 ---
.../LiteralValuePartitionAlgorithm.java | 106 ---
.../ui/PartitionAlgorithmListEditor.java | 224 -------
.../t2/partition/ui/TableTreeNodeColumn.java | 69 --
.../t2/partition/ui/TableTreeNodeRenderer.java | 554 ----------------
.../net/sf/taverna/t2/partition/ui/UITest.java | 58 --
.../t2/partition/PartitionTestApplication.java | 280 --------
.../LiteralValuePartitionAlgorithmTest.java | 68 --
taverna-beaninfo/pom.xml | 21 +
.../t2/lang/beans/PropertyAnnotated.java | 74 +++
.../t2/lang/beans/PropertyAnnotation.java | 109 +++
.../lang/beans/PropertyAnnotationExtractor.java | 202 ++++++
taverna-io/pom.xml | 21 +
.../net/sf/taverna/t2/lang/io/StreamCopier.java | 69 ++
.../sf/taverna/t2/lang/io/StreamDevourer.java | 106 +++
taverna-partition/pom.xml | 23 +
.../sf/taverna/t2/partition/HashSetModel.java | 116 ++++
.../net/sf/taverna/t2/partition/Partition.java | 441 +++++++++++++
.../t2/partition/PartitionAlgorithm.java | 47 ++
.../t2/partition/PartitionAlgorithmSetSPI.java | 36 +
.../t2/partition/PropertyExtractorRegistry.java | 37 ++
.../t2/partition/PropertyExtractorSPI.java | 44 ++
.../java/net/sf/taverna/t2/partition/Query.java | 56 ++
.../sf/taverna/t2/partition/RootPartition.java | 394 +++++++++++
.../net/sf/taverna/t2/partition/SetModel.java | 53 ++
.../t2/partition/SetModelChangeListener.java | 42 ++
.../algorithms/CustomPartitionAlgorithm.java | 98 +++
.../LiteralValuePartitionAlgorithm.java | 106 +++
.../ui/PartitionAlgorithmListEditor.java | 224 +++++++
.../t2/partition/ui/TableTreeNodeColumn.java | 69 ++
.../t2/partition/ui/TableTreeNodeRenderer.java | 554 ++++++++++++++++
.../net/sf/taverna/t2/partition/ui/UITest.java | 58 ++
.../t2/partition/PartitionTestApplication.java | 280 ++++++++
.../LiteralValuePartitionAlgorithmTest.java | 68 ++
taverna-ui/pom.xml | 36 +
.../net/sf/taverna/t2/lang/ui/CArrowImage.java | 198 ++++++
.../t2/lang/ui/CTransferableTreePath.java | 66 ++
.../taverna/t2/lang/ui/DeselectingButton.java | 45 ++
.../sf/taverna/t2/lang/ui/DialogTextArea.java | 83 +++
.../sf/taverna/t2/lang/ui/EdgeLineBorder.java | 91 +++
.../sf/taverna/t2/lang/ui/EditorKeySetUtil.java | 67 ++
.../taverna/t2/lang/ui/ExtensionFileFilter.java | 105 +++
.../net/sf/taverna/t2/lang/ui/FileTools.java | 117 ++++
.../net/sf/taverna/t2/lang/ui/HtmlUtils.java | 87 +++
.../sf/taverna/t2/lang/ui/JSplitPaneExt.java | 56 ++
.../sf/taverna/t2/lang/ui/KeywordDocument.java | 568 ++++++++++++++++
.../t2/lang/ui/LineEnabledTextPanel.java | 106 +++
.../net/sf/taverna/t2/lang/ui/LinePainter.java | 163 +++++
.../t2/lang/ui/LineWrappingTextArea.java | 217 ++++++
.../sf/taverna/t2/lang/ui/NoWrapEditorKit.java | 77 +++
.../sf/taverna/t2/lang/ui/ReadOnlyTextArea.java | 50 ++
.../t2/lang/ui/SanitisingDocumentFilter.java | 60 ++
.../net/sf/taverna/t2/lang/ui/ShadedLabel.java | 126 ++++
.../net/sf/taverna/t2/lang/ui/TableMap.java | 69 ++
.../net/sf/taverna/t2/lang/ui/TableSorter.java | 341 ++++++++++
.../t2/lang/ui/ValidatingUserInputDialog.java | 274 ++++++++
.../net/sf/taverna/t2/lang/ui/icons/Icons.java | 48 ++
.../lang/ui/tabselector/ScrollController.java | 85 +++
.../sf/taverna/t2/lang/ui/tabselector/Tab.java | 200 ++++++
.../t2/lang/ui/tabselector/TabLayout.java | 135 ++++
.../ui/tabselector/TabSelectorComponent.java | 99 +++
.../lang/ui/treetable/AbstractCellEditor.java | 81 +++
.../ui/treetable/AbstractTreeTableModel.java | 198 ++++++
.../t2/lang/ui/treetable/JTreeTable.LICENSE | 59 ++
.../t2/lang/ui/treetable/JTreeTable.java | 657 +++++++++++++++++++
.../t2/lang/ui/treetable/LinesBorder.java | 178 +++++
.../t2/lang/ui/treetable/TreeTableModel.java | 69 ++
.../ui/treetable/TreeTableModelAdapter.java | 132 ++++
.../net/sf/taverna/t2/lang/ui/icons/ok.png | Bin 0 -> 3318 bytes
.../net/sf/taverna/t2/lang/ui/icons/severe.png | Bin 0 -> 867 bytes
.../net/sf/taverna/t2/lang/ui/icons/warning.png | Bin 0 -> 3459 bytes
ui/pom.xml | 36 -
.../net/sf/taverna/t2/lang/ui/CArrowImage.java | 198 ------
.../t2/lang/ui/CTransferableTreePath.java | 66 --
.../taverna/t2/lang/ui/DeselectingButton.java | 45 --
.../sf/taverna/t2/lang/ui/DialogTextArea.java | 83 ---
.../sf/taverna/t2/lang/ui/EdgeLineBorder.java | 91 ---
.../sf/taverna/t2/lang/ui/EditorKeySetUtil.java | 67 --
.../taverna/t2/lang/ui/ExtensionFileFilter.java | 105 ---
.../net/sf/taverna/t2/lang/ui/FileTools.java | 117 ----
.../net/sf/taverna/t2/lang/ui/HtmlUtils.java | 87 ---
.../sf/taverna/t2/lang/ui/JSplitPaneExt.java | 56 --
.../sf/taverna/t2/lang/ui/KeywordDocument.java | 568 ----------------
.../t2/lang/ui/LineEnabledTextPanel.java | 106 ---
.../net/sf/taverna/t2/lang/ui/LinePainter.java | 163 -----
.../t2/lang/ui/LineWrappingTextArea.java | 217 ------
.../sf/taverna/t2/lang/ui/NoWrapEditorKit.java | 77 ---
.../sf/taverna/t2/lang/ui/ReadOnlyTextArea.java | 50 --
.../t2/lang/ui/SanitisingDocumentFilter.java | 60 --
.../net/sf/taverna/t2/lang/ui/ShadedLabel.java | 126 ----
.../net/sf/taverna/t2/lang/ui/TableMap.java | 69 --
.../net/sf/taverna/t2/lang/ui/TableSorter.java | 341 ----------
.../t2/lang/ui/ValidatingUserInputDialog.java | 274 --------
.../net/sf/taverna/t2/lang/ui/icons/Icons.java | 48 --
.../lang/ui/tabselector/ScrollController.java | 85 ---
.../sf/taverna/t2/lang/ui/tabselector/Tab.java | 200 ------
.../t2/lang/ui/tabselector/TabLayout.java | 135 ----
.../ui/tabselector/TabSelectorComponent.java | 99 ---
.../lang/ui/treetable/AbstractCellEditor.java | 81 ---
.../ui/treetable/AbstractTreeTableModel.java | 198 ------
.../t2/lang/ui/treetable/JTreeTable.LICENSE | 59 --
.../t2/lang/ui/treetable/JTreeTable.java | 657 -------------------
.../t2/lang/ui/treetable/LinesBorder.java | 178 -----
.../t2/lang/ui/treetable/TreeTableModel.java | 69 --
.../ui/treetable/TreeTableModelAdapter.java | 132 ----
.../net/sf/taverna/t2/lang/ui/icons/ok.png | Bin 3318 -> 0 bytes
.../net/sf/taverna/t2/lang/ui/icons/severe.png | Bin 867 -> 0 bytes
.../net/sf/taverna/t2/lang/ui/icons/warning.png | Bin 3459 -> 0 bytes
134 files changed, 8291 insertions(+), 8772 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
deleted file mode 100644
index 58d1f52..0000000
--- a/README.md
+++ /dev/null
@@ -1,3 +0,0 @@
-Taverna Workflow system assorted support utilities
-
-This code was previously hosted at http://taverna.googlecode.com/svn/taverna/utils/net.sf.taverna.t2.lang/
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/beans/pom.xml
----------------------------------------------------------------------
diff --git a/beans/pom.xml b/beans/pom.xml
deleted file mode 100644
index ea51b1a..0000000
--- a/beans/pom.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<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>net.sf.taverna.t2</groupId>
- <artifactId>lang</artifactId>
- <version>2.0.1-SNAPSHOT</version>
- </parent>
- <groupId>net.sf.taverna.t2.lang</groupId>
- <artifactId>beans</artifactId>
- <packaging>bundle</packaging>
- <name>BeanInfo extensions</name>
- <dependencies>
- <dependency>
- <groupId>org.apache.log4j</groupId>
- <artifactId>com.springsource.org.apache.log4j</artifactId>
- <version>${log4j.version}</version>
- </dependency>
- </dependencies>
-</project>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/beans/src/main/java/net/sf/taverna/t2/lang/beans/PropertyAnnotated.java
----------------------------------------------------------------------
diff --git a/beans/src/main/java/net/sf/taverna/t2/lang/beans/PropertyAnnotated.java b/beans/src/main/java/net/sf/taverna/t2/lang/beans/PropertyAnnotated.java
deleted file mode 100644
index aa59e68..0000000
--- a/beans/src/main/java/net/sf/taverna/t2/lang/beans/PropertyAnnotated.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/**********************************************************************
- * Copyright (C) 2009 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- **********************************************************************/
-package net.sf.taverna.t2.lang.beans;
-
-import java.beans.BeanInfo;
-import java.beans.Introspector;
-import java.beans.PropertyDescriptor;
-import java.beans.SimpleBeanInfo;
-
-/**
- * A {@link BeanInfo} that includes {@link PropertyDescriptor}s from methods
- * annotated using {@link PropertyAnnotation}.
- * <p>
- * The bean info from the PropertyAnnotation will then be available through
- * Java's {@link Introspector}, and allows you to specify details such as
- * {@link PropertyAnnotation#displayName()} and
- * {@link PropertyAnnotation#hidden()} for the properties of a Java Bean.
- * <p>
- * This class can either be used as a superclass for the classes containing
- * property annotated methods, or put in a neighbouring BeanInfo class.
- * <p>
- * For instance, if your class is called DescribedClass and has methods
- * annotated using {@link PropertyAnnotation}, either let DescribedClass
- * subclass {@link PropertyAnnotated}, or make a neighbouring {@link BeanInfo}
- * class called DescribedClassBeanInfo, which should subclass
- * {@link PropertyAnnotated}.
- *
- *
- * @author Stian Soiland-Reyes
- *
- */
-public class PropertyAnnotated extends SimpleBeanInfo {
-
- private static PropertyAnnotationExtractor extractor = new PropertyAnnotationExtractor();
-
- /**
- * {@inheritDoc}
- */
- @Override
- public PropertyDescriptor[] getPropertyDescriptors() {
- return extractor.getPropertyDescriptors(getDescribedClass());
- }
-
- /**
- * The class that is being described. By default this returns
- * {@link #getClass()} so that {@link PropertyAnnotated} can be used as a
- * superclass, but if instead the DescribedClassBeanInfo pattern is used,
- * subclass PropertyAnnotated in each BeanInfo class, and override this
- * method to return the described class. (DescribedClass in this example)
- *
- */
- public Class<?> getDescribedClass() {
- return getClass();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/beans/src/main/java/net/sf/taverna/t2/lang/beans/PropertyAnnotation.java
----------------------------------------------------------------------
diff --git a/beans/src/main/java/net/sf/taverna/t2/lang/beans/PropertyAnnotation.java b/beans/src/main/java/net/sf/taverna/t2/lang/beans/PropertyAnnotation.java
deleted file mode 100644
index 5923a21..0000000
--- a/beans/src/main/java/net/sf/taverna/t2/lang/beans/PropertyAnnotation.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/**********************************************************************
- * Copyright (C) 2009 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- **********************************************************************/
-package net.sf.taverna.t2.lang.beans;
-
-import java.beans.Introspector;
-import java.beans.PropertyDescriptor;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * An annotation of a Java bean style property method, ie. a getXX() or setXX()
- * method.
- * <p>
- * The annotations allow the method to better describe properties such as
- * {@link #displayName()}, {@link #shortDescription()} and {@link #hidden()}.
- * <p>
- * The annotations can be retrieved as {@link PropertyDescriptor} using
- * {@link PropertyAnnotationExtractor}, or if {@link PropertyAnnotated} has been
- * used (recommended), through Java's BeanInfo support, such as using
- * {@link Introspector}.
- * <p>
- * Annotations can be applied to interfaces or classes, abstract and normal
- * methods, as long as they confirm with the Java bean conventions. Annotations
- * will be inherited, so overriding methods don't need to reapply the annotations,
- * although they can if they want to override.
- * <p>
- * It is recommended that classes using these annotations either subclass
- * {@link PropertyAnnotated} or have a neighbouring BeanInfo class that
- * subclasses PropertyAnnotated.
- * <p>
- * Example usage:
- *
- * <pre>
- * public interface MyBean {
- * // Annotation for the property called "name". displayName: Title
- * // of the property shown in UI instead of "name".
- * @PropertyAnnotation(displayName = "Full name")
- * public String getName();
- *
- * // Second annotation for the write-method of the same property called
- * // "name". Both displayName and shortDescription will be set on the
- * // property descriptor.
- * @PropertyAnnotation(shortDescription = "The name of the person")
- * public void setName(String name);
- *
- * // Boolean read method for the property "married", two annotations.
- * // expert: Only shown in UI under "advanced" views.
- * @PropertyAnnotation(expert = true, shortDescription = "Marital status")
- * public boolean isMarried();
- *
- * // Write-method for the "married" property, no new annotations, but will
- * // get the ones from {@link #isMarried()}.
- * public void setMarried(boolean married);
- *
- * // Write-only method, hidden (not shown in UIs).
- * @PropertyAnnotation(hidden = true)
- * public void setID(String id);
- *
- * // Read-only method, no annotations, defaults will be used.
- * public void getTelephoneNumber(String number);
- * }
- * </pre>
- *
- * @see PropertyAnnotated
- * @author Stian Soiland-Reyes
- *
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target( { ElementType.METHOD })
-public @interface PropertyAnnotation {
-
- /**
- * A unique string that means the default should be used
- */
- public static String DEFAULT = "Default_8930B86A-50C0-4859-9B6F-DD034B3C5C1E";
-
- String displayName() default DEFAULT;
-
- String name() default DEFAULT;
-
- String shortDescription() default DEFAULT;
-
- boolean expert() default false;
-
- boolean hidden() default false;
-
- boolean preferred() default false;
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/beans/src/main/java/net/sf/taverna/t2/lang/beans/PropertyAnnotationExtractor.java
----------------------------------------------------------------------
diff --git a/beans/src/main/java/net/sf/taverna/t2/lang/beans/PropertyAnnotationExtractor.java b/beans/src/main/java/net/sf/taverna/t2/lang/beans/PropertyAnnotationExtractor.java
deleted file mode 100644
index 4524822..0000000
--- a/beans/src/main/java/net/sf/taverna/t2/lang/beans/PropertyAnnotationExtractor.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/**********************************************************************
- * Copyright (C) 2009 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- **********************************************************************/
-package net.sf.taverna.t2.lang.beans;
-
-import java.beans.IntrospectionException;
-import java.beans.PropertyDescriptor;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.WeakHashMap;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * A utility class for extracting {@link PropertyDescriptor}s from a class which
- * methods have been described using {@link PropertyAnnotation}.
- *
- * @author Stian Soiland-Reyes
- *
- */
-public class PropertyAnnotationExtractor {
-
- protected static Pattern methodPattern = Pattern
- .compile("(get|is|set)(.+)");
-
- protected WeakHashMap<Class<?>, List<Method>> allMethodsCache = new WeakHashMap<Class<?>, List<Method>>();
-
- protected WeakHashMap<Class<?>, PropertyDescriptor[]> propertyDescriptorsCache = new WeakHashMap<Class<?>, PropertyDescriptor[]>();
-
- @SuppressWarnings("unchecked")
- protected List<Class> ignoreClasses = Arrays.<Class>asList(Class.class, Object.class, PropertyAnnotated.class);
-
- /**
- * Find PropertyDescriptors for the given bean class based on descriptions
- * using {@link PropertyAnnotation}s.
- * <p>
- * Annotations will be inherited from interfaces and superclasses.
- *
- * @param beanClass
- * @return Array of {@link PropertyDescriptor}
- */
- public PropertyDescriptor[] getPropertyDescriptors(Class<?> beanClass) {
- PropertyDescriptor[] cached = propertyDescriptorsCache.get(beanClass);
- if (cached != null) {
- return cached;
- }
-
- Map<String, PropertyDescriptor> descriptors = new HashMap<String, PropertyDescriptor>();
-
- for (Method method : allMethods(beanClass)) {
- PropertyAnnotation annotation = method
- .getAnnotation(PropertyAnnotation.class);
- Matcher methodMatcher = methodPattern.matcher(method.getName());
- if (!methodMatcher.matches() && annotation == null) {
- continue;
- }
-
- String name = PropertyAnnotation.DEFAULT;
- if (annotation != null) {
- annotation.name();
- }
- if (name.equals(PropertyAnnotation.DEFAULT)) {
- name = methodMatcher.group(2);
- if (name.length() < 1) {
- continue;
- }
- // decapitalize first letter
- name = name.substring(0, 1).toLowerCase() + name.substring(1);
- }
- Method writeMethod = null;
- Method readMethod = null;
- if (methodMatcher.group(1).equals("set")) {
- writeMethod = method;
- if (writeMethod.getParameterTypes().length != 1) {
- continue;
- }
- } else {
- readMethod = method;
- if (readMethod.getParameterTypes().length != 0) {
- continue;
- }
- }
-
- PropertyDescriptor descriptor = descriptors.get(name);
- try {
- if (descriptor == null) {
- descriptor = new PropertyDescriptor(name, readMethod,
- writeMethod);
- descriptors.put(name, descriptor);
- }
- // Set the one we just found
- if (readMethod != null) {
- descriptor.setReadMethod(readMethod);
- }
- if (writeMethod != null) {
- descriptor.setWriteMethod(writeMethod);
- }
- } catch (IntrospectionException ex) {
- throw new RuntimeException("Can't inspect property " + name
- + " using method " + method, ex);
- }
- if (annotation != null) {
- descriptor.setExpert(annotation.expert());
- descriptor.setHidden(annotation.hidden());
- descriptor.setPreferred(annotation.preferred());
- if (!annotation.displayName()
- .equals(PropertyAnnotation.DEFAULT)) {
- descriptor.setDisplayName(annotation.displayName());
- }
- if (!annotation.shortDescription().equals(
- PropertyAnnotation.DEFAULT)) {
- descriptor.setShortDescription(annotation
- .shortDescription());
- }
- }
- }
- cached = descriptors.values().toArray(
- new PropertyDescriptor[descriptors.size()]);
- propertyDescriptorsCache.put(beanClass, cached);
- return cached;
- }
-
- /**
- * Find all {@link Method}s defined in the class, all its superclasses and
- * interfaces. This might include methods that override each other.
- * <p>
- * The list contains first the methods from each of the class's interfaces
- * (and the methods they inherit from their interfaces), then recurses for
- * the subclass of this class (including any additional interfaces used in
- * the superclasses), before finally adding methods declared in the given
- * class.
- * <p>
- * This can be useful to find annotations given to methods that have been
- * overridden in subclasses.
- *
- * @param theClass
- * @return
- */
- @SuppressWarnings("unchecked")
- protected List<Method> allMethods(Class<?> theClass) {
- List<Method> methods = allMethodsCache.get(theClass);
- if (methods == null) {
- methods = new ArrayList<Method>();
- allMethods(theClass, new HashSet<Class>(ignoreClasses), methods);
- allMethodsCache.put(theClass, methods);
- }
- return methods;
- }
-
- @SuppressWarnings("unchecked")
- protected void allMethods(Class<?> theClass, Set<Class> visitedClasses,
- List<Method> foundMethods) {
- if (theClass == null || theClass == Object.class
- || theClass == Class.class || !visitedClasses.add(theClass)) {
- // Top class or already visted
- return;
- }
- // Let's first dig down into our interfaces
- for (Class anInterface : theClass.getInterfaces()) {
- allMethods(anInterface, visitedClasses, foundMethods);
- }
- // And our superclasses
- allMethods(theClass.getSuperclass(), visitedClasses, foundMethods);
- // Before we find any methods only declared in this class
- // (parent methods are already earlier in the list -
- // note that the new methods might override earlier methods)
- for (Method method : theClass.getDeclaredMethods()) {
- int methodModifiers = method.getModifiers();
- if (!Modifier.isPublic(methodModifiers)
- || Modifier.isStatic(methodModifiers)) {
- continue;
- }
- assert !foundMethods.contains(method) : "Method discovered twice: "
- + method;
- foundMethods.add(method);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/io/pom.xml
----------------------------------------------------------------------
diff --git a/io/pom.xml b/io/pom.xml
deleted file mode 100644
index 1512fd7..0000000
--- a/io/pom.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<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>net.sf.taverna.t2</groupId>
- <artifactId>lang</artifactId>
- <version>2.0.1-SNAPSHOT</version>
- </parent>
- <groupId>net.sf.taverna.t2.lang</groupId>
- <artifactId>io</artifactId>
- <packaging>bundle</packaging>
- <name>IO utility classes</name>
- <dependencies>
- <dependency>
- <groupId>org.apache.log4j</groupId>
- <artifactId>com.springsource.org.apache.log4j</artifactId>
- <version>${log4j.version}</version>
- </dependency>
- </dependencies>
-</project>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/io/src/main/java/net/sf/taverna/t2/lang/io/StreamCopier.java
----------------------------------------------------------------------
diff --git a/io/src/main/java/net/sf/taverna/t2/lang/io/StreamCopier.java b/io/src/main/java/net/sf/taverna/t2/lang/io/StreamCopier.java
deleted file mode 100644
index b0d600d..0000000
--- a/io/src/main/java/net/sf/taverna/t2/lang/io/StreamCopier.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.lang.io;
-
-import java.io.InputStream;
-import java.io.OutputStream;
-
-import org.apache.log4j.Logger;
-
-/**
- * Copies an InputStream to an OutputStream.
- *
- * @author Tom Oinn
- */
-public class StreamCopier extends Thread {
-
- private static Logger logger = Logger
- .getLogger(StreamCopier.class);
-
- InputStream is;
-
- OutputStream os;
-
- /**
- * Create a new StreamCopier which will, when started, copy the specified
- * InputStream to the specified OutputStream
- */
- public StreamCopier(InputStream is, OutputStream os) {
- super("StreamCopier");
- this.is = is;
- this.os = os;
- }
-
- /**
- * Start copying the stream, exits when the InputStream runs out of data
- */
- public void run() {
- try {
- byte[] buffer = new byte[1024];
- int bytesRead;
- while ((bytesRead = is.read(buffer)) != -1) {
- os.write(buffer, 0, bytesRead);
- }
- os.flush();
- os.close();
- } catch (Exception ex) {
- logger.error("Could not copy stream", ex);
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/io/src/main/java/net/sf/taverna/t2/lang/io/StreamDevourer.java
----------------------------------------------------------------------
diff --git a/io/src/main/java/net/sf/taverna/t2/lang/io/StreamDevourer.java b/io/src/main/java/net/sf/taverna/t2/lang/io/StreamDevourer.java
deleted file mode 100644
index 8495e27..0000000
--- a/io/src/main/java/net/sf/taverna/t2/lang/io/StreamDevourer.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.lang.io;
-
-import java.io.BufferedReader;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-
-import org.apache.log4j.Logger;
-
-/**
- * Devours an input stream and allows the contents to be read as a String once
- * the stream has completed.
- *
- * @author Tom Oinn
- * @author Alan R Williams
- */
-public class StreamDevourer extends Thread {
-
- private static Logger logger = Logger.getLogger(StreamDevourer.class);
-
- private static byte[] newLine = System.getProperty("line.separator").getBytes();
-
- BufferedReader br;
-
- ByteArrayOutputStream output;
-
- /**
- * Returns the current value of the internal ByteArrayOutputStream
- */
- @Override
- public String toString() {
- return output.toString();
- }
-
- /**
- * Waits for the stream to close then returns the String representation of
- * its contents (this is equivalent to doing a join then calling toString)
- */
- public String blockOnOutput() {
- try {
- this.join();
- return output.toString();
- } catch (InterruptedException ie) {
- logger.error("Interrupted", ie);
- interrupt();
- return "";
- }
- }
-
- /**
- * Create the StreamDevourer and point it at an InputStream to consume
- */
- public StreamDevourer(InputStream is) {
- super("StreamDevourer");
- this.br = new BufferedReader(new InputStreamReader(is));
- this.output = new ByteArrayOutputStream();
- }
-
- /**
- * When started this Thread will copy all data from the InputStream into a
- * ByteArrayOutputStream via a BufferedReader. Because of the use of the
- * BufferedReader this is only really appropriate for streams of textual
- * data
- */
- @Override
- public void run() {
- try {
- String line = null;
- while ((line = br.readLine()) != null) {
- // && line.endsWith("</svg>") == false) {
- if (line.endsWith("\\") && !line.endsWith("\\\\")) {
- line = line.substring(0, line.length() - 1);
- output.write(line.getBytes());
- } else {
- output.write(line.getBytes());
- output.write(newLine);
- }
- }
- br.close();
- } catch (IOException ioe) {
- logger.error(ioe);
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/observer/pom.xml
----------------------------------------------------------------------
diff --git a/observer/pom.xml b/observer/pom.xml
deleted file mode 100644
index 76e8140..0000000
--- a/observer/pom.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<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>net.sf.taverna.t2</groupId>
- <artifactId>lang</artifactId>
- <version>2.0.1-SNAPSHOT</version>
- </parent>
- <groupId>net.sf.taverna.t2.lang</groupId>
- <artifactId>observer</artifactId>
- <packaging>bundle</packaging>
- <name>Observer pattern</name>
- <description>Implementation of the Observer pattern.</description>
- <dependencies>
- <dependency>
- <groupId>org.apache.log4j</groupId>
- <artifactId>com.springsource.org.apache.log4j</artifactId>
- <version>${log4j.version}</version>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>${junit.version}</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-</project>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/observer/src/main/java/net/sf/taverna/t2/lang/observer/MultiCaster.java
----------------------------------------------------------------------
diff --git a/observer/src/main/java/net/sf/taverna/t2/lang/observer/MultiCaster.java b/observer/src/main/java/net/sf/taverna/t2/lang/observer/MultiCaster.java
deleted file mode 100644
index d563e39..0000000
--- a/observer/src/main/java/net/sf/taverna/t2/lang/observer/MultiCaster.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.lang.observer;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-
-/**
- * Send notifications to registered observers about changes to models
- *
- * @author Ian Dunlop
- * @author Stian Soiland
- *
- * @param <Message>
- */
-public class MultiCaster<Message> implements Observable<Message> {
-
- private static Logger logger = Logger.getLogger(MultiCaster.class);
-
- private Observable<Message> observable;
-
- protected List<Observer<Message>> observers = new ArrayList<Observer<Message>>();
-
- /**
- * Set the {@link #observable} ie. the class that changes are happening to
- * and it's Message for this {@link MultiCaster}
- *
- * @param observable
- */
- public MultiCaster(Observable<Message> observable) {
- this.observable = observable;
- }
-
- /**
- * Tell all the registered observers about the change to the model
- *
- * @param message
- */
- @SuppressWarnings("unchecked")
- public void notify(Message message) {
- // Use a copy that can be iterated even if register/remove is called
- for (Observer<Message> observer : getObservers()) {
- try {
- observer.notify(observable, message);
- } catch (Exception ex) {
- logger.warn("Could not notify " + observer, ex);
- }
- }
- }
-
- /**
- * Register an observer ie. someone who wants informed about changes
- */
- public synchronized void addObserver(Observer<Message> observer) {
- observers.add(observer);
- }
-
- /**
- * Remove the observer and no longer send out any notifications about it
- */
- public synchronized void removeObserver(Observer<Message> observer) {
- observers.remove(observer);
- }
-
- /**
- * A list of all the classes currently registered with this
- * {@link MultiCaster}
- */
- public synchronized List<Observer<Message>> getObservers() {
- return new ArrayList<Observer<Message>>(observers);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/observer/src/main/java/net/sf/taverna/t2/lang/observer/Observable.java
----------------------------------------------------------------------
diff --git a/observer/src/main/java/net/sf/taverna/t2/lang/observer/Observable.java b/observer/src/main/java/net/sf/taverna/t2/lang/observer/Observable.java
deleted file mode 100644
index 1fa7425..0000000
--- a/observer/src/main/java/net/sf/taverna/t2/lang/observer/Observable.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.lang.observer;
-
-import java.util.List;
-
-/**
- * Implements this if you want to notify other classes about changes
- *
- * @author Ian Dunlop
- * @author Stian Soiland
- *
- * @param <Message>
- */
-public interface Observable<Message> {
- /**
- * Register an {@link Observer}
- *
- * @param observer
- * the class who wants notified of changes
- */
- public void addObserver(Observer<Message> observer);
-
- /**
- * Remove a class who is currently observing
- *
- * @param observer
- * the class who no longer wants notified
- */
- public void removeObserver(Observer<Message> observer);
-
- /**
- * A list of all the currently registered {@link Observer}s
- *
- * @return
- */
- public List<Observer<Message>> getObservers();
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/observer/src/main/java/net/sf/taverna/t2/lang/observer/Observer.java
----------------------------------------------------------------------
diff --git a/observer/src/main/java/net/sf/taverna/t2/lang/observer/Observer.java b/observer/src/main/java/net/sf/taverna/t2/lang/observer/Observer.java
deleted file mode 100644
index 81b7c85..0000000
--- a/observer/src/main/java/net/sf/taverna/t2/lang/observer/Observer.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.lang.observer;
-
-/**
- * Implement if you want to register with an {@link Observable}
- *
- * @author Ian Dunlop
- * @author Stian Soiland
- *
- * @param <Message>
- */
-public interface Observer<Message> {
- /**
- * Called by the {@link Observable} to notify the implementing class of
- * changes
- *
- * @param sender
- * the class where the changes have happened
- * @param message
- * what has changed
- * @throws Exception
- */
- public void notify(Observable<Message> sender, Message message)
- throws Exception;
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/observer/src/main/java/net/sf/taverna/t2/lang/observer/SwingAwareObserver.java
----------------------------------------------------------------------
diff --git a/observer/src/main/java/net/sf/taverna/t2/lang/observer/SwingAwareObserver.java b/observer/src/main/java/net/sf/taverna/t2/lang/observer/SwingAwareObserver.java
deleted file mode 100644
index 39435d7..0000000
--- a/observer/src/main/java/net/sf/taverna/t2/lang/observer/SwingAwareObserver.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2012 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.lang.observer;
-
-import javax.swing.SwingUtilities;
-
-/**
- * Implementation of an {@link Observer} that adds calls to notify to the AWT event dispatching
- * thread.
- *
- * @author David Withers
- */
-public abstract class SwingAwareObserver<Message> implements Observer<Message> {
-
- @Override
- public void notify(final Observable<Message> sender, final Message message) throws Exception {
- Runnable runnable = new Runnable() {
- @Override
- public void run() {
- notifySwing(sender, message);
- }
- };
- if (SwingUtilities.isEventDispatchThread()) {
- runnable.run();
- } else {
- // T2-971
- SwingUtilities.invokeLater(runnable);
- }
- }
-
- public abstract void notifySwing(Observable<Message> sender, Message message);
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/observer/src/main/java/net/sf/taverna/t2/lang/observer/package-info.java
----------------------------------------------------------------------
diff --git a/observer/src/main/java/net/sf/taverna/t2/lang/observer/package-info.java b/observer/src/main/java/net/sf/taverna/t2/lang/observer/package-info.java
deleted file mode 100644
index e9d3ff2..0000000
--- a/observer/src/main/java/net/sf/taverna/t2/lang/observer/package-info.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-/**
- * Implementation of the observer pattern. {@link Observer}s registers with an
- * {@link Observable} using {@link Observable#addObserver(Observer)}, and will receive
- * notifications as a call to {@link Observer#notify(Observable, Object)}.
- * <p>
- * Typical implementations of {@link Observable} will be delegating to a
- * {@link MultiCaster} to do the boring observer registration and message
- * dispatching.
- * </p>
- * <p>
- * Example of Observable:
- * <pre>
- * public class MyObservable implements Observable<MyEvent> {
- * public static class MyEvent {
- * // ..
- * }
- * private MultiCaster<:MyEvent> multiCaster = new MultiCaster<:MyEvent>(this);
- *
- * public void doStuff() {
- * multiCaster.notify(new MyEvent());
- * }
- *
- * public void addObserver(Observer<MyEvent> observer) {
- * multiCaster.addObserver(observer);
- * }
- *
- * public List<Observer<MyEvent>> getObservers() {
- * return multiCaster.getObservers();
- * }
- *
- * public void removeObserver(Observer<MyEvent> observer) {
- * multiCaster.removeObserver(observer);
- * }
- * }
- * </pre>
- * And an observer that is notified when MyObservable.doStuff() is called:
- * <pre>
- * public class MyObserver implements Observer<MyEvent> {
- * public void notify(Observable<MyEvent> sender, MyEvent message) {
- * System.out.println("Receieved " + message + " from " + sender);
- * }
- * }
- * </pre>
- * Example of usage:
- * <pre>
- * MyObservable observable = new MyObservable();
- * MyObserver observer = new MyObserver();
- * observable.addObserver(observer);
- * observable.doStuff();
- * </pre>
- */
-package net.sf.taverna.t2.lang.observer;
-
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/observer/src/test/java/net/sf/taverna/t2/lang/observer/ObserverTest.java
----------------------------------------------------------------------
diff --git a/observer/src/test/java/net/sf/taverna/t2/lang/observer/ObserverTest.java b/observer/src/test/java/net/sf/taverna/t2/lang/observer/ObserverTest.java
deleted file mode 100644
index 661cbbc..0000000
--- a/observer/src/test/java/net/sf/taverna/t2/lang/observer/ObserverTest.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.lang.observer;
-
-import static org.junit.Assert.*;
-
-import java.util.List;
-
-import net.sf.taverna.t2.lang.observer.MultiCaster;
-import net.sf.taverna.t2.lang.observer.Observable;
-import net.sf.taverna.t2.lang.observer.Observer;
-
-import org.junit.Test;
-
-public class ObserverTest {
-
- @Test
- public void registerObserver() throws Exception {
- MyObservable observable = new MyObservable();
- MyObserver observer1 = new MyObserver();
- MyObserver observer2 = new MyObserver();
-
- observable.triggerEvent(); // don't notify, but increase count
- assertNull(observer1.lastMessage);
- observable.addObserver(observer1);
- assertNull(observer1.lastMessage);
- assertNull(observer2.lastMessage);
- assertNull(observer1.lastSender);
- assertNull(observer2.lastSender);
- observable.triggerEvent();
- assertEquals("This is message 1", observer1.lastMessage);
- assertSame(observable, observer1.lastSender);
- assertNull(observer2.lastSender);
-
- observable.addObserver(observer2);
- assertNull(observer2.lastMessage);
- observable.triggerEvent();
- assertEquals("This is message 2", observer1.lastMessage);
- assertEquals("This is message 2", observer2.lastMessage);
- assertSame(observable, observer1.lastSender);
- assertSame(observable, observer2.lastSender);
-
- MyObservable otherObservable = new MyObservable();
- otherObservable.addObserver(observer2);
- otherObservable.triggerEvent();
- // New instance, should start from 0
- assertEquals("This is message 0", observer2.lastMessage);
- assertSame(otherObservable, observer2.lastSender);
-
- // observer1 unchanged
- assertEquals("This is message 2", observer1.lastMessage);
- assertSame(observable, observer1.lastSender);
-
- }
-
- @Test
- public void concurrencyTest() {
- MyObservable observable = new MyObservable();
- MyObserver dummyObserver = new MyObserver();
- SelvRemovingObserver selfRemoving = new SelvRemovingObserver();
- observable.addObserver(dummyObserver);
- observable.addObserver(selfRemoving);
- assertEquals(2, observable.getObservers().size());
- observable.triggerEvent();
-
-
- }
-
- public class MyObservable implements Observable<String> {
-
- private int counter = 0;
- MultiCaster<String> multiCaster = new MultiCaster<String>(this);
-
- public void addObserver(Observer<String> observer) {
- multiCaster.addObserver(observer);
- }
-
- public void removeObserver(Observer<String> observer) {
- multiCaster.removeObserver(observer);
- }
-
- public void triggerEvent() {
- multiCaster.notify("This is message " + counter++);
- }
-
- public List<Observer<String>> getObservers() {
- return multiCaster.getObservers();
- }
- }
-
- public class MyObserver implements Observer<String> {
- String lastMessage = null;
- Observable<String> lastSender = null;
-
- public void notify(Observable<String> sender, String message) {
- lastSender = sender;
- lastMessage = message;
- }
- }
-
- public class SelvRemovingObserver implements Observer<String> {
-
- public int called=0;
-
- public void notify(Observable<String> sender, String message) {
- called++;
- if (called > 1) {
- fail("Did not remove itself");
- }
- sender.removeObserver(this);
- }
-
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/partition/pom.xml
----------------------------------------------------------------------
diff --git a/partition/pom.xml b/partition/pom.xml
deleted file mode 100644
index ba5088a..0000000
--- a/partition/pom.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<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>net.sf.taverna.t2</groupId>
- <artifactId>lang</artifactId>
- <version>2.0.1-SNAPSHOT</version>
- </parent>
- <groupId>net.sf.taverna.t2.lang</groupId>
- <artifactId>partition</artifactId>
- <packaging>bundle</packaging>
- <name>Partition</name>
- <description>API for recursive subset partitioning</description>
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>${junit.version}</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-</project>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/partition/src/main/java/net/sf/taverna/t2/partition/HashSetModel.java
----------------------------------------------------------------------
diff --git a/partition/src/main/java/net/sf/taverna/t2/partition/HashSetModel.java b/partition/src/main/java/net/sf/taverna/t2/partition/HashSetModel.java
deleted file mode 100644
index 3a66eb0..0000000
--- a/partition/src/main/java/net/sf/taverna/t2/partition/HashSetModel.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.partition;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-/**
- * Implementation of SetModel based on a HashSet
- *
- * @author Tom Oinn
- */
-public class HashSetModel<ItemType> extends HashSet<ItemType> implements
- SetModel<ItemType> {
-
- /**
- *
- */
- private static final long serialVersionUID = 5763277571663880941L;
- // Listeners for set change events
- private List<SetModelChangeListener<ItemType>> changeListeners;
-
- /**
- * Default constructor, creates a set model based on a HashSet
- */
- public HashSetModel() {
- super();
- changeListeners = new ArrayList<SetModelChangeListener<ItemType>>();
- }
-
- /**
- * Implements SetModel
- */
- public synchronized void addSetModelChangeListener(
- SetModelChangeListener<ItemType> listener) {
- changeListeners.add(listener);
- }
-
- /**
- * Implements SetModel
- */
- public synchronized void removeSetModelChangeListener(
- SetModelChangeListener<ItemType> listener) {
- changeListeners.remove(listener);
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public synchronized void clear() {
- notifyRemoval((Set<Object>) this);
- super.clear();
- }
-
- @Override
- public synchronized boolean add(ItemType item) {
- if (super.add(item)) {
- notifyAddition(Collections.singleton(item));
- return true;
- }
- return false;
- }
-
- @Override
- public synchronized boolean remove(Object item) {
- if (super.remove(item)) {
- notifyRemoval(Collections.singleton(item));
- return true;
- }
- return false;
- }
-
- /**
- * Push addition notification to listeners
- *
- * @param itemsAdded
- */
- private synchronized void notifyAddition(Set<ItemType> itemsAdded) {
- for (SetModelChangeListener<ItemType> listener : new ArrayList<SetModelChangeListener<ItemType>>(
- changeListeners)) {
- listener.itemsWereAdded(itemsAdded);
- }
- }
-
- /**
- * Push removal notification to listeners
- *
- * @param itemsRemoved
- */
- private synchronized void notifyRemoval(Set<Object> itemsRemoved) {
- for (SetModelChangeListener<ItemType> listener : new ArrayList<SetModelChangeListener<ItemType>>(
- changeListeners)) {
- listener.itemsWereRemoved(itemsRemoved);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/partition/src/main/java/net/sf/taverna/t2/partition/Partition.java
----------------------------------------------------------------------
diff --git a/partition/src/main/java/net/sf/taverna/t2/partition/Partition.java b/partition/src/main/java/net/sf/taverna/t2/partition/Partition.java
deleted file mode 100644
index e1e5819..0000000
--- a/partition/src/main/java/net/sf/taverna/t2/partition/Partition.java
+++ /dev/null
@@ -1,441 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.partition;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-
-import javax.swing.event.TreeModelEvent;
-import javax.swing.tree.TreePath;
-
-/**
- * A partition represents a set of items which can be exclusively classified
- * into one or more distinct subsets along with the algorithm to perform this
- * subset operation.
- *
- * @author Tom Oinn
- *
- * @param <ItemType>
- * all items in the underlying set of which this is a subset are
- * instances of this type or can be cast to it according to
- * conventional java language rules.
- * @param <PartitionValueType>
- * the partition value type used by the parent partition algorithm to
- * create this partition object. As an example, if this partition
- * object represented all those entries with a particular host
- * institution this would be a String or possibly URL.
- * @param <ChildPartitionValueType>
- * the partition value type used by this partition's partition
- * algorithm to create sub-partitions, it's used in the signature
- * here because ordering of children is done based on these values.
- * Any child partition will have a getPartitionValue return type
- * cast-able to this type.
- */
-public class Partition<ItemType extends Comparable, PartitionValueType, ChildPartitionValueType> {
-
- // A comparator operating over the value type of the child partitions and
- // used to order them as created or to re-order on a change of this property
- private Comparator<ChildPartitionValueType> childPartitionOrder = null;
-
- // Back reference to the root partition of which this is a direct or
- // indirect sub-partition. If this *is* the root partition this points to
- // self
- protected RootPartition<ItemType> root;
-
- // A subset of the parent's member set containing items which have been
- // allocated to this partition by the parent's partition algorithm. The
- // partition is specified by the partitionValue field.
- private List<ItemType> members;
-
- // The parent partition of which this is a subset
- private Partition<ItemType, ?, PartitionValueType> parent;
-
- // Specification of the partition in terms of the parent's partitioning
- // algorithm
- private PartitionValueType partitionValue;
-
- // List of partitioning algorithms to be applied to this subset to create
- // further partitions, the algorithm at index 0 is the one used for this
- // partition, all others are passed in to the constructors for
- // sub-partitions
- protected List<PartitionAlgorithm<?>> partitionAlgorithms;
-
- // An initially empty list of sub-partitions created by the head element of
- // the partition algorithm list
- protected List<Partition<ItemType, ChildPartitionValueType, ?>> children;
-
- // Path from this node back to the root, initialised on first access and
- // cached
- private List<Partition<ItemType, ?, ?>> partitionPath = null;
-
- // For leaf partitions this is equal to the number of items in the member
- // set, for all other partitions it is the sum of the item count of all
- // child partitions
- protected int itemCount = 0;
-
- /**
- * Construct a new Partition, this is used by the RootPartition and by this
- * class to construct the recursively sub-divided partition structure based
- * on the rules encapsulated by the partition algorithm list.
- *
- * @param parent
- * parent partition of which this is a subset
- * @param pa
- * partition algorithm list, with the algorithm used to create
- * child partitions of this one at position 0, if this list is
- * empty this is a leaf partition.
- * @param root
- * reference to the RootPartition acting as the externally
- * visible front-end to this structure
- * @param pv
- * the value which the parent's partition algorithm has assigned
- * to this partition. This must be interpreted in the context of
- * the parent's first partition algorithm for display and other
- * purposes
- */
- protected Partition(Partition<ItemType, ?, PartitionValueType> parent,
- List<PartitionAlgorithm<?>> pa, RootPartition<ItemType> root,
- PartitionValueType pv) {
- this.root = root;
- this.members = new ArrayList<ItemType>();
- this.parent = parent;
- this.partitionValue = pv;
- this.partitionAlgorithms = pa;
- this.children = new ArrayList<Partition<ItemType, ChildPartitionValueType, ?>>();
- }
-
- /**
- * Return the number of items below this node in the partition tree; in the
- * case of leaf partitions this is the number of items in the member set,
- * for non-leaf partitions it is the sum of the item count for all immediate
- * child partitions.
- */
- public int getItemCount() {
- return this.itemCount;
- }
-
- /**
- * Sub-partitions of this partition are ordered based on a comparator over
- * the child partition value type.
- *
- * @return a comparator over child partition value types, or null if no
- * comparator has been specified (by default this returns null)
- */
- public Comparator<ChildPartitionValueType> getChildPartitionOrder() {
- return this.childPartitionOrder;
- }
-
- /**
- * Set a comparator for child partition ordering - if the supplied
- * comparator is different to the current one this will also trigger a
- * re-order of all child partitions and corresponding events in the root
- * partition's tree view. In the current implementation this is the very
- * broad 'tree structure changed' event for this node in the tree view.
- *
- * @param order
- * a new comparator to order child partitions
- */
- public void setChildPartitionOrder(Comparator<ChildPartitionValueType> order) {
- if (!order.equals(childPartitionOrder)) {
- childPartitionOrder = order;
- sortChildPartitions();
- }
- }
-
- /**
- * Return the parent partition of which this is a sub-partition, or null if
- * this is the root partition.
- */
- public Partition<ItemType, ?, PartitionValueType> getParent() {
- return this.parent;
- }
-
- /**
- * The parent partition created this partition based on a particular value
- * of a property of the members of the sub-partition. This returns that
- * value, and is the result returned from the parent partition's first
- * partition algorithm when run on all members of this partition or its
- * direct or indirect sub-partitions.
- */
- public PartitionValueType getPartitionValue() {
- return this.partitionValue;
- }
-
- @Override
- public String toString() {
- if (getParent() != null) {
- // query type
- String string = this.getParent().getPartitionAlgorithms().get(0)
- .toString();
- // result of query
- String string2 = this.partitionValue.toString();
- return string2 + " (" + getItemCount() + ")";
- } else {
- // This is for a root partition, loop through its children to return
- // the correct number when running a new query
- int items = 0;
- for (Partition child : children) {
- items = items + child.getItemCount();
- }
- String queryType = getPartitionAlgorithms().get(0).toString();
- // return "Activities which match query = " + getItemCount();
- return "Available activities (" + items + ")";
- //+ ", query by "
- // + queryType;
- }
- }
-
- /**
- * Return a list of Partition objects from the root (at index 0) to this
- * node at the final position in the list. Computes the first time then
- * caches, as it should be impossible for this to be modified without
- * recreation of the entire structure from scratch.
- */
- public synchronized List<Partition<ItemType, ?, ?>> getPartitionPath() {
- if (partitionPath == null) {
- List<Partition<ItemType, ?, ?>> al = new ArrayList<Partition<ItemType, ?, ?>>();
- Partition<ItemType, ?, ?> activePartition = this;
- al.add(activePartition);
- while (activePartition.getParent() != null) {
- al.add(0, activePartition.getParent());
- activePartition = activePartition.getParent();
- }
- partitionPath = al;
- }
- return partitionPath;
- }
-
- /**
- * If this is a leaf partition, defined as one with an empty list of
- * partition algorithms, then this method returns the set of all items which
- * have been classified as belonging to this leaf partition. For non-leaf
- * partitions it will return an empty set.
- */
- public final List<ItemType> getMembers() {
- return Collections.unmodifiableList(this.members);
- }
-
- /**
- * The list of partition algorithms applicable to this node (at index 0) and
- * subsequent downstream sub-partitions of it. If this is empty then the
- * partition is a leaf partition.
- */
- public final List<PartitionAlgorithm<?>> getPartitionAlgorithms() {
- return Collections.unmodifiableList(partitionAlgorithms);
- }
-
- /**
- * Sub-partitions of this partition defined by the partition algorithm at
- * index 0 of the list. If this is a leaf partition this will always be
- * empty.
- */
- public final List<Partition<ItemType, ChildPartitionValueType, ?>> getChildren() {
- return Collections.unmodifiableList(children);
- }
-
- /**
- * Inject an item into this partition, if there are partition algorithms in
- * the partition algorithm list (i.e. this is not a leaf) this will
- * recursively call the same method on child partitions or create new
- * partitions where there are none that match the value from the partition
- * algorithm. If this is a leaf partition the item is added to the member
- * set. The list is sorted when adding an item and it is inserted in the
- * appropriate place
- *
- * @param item
- * the item to add to the partition structure.
- */
- @SuppressWarnings("unchecked")
- protected synchronized void addItem(ItemType item) {
- if (partitionAlgorithms.isEmpty()) {
- // itemCount = 0;
- // Allocate directly to member set, no further partitioning
- members.add(item);
- Collections.sort(members);
- int indexOf = members.indexOf(item);
- // root.treeNodesInserted(new TreeModelEvent(this, getTreePath(),
- // new int[] { members.size() - 1 }, new Object[] { item }));
- root.treeNodesInserted(new TreeModelEvent(this, getTreePath(),
- new int[] { indexOf }, new Object[] { item }));
- // Increment item count for all partitions in the partition path
- for (Partition<ItemType, ?, ?> p : getPartitionPath()) {
- synchronized (p) {
- p.itemCount++;
- root.treeNodesChanged(new TreeModelEvent(this, p
- .getTreePath()));
- }
- }
-
- // Cache the storage of this item to this partition in the root
- // partition for more efficient removal if required (saves having to
- // search the entire partition tree, although that wouldn't be too
- // painful if it was required this is faster at the cost of a few
- // bytes of memory)
- root.itemStoredAt(item, this);
- // TODO - when the tree model covers items on the leaf nodes we'll
- // want to message it here as well.
- } else {
- PartitionAlgorithm<ChildPartitionValueType> pa;
- pa = (PartitionAlgorithm<ChildPartitionValueType>) partitionAlgorithms
- .get(0);
- ChildPartitionValueType pvalue = pa.allocate(item, root
- .getPropertyExtractorRegistry());
- // FIXME not sure how to do this since you seem to have to add the
- // items to the partition if you want to then search them again,
- // maybe you need a non-showing partition or something?
- // //if it is a failed search then don't bother adding to the
- // partition
- // if (pvalue.toString().equalsIgnoreCase("No match")) {
- // return;
- // }
- // See if there's a partition with this value already in the child
- // partition list
- for (Partition<ItemType, ChildPartitionValueType, ?> potentialChild : children) {
- if (potentialChild.getPartitionValue().equals(pvalue)) {
- potentialChild.addItem(item);
- return;
- }
- }
- // If not we have to create a new sub-partition
- List<PartitionAlgorithm<?>> tail = new ArrayList<PartitionAlgorithm<?>>();
- for (int i = 1; i < partitionAlgorithms.size(); i++) {
- tail.add(partitionAlgorithms.get(i));
- }
- Partition<ItemType, ChildPartitionValueType, ?> newPartition = new Partition(
- this, tail, this.root, pvalue);
- // Insert the new partition in the correct place according to the
- // comparator currently installed, or at the end if none exists or
- // the list is empty
- if (childPartitionOrder == null || children.isEmpty()) {
- children.add(newPartition);
- root.treeNodesInserted(new TreeModelEvent(this, getTreePath(),
- new int[] { children.indexOf(newPartition) },
- new Object[] { newPartition }));
- } else {
- boolean foundIndex = false;
- for (int i = 0; i < children.size(); i++) {
- ChildPartitionValueType existingPartitionValue = children
- .get(i).getPartitionValue();
- if (childPartitionOrder.compare(pvalue,
- existingPartitionValue) < 0) {
- children.add(i, newPartition);
- root.treeNodesInserted(new TreeModelEvent(this,
- getTreePath(), new int[] { i },
- new Object[] { newPartition }));
- if (i != 0) {
- root.treeStructureChanged(new TreeModelEvent(this,
- getTreePath()));
- }
- foundIndex = true;
- break;
- }
- }
- if (!foundIndex) {
- // Fallen off the end of the array without finding something
- // with greater index than the new partition so we add it at
- // the
- // end (by definition this is the largest value according to
- // the
- // comparator)
- children.add(newPartition);
- root.treeNodesInserted(new TreeModelEvent(this,
- getTreePath(), new int[] { children
- .indexOf(newPartition) },
- new Object[] { newPartition }));
- }
- }
- // Add the item to the new partition to trigger creation of any
- // sub-partitions required
- newPartition.addItem(item);
- }
- }
-
- /**
- * Remove an item from the member set
- *
- * @param item
- * the item to remove
- */
- protected void removeMember(ItemType item) {
- this.members.remove(item);
- }
-
- /**
- * Re-order the child partitions based on the comparator, if no comparator
- * has been defined this method does nothing. Tree structure changed
- * messages are fired from this node in the tree view if the comparator is
- * defined even if no nodes have been changed (lazy but not too much of an
- * issue I suspect)
- */
- protected synchronized final void sortChildPartitions() {
- if (this.childPartitionOrder == null) {
- // Can't do anything unless the comparator is set appropriately
- return;
- }
- Comparator<Partition<ItemType, ChildPartitionValueType, ?>> comparator = new Comparator<Partition<ItemType, ChildPartitionValueType, ?>>() {
- public int compare(
- Partition<ItemType, ChildPartitionValueType, ?> o1,
- Partition<ItemType, ChildPartitionValueType, ?> o2) {
- // FIXME is this really safe to do? It's fairly specific to our
- // case. Doesn't seem very generic
- if (o1.getPartitionValue().toString().equalsIgnoreCase(
- "no value")) {
- // No value so put it to the end
- return 1;
- }
- return childPartitionOrder.compare(o1.getPartitionValue(), o2
- .getPartitionValue());
- }
- };
- Collections.<Partition<ItemType, ChildPartitionValueType, ?>> sort(
- children, comparator);
- // Message the root that the node structure under this node has changed
- // (this is a bit lazy and we could almost certainly be more clever here
- // as the nodes have been removed and added to re-order them)
- root.treeStructureChanged(new TreeModelEvent(this, getTreePath()));
- }
-
- /**
- * Return a TreePath object with this node as the final entry in the path
- */
- protected final synchronized TreePath getTreePath() {
- return new TreePath(getPartitionPath().toArray());
- }
-
- // public void sortItems() {
- // System.out.println("sorting the items");
- // synchronized (members) {
- // List<ItemType> oldOrder = new ArrayList<ItemType>(members);
- // Collections.sort(oldOrder);
- //
- // for (ItemType item : oldOrder) {
- // removeMember(item);
- // }
- // for (ItemType item : oldOrder) {
- // addItem(item);
- // }
- // }
- //
- // }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/partition/src/main/java/net/sf/taverna/t2/partition/PartitionAlgorithm.java
----------------------------------------------------------------------
diff --git a/partition/src/main/java/net/sf/taverna/t2/partition/PartitionAlgorithm.java b/partition/src/main/java/net/sf/taverna/t2/partition/PartitionAlgorithm.java
deleted file mode 100644
index b7b80f6..0000000
--- a/partition/src/main/java/net/sf/taverna/t2/partition/PartitionAlgorithm.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.partition;
-
-/**
- * Interface for classes which can partition a set of objects into subsets according
- * to some embedded partitioning rule
- *
- * @author Tom Oinn
- * @author Stuart Owen
- *
- * @param ValueType
- * the java type of values used to represent the distinct partitions
- * created by this algorithm, in many cases these will be primitive
- * java types such as String but they could represent ranges of
- * values in the case of binning of continuous quantities etc.
- */
-public interface PartitionAlgorithm<ValueType> {
-
- /**
- * Given an object to classify return the value of the partition into which
- * the object falls.
- *
- * @param newItem
- * @return
- */
- ValueType allocate(Object newItem, PropertyExtractorRegistry reg);
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/partition/src/main/java/net/sf/taverna/t2/partition/PartitionAlgorithmSetSPI.java
----------------------------------------------------------------------
diff --git a/partition/src/main/java/net/sf/taverna/t2/partition/PartitionAlgorithmSetSPI.java b/partition/src/main/java/net/sf/taverna/t2/partition/PartitionAlgorithmSetSPI.java
deleted file mode 100644
index 330a11a..0000000
--- a/partition/src/main/java/net/sf/taverna/t2/partition/PartitionAlgorithmSetSPI.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.partition;
-
-import java.util.Set;
-
-/**
- * An SPI interface that provides access to a Set of partition algorithms.
- *
- * @author Stuart Owen
- *
- */
-public interface PartitionAlgorithmSetSPI {
- /**
- * @return a Set of PartitionAlgorithms
- */
- public Set<PartitionAlgorithm<?>> getPartitionAlgorithms();
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/partition/src/main/java/net/sf/taverna/t2/partition/PropertyExtractorRegistry.java
----------------------------------------------------------------------
diff --git a/partition/src/main/java/net/sf/taverna/t2/partition/PropertyExtractorRegistry.java b/partition/src/main/java/net/sf/taverna/t2/partition/PropertyExtractorRegistry.java
deleted file mode 100644
index 229aa87..0000000
--- a/partition/src/main/java/net/sf/taverna/t2/partition/PropertyExtractorRegistry.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.partition;
-
-import java.util.Map;
-
-/**
- * Convenience to allow caching of property extractors. Implementations should
- * scan for available PropertyExtractorSPI implementations and use these to get
- * the properties for each target, caching as applicable.
- *
- * @author Tom Oinn
- *
- */
-public interface PropertyExtractorRegistry {
-
- public Map<String, Object> getAllPropertiesFor(Object target);
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/partition/src/main/java/net/sf/taverna/t2/partition/PropertyExtractorSPI.java
----------------------------------------------------------------------
diff --git a/partition/src/main/java/net/sf/taverna/t2/partition/PropertyExtractorSPI.java b/partition/src/main/java/net/sf/taverna/t2/partition/PropertyExtractorSPI.java
deleted file mode 100644
index 130f2b7..0000000
--- a/partition/src/main/java/net/sf/taverna/t2/partition/PropertyExtractorSPI.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.partition;
-
-import java.util.Map;
-
-/**
- * SPI for classes which can extract or infer a set of named properties from a
- * target object.
- *
- * @author Tom Oinn
- *
- */
-public interface PropertyExtractorSPI {
-
- /**
- * Given a target object extract or infer the property map from it. If the
- * target is one which this plugin cannot act on then simply return an empty
- * map.
- *
- * @param target
- * @return
- */
- Map<String, Object> extractProperties(Object target);
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/partition/src/main/java/net/sf/taverna/t2/partition/Query.java
----------------------------------------------------------------------
diff --git a/partition/src/main/java/net/sf/taverna/t2/partition/Query.java b/partition/src/main/java/net/sf/taverna/t2/partition/Query.java
deleted file mode 100644
index c8f3cb6..0000000
--- a/partition/src/main/java/net/sf/taverna/t2/partition/Query.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.partition;
-
-import java.util.Date;
-
-/**
- * Defines a query which can be re-run and which presents a set view on its
- * results. The Query is intended to represent both the old Taverna scavenger
- * class (which were queries in all but name) and new integration with external
- * search-able repositories in which case the term 'query' is a more literal
- * description.
- *
- * @author Tom Oinn
- *
- * @param <ItemType>
- * the parameterised type of the result set of the query
- */
-public interface Query<ItemType> extends SetModel<ItemType> {
-
- /**
- * Run the query. The query has internal state from any previous runs
- * (including the initial empty state) and will notify all listeners from
- * the SetModel interface of any items that are present in the new query
- * result and not in the old state or vice versa. It also updates the query
- * time to be the current time.
- */
- public void doQuery();
-
- /**
- * Returns the time at which the query was last invoked, or null if the
- * query has not been invoked yet.
- *
- * @return time of last call to doQuery or null if this hasn't happened yet.
- */
- public Date getLastQueryTime();
-
-}
[49/50] [abbrv] incubator-taverna-workbench git commit: not quite
org.apache-ified poms
Posted by st...@apache.org.
not quite org.apache-ified poms
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/commit/71d2d4fe
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/tree/71d2d4fe
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/diff/71d2d4fe
Branch: refs/heads/master
Commit: 71d2d4fe746d9735c0a485c081809dce8a1b9dd5
Parents: fb641cf
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Fri Mar 6 22:30:12 2015 +0000
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Fri Mar 6 22:30:12 2015 +0000
----------------------------------------------------------------------
1/pom.xml | 75 ++++++++++++++++++++++++++++++++++++++++++
taverna-beaninfo/pom.xml | 2 +-
taverna-io/pom.xml | 3 +-
taverna-partition/pom.xml | 3 +-
taverna-ui/pom.xml | 3 +-
taverna-uibuilder/pom.xml | 3 +-
6 files changed, 80 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/71d2d4fe/1/pom.xml
----------------------------------------------------------------------
diff --git a/1/pom.xml b/1/pom.xml
new file mode 100644
index 0000000..7e5841f
--- /dev/null
+++ b/1/pom.xml
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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>net.sf.taverna</groupId>
+ <artifactId>taverna-parent</artifactId>
+ <version>3.0.1-SNAPSHOT</version>
+ </parent>
+
+ <name>Taverna support utilities</name>
+ <groupId>net.sf.taverna.t2</groupId>
+ <artifactId>lang</artifactId>
+ <version>2.0.1-SNAPSHOT</version>
+ <packaging>pom</packaging>
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>${junit.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.log4j</groupId>
+ <artifactId>com.springsource.org.apache.log4j</artifactId>
+ <version>${log4j.version}</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+ <repositories>
+ <repository>
+ <releases />
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ <id>mygrid-repository</id>
+ <name>myGrid Repository</name>
+ <url>http://www.mygrid.org.uk/maven/repository</url>
+ </repository>
+ <repository>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots />
+ <id>mygrid-snapshot-repository</id>
+ <name>myGrid Snapshot Repository</name>
+ <url>http://www.mygrid.org.uk/maven/snapshot-repository</url>
+ </repository>
+ <repository>
+ <id>com.springsource.repository.bundles.release</id>
+ <name>SpringSource Enterprise Bundle Repository - SpringSource Bundle Releases</name>
+ <url>http://repository.springsource.com/maven/bundles/release</url>
+ </repository>
+ <repository>
+ <id>com.springsource.repository.bundles.external</id>
+ <name>SpringSource Enterprise Bundle Repository - External Bundle Releases</name>
+ <url>http://repository.springsource.com/maven/bundles/external</url>
+ </repository>
+ </repositories>
+ <modules>
+ <module>beans</module>
+ <module>io</module>
+ <module>observer</module>
+ <module>partition</module>
+ <module>ui</module>
+ <module>uibuilder</module>
+ </modules>
+ <scm>
+ <connection>scm:git:https://github.com/taverna/taverna-support-utilities.git</connection>
+ <developerConnection>scm:git:ssh://git@github.com:taverna/taverna-support-utilities.git</developerConnection>
+ <url>https://github.com/taverna/taverna-support-utilities</url>
+ <tag>HEAD</tag>
+ </scm>
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/71d2d4fe/taverna-beaninfo/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-beaninfo/pom.xml b/taverna-beaninfo/pom.xml
index ea51b1a..263f33d 100644
--- a/taverna-beaninfo/pom.xml
+++ b/taverna-beaninfo/pom.xml
@@ -8,7 +8,7 @@
<version>2.0.1-SNAPSHOT</version>
</parent>
<groupId>net.sf.taverna.t2.lang</groupId>
- <artifactId>beans</artifactId>
+ <artifactId>taverna-beaninfo</artifactId>
<packaging>bundle</packaging>
<name>BeanInfo extensions</name>
<dependencies>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/71d2d4fe/taverna-io/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-io/pom.xml b/taverna-io/pom.xml
index 1512fd7..19a3c4d 100644
--- a/taverna-io/pom.xml
+++ b/taverna-io/pom.xml
@@ -7,8 +7,7 @@
<artifactId>lang</artifactId>
<version>2.0.1-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.lang</groupId>
- <artifactId>io</artifactId>
+ <artifactId>taverna-io</artifactId>
<packaging>bundle</packaging>
<name>IO utility classes</name>
<dependencies>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/71d2d4fe/taverna-partition/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-partition/pom.xml b/taverna-partition/pom.xml
index ba5088a..37439ae 100644
--- a/taverna-partition/pom.xml
+++ b/taverna-partition/pom.xml
@@ -7,8 +7,7 @@
<artifactId>lang</artifactId>
<version>2.0.1-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.lang</groupId>
- <artifactId>partition</artifactId>
+ <artifactId>taverna-partition</artifactId>
<packaging>bundle</packaging>
<name>Partition</name>
<description>API for recursive subset partitioning</description>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/71d2d4fe/taverna-ui/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-ui/pom.xml b/taverna-ui/pom.xml
index 6d42dc3..05c17f4 100644
--- a/taverna-ui/pom.xml
+++ b/taverna-ui/pom.xml
@@ -7,8 +7,7 @@
<artifactId>lang</artifactId>
<version>2.0.1-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.lang</groupId>
- <artifactId>ui</artifactId>
+ <artifactId>taverna-ui</artifactId>
<packaging>bundle</packaging>
<name>User interface (Swing) utility classes</name>
<dependencies>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/71d2d4fe/taverna-uibuilder/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-uibuilder/pom.xml b/taverna-uibuilder/pom.xml
index bc84391..4afa898 100644
--- a/taverna-uibuilder/pom.xml
+++ b/taverna-uibuilder/pom.xml
@@ -7,8 +7,7 @@
<artifactId>lang</artifactId>
<version>2.0.1-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.lang</groupId>
- <artifactId>uibuilder</artifactId>
+ <artifactId>taverna-uibuilder</artifactId>
<packaging>bundle</packaging>
<name>UI builder based on beans</name>
<dependencies>
[20/50] [abbrv] incubator-taverna-workbench git commit: added README
Posted by st...@apache.org.
added README
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/commit/4d399b7c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/tree/4d399b7c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/diff/4d399b7c
Branch: refs/heads/master
Commit: 4d399b7c16c00071afe78fb3da19be4eeab672c2
Parents: 68c55c9
Author: Christian-B <br...@cs.man.ac.uk>
Authored: Fri May 9 09:11:23 2014 +0100
Committer: Christian-B <br...@cs.man.ac.uk>
Committed: Fri May 9 09:11:23 2014 +0100
----------------------------------------------------------------------
README.md | 3 +++
1 file changed, 3 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/4d399b7c/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..58d1f52
--- /dev/null
+++ b/README.md
@@ -0,0 +1,3 @@
+Taverna Workflow system assorted support utilities
+
+This code was previously hosted at http://taverna.googlecode.com/svn/taverna/utils/net.sf.taverna.t2.lang/
\ No newline at end of file
[13/50] [abbrv] incubator-taverna-workbench git commit: Bumped up the
SNAPSHOT version numbers after branching for 2.5 release.
Posted by st...@apache.org.
Bumped up the SNAPSHOT version numbers after branching for 2.5 release.
git-svn-id: https://taverna.googlecode.com/svn/taverna/utils/net.sf.taverna.t2.lang/branches/maintenance@16860 bf327186-88b3-11dd-a302-d386e5130c1c
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/commit/df96cebd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/tree/df96cebd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/diff/df96cebd
Branch: refs/heads/master
Commit: df96cebd093e1be7c15220d250516ad1a42492d0
Parents: af0e768
Author: alex@mygrid.org.uk <al...@bf327186-88b3-11dd-a302-d386e5130c1c>
Authored: Tue Mar 18 15:32:50 2014 +0000
Committer: alex@mygrid.org.uk <al...@bf327186-88b3-11dd-a302-d386e5130c1c>
Committed: Tue Mar 18 15:32:50 2014 +0000
----------------------------------------------------------------------
beans/pom.xml | 2 +-
io/pom.xml | 2 +-
observer/pom.xml | 2 +-
partition/pom.xml | 2 +-
pom.xml | 4 ++--
results/pom.xml | 4 ++--
ui/pom.xml | 2 +-
uibuilder/pom.xml | 2 +-
8 files changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/df96cebd/beans/pom.xml
----------------------------------------------------------------------
diff --git a/beans/pom.xml b/beans/pom.xml
index 3d19823..14ba623 100644
--- a/beans/pom.xml
+++ b/beans/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>net.sf.taverna.t2</groupId>
<artifactId>lang</artifactId>
- <version>1.5-SNAPSHOT</version>
+ <version>1.6-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/df96cebd/io/pom.xml
----------------------------------------------------------------------
diff --git a/io/pom.xml b/io/pom.xml
index 7e58ce5..900bab6 100644
--- a/io/pom.xml
+++ b/io/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>net.sf.taverna.t2</groupId>
<artifactId>lang</artifactId>
- <version>1.5-SNAPSHOT</version>
+ <version>1.6-SNAPSHOT</version>
</parent>
<groupId>net.sf.taverna.t2.lang</groupId>
<artifactId>io</artifactId>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/df96cebd/observer/pom.xml
----------------------------------------------------------------------
diff --git a/observer/pom.xml b/observer/pom.xml
index 2724a36..5bf4236 100644
--- a/observer/pom.xml
+++ b/observer/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>net.sf.taverna.t2</groupId>
<artifactId>lang</artifactId>
- <version>1.5-SNAPSHOT</version>
+ <version>1.6-SNAPSHOT</version>
</parent>
<description>Implementation of the Observer pattern.</description>
<dependencies>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/df96cebd/partition/pom.xml
----------------------------------------------------------------------
diff --git a/partition/pom.xml b/partition/pom.xml
index 318b0c8..692c258 100644
--- a/partition/pom.xml
+++ b/partition/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>net.sf.taverna.t2</groupId>
<artifactId>lang</artifactId>
- <version>1.5-SNAPSHOT</version>
+ <version>1.6-SNAPSHOT</version>
</parent>
<description>API for recursive subset partitioning</description>
<dependencies>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/df96cebd/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index e540cc8..53b03a0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,14 +4,14 @@
<parent>
<groupId>net.sf.taverna</groupId>
<artifactId>taverna-parent</artifactId>
- <version>2.5-SNAPSHOT</version>
+ <version>2.6-SNAPSHOT</version>
<relativePath>../../taverna-parent/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<name>Taverna 2 language extensions</name>
<groupId>net.sf.taverna.t2</groupId>
- <version>1.5-SNAPSHOT</version>
+ <version>1.6-SNAPSHOT</version>
<artifactId>lang</artifactId>
<packaging>pom</packaging>
<dependencyManagement>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/df96cebd/results/pom.xml
----------------------------------------------------------------------
diff --git a/results/pom.xml b/results/pom.xml
index 61a6e05..4db22ee 100644
--- a/results/pom.xml
+++ b/results/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>net.sf.taverna.t2</groupId>
<artifactId>lang</artifactId>
- <version>1.5-SNAPSHOT</version>
+ <version>1.6-SNAPSHOT</version>
</parent>
<name>Common Results handling utilities</name>
<description>Common utilities for handling results, in particular Baclava document handling and de-referencing T2References</description>
@@ -34,7 +34,7 @@
<dependency>
<groupId>uk.org.mygrid.resources.mimeutil</groupId>
<artifactId>mime-util</artifactId>
- <version>2.1.2-3</version>
+ <version>2.1.2-7-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>uk.org.mygrid.resources.clapper</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/df96cebd/ui/pom.xml
----------------------------------------------------------------------
diff --git a/ui/pom.xml b/ui/pom.xml
index d2839fd..fbe0379 100644
--- a/ui/pom.xml
+++ b/ui/pom.xml
@@ -8,7 +8,7 @@
<parent>
<groupId>net.sf.taverna.t2</groupId>
<artifactId>lang</artifactId>
- <version>1.5-SNAPSHOT</version>
+ <version>1.6-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/df96cebd/uibuilder/pom.xml
----------------------------------------------------------------------
diff --git a/uibuilder/pom.xml b/uibuilder/pom.xml
index b102fad..b8848e7 100644
--- a/uibuilder/pom.xml
+++ b/uibuilder/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>net.sf.taverna.t2</groupId>
<artifactId>lang</artifactId>
- <version>1.5-SNAPSHOT</version>
+ <version>1.6-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
[09/50] [abbrv] incubator-taverna-workbench git commit: Document
filter for names
Posted by st...@apache.org.
Document filter for names
git-svn-id: https://taverna.googlecode.com/svn/taverna/utils/net.sf.taverna.t2.lang/branches/maintenance@16489 bf327186-88b3-11dd-a302-d386e5130c1c
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/commit/e388ce29
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/tree/e388ce29
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/diff/e388ce29
Branch: refs/heads/master
Commit: e388ce29bae532569d5c7aca1316421cba02c9ea
Parents: ddfae3f
Author: alan@mygrid.org.uk <al...@bf327186-88b3-11dd-a302-d386e5130c1c>
Authored: Tue Jan 7 16:53:54 2014 +0000
Committer: alan@mygrid.org.uk <al...@bf327186-88b3-11dd-a302-d386e5130c1c>
Committed: Tue Jan 7 16:53:54 2014 +0000
----------------------------------------------------------------------
.../t2/lang/ui/SanitisingDocumentFilter.java | 43 ++++++++++++++++++++
1 file changed, 43 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e388ce29/ui/src/main/java/net/sf/taverna/t2/lang/ui/SanitisingDocumentFilter.java
----------------------------------------------------------------------
diff --git a/ui/src/main/java/net/sf/taverna/t2/lang/ui/SanitisingDocumentFilter.java b/ui/src/main/java/net/sf/taverna/t2/lang/ui/SanitisingDocumentFilter.java
new file mode 100644
index 0000000..04341d4
--- /dev/null
+++ b/ui/src/main/java/net/sf/taverna/t2/lang/ui/SanitisingDocumentFilter.java
@@ -0,0 +1,43 @@
+/**
+ *
+ */
+package net.sf.taverna.t2.lang.ui;
+
+import java.util.regex.Pattern;
+
+import javax.swing.text.AttributeSet;
+import javax.swing.text.BadLocationException;
+import javax.swing.text.DocumentFilter;
+
+/**
+ * @author alanrw
+ *
+ */
+public class SanitisingDocumentFilter extends DocumentFilter {
+ public void insertString(DocumentFilter.FilterBypass fb, int offset, String string, AttributeSet attr) throws BadLocationException {
+
+ fb.insertString(offset, sanitiseString(string), attr);
+ }
+
+ public void replace(DocumentFilter.FilterBypass fb, int offset, int length,
+ String text, javax.swing.text.AttributeSet attr)
+
+ throws BadLocationException {
+ fb.insertString(offset, sanitiseString(text), attr);
+ }
+
+ private static String sanitiseString(String text) {
+ String result = text;
+ if (Pattern.matches("\\w++", text) == false) {
+ result = "";
+ for (char c : text.toCharArray()) {
+ if (Character.isLetterOrDigit(c) || c == '_') {
+ result += c;
+ } else {
+ result += "_";
+ }
+ }
+ }
+ return result;
+ }
+}
[36/50] [abbrv] incubator-taverna-workbench git commit:
org.apache.taverna.engine etc
Posted by st...@apache.org.
org.apache.taverna.engine etc
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/commit/47ed9d6c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/tree/47ed9d6c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/diff/47ed9d6c
Branch: refs/heads/master
Commit: 47ed9d6c2bad5d04da37d01cb97e0a0b86927ba7
Parents: 1e68144
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Fri Mar 6 22:15:46 2015 +0000
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Fri Mar 6 22:15:46 2015 +0000
----------------------------------------------------------------------
pom.xml | 2 --
taverna-disabled-activity-ui/pom.xml | 6 ++--
taverna-workbench-activity-palette-impl/pom.xml | 8 ++---
taverna-workbench-iteration-strategy-ui/pom.xml | 8 ++---
taverna-workbench-monitor-view/pom.xml | 4 +--
.../pom.xml | 4 +--
taverna-workbench-perspective-results/pom.xml | 2 +-
taverna-workbench-reference-ui/pom.xml | 4 +--
taverna-workbench-renderers-api/pom.xml | 2 +-
taverna-workbench-renderers-exts/pom.xml | 2 +-
taverna-workbench-renderers-impl/pom.xml | 2 +-
taverna-workbench-report-explainer/pom.xml | 32 ++++++++++----------
taverna-workbench-report-impl/pom.xml | 4 +--
taverna-workbench-results-view/pom.xml | 10 +++---
taverna-workbench-run-ui/pom.xml | 4 +--
15 files changed, 46 insertions(+), 48 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/47ed9d6c/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 4d24ebf..8db98c2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -33,9 +33,7 @@
<taverna.language.version>0.15.0-incubating-SNAPSHOT</taverna.language.version>
<taverna.osgi.version>0.2.0-incubating-SNAPSHOT</taverna.osgi.version>
<taverna.engine.version>3.1.0-incubating-SNAPSHOT</taverna.engine.version>
- <!-- should not use:
<taverna.commonactivities.version>2.1.0-incubating-SNAPSHOT</taverna.commonactivities.version>
- -->
</properties>
<modules>
<module>taverna-dataflow-activity-ui</module>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/47ed9d6c/taverna-disabled-activity-ui/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-disabled-activity-ui/pom.xml b/taverna-disabled-activity-ui/pom.xml
index 528ebcf..c26dcdc 100644
--- a/taverna-disabled-activity-ui/pom.xml
+++ b/taverna-disabled-activity-ui/pom.xml
@@ -59,9 +59,9 @@
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.activities</groupId>
- <artifactId>beanshell-activity</artifactId>
- <version>${t2.activities.version}</version>
+ <groupId>org.apache.taverna.commonactivities</groupId>
+ <artifactId>taverna-beanshell-activity</artifactId>
+ <version>${taverna.commonactivities.version}</version>
</dependency>
<dependency>
<groupId>javax.help</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/47ed9d6c/taverna-workbench-activity-palette-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-activity-palette-impl/pom.xml b/taverna-workbench-activity-palette-impl/pom.xml
index bed75bb..3508f38 100644
--- a/taverna-workbench-activity-palette-impl/pom.xml
+++ b/taverna-workbench-activity-palette-impl/pom.xml
@@ -34,9 +34,9 @@
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.core</groupId>
+ <groupId>org.apache.taverna.engine</groupId>
<artifactId>workflowmodel-api</artifactId>
- <version>${t2.core.version}</version>
+ <version>${taverna.engine.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.lang</groupId>
@@ -69,9 +69,9 @@
<!-- TODO Remove non-test impl dependency -->
<dependency>
- <groupId>net.sf.taverna.t2.core</groupId>
+ <groupId>org.apache.taverna.engine</groupId>
<artifactId>workflowmodel-impl</artifactId>
- <version>${t2.core.version}</version>
+ <version>${taverna.engine.version}</version>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/47ed9d6c/taverna-workbench-iteration-strategy-ui/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-iteration-strategy-ui/pom.xml b/taverna-workbench-iteration-strategy-ui/pom.xml
index f143153..ce47f16 100644
--- a/taverna-workbench-iteration-strategy-ui/pom.xml
+++ b/taverna-workbench-iteration-strategy-ui/pom.xml
@@ -29,9 +29,9 @@
<description>An SPI system for building UI menues</description>
<dependencies>
<dependency>
- <groupId>net.sf.taverna.t2.core</groupId>
+ <groupId>org.apache.taverna.engine</groupId>
<artifactId>workflowmodel-api</artifactId>
- <version>${t2.core.version}</version>
+ <version>${taverna.engine.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.lang</groupId>
@@ -70,9 +70,9 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.core</groupId>
+ <groupId>org.apache.taverna.engine</groupId>
<artifactId>workflowmodel-impl</artifactId>
- <version>${t2.core.version}</version>
+ <version>${taverna.engine.version}</version>
<!-- <scope>test</scope> -->
</dependency>
</dependencies>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/47ed9d6c/taverna-workbench-monitor-view/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-monitor-view/pom.xml b/taverna-workbench-monitor-view/pom.xml
index 2e3b3f6..962367f 100644
--- a/taverna-workbench-monitor-view/pom.xml
+++ b/taverna-workbench-monitor-view/pom.xml
@@ -53,12 +53,12 @@
<version>${t2.lang.version}</version>
</dependency>
<dependency>
- <groupId>uk.org.taverna.platform</groupId>
+ <groupId>org.apache.taverna.engine</groupId>
<artifactId>taverna-report-api</artifactId>
<version>${platform.version}</version>
</dependency>
<dependency>
- <groupId>uk.org.taverna.platform</groupId>
+ <groupId>org.apache.taverna.engine</groupId>
<artifactId>taverna-run-api</artifactId>
<version>${platform.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/47ed9d6c/taverna-workbench-perspective-biocatalogue/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-perspective-biocatalogue/pom.xml b/taverna-workbench-perspective-biocatalogue/pom.xml
index f967fc4..4188449 100644
--- a/taverna-workbench-perspective-biocatalogue/pom.xml
+++ b/taverna-workbench-perspective-biocatalogue/pom.xml
@@ -41,9 +41,9 @@
<!-- <dependency> <groupId>${project.parent.groupId}</groupId> <artifactId>perspective-core</artifactId>
<version>${project.parent.version}</version> </dependency> -->
<dependency>
- <groupId>net.sf.taverna.t2.core</groupId>
+ <groupId>org.apache.taverna.engine</groupId>
<artifactId>workflowmodel-impl</artifactId>
- <version>${t2.core.version}</version>
+ <version>${taverna.engine.version}</version>
</dependency>
<dependency>
<groupId>${project.parent.groupId}</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/47ed9d6c/taverna-workbench-perspective-results/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-perspective-results/pom.xml b/taverna-workbench-perspective-results/pom.xml
index 44ee583..bed0f48 100644
--- a/taverna-workbench-perspective-results/pom.xml
+++ b/taverna-workbench-perspective-results/pom.xml
@@ -55,7 +55,7 @@
<version>${t2.lang.version}</version>
</dependency>
<dependency>
- <groupId>uk.org.taverna.platform</groupId>
+ <groupId>org.apache.taverna.engine</groupId>
<artifactId>taverna-run-api</artifactId>
<version>${platform.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/47ed9d6c/taverna-workbench-reference-ui/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-reference-ui/pom.xml b/taverna-workbench-reference-ui/pom.xml
index cd6153e..3d54f71 100644
--- a/taverna-workbench-reference-ui/pom.xml
+++ b/taverna-workbench-reference-ui/pom.xml
@@ -59,12 +59,12 @@
<version>${t2.baclava.version}</version>
</dependency>
<dependency>
- <groupId>uk.org.taverna.platform</groupId>
+ <groupId>org.apache.taverna.engine</groupId>
<artifactId>taverna-run-api</artifactId>
<version>${platform.version}</version>
</dependency>
<dependency>
- <groupId>uk.org.taverna.databundle</groupId>
+ <groupId>org.apache.taverna.language</groupId>
<artifactId>databundle</artifactId>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/47ed9d6c/taverna-workbench-renderers-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-renderers-api/pom.xml b/taverna-workbench-renderers-api/pom.xml
index 7dbdb62..43dd94e 100644
--- a/taverna-workbench-renderers-api/pom.xml
+++ b/taverna-workbench-renderers-api/pom.xml
@@ -28,7 +28,7 @@
<name>Renderers API</name>
<dependencies>
<dependency>
- <groupId>uk.org.taverna.databundle</groupId>
+ <groupId>org.apache.taverna.language</groupId>
<artifactId>databundle</artifactId>
<version>${taverna.databundle.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/47ed9d6c/taverna-workbench-renderers-exts/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-renderers-exts/pom.xml b/taverna-workbench-renderers-exts/pom.xml
index 3bfa11e..373d4d5 100644
--- a/taverna-workbench-renderers-exts/pom.xml
+++ b/taverna-workbench-renderers-exts/pom.xml
@@ -37,7 +37,7 @@
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>uk.org.taverna.databundle</groupId>
+ <groupId>org.apache.taverna.language</groupId>
<artifactId>databundle</artifactId>
<version>0.1.0-SNAPSHOT</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/47ed9d6c/taverna-workbench-renderers-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-renderers-impl/pom.xml b/taverna-workbench-renderers-impl/pom.xml
index 2355130..89e1d8c 100644
--- a/taverna-workbench-renderers-impl/pom.xml
+++ b/taverna-workbench-renderers-impl/pom.xml
@@ -52,7 +52,7 @@
<version>${t2.lang.version}</version>
</dependency>
<dependency>
- <groupId>uk.org.taverna.databundle</groupId>
+ <groupId>org.apache.taverna.language</groupId>
<artifactId>databundle</artifactId>
<version>${taverna.databundle.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/47ed9d6c/taverna-workbench-report-explainer/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-report-explainer/pom.xml b/taverna-workbench-report-explainer/pom.xml
index cf9f5ac..9ca8d50 100644
--- a/taverna-workbench-report-explainer/pom.xml
+++ b/taverna-workbench-report-explainer/pom.xml
@@ -38,27 +38,27 @@
<dependency>
<groupId>${project.parent.groupId}</groupId>
<artifactId>retry-ui</artifactId>
- <version>${project.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-activities</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>dataflow-activity-ui</artifactId>
- <version>${t2.ui.activities.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-activities</groupId>
- <artifactId>disabled-activity-ui</artifactId>
- <version>${t2.ui.activities.version}</version>
+ <groupId>${project.parent.groupId}</groupId>
+ <artifactId>taverna-disabled-activity-ui</artifactId>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.activities</groupId>
- <artifactId>wsdl-activity</artifactId>
- <version>${t2.activities.version}</version>
+ <groupId>org.apache.taverna.commonactivities</groupId>
+ <artifactId>taverna-wsdl-activity</artifactId>
+ <version>${taverna.commonactivities.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.activities</groupId>
- <artifactId>dataflow-activity</artifactId>
- <version>${t2.activities.version}</version>
+ <groupId>org.apache.taverna.engine</groupId>
+ <artifactId>taverna-dataflow-activity</artifactId>
+ <version>${taverna.engine.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
@@ -66,9 +66,9 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.core</groupId>
+ <groupId>org.apache.taverna.engine</groupId>
<artifactId>workflowmodel-api</artifactId>
- <version>${t2.core.version}</version>
+ <version>${taverna.engine.version}</version>
</dependency>
<dependency>
<groupId>${project.parent.groupId}</groupId>
@@ -96,9 +96,9 @@
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.core</groupId>
+ <groupId>org.apache.taverna.engine</groupId>
<artifactId>workflowmodel-impl</artifactId>
- <version>${t2.core.version}</version>
+ <version>${taverna.engine.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.lang</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/47ed9d6c/taverna-workbench-report-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-report-impl/pom.xml b/taverna-workbench-report-impl/pom.xml
index ee86323..d0c6c16 100644
--- a/taverna-workbench-report-impl/pom.xml
+++ b/taverna-workbench-report-impl/pom.xml
@@ -28,9 +28,9 @@
<name>Reporting Implementation</name>
<dependencies>
<dependency>
- <groupId>net.sf.taverna.t2.core</groupId>
+ <groupId>org.apache.taverna.engine</groupId>
<artifactId>workflowmodel-api</artifactId>
- <version>${t2.core.version}</version>
+ <version>${taverna.engine.version}</version>
</dependency>
<dependency>
<groupId>${project.parent.groupId}</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/47ed9d6c/taverna-workbench-results-view/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-results-view/pom.xml b/taverna-workbench-results-view/pom.xml
index 941ec9b..c0aa290 100644
--- a/taverna-workbench-results-view/pom.xml
+++ b/taverna-workbench-results-view/pom.xml
@@ -87,24 +87,24 @@
<version>${taverna.configuration.version}</version>
</dependency>
<dependency>
- <groupId>uk.org.taverna.platform</groupId>
+ <groupId>org.apache.taverna.engine</groupId>
<artifactId>taverna-report-api</artifactId>
<version>${platform.version}</version>
</dependency>
<dependency>
- <groupId>uk.org.taverna.platform</groupId>
+ <groupId>org.apache.taverna.engine</groupId>
<artifactId>taverna-run-api</artifactId>
<version>${platform.version}</version>
</dependency>
<dependency>
- <groupId>uk.org.taverna.databundle</groupId>
+ <groupId>org.apache.taverna.language</groupId>
<artifactId>databundle</artifactId>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.core</groupId>
+ <groupId>org.apache.taverna.engine</groupId>
<artifactId>provenanceconnector</artifactId>
- <version>${t2.core.version}</version>
+ <version>${taverna.engine.version}</version>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/47ed9d6c/taverna-workbench-run-ui/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-run-ui/pom.xml b/taverna-workbench-run-ui/pom.xml
index 20dcd95..a71b48a 100644
--- a/taverna-workbench-run-ui/pom.xml
+++ b/taverna-workbench-run-ui/pom.xml
@@ -58,12 +58,12 @@
<version>${t2.lang.version}</version>
</dependency>
<dependency>
- <groupId>uk.org.taverna.platform</groupId>
+ <groupId>org.apache.taverna.engine</groupId>
<artifactId>taverna-run-api</artifactId>
<version>${platform.version}</version>
</dependency>
<dependency>
- <groupId>uk.org.taverna.platform</groupId>
+ <groupId>org.apache.taverna.engine</groupId>
<artifactId>taverna-execution-api</artifactId>
<version>${platform.version}</version>
</dependency>
[05/50] [abbrv] incubator-taverna-workbench git commit: Added Border
that can draw borders on selected edges of a component.
Posted by st...@apache.org.
Added Border that can draw borders on selected edges of a component.
git-svn-id: https://taverna.googlecode.com/svn/taverna/utils/net.sf.taverna.t2.lang/trunk@15965 bf327186-88b3-11dd-a302-d386e5130c1c
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/commit/ef5ec645
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/tree/ef5ec645
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/diff/ef5ec645
Branch: refs/heads/master
Commit: ef5ec6452d87d17276f92fc3dd2da07ab9f8161f
Parents: 1704b7d
Author: david@mygrid.org.uk <da...@bf327186-88b3-11dd-a302-d386e5130c1c>
Authored: Mon Jul 29 10:18:46 2013 +0000
Committer: david@mygrid.org.uk <da...@bf327186-88b3-11dd-a302-d386e5130c1c>
Committed: Mon Jul 29 10:18:46 2013 +0000
----------------------------------------------------------------------
.../sf/taverna/t2/lang/ui/EdgeLineBorder.java | 91 ++++++++++++++++++++
1 file changed, 91 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/ef5ec645/ui/src/main/java/net/sf/taverna/t2/lang/ui/EdgeLineBorder.java
----------------------------------------------------------------------
diff --git a/ui/src/main/java/net/sf/taverna/t2/lang/ui/EdgeLineBorder.java b/ui/src/main/java/net/sf/taverna/t2/lang/ui/EdgeLineBorder.java
new file mode 100644
index 0000000..f49faa1
--- /dev/null
+++ b/ui/src/main/java/net/sf/taverna/t2/lang/ui/EdgeLineBorder.java
@@ -0,0 +1,91 @@
+/*******************************************************************************
+ * Copyright (C) 2013 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.lang.ui;
+
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Graphics;
+import java.awt.Insets;
+
+import javax.swing.JFrame;
+import javax.swing.JPanel;
+import javax.swing.border.Border;
+import javax.swing.border.LineBorder;
+
+/**
+ *
+ *
+ * @author David Withers
+ */
+public class EdgeLineBorder implements Border {
+
+ public static final int TOP = 1;
+ public static final int BOTTOM = 2;
+ public static final int LEFT = 3;
+ public static final int RIGHT = 4;
+ private final int edge;
+ private final Color color;
+
+ public EdgeLineBorder(int edge, Color color) {
+ this.edge = edge;
+ this.color = color;
+ }
+
+ @Override
+ public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
+ Color oldColor = g.getColor();
+ g.setColor(color);
+ switch (edge) {
+ case TOP:
+ g.drawLine(x, y, x+width, y);
+ break;
+ case BOTTOM:
+ g.drawLine(x, y+height-2, x+width, y+height-2);
+ break;
+ case LEFT:
+ g.drawLine(x, y, x+width, y+height);
+ break;
+ case RIGHT:
+ g.drawLine(x+width, y, x+width, y+height);
+ break;
+ }
+ g.setColor(oldColor);
+ }
+
+ @Override
+ public Insets getBorderInsets(Component c) {
+ return new Insets(0, 0, 0, 0);
+ }
+
+ @Override
+ public boolean isBorderOpaque() {
+ return false;
+ }
+
+ public static void main(String[] args) {
+ JFrame frame = new JFrame();
+ frame.setSize(500, 500);
+ JPanel panel = new JPanel();
+ panel.setBorder(new EdgeLineBorder(TOP, Color.GRAY));
+ frame.add(panel);
+ frame.setVisible(true);
+ }
+}
[28/50] [abbrv] incubator-taverna-workbench git commit: Updated
commons.io to version 2.4 for T3-1193
Posted by st...@apache.org.
Updated commons.io to version 2.4 for T3-1193
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/commit/f0af04e0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/tree/f0af04e0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/diff/f0af04e0
Branch: refs/heads/master
Commit: f0af04e02c33228f5820e2d8157ed6b2a6cf98ac
Parents: efc39a3
Author: Christian-B <br...@cs.man.ac.uk>
Authored: Mon Jun 30 17:06:10 2014 +0100
Committer: Christian-B <br...@cs.man.ac.uk>
Committed: Mon Jun 30 17:06:10 2014 +0100
----------------------------------------------------------------------
ui/pom.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f0af04e0/ui/pom.xml
----------------------------------------------------------------------
diff --git a/ui/pom.xml b/ui/pom.xml
index 7e0d708..6d42dc3 100644
--- a/ui/pom.xml
+++ b/ui/pom.xml
@@ -23,8 +23,8 @@
<version>${jedit.syntax.version}</version>
</dependency>
<dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>com.springsource.org.apache.commons.io</artifactId>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
<version>${commons.io.version}</version>
</dependency>
<dependency>
[46/50] [abbrv] incubator-taverna-workbench git commit: taverna-*
Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/PrimitiveTypeBean.java
----------------------------------------------------------------------
diff --git a/uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/PrimitiveTypeBean.java b/uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/PrimitiveTypeBean.java
deleted file mode 100644
index 8240fea..0000000
--- a/uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/PrimitiveTypeBean.java
+++ /dev/null
@@ -1,101 +0,0 @@
-package net.sf.taverna.t2.lang.uibuilder;
-
-/**
- * Bean containing all the primitive types in Java (AFAIK)
- *
- * @author Tom Oinn
- *
- */
-public class PrimitiveTypeBean {
-
- private int intValue = 1;
- private short shortValue = 2;
- private long longValue = (long) 3.0123;
- private double doubleValue = 4.01234;
- private boolean booleanValue = false;
- private byte byteValue = 5;
- private float floatValue = 6.012345f;
- private char charValue = 'a';
-
- public PrimitiveTypeBean() {
- //
- }
-
- public void setIntValue(int intValue) {
- this.intValue = intValue;
- }
-
- public String toString() {
- return intValue + "," + shortValue + "," + longValue + ","
- + doubleValue + "," + booleanValue + "," + byteValue + ","
- + floatValue + "," + charValue;
- }
-
- public int getIntValue() {
- return intValue;
- }
-
- public void setShortValue(short shortValue) {
- this.shortValue = shortValue;
- System.out.println(this);
- }
-
- public short getShortValue() {
- return shortValue;
- }
-
- public void setLongValue(long longValue) {
- this.longValue = longValue;
- System.out.println(this);
- }
-
- public long getLongValue() {
- return longValue;
- }
-
- public void setDoubleValue(double doubleValue) {
- this.doubleValue = doubleValue;
- System.out.println(this);
- }
-
- public double getDoubleValue() {
- return doubleValue;
- }
-
- public void setBooleanValue(boolean booleanValue) {
- this.booleanValue = booleanValue;
- System.out.println(this);
- }
-
- public boolean getBooleanValue() {
- return booleanValue;
- }
-
- public void setByteValue(byte byteValue) {
- this.byteValue = byteValue;
- System.out.println(this);
- }
-
- public byte getByteValue() {
- return byteValue;
- }
-
- public void setFloatValue(float floatValue) {
- this.floatValue = floatValue;
- System.out.println(this);
- }
-
- public float getFloatValue() {
- return floatValue;
- }
-
- public void setCharValue(char charValue) {
- this.charValue = charValue;
- System.out.println(this);
- }
-
- public char getCharValue() {
- return charValue;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/SampleEnum.java
----------------------------------------------------------------------
diff --git a/uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/SampleEnum.java b/uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/SampleEnum.java
deleted file mode 100644
index c5ed446..0000000
--- a/uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/SampleEnum.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package net.sf.taverna.t2.lang.uibuilder;
-
-/**
- * Very simple example enumeration
- *
- * @author Tom Oinn
- *
- */
-public enum SampleEnum {
-
- ABCD, EFGH, IJKL;
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/TopLevelBean.java
----------------------------------------------------------------------
diff --git a/uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/TopLevelBean.java b/uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/TopLevelBean.java
deleted file mode 100644
index 3a4d74e..0000000
--- a/uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/TopLevelBean.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package net.sf.taverna.t2.lang.uibuilder;
-
-/**
- * Bean containing the various other sub-beans
- *
- * @author Tom Oinn
- *
- */
-public class TopLevelBean {
-
- private SampleEnum enumeratedField = SampleEnum.ABCD;
- private BeanWithBoundProps boundBean = new BeanWithBoundProps();
- private BeanWithNestedList nest = new BeanWithNestedList();
-
- public TopLevelBean() {
- //
- }
-
- public void setEnumeratedField(SampleEnum enumeratedField) {
- this.enumeratedField = enumeratedField;
- }
-
- public SampleEnum getEnumeratedField() {
- return enumeratedField;
- }
-
- public void setBoundBean(BeanWithBoundProps boundBean) {
- this.boundBean = boundBean;
- }
-
- public BeanWithBoundProps getBoundBean() {
- return boundBean;
- }
-
- public void setNest(BeanWithNestedList nest) {
- this.nest = nest;
- }
-
- public BeanWithNestedList getNest() {
- return nest;
- }
-
-}
[22/50] [abbrv] incubator-taverna-workbench git commit: scm update
Posted by st...@apache.org.
scm update
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/commit/e0abf716
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/tree/e0abf716
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/diff/e0abf716
Branch: refs/heads/master
Commit: e0abf716b80f073a652f20a46ffb73e187fc68c1
Parents: 2c6e9c2
Author: Christian-B <br...@cs.man.ac.uk>
Authored: Wed May 14 09:12:50 2014 +0100
Committer: Christian-B <br...@cs.man.ac.uk>
Committed: Wed May 14 09:12:50 2014 +0100
----------------------------------------------------------------------
pom.xml | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e0abf716/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 961c438..0a3d8db 100644
--- a/pom.xml
+++ b/pom.xml
@@ -66,9 +66,10 @@
<module>ui</module>
<module>uibuilder</module>
</modules>
- <scm>
- <connection>scm:svn:http://taverna.googlecode.com/svn/taverna/utils/net.sf.taverna.t2.lang/trunk/</connection>
- <developerConnection>scm:svn:https://taverna.googlecode.com/svn/taverna/utils/net.sf.taverna.t2.lang/trunk/</developerConnection>
- <url>http://code.google.com/p/taverna/source/browse/#svn/taverna/utils/net.sf.taverna.t2.lang/trunk/</url>
- </scm>
+ <scm>
+ <connection>scm:git:https://github.com/taverna/taverna-support-utilities.git</connection>
+ <developerConnection>scm:git:ssh://git@github.com:taverna/taverna-support-utilities.git</developerConnection>
+ <url>https://github.com/taverna/taverna-support-utilities</url>
+ <tag>HEAD</tag>
+ </scm>
</project>
[17/50] [abbrv] incubator-taverna-workbench git commit: added
gitignore
Posted by st...@apache.org.
added gitignore
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/commit/70e36de1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/tree/70e36de1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/diff/70e36de1
Branch: refs/heads/master
Commit: 70e36de1458ebded795890f72c44547ba7b117e6
Parents: a479d54
Author: Christian-B <br...@cs.man.ac.uk>
Authored: Fri May 9 09:07:55 2014 +0100
Committer: Christian-B <br...@cs.man.ac.uk>
Committed: Fri May 9 09:07:55 2014 +0100
----------------------------------------------------------------------
.gitignore | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/70e36de1/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..ebe0e5b
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,24 @@
+# ignore project files #
+.classpath
+.project
+.settings/
+catalog-v001.xml
+
+# ignore target files #
+target/
+bin/
+build/
+dist/
+apidoc/
+*.swp
+
+# ignore svn files if there
+.svn
+
+# ignore log files #
+*.log
+/logs/*
+*/logs/*
+
+
+
[12/50] [abbrv] incubator-taverna-workbench git commit: Added link
listening as per T3-1085
Posted by st...@apache.org.
Added link listening as per T3-1085
git-svn-id: https://taverna.googlecode.com/svn/taverna/utils/net.sf.taverna.t2.lang/branches/maintenance@16835 bf327186-88b3-11dd-a302-d386e5130c1c
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/commit/af0e7688
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/tree/af0e7688
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/diff/af0e7688
Branch: refs/heads/master
Commit: af0e768861d296e6ed714720b807a6be4fd51baf
Parents: d5d915d
Author: alan@mygrid.org.uk <al...@bf327186-88b3-11dd-a302-d386e5130c1c>
Authored: Fri Mar 14 15:22:12 2014 +0000
Committer: alan@mygrid.org.uk <al...@bf327186-88b3-11dd-a302-d386e5130c1c>
Committed: Fri Mar 14 15:22:12 2014 +0000
----------------------------------------------------------------------
.../net/sf/taverna/t2/lang/ui/HtmlUtils.java | 25 ++++++++++++++++++++
1 file changed, 25 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/af0e7688/ui/src/main/java/net/sf/taverna/t2/lang/ui/HtmlUtils.java
----------------------------------------------------------------------
diff --git a/ui/src/main/java/net/sf/taverna/t2/lang/ui/HtmlUtils.java b/ui/src/main/java/net/sf/taverna/t2/lang/ui/HtmlUtils.java
index 99668a6..a30d36f 100644
--- a/ui/src/main/java/net/sf/taverna/t2/lang/ui/HtmlUtils.java
+++ b/ui/src/main/java/net/sf/taverna/t2/lang/ui/HtmlUtils.java
@@ -3,12 +3,21 @@
*/
package net.sf.taverna.t2.lang.ui;
+import static org.apache.log4j.Logger.getLogger;
+
import java.awt.BorderLayout;
+import java.awt.Desktop;
+import java.io.IOException;
+import java.net.URISyntaxException;
import java.util.HashMap;
import java.util.Map;
import javax.swing.JEditorPane;
import javax.swing.JPanel;
+import javax.swing.event.HyperlinkEvent;
+import javax.swing.event.HyperlinkListener;
+
+import org.apache.log4j.Logger;
/**
* @author alanrw
@@ -16,8 +25,24 @@ import javax.swing.JPanel;
*/
public class HtmlUtils {
+ private static Logger logger = getLogger(HtmlUtils.class);
+
+
+
public static JEditorPane createEditorPane(String html) {
JEditorPane result = new JEditorPane("text/html", html);
+ result.addHyperlinkListener(new HyperlinkListener() {
+
+ @Override
+ public void hyperlinkUpdate(HyperlinkEvent arg0) {
+ if (HyperlinkEvent.EventType.ACTIVATED == arg0.getEventType()) {
+ try {
+ Desktop.getDesktop().browse(arg0.getURL().toURI());
+ } catch (IOException | URISyntaxException e1) {
+ logger.error(e1);
+ }
+ }
+ }});
result.setEditable(false);
return result;
}
[08/50] [abbrv] incubator-taverna-workbench git commit: T3-896 Added
icons to tabs
Posted by st...@apache.org.
T3-896 Added icons to tabs
git-svn-id: https://taverna.googlecode.com/svn/taverna/utils/net.sf.taverna.t2.lang/trunk@16341 bf327186-88b3-11dd-a302-d386e5130c1c
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/commit/79819425
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/tree/79819425
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/diff/79819425
Branch: refs/heads/master
Commit: 79819425e15ce03a53cbf8cc5900b95895bffc0a
Parents: abbb57a
Author: david@mygrid.org.uk <da...@bf327186-88b3-11dd-a302-d386e5130c1c>
Authored: Mon Nov 11 16:56:48 2013 +0000
Committer: david@mygrid.org.uk <da...@bf327186-88b3-11dd-a302-d386e5130c1c>
Committed: Mon Nov 11 16:56:48 2013 +0000
----------------------------------------------------------------------
.../net/sf/taverna/t2/lang/ui/tabselector/Tab.java | 13 +++++++++++++
.../t2/lang/ui/tabselector/TabSelectorComponent.java | 4 ++++
2 files changed, 17 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/79819425/ui/src/main/java/net/sf/taverna/t2/lang/ui/tabselector/Tab.java
----------------------------------------------------------------------
diff --git a/ui/src/main/java/net/sf/taverna/t2/lang/ui/tabselector/Tab.java b/ui/src/main/java/net/sf/taverna/t2/lang/ui/tabselector/Tab.java
index 6cd9b70..3c40b42 100644
--- a/ui/src/main/java/net/sf/taverna/t2/lang/ui/tabselector/Tab.java
+++ b/ui/src/main/java/net/sf/taverna/t2/lang/ui/tabselector/Tab.java
@@ -32,6 +32,7 @@ import java.awt.RenderingHints;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
+import javax.swing.Icon;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JToggleButton;
@@ -51,10 +52,16 @@ public abstract class Tab<T> extends JToggleButton {
protected final T selection;
private String name;
+ private Icon icon;
private JLabel label;
public Tab(String name, T selection) {
+ this(name, null, selection);
+ }
+
+ public Tab(String name, Icon icon, T selection) {
this.name = name;
+ this.icon = icon;
this.selection = selection;
initialise();
}
@@ -69,6 +76,7 @@ public abstract class Tab<T> extends JToggleButton {
GridBagConstraints c = new GridBagConstraints();
label = new JLabel(this.name);
+ label.setIcon(icon);
c.anchor = GridBagConstraints.WEST;
c.fill = GridBagConstraints.BOTH;
c.insets = new Insets(0, 5, 0, 5);
@@ -101,6 +109,11 @@ public abstract class Tab<T> extends JToggleButton {
}
}
+ public void setIcon(Icon icon) {
+ label.setIcon(icon);
+ repaint();
+ }
+
@Override
public void updateUI() {
// override to ignore UI update
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/79819425/ui/src/main/java/net/sf/taverna/t2/lang/ui/tabselector/TabSelectorComponent.java
----------------------------------------------------------------------
diff --git a/ui/src/main/java/net/sf/taverna/t2/lang/ui/tabselector/TabSelectorComponent.java b/ui/src/main/java/net/sf/taverna/t2/lang/ui/tabselector/TabSelectorComponent.java
index a918143..d09b6ec 100644
--- a/ui/src/main/java/net/sf/taverna/t2/lang/ui/tabselector/TabSelectorComponent.java
+++ b/ui/src/main/java/net/sf/taverna/t2/lang/ui/tabselector/TabSelectorComponent.java
@@ -63,6 +63,10 @@ public abstract class TabSelectorComponent<T> extends JPanel {
protected abstract Tab<T> createTab(T object);
+ public Tab<T> getTab(T object) {
+ return tabMap.get(object);
+ }
+
public void addObject(T object) {
Tab<T> button = createTab(object);
tabMap.put(object, button);
[41/50] [abbrv] incubator-taverna-workbench git commit: taverna-*
Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/LinePainter.java
----------------------------------------------------------------------
diff --git a/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/LinePainter.java b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/LinePainter.java
new file mode 100644
index 0000000..0fb2926
--- /dev/null
+++ b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/LinePainter.java
@@ -0,0 +1,163 @@
+package net.sf.taverna.t2.lang.ui;
+
+import java.awt.*;
+import java.awt.event.*;
+import javax.swing.*;
+import javax.swing.event.*;
+import javax.swing.text.*;
+
+/*
+ * Track the movement of the Caret by painting a background line at the
+ * current caret position.
+ *
+ * Copied from http://www.camick.com/java/source/LinePainter.java
+ *
+ * Written by Rob Camick
+ */
+public class LinePainter
+ implements Highlighter.HighlightPainter, CaretListener, MouseListener, MouseMotionListener
+{
+ private JTextComponent component;
+
+ private Color color;
+
+ private Rectangle lastView;
+
+ /*
+ * The line color will be calculated automatically by attempting
+ * to make the current selection lighter by a factor of 1.2.
+ *
+ * @param component text component that requires background line painting
+ */
+ public LinePainter(JTextComponent component)
+ {
+ this(component, null);
+ setLighter(component.getSelectionColor());
+ }
+
+ /*
+ * Manually control the line color
+ *
+ * @param component text component that requires background line painting
+ * @param color the color of the background line
+ */
+ public LinePainter(JTextComponent component, Color color)
+ {
+ this.component = component;
+ setColor( color );
+
+ // Add listeners so we know when to change highlighting
+
+ component.addCaretListener( this );
+ component.addMouseListener( this );
+ component.addMouseMotionListener( this );
+
+ // Turn highlighting on by adding a dummy highlight
+
+ try
+ {
+ component.getHighlighter().addHighlight(0, 0, this);
+ }
+ catch(BadLocationException ble) {}
+ }
+
+ /*
+ * You can reset the line color at any time
+ *
+ * @param color the color of the background line
+ */
+ public void setColor(Color color)
+ {
+ this.color = color;
+ }
+
+ /*
+ * Calculate the line color by making the selection color lighter
+ *
+ * @return the color of the background line
+ */
+ public void setLighter(Color color)
+ {
+ int red = Math.min(255, (int)(color.getRed() * 1.2));
+ int green = Math.min(255, (int)(color.getGreen() * 1.2));
+ int blue = Math.min(255, (int)(color.getBlue() * 1.2));
+ setColor(new Color(red, green, blue));
+ }
+
+ // Paint the background highlight
+
+ public void paint(Graphics g, int p0, int p1, Shape bounds, JTextComponent c)
+ {
+ try
+ {
+ Rectangle r = c.modelToView(c.getCaretPosition());
+ g.setColor( color );
+ g.fillRect(0, r.y, c.getWidth(), r.height);
+
+ if (lastView == null)
+ lastView = r;
+ }
+ catch(BadLocationException ble) {System.out.println(ble);}
+ }
+
+ /*
+ * Caret position has changed, remove the highlight
+ */
+ private void resetHighlight()
+ {
+ // Use invokeLater to make sure updates to the Document are completed,
+ // otherwise Undo processing causes the modelToView method to loop.
+
+ SwingUtilities.invokeLater(new Runnable()
+ {
+ public void run()
+ {
+ try
+ {
+ int offset = component.getCaretPosition();
+ Rectangle currentView = component.modelToView(offset);
+
+ if (lastView == null) {
+ lastView = currentView;
+ } else {
+ // Remove the highlighting from the previously highlighted line
+ if (lastView.y != currentView.y)
+ {
+ component.repaint(0, lastView.y, component.getWidth(), lastView.height);
+ lastView = currentView;
+ }
+ }
+ }
+ catch(BadLocationException ble) {}
+ }
+ });
+ }
+
+ // Implement CaretListener
+
+ public void caretUpdate(CaretEvent e)
+ {
+ resetHighlight();
+ }
+
+ // Implement MouseListener
+
+ public void mousePressed(MouseEvent e)
+ {
+ resetHighlight();
+ }
+
+ public void mouseClicked(MouseEvent e) {}
+ public void mouseEntered(MouseEvent e) {}
+ public void mouseExited(MouseEvent e) {}
+ public void mouseReleased(MouseEvent e) {}
+
+ // Implement MouseMotionListener
+
+ public void mouseDragged(MouseEvent e)
+ {
+ resetHighlight();
+ }
+
+ public void mouseMoved(MouseEvent e) {}
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/LineWrappingTextArea.java
----------------------------------------------------------------------
diff --git a/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/LineWrappingTextArea.java b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/LineWrappingTextArea.java
new file mode 100644
index 0000000..dde1566
--- /dev/null
+++ b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/LineWrappingTextArea.java
@@ -0,0 +1,217 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.lang.ui;
+
+import java.awt.Component;
+import java.awt.Font;
+import java.awt.FontMetrics;
+import java.text.BreakIterator;
+import java.util.ArrayList;
+
+import javax.swing.JScrollPane;
+import javax.swing.JTextArea;
+
+/**
+ * A JTextArea whose text can be line wrapped either
+ * based on the size of the scroll pane that holds the text area or by a given
+ * line width in characters.
+ *
+ * @author Alex Nenadic
+ *
+ */
+@SuppressWarnings("serial")
+public class LineWrappingTextArea extends JTextArea{
+
+ String originalText;
+ String[] wrappedLines;
+ int lineWidth;
+
+ final FontMetrics fontMetrics;
+
+ public LineWrappingTextArea(String text){
+ super(text);
+ setFont(new Font("Monospaced", Font.PLAIN,12));
+ fontMetrics = this.getFontMetrics(this.getFont());
+ setCaretPosition(0);
+ originalText = text;
+ }
+
+ /**
+ * Based on:
+ * @author Robert Hanson
+ * http://progcookbook.blogspot.com/2006/02/text-wrapping-function-for-java.html
+ *
+ * This function takes a string value and a line length, and returns an array of
+ * lines. Lines are cut on word boundaries, where the word boundary is a space
+ * character. Spaces are included as the last character of a word, so most lines
+ * will actually end with a space. This isn't too problematic, but will cause a
+ * word to wrap if that space pushes it past the max line length.
+ *
+ * This is a modified version - added various word boundaries based on Java's word's
+ * BreakIterator in addition to simply space character as in the original function.
+ *
+ *
+ */
+ private String [] wrapTextIntoLines (String text, int len)
+ {
+ // BreakIterator will take care of word boundary characters for us
+ BreakIterator wordIterator = BreakIterator.getWordInstance();
+ wordIterator.setText(text);
+
+ // return empty array for null text
+ if (text == null)
+ return new String[] {};
+
+ // return text if len is zero or less
+ if (len <= 0)
+ return new String[] { text };
+
+ // return text if less than length
+ if (text.length() <= len)
+ return new String[] { text };
+
+ //char[] chars = text.toCharArray(); // no need to copy the text once again
+ ArrayList<String> lines = new ArrayList<String>();
+ StringBuffer line = new StringBuffer();
+ StringBuffer word = new StringBuffer();
+
+ for (int i = 0; i < text.length(); i++) {
+ //for (int i = 0; i < chars.length; i++) {
+ word.append(text.charAt(i));
+ //word.append(chars[i]);
+
+ if (wordIterator.isBoundary(i)){ // is this character a word boundary?
+ //if (chars[i] == ' ') {
+ if ((line.length() + word.length()) > len) {
+ lines.add(line.toString());
+ line.delete(0, line.length());
+ }
+
+ line.append(word);
+ word.delete(0, word.length());
+ }
+ }
+
+ // handle any extra chars in current word
+ if (word.length() > 0) {
+ if ((line.length() + word.length()) > len) {
+ lines.add(line.toString());
+ line.delete(0, line.length());
+ }
+ line.append(word);
+ }
+
+ // handle extra line
+ if (line.length() > 0) {
+ lines.add(line.toString());
+ }
+
+ String[] ret = new String[lines.size()];
+ int c = 0; // counter
+ for (String line2 : lines) {
+ ret[c++] = line2;
+ }
+
+ return ret;
+ }
+
+ public void wrapText() {
+ // Figure out how many characters to leave in one line
+ // Based on the size of JTextArea on the screen and font
+ // size - modified from
+ // http://www.coderanch.com/t/517006/GUI/java/Visible-column-row-count-JTextArea
+
+ // Get width of any char (font is monospaced)
+ final int charWidth = fontMetrics.charWidth('M');
+ // Get the width of the visible viewport of the scroll pane
+ // that contains the lot - loop until such a scroll pane is found
+ JScrollPane scrollPane = null;
+ Component currentComponent = getParent();
+ while (true) {
+ if (currentComponent == null) {
+ break;
+ }
+ if (currentComponent instanceof JScrollPane) {
+ scrollPane = (JScrollPane) currentComponent;
+ break;
+ } else {
+ currentComponent = currentComponent.getParent();
+ }
+ }
+ int prefWidth;
+ int maxChars;
+ if (scrollPane == null) { // We did not find the parent scroll pane
+ maxChars = 80; // wrap into lines of 80 characters
+ } else {
+ prefWidth = scrollPane.getVisibleRect().width;
+// if (scrollPane.getVerticalScrollBar().isVisible()){
+// prefWidth = prefWidth - scrollPane.getVerticalScrollBar().getWidth();
+// }
+ maxChars = prefWidth / charWidth - 3; // -3 because there is some
+ // space between the text
+ // area and the edge of
+ // scroll pane so just to be sure
+ }
+
+ // If we have not wrapped lines before or the
+ // width of the textarea has changed
+ if (wrappedLines == null || lineWidth != maxChars) {
+ lineWidth = maxChars;
+ wrappedLines = wrapTextIntoLines(getText(), lineWidth);
+ }
+
+ if (wrappedLines.length >= 1) {
+ setText(""); // clear the text area
+ StringBuffer buff = new StringBuffer();
+ for (int i = 0; i < wrappedLines.length; i++) {
+ buff.append(wrappedLines[i] + "\n");
+ }
+ // Remove the last \n
+ setText(buff.substring(0, buff.length()-1));
+ repaint();
+ }
+ }
+
+ public void wrapText(int numCharactersPerLine){
+ // If we have not wrapped lines before or the
+ // number of characters per line has changed since last
+ // we wrapped
+ if (wrappedLines == null || lineWidth != numCharactersPerLine) {
+ lineWidth = numCharactersPerLine;
+ wrappedLines = wrapTextIntoLines(getText(), lineWidth);
+ }
+
+ if (wrappedLines.length >= 1) {
+ setText(""); // clear the text area
+ for (int i = 0; i < wrappedLines.length; i++) {
+ append(wrappedLines[i] + "\n");
+ }
+ repaint();
+ }
+
+ }
+
+ public void unwrapText(){
+ setText(originalText);
+ repaint();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/NoWrapEditorKit.java
----------------------------------------------------------------------
diff --git a/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/NoWrapEditorKit.java b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/NoWrapEditorKit.java
new file mode 100644
index 0000000..f032d67
--- /dev/null
+++ b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/NoWrapEditorKit.java
@@ -0,0 +1,77 @@
+/**
+ *
+ */
+package net.sf.taverna.t2.lang.ui;
+
+import javax.swing.text.AbstractDocument;
+import javax.swing.text.BoxView;
+import javax.swing.text.ComponentView;
+import javax.swing.text.Element;
+import javax.swing.text.IconView;
+import javax.swing.text.LabelView;
+import javax.swing.text.ParagraphView;
+import javax.swing.text.StyleConstants;
+import javax.swing.text.StyledEditorKit;
+import javax.swing.text.View;
+import javax.swing.text.ViewFactory;
+
+
+/**
+ *
+ * The following class is copied from http://forums.sun.com/thread.jspa?threadID=622683
+ *
+ */
+public class NoWrapEditorKit extends StyledEditorKit
+{
+ public ViewFactory getViewFactory()
+ {
+ return new StyledViewFactory();
+ }
+
+ static class StyledViewFactory implements ViewFactory
+ {
+ public View create(Element elem)
+ {
+ String kind = elem.getName();
+
+ if (kind != null)
+ {
+ if (kind.equals(AbstractDocument.ContentElementName))
+ {
+ return new LabelView(elem);
+ }
+ else if (kind.equals(AbstractDocument.ParagraphElementName))
+ {
+ return new ParagraphView(elem);
+ }
+ else if (kind.equals(AbstractDocument.SectionElementName))
+ {
+ return new NoWrapBoxView(elem, View.Y_AXIS);
+ }
+ else if (kind.equals(StyleConstants.ComponentElementName))
+ {
+ return new ComponentView(elem);
+ }
+ else if (kind.equals(StyleConstants.IconElementName))
+ {
+ return new IconView(elem);
+ }
+ }
+
+ return new LabelView(elem);
+ }
+ }
+
+ static class NoWrapBoxView extends BoxView {
+ public NoWrapBoxView(Element elem, int axis) {
+ super(elem, axis);
+ }
+
+ public void layout(int width, int height) {
+ super.layout(32768, height);
+ }
+ public float getMinimumSpan(int axis) {
+ return super.getPreferredSpan(axis);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/ReadOnlyTextArea.java
----------------------------------------------------------------------
diff --git a/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/ReadOnlyTextArea.java b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/ReadOnlyTextArea.java
new file mode 100644
index 0000000..0759605
--- /dev/null
+++ b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/ReadOnlyTextArea.java
@@ -0,0 +1,50 @@
+/**
+ *
+ */
+package net.sf.taverna.t2.lang.ui;
+
+import javax.swing.JTextArea;
+import javax.swing.text.Document;
+
+/**
+ * @author alanrw
+ *
+ */
+public class ReadOnlyTextArea extends JTextArea {
+
+ public ReadOnlyTextArea () {
+ super();
+ setFields();
+ }
+
+ public ReadOnlyTextArea(Document doc) {
+ super(doc);
+ setFields();
+ }
+
+ public ReadOnlyTextArea (Document doc, String text, int rows, int columns) {
+ super(doc,text,rows,columns);
+ setFields();
+ }
+
+ public ReadOnlyTextArea(int rows, int columns) {
+ super(rows, columns);
+ setFields();
+ }
+
+ public ReadOnlyTextArea(String text) {
+ super(text);
+ setFields();
+ }
+
+ public ReadOnlyTextArea(String text, int rows, int columns) {
+ super(text, rows, columns);
+ setFields();
+ }
+
+ private void setFields() {
+ super.setEditable(false);
+ super.setLineWrap(true);
+ super.setWrapStyleWord(true);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/SanitisingDocumentFilter.java
----------------------------------------------------------------------
diff --git a/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/SanitisingDocumentFilter.java b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/SanitisingDocumentFilter.java
new file mode 100644
index 0000000..2a91e18
--- /dev/null
+++ b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/SanitisingDocumentFilter.java
@@ -0,0 +1,60 @@
+/**
+ *
+ */
+package net.sf.taverna.t2.lang.ui;
+
+import java.util.regex.Pattern;
+
+import javax.swing.text.AbstractDocument;
+import javax.swing.text.AttributeSet;
+import javax.swing.text.BadLocationException;
+import javax.swing.text.Document;
+import javax.swing.text.DocumentFilter;
+import javax.swing.text.JTextComponent;
+
+/**
+ * @author alanrw
+ *
+ */
+public class SanitisingDocumentFilter extends DocumentFilter {
+
+ private static SanitisingDocumentFilter INSTANCE = new SanitisingDocumentFilter();
+
+ private SanitisingDocumentFilter () {
+ super();
+ }
+
+ public static void addFilterToComponent(JTextComponent c) {
+ Document d = c.getDocument();
+ if (d instanceof AbstractDocument) {
+ ((AbstractDocument) d).setDocumentFilter(INSTANCE);
+ }
+ }
+
+ public void insertString(DocumentFilter.FilterBypass fb, int offset, String string, AttributeSet attr) throws BadLocationException {
+
+ fb.insertString(offset, sanitiseString(string), attr);
+ }
+
+ public void replace(DocumentFilter.FilterBypass fb, int offset, int length,
+ String text, javax.swing.text.AttributeSet attr)
+
+ throws BadLocationException {
+ fb.replace(offset, length, sanitiseString(text), attr);
+ }
+
+ private static String sanitiseString(String text) {
+ String result = text;
+ if (Pattern.matches("\\w++", text) == false) {
+ result = "";
+ for (char c : text.toCharArray()) {
+ if (Character.isLetterOrDigit(c) || c == '_') {
+ result += c;
+ } else {
+ result += "_";
+ }
+ }
+ }
+ return result;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/ShadedLabel.java
----------------------------------------------------------------------
diff --git a/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/ShadedLabel.java b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/ShadedLabel.java
new file mode 100644
index 0000000..27ebe33
--- /dev/null
+++ b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/ShadedLabel.java
@@ -0,0 +1,126 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+/**
+ * This file is a component of the Taverna project,
+ * and is licensed under the GNU LGPL.
+ * Copyright Tom Oinn, EMBL-EBI
+ */
+package net.sf.taverna.t2.lang.ui;
+
+import java.awt.Color;
+import java.awt.FlowLayout;
+import java.awt.GradientPaint;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.Paint;
+
+import javax.swing.Box;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.SwingConstants;
+
+/**
+ * A JLabel like component with a shaded background
+ *
+ * @author Tom Oinn
+ */
+public class ShadedLabel extends JPanel {
+
+ // If you change these, please make sure BLUE is really blue, etc.. :-)
+
+ public static Color ORANGE = new Color(238, 206, 143);
+
+ public static Color BLUE = new Color(213, 229, 246);
+
+ public static Color GREEN = new Color(161, 198, 157);
+
+ final JLabel label;
+
+ Color colour;
+
+ Color toColour = Color.WHITE;
+
+ private String text;
+
+ /**
+ * Create a ShadedLabel blending from the specified colour to white (left to
+ * right) and with the specified text.
+ */
+ public ShadedLabel(String text, Color colour) {
+ this(text, colour, false);
+ }
+
+ /**
+ * Create a ShadedLabel blending from the specified colour to either white
+ * if halfShade is false or to a colour halfway between the specified colour
+ * and white if true and with the specified text
+ */
+ public ShadedLabel(String text, Color colour, boolean halfShade) {
+ super(new FlowLayout(FlowLayout.LEFT, 0, 3));
+
+ if (halfShade) {
+ toColour = halfShade(colour);
+ }
+ label = new JLabel("",
+ SwingConstants.LEFT);
+ setText(text);
+ label.setOpaque(false);
+ add(Box.createHorizontalStrut(5));
+ add(label);
+ add(Box.createHorizontalStrut(5));
+ setOpaque(false);
+ this.colour = colour;
+ }
+
+ public void setText(String text) {
+ this.text = text;
+ label.setText("<html><body><b>" + text + "</b></body></html>");
+ invalidate();
+ }
+
+ public String getText() {
+ return text;
+ }
+
+ @Override
+ protected void paintComponent(Graphics g) {
+ final int width = getWidth();
+ final int height = getHeight();
+ Graphics2D g2d = (Graphics2D) g;
+ Paint oldPaint = g2d.getPaint();
+ g2d.setPaint(new GradientPaint(0, 0, this.colour, width, height,
+ toColour));
+ g2d.fillRect(0, 0, width, height);
+ g2d.setPaint(oldPaint);
+ super.paintComponent(g);
+ }
+
+ public static Color halfShade(Color colour) {
+ return new Color((colour.getRed() + 510) / 3,
+ (colour.getGreen() + 510) / 3, (colour.getBlue() + 510) / 3);
+ }
+
+ @Override
+ public boolean isFocusable() {
+ return false;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/TableMap.java
----------------------------------------------------------------------
diff --git a/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/TableMap.java b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/TableMap.java
new file mode 100644
index 0000000..dbef4c0
--- /dev/null
+++ b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/TableMap.java
@@ -0,0 +1,69 @@
+/**
+ *
+ */
+package net.sf.taverna.t2.lang.ui;
+
+import javax.swing.table.AbstractTableModel;
+import javax.swing.table.TableModel;
+import javax.swing.event.TableModelListener;
+import javax.swing.event.TableModelEvent;
+
+/**
+ * Copied from code found at http://www.informit.com/guides/content.aspx?g=java&seqNum=57
+ *
+ */
+public class TableMap extends AbstractTableModel implements TableModelListener {
+ protected TableModel model;
+
+ public TableModel getModel() {
+ return model;
+ }
+
+ public void setModel(TableModel model) {
+ this.model = model;
+ model.addTableModelListener(this);
+ }
+
+ // By default, implement TableModel by forwarding all messages
+ // to the model.
+
+ public Object getValueAt(int aRow, int aColumn) {
+ return model.getValueAt(aRow, aColumn);
+ }
+
+ public void setValueAt(Object aValue, int aRow, int aColumn) {
+ model.setValueAt(aValue, aRow, aColumn);
+ }
+
+ public int getRowCount() {
+ return (model == null) ? 0 : model.getRowCount();
+ }
+
+ public int getColumnCount() {
+ return (model == null) ? 0 : model.getColumnCount();
+ }
+
+ public String getColumnName(int aColumn) {
+ return model.getColumnName(aColumn);
+ }
+
+ public Class getColumnClass(int aColumn) {
+ return model.getColumnClass(aColumn);
+ }
+
+ public boolean isCellEditable(int row, int column) {
+ return model.isCellEditable(row, column);
+ }
+
+ public int transposeRow(int row) {
+ return row;
+ }
+
+ //
+ // Implementation of the TableModelListener interface,
+ //
+ // By default forward all events to all the listeners.
+ public void tableChanged(TableModelEvent e) {
+ fireTableChanged(e);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/TableSorter.java
----------------------------------------------------------------------
diff --git a/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/TableSorter.java b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/TableSorter.java
new file mode 100644
index 0000000..7c7083d
--- /dev/null
+++ b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/TableSorter.java
@@ -0,0 +1,341 @@
+/**
+ *
+ */
+package net.sf.taverna.t2.lang.ui;
+
+/**
+ * Copied from code found at http://www.informit.com/guides/content.aspx?g=java&seqNum=57
+ */
+
+import java.util.Date;
+import java.util.Vector;
+
+import javax.swing.table.TableModel;
+import javax.swing.event.TableModelEvent;
+
+//Imports for picking up mouse events from the JTable.
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.InputEvent;
+import javax.swing.JTable;
+import javax.swing.table.JTableHeader;
+import javax.swing.table.TableColumnModel;
+
+public class TableSorter extends TableMap {
+ int indexes[];
+ Vector sortingColumns = new Vector();
+ boolean ascending = true;
+ int compares;
+
+ public TableSorter() {
+ indexes = new int[0]; // for consistency
+ }
+
+ public TableSorter(TableModel model) {
+ setModel(model);
+ }
+
+ public void setModel(TableModel model) {
+ super.setModel(model);
+ reallocateIndexes();
+ }
+
+ public int compareRowsByColumn(int row1, int row2, int column) {
+ Class type = model.getColumnClass(column);
+ TableModel data = model;
+
+ // Check for nulls.
+
+ Object o1 = data.getValueAt(row1, column);
+ Object o2 = data.getValueAt(row2, column);
+
+ // If both values are null, return 0.
+ if (o1 == null && o2 == null) {
+ return 0;
+ } else if (o1 == null) { // Define null less than everything.
+ return -1;
+ } else if (o2 == null) {
+ return 1;
+ }
+
+ if (o1 instanceof Comparable) {
+ return ((Comparable) o1).compareTo(o2);
+ }
+ /*
+ * We copy all returned values from the getValue call in case an
+ * optimised model is reusing one object to return many values. The
+ * Number subclasses in the JDK are immutable and so will not be used in
+ * this way but other subclasses of Number might want to do this to save
+ * space and avoid unnecessary heap allocation.
+ */
+
+ if (type.getSuperclass() == java.lang.Number.class) {
+ Number n1 = (Number) data.getValueAt(row1, column);
+ double d1 = n1.doubleValue();
+ Number n2 = (Number) data.getValueAt(row2, column);
+ double d2 = n2.doubleValue();
+
+ if (d1 < d2) {
+ return -1;
+ } else if (d1 > d2) {
+ return 1;
+ } else {
+ return 0;
+ }
+ } else if (type == java.util.Date.class) {
+ Date d1 = (Date) data.getValueAt(row1, column);
+ long n1 = d1.getTime();
+ Date d2 = (Date) data.getValueAt(row2, column);
+ long n2 = d2.getTime();
+
+ if (n1 < n2) {
+ return -1;
+ } else if (n1 > n2) {
+ return 1;
+ } else {
+ return 0;
+ }
+ } else if (type == String.class) {
+ String s1 = (String) data.getValueAt(row1, column);
+ String s2 = (String) data.getValueAt(row2, column);
+ int result = s1.compareTo(s2);
+
+ if (result < 0) {
+ return -1;
+ } else if (result > 0) {
+ return 1;
+ } else {
+ return 0;
+ }
+ } else if (type == Boolean.class) {
+ Boolean bool1 = (Boolean) data.getValueAt(row1, column);
+ boolean b1 = bool1.booleanValue();
+ Boolean bool2 = (Boolean) data.getValueAt(row2, column);
+ boolean b2 = bool2.booleanValue();
+
+ if (b1 == b2) {
+ return 0;
+ } else if (b1) { // Define false < true
+ return 1;
+ } else {
+ return -1;
+ }
+ } else {
+ Object v1 = data.getValueAt(row1, column);
+ String s1 = v1.toString();
+ Object v2 = data.getValueAt(row2, column);
+ String s2 = v2.toString();
+ int result = s1.compareTo(s2);
+
+ if (result < 0) {
+ return -1;
+ } else if (result > 0) {
+ return 1;
+ } else {
+ return 0;
+ }
+ }
+ }
+
+ public int compare(int row1, int row2) {
+ compares++;
+ for (int level = 0; level < sortingColumns.size(); level++) {
+ Integer column = (Integer) sortingColumns.elementAt(level);
+ int result = compareRowsByColumn(row1, row2, column.intValue());
+ if (result != 0) {
+ return ascending ? result : -result;
+ }
+ }
+ return 0;
+ }
+
+ public void reallocateIndexes() {
+ int rowCount = model.getRowCount();
+
+ // Set up a new array of indexes with the right number of elements
+ // for the new data model.
+ indexes = new int[rowCount];
+
+ // Initialise with the identity mapping.
+ for (int row = 0; row < rowCount; row++) {
+ indexes[row] = row;
+ }
+ }
+
+ public void tableChanged(TableModelEvent e) {
+ // System.out.println("Sorter: tableChanged");
+ reallocateIndexes();
+
+ super.tableChanged(e);
+ }
+
+ public void checkModel() {
+ if (indexes.length != model.getRowCount()) {
+ System.err.println("Sorter not informed of a change in model.");
+ }
+ }
+
+ public void sort(Object sender) {
+ checkModel();
+
+ compares = 0;
+ // n2sort();
+ // qsort(0, indexes.length-1);
+ shuttlesort((int[]) indexes.clone(), indexes, 0, indexes.length);
+ // System.out.println("Compares: "+compares);
+ }
+
+ public void n2sort() {
+ for (int i = 0; i < getRowCount(); i++) {
+ for (int j = i + 1; j < getRowCount(); j++) {
+ if (compare(indexes[i], indexes[j]) == -1) {
+ swap(i, j);
+ }
+ }
+ }
+ }
+
+ // This is a home-grown implementation which we have not had time
+ // to research - it may perform poorly in some circumstances. It
+ // requires twice the space of an in-place algorithm and makes
+ // NlogN assigments shuttling the values between the two
+ // arrays. The number of compares appears to vary between N-1 and
+ // NlogN depending on the initial order but the main reason for
+ // using it here is that, unlike qsort, it is stable.
+ public void shuttlesort(int from[], int to[], int low, int high) {
+ if (high - low < 2) {
+ return;
+ }
+ int middle = (low + high) / 2;
+ shuttlesort(to, from, low, middle);
+ shuttlesort(to, from, middle, high);
+
+ int p = low;
+ int q = middle;
+
+ /*
+ * This is an optional short-cut; at each recursive call, check to see
+ * if the elements in this subset are already ordered. If so, no further
+ * comparisons are needed; the sub-array can just be copied. The array
+ * must be copied rather than assigned otherwise sister calls in the
+ * recursion might get out of sinc. When the number of elements is three
+ * they are partitioned so that the first set, [low, mid), has one
+ * element and and the second, [mid, high), has two. We skip the
+ * optimisation when the number of elements is three or less as the
+ * first compare in the normal merge will produce the same sequence of
+ * steps. This optimisation seems to be worthwhile for partially ordered
+ * lists but some analysis is needed to find out how the performance
+ * drops to Nlog(N) as the initial order diminishes - it may drop very
+ * quickly.
+ */
+
+ if (high - low >= 4 && compare(from[middle - 1], from[middle]) <= 0) {
+ for (int i = low; i < high; i++) {
+ to[i] = from[i];
+ }
+ return;
+ }
+
+ // A normal merge.
+
+ for (int i = low; i < high; i++) {
+ if (q >= high || (p < middle && compare(from[p], from[q]) <= 0)) {
+ to[i] = from[p++];
+ } else {
+ to[i] = from[q++];
+ }
+ }
+ }
+
+ public void swap(int i, int j) {
+ int tmp = indexes[i];
+ indexes[i] = indexes[j];
+ indexes[j] = tmp;
+ }
+
+ // The mapping only affects the contents of the data rows.
+ // Pass all requests to these rows through the mapping array: "indexes".
+
+ public Object getValueAt(int aRow, int aColumn) {
+ checkModel();
+ return model.getValueAt(indexes[aRow], aColumn);
+ }
+
+ public void setValueAt(Object aValue, int aRow, int aColumn) {
+ checkModel();
+ model.setValueAt(aValue, indexes[aRow], aColumn);
+ }
+
+ public void sortByColumn(int column) {
+ sortByColumn(column, true);
+ }
+
+ public void sortByColumn(int column, boolean ascending) {
+ this.ascending = ascending;
+ sortingColumns.removeAllElements();
+ sortingColumns.addElement(new Integer(column));
+ sort(this);
+ super.tableChanged(new TableModelEvent(this));
+ }
+
+ private int lastSortedColumn = -1;
+ private boolean lastAscending = false;
+
+ public void sortColumn(JTable tableView, int column) {
+ int currentlySelectedRow = tableView.getSelectedRow();
+ int underlyingSelectedRow = -1;
+ if (currentlySelectedRow != -1) {
+ underlyingSelectedRow = transposeRow(currentlySelectedRow);
+ }
+ // System.out.println("Sorting ...");
+ boolean ascendingColumn = true;
+ if (lastSortedColumn == column) {
+ ascendingColumn = !lastAscending;
+ }
+ lastSortedColumn = column;
+ lastAscending = ascendingColumn;
+ this.sortByColumn(column, ascendingColumn);
+ if (underlyingSelectedRow != -1) {
+ for (int row = 0; row < indexes.length; row++) {
+ if (transposeRow(row) == underlyingSelectedRow) {
+ tableView.setRowSelectionInterval(row, row);
+ }
+ }
+ }
+ }
+
+ public void resort(JTable tableView) {
+ if (lastSortedColumn != -1) {
+ lastAscending = !lastAscending;
+ sortColumn(tableView, lastSortedColumn);
+ }
+ }
+
+ // There is no-where else to put this.
+ // Add a mouse listener to the Table to trigger a table sort
+ // when a column heading is clicked in the JTable.
+ public void addMouseListenerToHeaderInTable(JTable table) {
+ final TableSorter sorter = this;
+ final JTable tableView = table;
+ tableView.setColumnSelectionAllowed(false);
+ MouseAdapter listMouseListener = new MouseAdapter() {
+
+ private int lastClickedColumn = -1;
+ private boolean lastAscending = false;
+ public void mouseClicked(MouseEvent e) {
+ TableColumnModel columnModel = tableView.getColumnModel();
+ int viewColumn = columnModel.getColumnIndexAtX(e.getX());
+ int column = tableView.convertColumnIndexToModel(viewColumn);
+ if (e.getClickCount() == 1 && column != -1) {
+ sortColumn(tableView, column);
+ }
+ }
+ };
+ JTableHeader th = tableView.getTableHeader();
+ th.addMouseListener(listMouseListener);
+ }
+
+ public int transposeRow(int row) {
+ return indexes[row];
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/ValidatingUserInputDialog.java
----------------------------------------------------------------------
diff --git a/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/ValidatingUserInputDialog.java b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/ValidatingUserInputDialog.java
new file mode 100644
index 0000000..005b4b4
--- /dev/null
+++ b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/ValidatingUserInputDialog.java
@@ -0,0 +1,274 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.lang.ui;
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.FlowLayout;
+import java.awt.Font;
+import java.awt.Insets;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.FocusAdapter;
+import java.awt.event.FocusEvent;
+import java.awt.event.KeyAdapter;
+import java.awt.event.KeyEvent;
+import java.util.Set;
+
+import javax.swing.JButton;
+import javax.swing.JDialog;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JTextArea;
+import javax.swing.border.EmptyBorder;
+import javax.swing.event.DocumentEvent;
+import javax.swing.event.DocumentListener;
+import javax.swing.text.JTextComponent;
+
+import net.sf.taverna.t2.lang.ui.icons.Icons;
+
+/**
+ * A user input dialog that validates the input as the user is entering the
+ * input and gives feedback on why the input is invalid.
+ *
+ * @author David Withers
+ */
+public class ValidatingUserInputDialog extends JDialog {
+
+ private static final long serialVersionUID = 1L;
+
+ private String inputTitle;
+
+ private JButton okButton;
+
+ private JButton cancelButton;
+
+ private JTextArea inputText;
+
+ private JPanel inputPanel;
+
+ private JLabel iconLabel;
+
+ private boolean valid = true;
+
+ private boolean result = false;
+
+ /**
+ * Constructs a new instance of ValidatingUserInputDialog.
+ *
+ * @param inputTitle
+ * the title for the dialog.
+ * @param inputMessage
+ * the message describing what the user should input.
+ */
+ public ValidatingUserInputDialog(String inputTitle, JPanel inputPanel) {
+ this.inputTitle = inputTitle;
+ this.inputPanel = inputPanel;
+ initialize();
+ }
+
+ /**
+ * Adds a text component and the rules for a valid user entry.
+ *
+ * @param textComponent
+ * the text component to validate
+ * @param invalidInputs
+ * a set of inputs that are not valid. This is typically a set of
+ * already used identifiers to avoid name clashes. Can be an
+ * empty set or null.
+ * @param invalidInputsMessage
+ * the message to display if the user enters a value that is in
+ * invalidInputs.
+ * @param inputRegularExpression
+ * a regular expression that specifies a valid user input. Can be
+ * null.
+ * @param inputRegularExpressionMessage
+ * the message to display if the user enters a value that doesn't
+ * match the inputRegularExpression.
+ */
+ public void addTextComponentValidation(final JTextComponent textComponent,
+ final String inputMessage, final Set<String> invalidInputs,
+ final String invalidInputsMessage,
+ final String inputRegularExpression,
+ final String inputRegularExpressionMessage) {
+ textComponent.getDocument().addDocumentListener(new DocumentListener() {
+ public void changedUpdate(DocumentEvent e) {
+ }
+
+ public void insertUpdate(DocumentEvent e) {
+ verify(textComponent.getText(), inputMessage, invalidInputs,
+ invalidInputsMessage, inputRegularExpression,
+ inputRegularExpressionMessage);
+ }
+
+ public void removeUpdate(DocumentEvent e) {
+ verify(textComponent.getText(), inputMessage, invalidInputs,
+ invalidInputsMessage, inputRegularExpression,
+ inputRegularExpressionMessage);
+ }
+ });
+ textComponent.addKeyListener(new KeyAdapter() {
+ boolean okDown = false;
+
+ public void keyPressed(KeyEvent e) {
+ if (okButton.isEnabled() && e.getKeyCode() == KeyEvent.VK_ENTER) {
+ okDown = true;
+ }
+ }
+ public void keyReleased(KeyEvent e) {
+ if (okDown && okButton.isEnabled() && e.getKeyCode() == KeyEvent.VK_ENTER) {
+ okButton.doClick();
+ }
+ }
+ });
+ textComponent.addFocusListener(new FocusAdapter() {
+ public void focusGained(FocusEvent e) {
+ if (valid) {
+ setMessage(inputMessage);
+ }
+ }
+ });
+ }
+
+ /**
+ * Adds a component and a message to display when the component is in focus.
+ *
+ * @param component
+ * the component to add
+ * @param message
+ * the message to display when the component is in focus
+ */
+ public void addMessageComponent(Component component, final String message) {
+ component.addFocusListener(new FocusAdapter() {
+ public void focusGained(FocusEvent e) {
+ if (valid) {
+ setMessage(message);
+ }
+ }
+ });
+ }
+
+ private void initialize() {
+ setLayout(new BorderLayout());
+
+ JPanel messagePanel = new JPanel(new BorderLayout());
+ messagePanel.setBorder(new EmptyBorder(5, 5, 0, 0));
+ messagePanel.setBackground(Color.WHITE);
+
+ add(messagePanel, BorderLayout.NORTH);
+
+ JLabel inputLabel = new JLabel(inputTitle);
+ inputLabel.setBackground(Color.WHITE);
+ Font baseFont = inputLabel.getFont();
+ inputLabel.setFont(baseFont.deriveFont(Font.BOLD));
+ messagePanel.add(inputLabel, BorderLayout.NORTH);
+
+ inputText = new JTextArea();
+ inputText.setMargin(new Insets(5, 10, 10, 10));
+ inputText.setMinimumSize(new Dimension(0, 30));
+ inputText.setFont(baseFont.deriveFont(11f));
+ inputText.setEditable(false);
+ inputText.setFocusable(false);
+ messagePanel.add(inputText, BorderLayout.CENTER);
+
+ iconLabel = new JLabel();
+ messagePanel.add(iconLabel, BorderLayout.WEST);
+
+ add(inputPanel, BorderLayout.CENTER);
+
+ JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.TRAILING));
+ add(buttonPanel, BorderLayout.SOUTH);
+
+ okButton = new JButton("OK");
+ okButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ result = valid;
+ setVisible(false);
+ }
+ });
+ okButton.setEnabled(false);
+ buttonPanel.add(okButton);
+
+ cancelButton = new JButton("Cancel");
+ cancelButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ setVisible(false);
+ }
+ });
+ buttonPanel.add(cancelButton);
+
+ setModal(true);
+ setDefaultCloseOperation(HIDE_ON_CLOSE);
+ }
+
+ public void setMessage(String message) {
+ iconLabel.setIcon(null);
+ inputText.setText(message);
+ }
+
+ public void setWarningMessage(String message) {
+ iconLabel.setIcon(Icons.warningIcon);
+ inputText.setText(message);
+ }
+
+ public void setErrorMessage(String message) {
+ iconLabel.setIcon(Icons.severeIcon);
+ inputText.setText(message);
+ }
+
+ private void verify(String text, String inputMessage,
+ Set<String> invalidInputs, String invalidInputsMessage,
+ String inputRegularExpression, String inputRegularExpressionMessage) {
+ if (invalidInputs != null && invalidInputs.contains(text)) {
+ setErrorMessage(invalidInputsMessage);
+ valid = false;
+ } else if (inputRegularExpression != null
+ && !text.matches(inputRegularExpression)) {
+ setErrorMessage(inputRegularExpressionMessage);
+ valid = false;
+ } else {
+ setMessage(inputMessage);
+ valid = true;
+ }
+ okButton.setEnabled(valid);
+// okButton.setSelected(valid);
+ }
+
+ /**
+ * Show the dialog relative to the component. If the component is null then
+ * the dialog is shown in the centre of the screen.
+ *
+ * Returns true if the user input is valid.
+ *
+ * @param component
+ * the component that the dialog is shown relative to
+ * @return true if the user input is valid
+ */
+ public boolean show(Component component) {
+ setLocationRelativeTo(component);
+ setVisible(true);
+ dispose();
+ return result;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/icons/Icons.java
----------------------------------------------------------------------
diff --git a/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/icons/Icons.java b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/icons/Icons.java
new file mode 100644
index 0000000..398b3f4
--- /dev/null
+++ b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/icons/Icons.java
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.lang.ui.icons;
+
+import javax.swing.ImageIcon;
+
+import org.apache.log4j.Logger;
+
+public class Icons {
+
+ private static Logger logger = Logger.getLogger(Icons.class);
+
+
+
+ public static ImageIcon okIcon;
+ public static ImageIcon severeIcon;
+ public static ImageIcon warningIcon;
+
+ static {
+ try {
+ Class c = Icons.class;
+ okIcon = new ImageIcon(c.getResource("ok.png"));
+ severeIcon = new ImageIcon(c.getResource("severe.png"));
+ warningIcon = new ImageIcon(c.getResource("warning.png"));
+
+ } catch (Exception ex) {
+ logger.error("Unable to load standard icons", ex);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/tabselector/ScrollController.java
----------------------------------------------------------------------
diff --git a/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/tabselector/ScrollController.java b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/tabselector/ScrollController.java
new file mode 100644
index 0000000..f7218a6
--- /dev/null
+++ b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/tabselector/ScrollController.java
@@ -0,0 +1,85 @@
+/*******************************************************************************
+ * Copyright (C) 2013 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.lang.ui.tabselector;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.JButton;
+import javax.swing.JComponent;
+
+/**
+ * Controls tab scrolling when there is not enough space to show all the tabs.
+ *
+ * @author David Withers
+ */
+public class ScrollController {
+
+ private int position;
+ private final JButton scrollLeft;
+ private final JButton scrollRight;
+
+ public ScrollController(final JComponent component) {
+ scrollLeft = new JButton("<");
+ scrollRight = new JButton(">");
+ scrollLeft.setOpaque(true);
+ scrollRight.setOpaque(true);
+ scrollLeft.addActionListener(new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ increment();
+ component.doLayout();
+ }
+ });
+ scrollRight.addActionListener(new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ decrement();
+ component.doLayout();
+ }
+ });
+ }
+
+ public JButton getScrollLeft() {
+ return scrollLeft;
+ }
+
+ public JButton getScrollRight() {
+ return scrollRight;
+ }
+
+ public int getPosition() {
+ return position;
+ }
+
+ public void reset() {
+ position = 0;
+ }
+
+ public void increment() {
+ position++;
+ }
+
+ public void decrement() {
+ position--;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/tabselector/Tab.java
----------------------------------------------------------------------
diff --git a/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/tabselector/Tab.java b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/tabselector/Tab.java
new file mode 100644
index 0000000..3c40b42
--- /dev/null
+++ b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/tabselector/Tab.java
@@ -0,0 +1,200 @@
+/*******************************************************************************
+ * Copyright (C) 2012 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.lang.ui.tabselector;
+
+import java.awt.BasicStroke;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+import java.awt.RenderingHints;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.Icon;
+import javax.swing.JButton;
+import javax.swing.JLabel;
+import javax.swing.JToggleButton;
+import javax.swing.plaf.basic.BasicButtonUI;
+
+/**
+ * Tab button that includes a label and a close button.
+ *
+ * @author David Withers
+ */
+public abstract class Tab<T> extends JToggleButton {
+
+ private static final long serialVersionUID = 1L;
+
+ public final static Color midGrey = new Color(160,160,160);
+ public final static Color lightGrey = new Color(200,200,200);
+
+ protected final T selection;
+ private String name;
+ private Icon icon;
+ private JLabel label;
+
+ public Tab(String name, T selection) {
+ this(name, null, selection);
+ }
+
+ public Tab(String name, Icon icon, T selection) {
+ this.name = name;
+ this.icon = icon;
+ this.selection = selection;
+ initialise();
+ }
+
+ private void initialise() {
+ setUI(new BasicButtonUI());
+ setLayout(new GridBagLayout());
+ setOpaque(false);
+ setBackground(Color.red);
+ setBorder(null);
+
+ GridBagConstraints c = new GridBagConstraints();
+
+ label = new JLabel(this.name);
+ label.setIcon(icon);
+ c.anchor = GridBagConstraints.WEST;
+ c.fill = GridBagConstraints.BOTH;
+ c.insets = new Insets(0, 5, 0, 5);
+ c.weightx = 1;
+ add(label, c);
+
+ JButton button = new CloseWorkflowButton();
+ c.fill = GridBagConstraints.NONE;
+ c.insets = new Insets(0, 0, 0, 5);
+ c.weightx = 0;
+ add(button, c);
+
+ addActionListener(new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ clickTabAction();
+ }
+ });
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ if (!this.name.equals(name)) {
+ this.name = name;
+ label.setText(name);
+ repaint();
+ }
+ }
+
+ public void setIcon(Icon icon) {
+ label.setIcon(icon);
+ repaint();
+ }
+
+ @Override
+ public void updateUI() {
+ // override to ignore UI update
+ }
+
+ @Override
+ protected void paintComponent(Graphics g) {
+ super.paintComponent(g);
+ Graphics2D g2 = (Graphics2D) g.create();
+ if (getModel().isPressed()) {
+ g2.translate(1, 1);
+ }
+ if (!getModel().isSelected()) {
+ g2.setColor(lightGrey);
+ g2.fillRoundRect(1, 0, getWidth() - 3, getHeight() - 1, 4, 10);
+ }
+ g2.setColor(midGrey);
+ g2.drawRoundRect(1, 0, getWidth() - 3, getHeight(), 4, 10);
+ if (getModel().isSelected()) {
+ g2.setColor(getParent().getBackground());
+ g2.drawLine(1, getHeight() - 1, getWidth() - 2, getHeight() - 1);
+ }
+ g2.dispose();
+ }
+
+ protected abstract void clickTabAction();
+
+ protected abstract void closeTabAction();
+
+ @SuppressWarnings("serial")
+ private class CloseWorkflowButton extends JButton {
+
+ private final int size = 15;
+ private final int border = 4;
+
+ public CloseWorkflowButton() {
+ setUI(new BasicButtonUI());
+ setPreferredSize(new Dimension(size, size));
+ setMinimumSize(new Dimension(size, size));
+ setContentAreaFilled(false);
+ setFocusable(false);
+ setToolTipText("Close workflow");
+
+ setRolloverEnabled(true);
+ addActionListener(new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ closeTabAction();
+ }
+ });
+ }
+
+ @Override
+ public void updateUI() {
+ // override to ignore UI update
+ }
+
+ @Override
+ protected void paintComponent(Graphics g) {
+ super.paintComponent(g);
+ Graphics2D g2 = (Graphics2D) g.create();
+ // animate button press
+ if (getModel().isPressed()) {
+ g2.translate(1, 1);
+ }
+ g2.setColor(midGrey);
+ if (getModel().isRollover()) {
+ // draw armed button
+ g2.fillRoundRect(0, 0, size - 1, size - 1, 4, 4);
+ g2.setColor(Color.GRAY);
+ g2.drawRoundRect(0, 0, size - 1, size - 1, 4, 4);
+ g2.setColor(Color.RED);
+ }
+ // draw 'x'
+ g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE);
+ g2.setStroke(new BasicStroke(2.5f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_BEVEL));
+ g2.drawLine(border, border, size - border, size - border);
+ g2.drawLine(border, size - border, size - border, border);
+ g2.dispose();
+ }
+
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/tabselector/TabLayout.java
----------------------------------------------------------------------
diff --git a/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/tabselector/TabLayout.java b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/tabselector/TabLayout.java
new file mode 100644
index 0000000..2a12f0e
--- /dev/null
+++ b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/tabselector/TabLayout.java
@@ -0,0 +1,135 @@
+/*******************************************************************************
+ * Copyright (C) 2012 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.lang.ui.tabselector;
+
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.Dimension;
+import java.awt.Insets;
+import java.awt.LayoutManager;
+
+/**
+ * LayoutManager for laying out tabs.
+ * <p>
+ * Tabs are made all the same width and prefer to be maximumTabWidth. If there is more than
+ * preferred width available extra space is left blank. If there is not enough width for tabs to be
+ * maximumTabWidth tab width is reduced until it reaches minimumTabWidth. If there is not enough
+ * width to show tabs at minimumTabWidth scroll buttons are shows and tabs can be scrolled within
+ * the available width.
+ *
+ * @author David Withers
+ */
+public class TabLayout implements LayoutManager {
+
+ public static final int DEFAULT_MINIMUM_TAB_WIDTH = 100;
+ public static final int DEFAULT_MAXIMUM_TAB_WIDTH = 250;
+ public static final int DEFAULT_TAB_HEIGHT = 22;
+ public static final int DEFAULT_SCROLL_BUTTON_WIDTH = 22;
+
+ private final int minimumTabWidth, maximumTabWidth, tabHeight, scrollButtonWidth;
+ private final ScrollController scrollController;
+
+ public TabLayout(ScrollController scrollController) {
+ this(scrollController, DEFAULT_MINIMUM_TAB_WIDTH, DEFAULT_MAXIMUM_TAB_WIDTH,
+ DEFAULT_TAB_HEIGHT, DEFAULT_SCROLL_BUTTON_WIDTH);
+ }
+
+ public TabLayout(ScrollController scrollController, int minimumTabWidth, int maximumTabWidth,
+ int tabHeight, int scrollButtonWidth) {
+ this.scrollController = scrollController;
+ this.minimumTabWidth = minimumTabWidth;
+ this.maximumTabWidth = maximumTabWidth;
+ this.tabHeight = tabHeight;
+ this.scrollButtonWidth = scrollButtonWidth;
+ }
+
+ @Override
+ public void removeLayoutComponent(Component comp) {
+ }
+
+ @Override
+ public void layoutContainer(Container parent) {
+ Component[] components = parent.getComponents();
+ int tabs = components.length - 2;
+ if (tabs > 0) {
+ Insets insets = parent.getInsets();
+ int x = insets.left;
+ int y = insets.top;
+ int availableWidth = parent.getWidth() - insets.left - insets.right;
+ int tabWidth = availableWidth / tabs;
+ boolean showScrollButtons = false;
+ if (tabWidth < minimumTabWidth) {
+ tabWidth = minimumTabWidth;
+ showScrollButtons = true;
+ } else if (tabWidth > maximumTabWidth) {
+ tabWidth = maximumTabWidth;
+ }
+ if (showScrollButtons) {
+ scrollController.getScrollLeft().setLocation(x, y);
+ scrollController.getScrollLeft().setSize(
+ new Dimension(scrollButtonWidth, tabHeight));
+ scrollController.getScrollLeft().setVisible(true);
+ scrollController.getScrollLeft().setEnabled(shouldScrollLeft(tabs, availableWidth));
+ x = x + scrollButtonWidth - (scrollController.getPosition() * minimumTabWidth);
+ scrollController.getScrollRight()
+ .setLocation(availableWidth - scrollButtonWidth, y);
+ scrollController.getScrollRight().setSize(
+ new Dimension(scrollButtonWidth, tabHeight));
+ scrollController.getScrollRight().setVisible(true);
+ scrollController.getScrollRight().setEnabled(scrollController.getPosition() > 0);
+ } else {
+ scrollController.getScrollLeft().setVisible(false);
+ scrollController.getScrollRight().setVisible(false);
+ scrollController.reset();
+ }
+ for (int i = 2; i < components.length; i++) {
+ components[i].setLocation(x, y);
+ components[i].setSize(new Dimension(tabWidth, tabHeight));
+ x = x + tabWidth;
+ }
+ }
+ }
+
+ @Override
+ public void addLayoutComponent(String name, Component comp) {
+ }
+
+ @Override
+ public Dimension minimumLayoutSize(Container parent) {
+ return calculateSize(parent.getInsets(), 2, minimumTabWidth);
+ }
+
+ @Override
+ public Dimension preferredLayoutSize(Container parent) {
+ return calculateSize(parent.getInsets(), parent.getComponents().length, maximumTabWidth);
+ }
+
+ private Dimension calculateSize(Insets insets, int tabs, int tabWidth) {
+ int width = insets.left + insets.right + tabs * tabWidth;
+ int height = insets.top + insets.bottom + tabHeight;
+ return new Dimension(width, height);
+ }
+
+ private boolean shouldScrollLeft(int tabs, int availableWidth) {
+ int tabsToShow = tabs - scrollController.getPosition();
+ return (tabsToShow * minimumTabWidth) > (availableWidth - (scrollButtonWidth * 2));
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/tabselector/TabSelectorComponent.java
----------------------------------------------------------------------
diff --git a/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/tabselector/TabSelectorComponent.java b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/tabselector/TabSelectorComponent.java
new file mode 100644
index 0000000..d09b6ec
--- /dev/null
+++ b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/tabselector/TabSelectorComponent.java
@@ -0,0 +1,99 @@
+/*******************************************************************************
+ * Copyright (C) 2012 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.lang.ui.tabselector;
+
+import java.awt.BorderLayout;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.swing.ButtonGroup;
+import javax.swing.JPanel;
+
+/**
+ * Component for selecting objects using tabs.
+ *
+ * @author David Withers
+ */
+public abstract class TabSelectorComponent<T> extends JPanel {
+
+ private static final long serialVersionUID = 1L;
+
+ private Map<T, Tab<T>> tabMap;
+ private ButtonGroup tabGroup;
+ private ScrollController scrollController;
+
+ public TabSelectorComponent() {
+ tabMap = new HashMap<T, Tab<T>>();
+ tabGroup = new ButtonGroup();
+ setLayout(new BorderLayout());
+ scrollController = new ScrollController(this);
+ add(scrollController.getScrollLeft());
+ add(scrollController.getScrollRight());
+ setLayout(new TabLayout(scrollController));
+ }
+
+ @Override
+ protected void paintComponent(Graphics g) {
+ super.paintComponent(g);
+ Graphics2D g2 = (Graphics2D) g.create();
+ g2.setColor(Tab.midGrey);
+ g2.drawLine(0, getHeight() - 1, getWidth(), getHeight() - 1);
+ g2.dispose();
+ }
+
+ protected abstract Tab<T> createTab(T object);
+
+ public Tab<T> getTab(T object) {
+ return tabMap.get(object);
+ }
+
+ public void addObject(T object) {
+ Tab<T> button = createTab(object);
+ tabMap.put(object, button);
+ tabGroup.add(button);
+ add(button);
+ revalidate();
+ repaint();
+ button.setSelected(true);
+ }
+
+ public void removeObject(T object) {
+ Tab<T> button = tabMap.remove(object);
+ if (button != null) {
+ tabGroup.remove(button);
+ remove(button);
+ revalidate();
+ repaint();
+ }
+ }
+
+ public void selectObject(T object) {
+ Tab<T> button = tabMap.get(object);
+ if (button != null) {
+ button.setSelected(true);
+ } else {
+ addObject(object);
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/treetable/AbstractCellEditor.java
----------------------------------------------------------------------
diff --git a/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/treetable/AbstractCellEditor.java b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/treetable/AbstractCellEditor.java
new file mode 100644
index 0000000..63827bb
--- /dev/null
+++ b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/treetable/AbstractCellEditor.java
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.lang.ui.treetable;
+
+import java.util.EventObject;
+
+import javax.swing.CellEditor;
+import javax.swing.event.CellEditorListener;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.EventListenerList;
+
+public class AbstractCellEditor implements CellEditor {
+
+ protected EventListenerList listenerList = new EventListenerList();
+
+ public Object getCellEditorValue() { return null; }
+ public boolean isCellEditable(EventObject e) { return true; }
+ public boolean shouldSelectCell(EventObject anEvent) { return false; }
+ public boolean stopCellEditing() { return true; }
+ public void cancelCellEditing() {}
+
+ public void addCellEditorListener(CellEditorListener l) {
+ listenerList.add(CellEditorListener.class, l);
+ }
+
+ public void removeCellEditorListener(CellEditorListener l) {
+ listenerList.remove(CellEditorListener.class, l);
+ }
+
+ /*
+ * Notify all listeners that have registered interest for
+ * notification on this event type.
+ * @see EventListenerList
+ */
+ protected void fireEditingStopped() {
+ // Guaranteed to return a non-null array
+ Object[] listeners = listenerList.getListenerList();
+ // Process the listeners last to first, notifying
+ // those that are interested in this event
+ for (int i = listeners.length-2; i>=0; i-=2) {
+ if (listeners[i]==CellEditorListener.class) {
+ ((CellEditorListener)listeners[i+1]).editingStopped(new ChangeEvent(this));
+ }
+ }
+ }
+
+ /*
+ * Notify all listeners that have registered interest for
+ * notification on this event type.
+ * @see EventListenerList
+ */
+ protected void fireEditingCanceled() {
+ // Guaranteed to return a non-null array
+ Object[] listeners = listenerList.getListenerList();
+ // Process the listeners last to first, notifying
+ // those that are interested in this event
+ for (int i = listeners.length-2; i>=0; i-=2) {
+ if (listeners[i]==CellEditorListener.class) {
+ ((CellEditorListener)listeners[i+1]).editingCanceled(new ChangeEvent(this));
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/treetable/AbstractTreeTableModel.java
----------------------------------------------------------------------
diff --git a/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/treetable/AbstractTreeTableModel.java b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/treetable/AbstractTreeTableModel.java
new file mode 100644
index 0000000..afec8f3
--- /dev/null
+++ b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/treetable/AbstractTreeTableModel.java
@@ -0,0 +1,198 @@
+/*
+ * @(#)AbstractTreeTableModel.java 1.2 98/10/27
+ *
+ * Copyright 1997, 1998 by Sun Microsystems, Inc.,
+ * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
+ * All rights reserved.
+ *
+ * This software is the confidential and proprietary information
+ * of Sun Microsystems, Inc. ("Confidential Information"). You
+ * shall not disclose such Confidential Information and shall use
+ * it only in accordance with the terms of the license agreement
+ * you entered into with Sun.
+ */
+package net.sf.taverna.t2.lang.ui.treetable;
+
+import javax.swing.event.EventListenerList;
+import javax.swing.event.TreeModelEvent;
+import javax.swing.event.TreeModelListener;
+import javax.swing.tree.TreePath;
+
+/**
+ * @version 1.2 10/27/98
+ * An abstract implementation of the TreeTableModel interface, handling the list
+ * of listeners.
+ * @author Philip Milne
+ */
+
+public abstract class AbstractTreeTableModel implements TreeTableModel {
+ protected Object root;
+ protected EventListenerList listenerList = new EventListenerList();
+
+ public AbstractTreeTableModel(Object root) {
+ this.root = root;
+ }
+
+ //
+ // Default implementations for methods in the TreeModel interface.
+ //
+
+ public Object getRoot() {
+ return root;
+ }
+
+ public boolean isLeaf(Object node) {
+ return getChildCount(node) == 0;
+ }
+
+ public void valueForPathChanged(TreePath path, Object newValue) {}
+
+ // This is not called in the JTree's default mode: use a naive implementation.
+ public int getIndexOfChild(Object parent, Object child) {
+ for (int i = 0; i < getChildCount(parent); i++) {
+ if (getChild(parent, i).equals(child)) {
+ return i;
+ }
+ }
+ return -1;
+ }
+
+ public void addTreeModelListener(TreeModelListener l) {
+ listenerList.add(TreeModelListener.class, l);
+ }
+
+ public void removeTreeModelListener(TreeModelListener l) {
+ listenerList.remove(TreeModelListener.class, l);
+ }
+
+ /*
+ * Notify all listeners that have registered interest for
+ * notification on this event type. The event instance
+ * is lazily created using the parameters passed into
+ * the fire method.
+ * @see EventListenerList
+ */
+ protected void fireTreeNodesChanged(Object source, Object[] path,
+ int[] childIndices,
+ Object[] children) {
+ // Guaranteed to return a non-null array
+ Object[] listeners = listenerList.getListenerList();
+ TreeModelEvent e = null;
+ // Process the listeners last to first, notifying
+ // those that are interested in this event
+ for (int i = listeners.length-2; i>=0; i-=2) {
+ if (listeners[i]==TreeModelListener.class) {
+ // Lazily create the event:
+ if (e == null)
+ e = new TreeModelEvent(source, path,
+ childIndices, children);
+ ((TreeModelListener)listeners[i+1]).treeNodesChanged(e);
+ }
+ }
+ }
+
+ /*
+ * Notify all listeners that have registered interest for
+ * notification on this event type. The event instance
+ * is lazily created using the parameters passed into
+ * the fire method.
+ * @see EventListenerList
+ */
+ protected void fireTreeNodesInserted(Object source, Object[] path,
+ int[] childIndices,
+ Object[] children) {
+ // Guaranteed to return a non-null array
+ Object[] listeners = listenerList.getListenerList();
+ TreeModelEvent e = null;
+ // Process the listeners last to first, notifying
+ // those that are interested in this event
+ for (int i = listeners.length-2; i>=0; i-=2) {
+ if (listeners[i]==TreeModelListener.class) {
+ // Lazily create the event:
+ if (e == null)
+ e = new TreeModelEvent(source, path,
+ childIndices, children);
+ ((TreeModelListener)listeners[i+1]).treeNodesInserted(e);
+ }
+ }
+ }
+
+ /*
+ * Notify all listeners that have registered interest for
+ * notification on this event type. The event instance
+ * is lazily created using the parameters passed into
+ * the fire method.
+ * @see EventListenerList
+ */
+ protected void fireTreeNodesRemoved(Object source, Object[] path,
+ int[] childIndices,
+ Object[] children) {
+ // Guaranteed to return a non-null array
+ Object[] listeners = listenerList.getListenerList();
+ TreeModelEvent e = null;
+ // Process the listeners last to first, notifying
+ // those that are interested in this event
+ for (int i = listeners.length-2; i>=0; i-=2) {
+ if (listeners[i]==TreeModelListener.class) {
+ // Lazily create the event:
+ if (e == null)
+ e = new TreeModelEvent(source, path,
+ childIndices, children);
+ ((TreeModelListener)listeners[i+1]).treeNodesRemoved(e);
+ }
+ }
+ }
+
+ /*
+ * Notify all listeners that have registered interest for
+ * notification on this event type. The event instance
+ * is lazily created using the parameters passed into
+ * the fire method.
+ * @see EventListenerList
+ */
+ protected void fireTreeStructureChanged(Object source, Object[] path,
+ int[] childIndices,
+ Object[] children) {
+ // Guaranteed to return a non-null array
+ Object[] listeners = listenerList.getListenerList();
+ TreeModelEvent e = null;
+ // Process the listeners last to first, notifying
+ // those that are interested in this event
+ for (int i = listeners.length-2; i>=0; i-=2) {
+ if (listeners[i]==TreeModelListener.class) {
+ // Lazily create the event:
+ if (e == null)
+ e = new TreeModelEvent(source, path,
+ childIndices, children);
+ ((TreeModelListener)listeners[i+1]).treeStructureChanged(e);
+ }
+ }
+ }
+
+ //
+ // Default impelmentations for methods in the TreeTableModel interface.
+ //
+
+ public Class getColumnClass(int column) { return Object.class; }
+
+ /** By default, make the column with the Tree in it the only editable one.
+ * Making this column editable causes the JTable to forward mouse
+ * and keyboard events in the Tree column to the underlying JTree.
+ */
+ public boolean isCellEditable(Object node, int column) {
+ return getColumnClass(column) == TreeTableModel.class;
+ }
+
+ public void setValueAt(Object aValue, Object node, int column) {}
+
+
+ // Left to be implemented in the subclass:
+
+ /*
+ * public Object getChild(Object parent, int index)
+ * public int getChildCount(Object parent)
+ * public int getColumnCount()
+ * public String getColumnName(Object node, int column)
+ * public Object getValueAt(Object node, int column)
+ */
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/treetable/JTreeTable.LICENSE
----------------------------------------------------------------------
diff --git a/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/treetable/JTreeTable.LICENSE b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/treetable/JTreeTable.LICENSE
new file mode 100644
index 0000000..7500c7a
--- /dev/null
+++ b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/treetable/JTreeTable.LICENSE
@@ -0,0 +1,59 @@
+The license below applies to the classes contained within the
+package net.sf.taverna.t2.lang.ui.treetable package. These classes have been taken
+from the Sun Developer Network tutorial on using JTree components within JTables. The URLs for the tutorials are as follows :
+
+http://java.sun.com/products/jfc/tsc/articles/treetable1/index.html
+http://java.sun.com/products/jfc/tsc/articles/treetable2/index.html
+http://java.sun.com/products/jfc/tsc/articles/bookmarks/index.html#editableJTreeTable
+
+The original web page form of this license is available at :
+
+http://developers.sun.com/license/berkeley_license.html?uid=6910008
+
+Tom Oinn, tmo@ebi.ac.uk, 23rd Feb 2004
+
+-------------------------------------------------------------------------------------
+
+Code sample
+
+License
+
+ Copyright 1994-2004 Sun Microsystems, Inc. All Rights Reserved.
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+
+
+ 1 Redistribution of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+
+ 2 Redistribution in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+
+ Neither the name of Sun Microsystems, Inc. or the names of contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+
+ This software is provided "AS IS," without a warranty of any kind. ALL
+ EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING
+ ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
+ OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN")
+ AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE
+ AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST
+ REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL,
+ INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE
+ THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS
+ SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+
+
+ You acknowledge that this software is not designed, licensed or intended
+ for use in the design, construction, operation or maintenance of any
+ nuclear facility.
+
+-------------------------------------------------------------------------------------
\ No newline at end of file
[23/50] [abbrv] incubator-taverna-workbench git commit: Merge branch
'maintenance'
Posted by st...@apache.org.
Merge branch 'maintenance'
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/commit/66452d92
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/tree/66452d92
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/diff/66452d92
Branch: refs/heads/master
Commit: 66452d9227469b31c1c33f4b3c672898d31a46eb
Parents: 4d399b7 e0abf71
Author: Donal Fellows <do...@manchester.ac.uk>
Authored: Thu May 15 11:15:15 2014 +0100
Committer: Donal Fellows <do...@manchester.ac.uk>
Committed: Thu May 15 11:15:15 2014 +0100
----------------------------------------------------------------------
pom.xml | 15 ++---
ui/pom.xml | 5 ++
.../net/sf/taverna/t2/lang/ui/FileTools.java | 33 +++--------
.../net/sf/taverna/t2/lang/ui/HtmlUtils.java | 25 ++++++++
.../t2/lang/ui/SanitisingDocumentFilter.java | 60 ++++++++++++++++++++
5 files changed, 105 insertions(+), 33 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/66452d92/pom.xml
----------------------------------------------------------------------
diff --cc pom.xml
index 8f189d2,0a3d8db..7e5841f
--- a/pom.xml
+++ b/pom.xml
@@@ -5,14 -4,16 +5,14 @@@
<parent>
<groupId>net.sf.taverna</groupId>
<artifactId>taverna-parent</artifactId>
- <version>2.6-SNAPSHOT</version>
- <relativePath>../../taverna-parent/pom.xml</relativePath>
+ <version>3.0.1-SNAPSHOT</version>
</parent>
-
+
- <modelVersion>4.0.0</modelVersion>
+ <name>Taverna support utilities</name>
<groupId>net.sf.taverna.t2</groupId>
- <version>1.6-SNAPSHOT</version>
<artifactId>lang</artifactId>
+ <version>2.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
- <name>Taverna 2 language extensions</name>
<dependencyManagement>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/66452d92/ui/pom.xml
----------------------------------------------------------------------
diff --cc ui/pom.xml
index efa9b29,fbe0379..4e77d66
--- a/ui/pom.xml
+++ b/ui/pom.xml
@@@ -18,13 -17,13 +18,18 @@@
<version>${project.version}</version>
</dependency>
<dependency>
+ <groupId>net.sf.taverna.jedit</groupId>
+ <artifactId>jedit-syntax</artifactId>
+ <version>${jedit.syntax.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>${commons.io.version}</version>
+ </dependency>
+ <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
+ <groupId>org.apache.log4j</groupId>
+ <artifactId>com.springsource.org.apache.log4j</artifactId>
</dependency>
</dependencies>
</project>
[48/50] [abbrv] incubator-taverna-workbench git commit: taverna-*
Posted by st...@apache.org.
taverna-*
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/commit/fb641cfc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/tree/fb641cfc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/diff/fb641cfc
Branch: refs/heads/master
Commit: fb641cfc7feff5907b90301193a9b2aca45e8333
Parents: f676ef3
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Fri Mar 6 22:28:51 2015 +0000
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Fri Mar 6 22:28:51 2015 +0000
----------------------------------------------------------------------
.travis.yml | 1 -
taverna-uibuilder/pom.xml | 26 +
.../lang/uibuilder/AbstractListComponent.java | 521 +++++++++++++++++++
.../t2/lang/uibuilder/AlignableComponent.java | 29 ++
.../sf/taverna/t2/lang/uibuilder/Alignment.java | 66 +++
.../taverna/t2/lang/uibuilder/BeanCheckBox.java | 54 ++
.../t2/lang/uibuilder/BeanComponent.java | 420 +++++++++++++++
.../t2/lang/uibuilder/BeanEnumComboBox.java | 89 ++++
.../taverna/t2/lang/uibuilder/BeanTextArea.java | 89 ++++
.../t2/lang/uibuilder/BeanTextComponent.java | 174 +++++++
.../t2/lang/uibuilder/BeanTextField.java | 60 +++
.../net/sf/taverna/t2/lang/uibuilder/Icons.java | 41 ++
.../taverna/t2/lang/uibuilder/ListHandler.java | 67 +++
.../lang/uibuilder/RecursiveListComponent.java | 98 ++++
.../sf/taverna/t2/lang/uibuilder/UIBuilder.java | 236 +++++++++
.../lang/uibuilder/UIConstructionException.java | 29 ++
.../t2/lang/uibuilder/WrappedListComponent.java | 105 ++++
.../sf/taverna/t2/lang/uibuilder/package.html | 4 +
.../net/sf/taverna/t2/lang/uibuilder/delete.png | Bin 0 -> 1120 bytes
.../net/sf/taverna/t2/lang/uibuilder/down.png | Bin 0 -> 1077 bytes
.../net/sf/taverna/t2/lang/uibuilder/new.png | Bin 0 -> 1146 bytes
.../net/sf/taverna/t2/lang/uibuilder/up.png | Bin 0 -> 1074 bytes
.../taverna/t2/lang/uibuilder/Application.java | 48 ++
.../taverna/t2/lang/uibuilder/Application2.java | 44 ++
.../t2/lang/uibuilder/BeanWithBoundProps.java | 74 +++
.../lang/uibuilder/BeanWithListProperties.java | 35 ++
.../t2/lang/uibuilder/BeanWithNestedList.java | 28 +
.../t2/lang/uibuilder/PrimitiveTypeBean.java | 101 ++++
.../taverna/t2/lang/uibuilder/SampleEnum.java | 13 +
.../taverna/t2/lang/uibuilder/TopLevelBean.java | 43 ++
uibuilder/pom.xml | 26 -
.../lang/uibuilder/AbstractListComponent.java | 521 -------------------
.../t2/lang/uibuilder/AlignableComponent.java | 29 --
.../sf/taverna/t2/lang/uibuilder/Alignment.java | 66 ---
.../taverna/t2/lang/uibuilder/BeanCheckBox.java | 54 --
.../t2/lang/uibuilder/BeanComponent.java | 420 ---------------
.../t2/lang/uibuilder/BeanEnumComboBox.java | 89 ----
.../taverna/t2/lang/uibuilder/BeanTextArea.java | 89 ----
.../t2/lang/uibuilder/BeanTextComponent.java | 174 -------
.../t2/lang/uibuilder/BeanTextField.java | 60 ---
.../net/sf/taverna/t2/lang/uibuilder/Icons.java | 41 --
.../taverna/t2/lang/uibuilder/ListHandler.java | 67 ---
.../lang/uibuilder/RecursiveListComponent.java | 98 ----
.../sf/taverna/t2/lang/uibuilder/UIBuilder.java | 236 ---------
.../lang/uibuilder/UIConstructionException.java | 29 --
.../t2/lang/uibuilder/WrappedListComponent.java | 105 ----
.../sf/taverna/t2/lang/uibuilder/package.html | 4 -
.../net/sf/taverna/t2/lang/uibuilder/delete.png | Bin 1120 -> 0 bytes
.../net/sf/taverna/t2/lang/uibuilder/down.png | Bin 1077 -> 0 bytes
.../net/sf/taverna/t2/lang/uibuilder/new.png | Bin 1146 -> 0 bytes
.../net/sf/taverna/t2/lang/uibuilder/up.png | Bin 1074 -> 0 bytes
.../taverna/t2/lang/uibuilder/Application.java | 48 --
.../taverna/t2/lang/uibuilder/Application2.java | 44 --
.../t2/lang/uibuilder/BeanWithBoundProps.java | 74 ---
.../lang/uibuilder/BeanWithListProperties.java | 35 --
.../t2/lang/uibuilder/BeanWithNestedList.java | 28 -
.../t2/lang/uibuilder/PrimitiveTypeBean.java | 101 ----
.../taverna/t2/lang/uibuilder/SampleEnum.java | 13 -
.../taverna/t2/lang/uibuilder/TopLevelBean.java | 43 --
59 files changed, 2494 insertions(+), 2495 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index dff5f3a..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1 +0,0 @@
-language: java
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/taverna-uibuilder/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-uibuilder/pom.xml b/taverna-uibuilder/pom.xml
new file mode 100644
index 0000000..bc84391
--- /dev/null
+++ b/taverna-uibuilder/pom.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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>net.sf.taverna.t2</groupId>
+ <artifactId>lang</artifactId>
+ <version>2.0.1-SNAPSHOT</version>
+ </parent>
+ <groupId>net.sf.taverna.t2.lang</groupId>
+ <artifactId>uibuilder</artifactId>
+ <packaging>bundle</packaging>
+ <name>UI builder based on beans</name>
+ <dependencies>
+ <dependency>
+ <groupId>net.sf.taverna.t2.lang</groupId>
+ <artifactId>ui</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.log4j</groupId>
+ <artifactId>com.springsource.org.apache.log4j</artifactId>
+ <version>${log4j.version}</version>
+ </dependency>
+ </dependencies>
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/AbstractListComponent.java
----------------------------------------------------------------------
diff --git a/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/AbstractListComponent.java b/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/AbstractListComponent.java
new file mode 100644
index 0000000..9a7761c
--- /dev/null
+++ b/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/AbstractListComponent.java
@@ -0,0 +1,521 @@
+package net.sf.taverna.t2.lang.uibuilder;
+
+import static net.sf.taverna.t2.lang.uibuilder.Icons.getIcon;
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.GridLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.lang.reflect.InvocationTargetException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Timer;
+import java.util.TimerTask;
+
+import javax.swing.BorderFactory;
+import javax.swing.Box;
+import javax.swing.BoxLayout;
+import javax.swing.JButton;
+import javax.swing.JComponent;
+import javax.swing.JPanel;
+import javax.swing.JSeparator;
+import javax.swing.SwingConstants;
+import javax.swing.SwingUtilities;
+
+import org.apache.log4j.Logger;
+
+/**
+ * Superclass for list and wrapped list components generated by the UI builder.
+ * Accepts properties to determine whether the 'new', 'move' and 'delete'
+ * controls should be displayed and what, if any, concrete class should be used
+ * when constructing new items. Properties are as follows:
+ * <p>
+ * <ul>
+ * <li><code>nodelete</code> If set do not show the 'delete item' button</li>
+ * <li><code>nomove</code> If set do not show the 'move up' and 'move down'
+ * buttons</li>
+ * <li><code>new=some.class.Name</code> If set then use the specified class,
+ * loaded with the target object's classloader, when adding new items. Also adds
+ * the 'New Item' button to the top of the list panel. The specified class must
+ * be valid to insert into the list and must have a no-argument constructor</li>
+ * </ul>
+ *
+ * @author Tom Oinn
+ *
+ */
+public abstract class AbstractListComponent extends JPanel {
+
+ private static final long serialVersionUID = 2067559836729348490L;
+
+ private static Logger logger = Logger
+ .getLogger(AbstractListComponent.class);
+
+ private String fieldName;
+ @SuppressWarnings("unchecked")
+ private List theList;
+ private Properties props;
+ private Map<String, Properties> fieldProps;
+ private List<String> subFields;
+ private String parent;
+ private JPanel listItemContainer;
+ private boolean showDelete = true;
+ private boolean showMove = true;
+ @SuppressWarnings("unchecked")
+ private Class newItemClass = null;
+ protected static Color deferredButtonColour = Color.orange;
+ private static Object[] prototypes;
+
+ static {
+ try {
+ prototypes = new Object[] { new URL("http://some.host.com/path"),
+ new Boolean(true), new Integer(1), new Float(1),
+ new Short((short) 1), new Long((long) 1),
+ new Character('a'), new Double((double) 1),
+ new Byte((byte) 1) };
+ } catch (MalformedURLException e) {
+ logger.error("Unable to generate URL", e);
+ }
+ }
+
+ /**
+ * Build a generic list component
+ *
+ * @param fieldName
+ * the name of the field this component represents in its parent
+ * bean
+ * @param theList
+ * the list value of the field
+ * @param props
+ * properties for this field
+ * @param fieldProps
+ * aggregated properties for all fields in the UI builder scope
+ * @param newItemClass
+ * the class to use for construction of new item instances, or
+ * null if this is not supported
+ * @param subFields
+ * all field names within this field, this will be empty for a
+ * wrapped list
+ * @param parent
+ * the parent field ID used to access subfield properties
+ * @throws NoSuchMethodException
+ * @throws ClassNotFoundException
+ * @throws InvocationTargetException
+ * @throws IllegalAccessException
+ * @throws IllegalArgumentException
+ */
+ @SuppressWarnings("unchecked")
+ protected AbstractListComponent(String fieldName, List theList,
+ Properties props, Map<String, Properties> fieldProps,
+ final Class<?> newItemClass, List<String> subFields, String parent)
+ throws NoSuchMethodException, IllegalArgumentException,
+ IllegalAccessException, InvocationTargetException,
+ ClassNotFoundException {
+ super();
+ this.fieldName = fieldName;
+ this.theList = theList;
+ this.props = props;
+ this.fieldProps = fieldProps;
+ this.subFields = subFields;
+ this.parent = parent;
+ if (props.containsKey("nodelete")) {
+ showDelete = false;
+ }
+ if (props.containsKey("nomove")) {
+ showMove = false;
+ }
+ this.newItemClass = newItemClass;
+ setOpaque(false);
+ setLayout(new BorderLayout());
+ String displayName = fieldName;
+ if (props.containsKey("name")) {
+ displayName = props.getProperty("name");
+ }
+ setBorder(BorderFactory.createTitledBorder(displayName));
+ if (newItemClass != null) {
+ // Generate 'add new' UI here
+ JPanel newItemPanel = new JPanel();
+ newItemPanel.setOpaque(false);
+ newItemPanel.setLayout(new BoxLayout(newItemPanel,
+ BoxLayout.LINE_AXIS));
+ newItemPanel.add(Box.createHorizontalGlue());
+
+ final JButton newItemButton = new JButton("New Item",
+ getIcon("new"));
+ newItemPanel.add(newItemButton);
+ newItemButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ try {
+ Object instance = null;
+ try {
+ instance = newItemClass.newInstance();
+ } catch (InstantiationException ie) {
+ // Probably because the class has no default
+ // constructor, use the prototype list
+ for (Object prototype : prototypes) {
+ if (newItemClass.isAssignableFrom(prototype
+ .getClass())) {
+ instance = prototype;
+ break;
+ }
+ }
+ if (instance == null) {
+ throw ie;
+ }
+ }
+ addNewItemToList(instance);
+ newItemButton.setForeground(BeanComponent.validColour);
+ } catch (Exception ex) {
+ newItemButton
+ .setForeground(BeanComponent.invalidColour);
+ logger.error("", ex);
+ }
+ }
+ });
+ add(newItemPanel, BorderLayout.NORTH);
+ }
+ listItemContainer = new JPanel();
+ listItemContainer.setOpaque(false);
+ listItemContainer.setLayout(new BoxLayout(listItemContainer,
+ BoxLayout.PAGE_AXIS));
+ updateListContents();
+ add(listItemContainer, BorderLayout.CENTER);
+ }
+
+ protected void updateListContents() throws NoSuchMethodException,
+ IllegalArgumentException, IllegalAccessException,
+ InvocationTargetException, ClassNotFoundException {
+ listItemContainer.removeAll();
+ boolean first = true;
+ int index = 0;
+ List<JComponent> listComponents = getListComponents();
+ for (JComponent component : listComponents) {
+ if (first && newItemClass == null) {
+ first = false;
+ } else {
+ List<Component> c = getSeparatorComponents();
+ if (c != null) {
+ for (Component jc : c) {
+ listItemContainer.add(jc);
+ }
+ }
+ }
+ JComponent wrappedComponent = wrapWithControls(component, index++,
+ listComponents.size());
+ if (wrappedComponent != null) {
+ listItemContainer.add(wrappedComponent);
+ } else {
+ listItemContainer.add(component);
+ }
+ }
+ revalidate();
+ }
+
+ /**
+ * Wrap the given component in a panel including whatever list manipulation
+ * controls are needed. The index of the item being wrapped is supplied to
+ * inform the various actions the controls can perform. By default this
+ * returns a JPanel with delete and move controls
+ *
+ * @param component
+ * @param index
+ * @return
+ */
+ protected JPanel wrapWithControls(JComponent component, final int index,
+ int listSize) {
+ int numberOfButtons = 3;
+ if (!showDelete) {
+ numberOfButtons--;
+ }
+ if (!showMove) {
+ numberOfButtons -= 2;
+ }
+ if (numberOfButtons == 0) {
+ return null;
+ }
+ JPanel result = new JPanel();
+ result.setOpaque(false);
+ result.setLayout(new BorderLayout());
+ result.add(component, BorderLayout.CENTER);
+ // Construct the controls
+ JPanel controls = new JPanel();
+ controls.setOpaque(false);
+ controls.setLayout(new BorderLayout());
+ controls
+ .add(new JSeparator(SwingConstants.VERTICAL), BorderLayout.WEST);
+ result.add(controls, BorderLayout.EAST);
+ JPanel buttons = new JPanel();
+ buttons.setOpaque(false);
+ buttons.setLayout(new GridLayout(0, numberOfButtons));
+
+ if (showMove) {
+ // Move up button, or spacer if already at index 0
+ if (index > 0) {
+ JButton moveUpButton = createButton("up", false);
+ moveUpButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ try {
+ itemMoved(index, index - 1);
+ } catch (Exception ex) {
+ logger.error("Unable to move item", ex);
+ }
+ }
+ });
+ buttons.add(moveUpButton);
+ } else {
+ buttons.add(Box.createGlue());
+ }
+
+ // Move down button, or spacer if index == listSize-1
+ if (index < (listSize - 1)) {
+ JButton moveDownButton = createButton("down", false);
+ moveDownButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ try {
+ itemMoved(index, index + 1);
+ } catch (Exception ex) {
+ logger.error("Unable to move item", ex);
+ }
+ }
+ });
+ buttons.add(moveDownButton);
+ } else {
+ buttons.add(Box.createGlue());
+ }
+ }
+
+ if (showDelete) {
+ // Delete button
+ JButton deleteButton = createButton("delete", true);
+ deleteButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ try {
+ deleteItemAtIndex(index);
+ } catch (Exception ex) {
+ logger.error("Unable to delete item", ex);
+ }
+ }
+ });
+ buttons.add(deleteButton);
+ }
+ JPanel buttonWrapper = new JPanel();
+ buttonWrapper.setLayout(new BorderLayout());
+ buttonWrapper.setOpaque(false);
+ buttonWrapper.add(buttons, BorderLayout.NORTH);
+ controls.add(buttonWrapper, BorderLayout.CENTER);
+ return result;
+ }
+
+ private static Timer timer = new Timer();
+
+ @SuppressWarnings("serial")
+ private JButton createButton(String iconName, final boolean deferActions) {
+ JButton result = new JButton(getIcon(iconName)) {
+ @Override
+ public Dimension getPreferredSize() {
+ return new Dimension(getIcon().getIconWidth() + 8, (int) super
+ .getPreferredSize().getHeight());
+ }
+
+ @Override
+ public Dimension getMinimumSize() {
+ return new Dimension(getIcon().getIconWidth() + 8, (int) super
+ .getMinimumSize().getHeight());
+ }
+
+ private boolean active = false;
+ private Color defaultBackground = null;
+
+ @Override
+ public void addActionListener(final ActionListener theListener) {
+ if (defaultBackground == null) {
+ defaultBackground = getBackground();
+ }
+ if (!deferActions) {
+ super.addActionListener(theListener);
+ return;
+ } else {
+ super.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent ae) {
+ if (active) {
+ theListener.actionPerformed(ae);
+ } else {
+ setActive(true);
+ timer.schedule(new TimerTask() {
+
+ @Override
+ public void run() {
+ SwingUtilities
+ .invokeLater(new Runnable() {
+ public void run() {
+ setActive(false);
+ }
+ });
+ }
+ }, 1000);
+ }
+ }
+ });
+ }
+ }
+
+ private synchronized void setActive(boolean isActive) {
+ if (isActive == active) {
+ return;
+ } else {
+ active = isActive;
+ setBackground(active ? deferredButtonColour
+ : defaultBackground);
+
+ }
+ }
+ };
+ result.setFocusable(false);
+ return result;
+ }
+
+ /**
+ * Called when building the UI, must return a list of editor components
+ * corresponding to items in the list
+ *
+ * @throws NoSuchMethodException
+ * @throws ClassNotFoundException
+ * @throws InvocationTargetException
+ * @throws IllegalAccessException
+ * @throws IllegalArgumentException
+ */
+ protected abstract List<JComponent> getListComponents()
+ throws NoSuchMethodException, IllegalArgumentException,
+ IllegalAccessException, InvocationTargetException,
+ ClassNotFoundException;
+
+ /**
+ * Override to specify a separator component to be used inbetween internal
+ * list components, by default no component is used (this returns null).
+ *
+ * @return
+ */
+ protected List<Component> getSeparatorComponents() {
+ return null;
+ }
+
+ /**
+ * Called when the user has clicked on the 'new item' button, this method is
+ * passed the new instance of the specified type and should handle the
+ * addition of this item to the list and the update of the UI to reflect
+ * this change
+ *
+ * @param o
+ * the object to add to the list
+ * @throws ClassNotFoundException
+ * @throws InvocationTargetException
+ * @throws IllegalAccessException
+ * @throws NoSuchMethodException
+ * @throws IllegalArgumentException
+ */
+ protected abstract void addNewItemToList(Object o)
+ throws IllegalArgumentException, NoSuchMethodException,
+ IllegalAccessException, InvocationTargetException,
+ ClassNotFoundException;
+
+ /**
+ * Called when the user has clicked on the 'delete item' button next to a
+ * particular item in the list, this method is passed the index within the
+ * list of the item to be deleted and must update the UI appropriately
+ *
+ * @param index
+ * @throws ClassNotFoundException
+ * @throws InvocationTargetException
+ * @throws IllegalAccessException
+ * @throws NoSuchMethodException
+ * @throws IllegalArgumentException
+ */
+ protected abstract void deleteItemAtIndex(int index)
+ throws IllegalArgumentException, NoSuchMethodException,
+ IllegalAccessException, InvocationTargetException,
+ ClassNotFoundException;
+
+ /**
+ * Called when the user has moved an item from one index to another, passed
+ * the old index of the item and the desired new index. This method must
+ * effect the actual move within the list and the update of the UI.
+ *
+ * @throws ClassNotFoundException
+ * @throws InvocationTargetException
+ * @throws IllegalAccessException
+ * @throws NoSuchMethodException
+ * @throws IllegalArgumentException
+ */
+ protected abstract void itemMoved(int fromIndex, int toIndex)
+ throws IllegalArgumentException, NoSuchMethodException,
+ IllegalAccessException, InvocationTargetException,
+ ClassNotFoundException;
+
+ /**
+ * Get the field name of this component
+ *
+ * @return
+ */
+ protected final String getFieldName() {
+ return this.fieldName;
+ }
+
+ /**
+ * Return the underlying list presented by this component
+ *
+ * @return
+ */
+ @SuppressWarnings("unchecked")
+ protected final List getUnderlyingList() {
+ return this.theList;
+ }
+
+ /**
+ * Get a list of (renamed) sub-fields of this field, so if this field was
+ * foo.bar.someList and had a foo.bar.someList.urgle this would contain
+ * 'urgle'
+ *
+ * @return
+ */
+ protected final List<String> getSubFields() {
+ return this.subFields;
+ }
+
+ /**
+ * Get the properties applied to this list component
+ *
+ * @return
+ */
+ protected final Properties getProperties() {
+ return this.props;
+ }
+
+ /**
+ * The parent field name is the name of this field plus its parent string
+ * and is used when recursively building sub-panels within the list. Pass
+ * this into the 'parent' argument of the UIBuilder's construction methods.
+ *
+ * @return
+ */
+ protected final String getParentFieldName() {
+ return this.parent;
+ }
+
+ /**
+ * Get the map of all field->property object block defined by the UI builder
+ * constructing this component. This is used along with the parent field
+ * name to determine properties of sub-components when recursing into a
+ * nested collection.
+ *
+ * @return
+ */
+ protected final Map<String, Properties> getFieldProperties() {
+ return this.fieldProps;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/AlignableComponent.java
----------------------------------------------------------------------
diff --git a/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/AlignableComponent.java b/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/AlignableComponent.java
new file mode 100644
index 0000000..483771b
--- /dev/null
+++ b/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/AlignableComponent.java
@@ -0,0 +1,29 @@
+package net.sf.taverna.t2.lang.uibuilder;
+
+/**
+ * Superinterface for components which have a label and which may be mutually
+ * aligned within a panel. This assumes the component is laid out with a label
+ * to the left of the main editing area, and that we want to ensure that all
+ * editing areas line up and can do this by setting the preferred size of the
+ * label.
+ *
+ * @author Tom Oinn
+ *
+ */
+public interface AlignableComponent {
+
+ /**
+ * Set the preferred width of the label for this alignable component
+ *
+ * @param newWidth
+ */
+ public void setLabelWidth(int newWidth);
+
+ /**
+ * Get the current preferred width of the label for this alignable component
+ *
+ * @return
+ */
+ public int getLabelWidth();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/Alignment.java
----------------------------------------------------------------------
diff --git a/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/Alignment.java b/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/Alignment.java
new file mode 100644
index 0000000..6143887
--- /dev/null
+++ b/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/Alignment.java
@@ -0,0 +1,66 @@
+package net.sf.taverna.t2.lang.uibuilder;
+
+import java.awt.Component;
+import java.awt.Container;
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.swing.SwingUtilities;
+
+import org.apache.log4j.Logger;
+
+/**
+ * Static utility method to align alignable components within a container
+ *
+ * @author Tom Oinn
+ *
+ */
+public abstract class Alignment {
+
+ private static Logger logger = Logger
+ .getLogger(Alignment.class);
+
+ /**
+ * Find all instances of BeanFieldTextArea in the specified container and
+ * set all label widths to the same as the widest of them, aligning the
+ * content areas as a result
+ *
+ * @param container
+ */
+ public static void alignInContainer(Container container) {
+ int widestLabel = 0;
+ final List<AlignableComponent> fields = new ArrayList<AlignableComponent>();
+ for (Component comp : container.getComponents()) {
+ if (comp instanceof AlignableComponent) {
+ AlignableComponent field = (AlignableComponent) comp;
+ int fieldWidth = field.getLabelWidth();
+ if (fieldWidth > widestLabel) {
+ widestLabel = fieldWidth;
+ }
+ fields.add(field);
+ }
+ }
+ final int widestLabelVal = widestLabel;
+ if (!SwingUtilities.isEventDispatchThread()) {
+ try {
+ SwingUtilities.invokeAndWait(new Runnable() {
+ public void run() {
+ for (AlignableComponent field : fields) {
+ field.setLabelWidth(widestLabelVal);
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ logger.error("", e);
+ } catch (InvocationTargetException e) {
+ logger.error("", e);
+ }
+ } else {
+ for (AlignableComponent field : fields) {
+ field.setLabelWidth(widestLabelVal);
+ }
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/BeanCheckBox.java
----------------------------------------------------------------------
diff --git a/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/BeanCheckBox.java b/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/BeanCheckBox.java
new file mode 100644
index 0000000..1d86f4a
--- /dev/null
+++ b/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/BeanCheckBox.java
@@ -0,0 +1,54 @@
+package net.sf.taverna.t2.lang.uibuilder;
+
+import java.awt.BorderLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.Properties;
+
+import javax.swing.Box;
+import javax.swing.JCheckBox;
+
+/**
+ * Bean field editor using a JCheckBox to handle boolean and Boolean field types
+ *
+ * @author Tom Oinn
+ */
+public class BeanCheckBox extends BeanComponent implements AlignableComponent {
+
+ private static final long serialVersionUID = -2842617445268734650L;
+ private JCheckBox value;
+
+ public BeanCheckBox(Object target, String propertyName, Properties props)
+ throws NoSuchMethodException {
+ this(target, propertyName, true, props);
+ }
+
+ public BeanCheckBox(Object target, String propertyName, boolean useLabel,
+ Properties props) throws NoSuchMethodException {
+ super(target, propertyName, useLabel, props);
+ setLayout(new BorderLayout());
+ value = new JCheckBox();
+ value.setSelected(getBooleanProperty());
+ value.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent ae) {
+ boolean isSelected = value.isSelected();
+ currentObjectValue = isSelected;
+ setProperty();
+ }
+ });
+ addLabel();
+ value.setOpaque(false);
+ add(Box.createHorizontalGlue(), BorderLayout.CENTER);
+ add(value, BorderLayout.EAST);
+ }
+
+ @Override
+ protected void updateComponent() {
+ value.setSelected(getBooleanProperty());
+ }
+
+ private boolean getBooleanProperty() {
+ return (Boolean) getProperty();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/BeanComponent.java
----------------------------------------------------------------------
diff --git a/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/BeanComponent.java b/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/BeanComponent.java
new file mode 100644
index 0000000..27014e1
--- /dev/null
+++ b/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/BeanComponent.java
@@ -0,0 +1,420 @@
+package net.sf.taverna.t2.lang.uibuilder;
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.Properties;
+
+import javax.swing.Box;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.SwingUtilities;
+import javax.swing.event.AncestorEvent;
+import javax.swing.event.AncestorListener;
+
+import org.apache.log4j.Logger;
+
+/**
+ * Superclass of all bean component editors acting on a single (non collection)
+ * property within a POJO. This handles bound properties, using reflection to
+ * determine whether an appropriate addPropertyChangeListener method exists on
+ * the target bean and registering a listener if so. It also registers an
+ * ancestor listener to de-register this property listener if the component is
+ * removed from the display heirarchy and to re-attach it if the component is
+ * added. Implement updateComponent with the code to update the UI state from
+ * the underlying object, this is called when a property change is received by
+ * the listener (but not used for unbound properties).
+ * <p>
+ * This superclass also defines the name property:
+ * <ul>
+ * <li><code>name=SomeName</code> by default field labels use the field name
+ * defined in the configuration, including any case used. If this property is
+ * defined then the specified name is used instead</li>
+ * </ul>
+ *
+ * @author Tom Oinn
+ */
+public abstract class BeanComponent extends JPanel {
+
+ private static Logger logger = Logger
+ .getLogger(BeanComponent.class);
+
+ private static final long serialVersionUID = -6044009506938335937L;
+ protected Object target;
+ protected String propertyName;
+ protected Method getMethod, setMethod = null;
+ protected boolean editable = true;
+ protected Class<?> propertyType;
+ protected static Color invalidColour = Color.red;
+ protected static Color validColour = Color.black;
+ protected static Color uneditedColour = Color.white;
+ protected static Color editedColour = new Color(255, 245, 200);
+ protected boolean currentValueValid = true;
+ protected Object currentObjectValue = null;
+ protected JLabel label;
+ private boolean useLabel = false;
+ protected static int height = 16;
+ private Properties properties;
+ private PropertyChangeListener propertyListener = null;
+
+ /**
+ * Equivalent to BeanComponent(target, propertyName, true, props)
+ */
+ public BeanComponent(Object target, String propertyName, Properties props)
+ throws NoSuchMethodException {
+ this(target, propertyName, true, props);
+ }
+
+ /**
+ * Superclass constructor for BeanComponent instances.
+ *
+ * @param target
+ * the object containing the property this component acts as a
+ * view and controller for
+ * @param propertyName
+ * name of the property in the target object
+ * @param useLabel
+ * whether to show the label component (we set this to false for
+ * wrapped lists, for example)
+ * @param props
+ * a component specific properties object, passing in any
+ * properties defined in the configuration passed to UIBuilder
+ * @throws NoSuchMethodException
+ * if the appropriate get method for the named property can't be
+ * found
+ */
+ public BeanComponent(Object target, String propertyName, boolean useLabel,
+ Properties props) throws NoSuchMethodException {
+ super();
+ setOpaque(false);
+ // Find methods
+ this.properties = props;
+ this.useLabel = useLabel;
+ this.target = target;
+ this.propertyName = propertyName;
+
+ // If the target implements property change support then we can attach a
+ // listener to update the UI if the bound property changes. This
+ // listener is attached and detached in response to an ancestor listener
+ // so the bound property is only monitored when the component is visible
+ // in the UI.
+ try {
+ target.getClass().getMethod("addPropertyChangeListener",
+ String.class, PropertyChangeListener.class);
+ setUpPropertyListener();
+ addAncestorListener(new AncestorListener() {
+ public void ancestorAdded(AncestorEvent event) {
+ setUpPropertyListener();
+ }
+
+ public void ancestorMoved(AncestorEvent event) {
+ // Ignore
+ }
+
+ public void ancestorRemoved(AncestorEvent event) {
+ tearDownPropertyListener();
+ }
+ });
+ } catch (NoSuchMethodException nsme) {
+ // Means we don't have a bound property listener
+ }
+
+ getMethod = findMethodWithPrefix("get");
+ try {
+ setMethod = findMethodWithPrefix("set");
+ } catch (NoSuchMethodException nsme) {
+ logger.error("Unable to find set method", nsme);
+ editable = false;
+ }
+ propertyType = getPropertyType(target, propertyName);
+ }
+
+ /**
+ * Attempts to create and bind a property change listener to the target
+ * bean, failing silently if the bean doesn't implement the appropriate
+ * methods
+ */
+ private synchronized void setUpPropertyListener() {
+ if (propertyListener == null) {
+ Method addListener = null;
+ try {
+ addListener = target.getClass().getMethod(
+ "addPropertyChangeListener", String.class,
+ PropertyChangeListener.class);
+ } catch (NoSuchMethodException nsme) {
+ return;
+ }
+ propertyListener = new PropertyChangeListener() {
+ public void propertyChange(PropertyChangeEvent evt) {
+ Object newValue = evt.getNewValue();
+ if (currentObjectValue == null
+ || (newValue != currentObjectValue && !newValue
+ .equals(currentObjectValue))) {
+ // System.out.println("Property change, source was "+evt.getSource());
+ if (SwingUtilities.isEventDispatchThread()) {
+ updateComponent();
+ } else {
+ // try {
+ SwingUtilities.invokeLater(new Runnable() {
+ public void run() {
+ updateComponent();
+ }
+ });
+ }
+ }
+ }
+ };
+ try {
+ addListener.invoke(target, propertyName, propertyListener);
+ } catch (IllegalArgumentException e) {
+ logger.error("Unable to set up property listener", e);
+ } catch (IllegalAccessException e) {
+ logger.error("Unable to set up property listener", e);
+ } catch (InvocationTargetException e) {
+ logger.error("Unable to set up property listener", e);
+ }
+ }
+ }
+
+ /**
+ * If the property listener for bound properties exists then this method
+ * unregisters it from the target, attempting to use a variety of the
+ * standard method names to do so
+ */
+ private synchronized void tearDownPropertyListener() {
+ if (propertyListener == null) {
+ return;
+ }
+ try {
+ Method removeListener = null;
+ try {
+ removeListener = target.getClass().getMethod(
+ "removePropertyChangeListener", String.class,
+ PropertyChangeListener.class);
+ removeListener.invoke(target, propertyName, propertyListener);
+ } catch (NoSuchMethodException nsme) {
+ try {
+ removeListener = target.getClass().getMethod(
+ "removePropertyChangeListener",
+ PropertyChangeListener.class);
+ removeListener.invoke(target, propertyListener);
+ } catch (NoSuchMethodException nsme2) {
+ return;
+ }
+ }
+ } catch (IllegalArgumentException e) {
+ logger.error("Unable to remove property listener", e);
+ } catch (IllegalAccessException e) {
+ logger.error("Unable to remove property listener", e);
+ } catch (InvocationTargetException e) {
+ logger.error("Unable to remove property listener", e);
+ }
+ propertyListener = null;
+ }
+
+ /**
+ * Called by the bound property listener, implementing components must
+ * update their UI state in this method to match the value of the underlying
+ * component. This method is always called in the AWT dispatch thread so
+ * implementations can safely modify the state of UI components without
+ * worrying about swing thread handling
+ */
+ protected abstract void updateComponent();
+
+ /**
+ * Adds the label to the component if labels are enabled
+ */
+ protected void addLabel() {
+ if (useLabel) {
+ String labelName = propertyName;
+ if (getProperties().containsKey("name")) {
+ labelName = getProperties().getProperty("name");
+ }
+ label = new JLabel(labelName);
+ label.setOpaque(false);
+ label.setPreferredSize(new Dimension(
+ label.getPreferredSize().width, height));
+ JPanel labelPanel = new JPanel();
+ labelPanel.setOpaque(false);
+ labelPanel.add(label);
+ labelPanel.add(Box.createHorizontalStrut(5));
+ add(labelPanel, BorderLayout.WEST);
+ }
+ }
+
+ /**
+ * Return the type of the property on the target object, trying to locate a
+ * matching 'get' method for the supplied property name and returning the
+ * class of that method's return type.
+ * <p>
+ * Attempts to, in order :
+ * <ol>
+ * <li>Call the method and get the concrete type of the returned value</li>
+ * <li>Get the declared return type of the get method</li>
+ * </ol>
+ *
+ * @param target
+ * @param propertyName
+ * @return
+ * @throws NoSuchMethodException
+ * if the get method can't be found for the given property name
+ * on the target
+ */
+ public static Class<?> getPropertyType(Object target, String propertyName)
+ throws NoSuchMethodException {
+ Method getMethod = findMethodWithPrefix("get", target, propertyName);
+ try {
+ Object value = getMethod.invoke(target);
+ if (value != null) {
+ return value.getClass();
+ }
+ } catch (InvocationTargetException ite) {
+ //
+ } catch (IllegalArgumentException e) {
+ //
+ } catch (IllegalAccessException e) {
+ //
+ }
+ // if (target instanceof ListHandler.ListItem) {
+ // return ((ListHandler.ListItem) target).getTargetClass();
+ // }
+ return getMethod.getReturnType();
+ }
+
+ /**
+ * Searches for the specified method on the target object, throwing an
+ * exception if it can't be found. Searches for
+ * target.[prefix][propertyname]()
+ *
+ * @throws NoSuchMethodException
+ */
+ static Method findMethodWithPrefix(String prefix, Object target,
+ String propertyName) throws NoSuchMethodException {
+ for (Method m : target.getClass().getMethods()) {
+ if (m.getName().equalsIgnoreCase(prefix + propertyName)) {
+ return m;
+ }
+ }
+ throw new NoSuchMethodException("Can't find method matching '" + prefix
+ + propertyName + "' in " + target.getClass().getCanonicalName());
+ }
+
+ /**
+ * Calls the static findMethodWithPrefix passing in the property name and
+ * the target assigned to this instance
+ *
+ * @param prefix
+ * a string prefix to use when finding the name, searches for
+ * [prefix][propertyname]()
+ * @return a Method matching the query
+ * @throws NoSuchMethodException
+ * if the method can't be found.
+ */
+ protected final Method findMethodWithPrefix(String prefix)
+ throws NoSuchMethodException {
+ return findMethodWithPrefix(prefix, target, propertyName);
+ }
+
+ /**
+ * Returns the toString value of the current bean property, or the empty
+ * string if the get method returns null
+ */
+ protected final String getPropertyAsString() {
+ Object value = getProperty();
+ if (value == null) {
+ return "";
+ }
+ currentObjectValue = value;
+ return value.toString();
+ }
+
+ /**
+ * Uses reflection to call the get[property name] method on the target bean
+ * and returns the result
+ *
+ * @return current value of the bean property
+ */
+ protected final Object getProperty() {
+ try {
+ Object value = getMethod.invoke(target);
+ return value;
+ } catch (Exception ex) {
+ logger.error("Unable to get property", ex);
+ return null;
+ }
+ }
+
+ /**
+ * Sets the property on the object to the current object value for this UI
+ * component, effectively pushing any changes into the underlying target
+ * bean
+ */
+ protected final void setProperty() {
+ if (currentValueValid && editable) {
+ if (setMethod != null) {
+ try {
+ setMethod.invoke(target, currentObjectValue);
+ } catch (IllegalArgumentException e) {
+ logger.error("Unable to set property", e);
+ } catch (IllegalAccessException e) {
+ logger.error("Unable to set property", e);
+ } catch (InvocationTargetException e) {
+ logger.error("Unable to set property", e);
+ }
+ }
+ }
+ }
+
+ /**
+ * If using labels (as determined by the useLabel property) this sets the
+ * preferred width of the label for this component
+ *
+ * @param newWidth
+ * new label width in pixels
+ */
+ public void setLabelWidth(int newWidth) {
+ if (useLabel) {
+ label.setPreferredSize(new Dimension(newWidth, height));
+ }
+ }
+
+ /**
+ * If using labels (as determined by the useLabel property) this returns the
+ * current preferred size of the label associated with this component
+ *
+ * @return label width in pixels
+ */
+ public int getLabelWidth() {
+ if (useLabel) {
+ return this.label.getPreferredSize().width;
+ } else {
+ return 0;
+ }
+ }
+
+ /**
+ * If using the label then set its text (foreground) colour
+ *
+ * @param colour
+ */
+ public void setLabelColour(Color colour) {
+ if (useLabel) {
+ this.label.setForeground(colour);
+ }
+ }
+
+ /**
+ * Get the properties object associated with this component. This is
+ * generated from the configuration passed to UIBuilder
+ *
+ * @return a Properties object containing named properties applying to this
+ * component in the UI
+ */
+ public Properties getProperties() {
+ return this.properties;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/BeanEnumComboBox.java
----------------------------------------------------------------------
diff --git a/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/BeanEnumComboBox.java b/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/BeanEnumComboBox.java
new file mode 100644
index 0000000..34646a4
--- /dev/null
+++ b/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/BeanEnumComboBox.java
@@ -0,0 +1,89 @@
+package net.sf.taverna.t2.lang.uibuilder;
+
+import java.awt.BorderLayout;
+import java.awt.Dimension;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.Properties;
+
+import javax.swing.JComboBox;
+
+/**
+ * Bean property editor for enumerated property types, rendering the enumeration
+ * as a combo box
+ *
+ * @author Tom Oinn
+ *
+ */
+public class BeanEnumComboBox extends BeanComponent implements
+ AlignableComponent {
+
+ private static final long serialVersionUID = -6892016525599793149L;
+
+ private Object[] possibleValues;
+ private static int height = 24;
+ private JComboBox value;
+
+ public BeanEnumComboBox(Object target, String propertyName, Properties props)
+ throws NoSuchMethodException {
+ this(target, propertyName, true, props);
+ }
+
+ public BeanEnumComboBox(Object target, String propertyName,
+ boolean useLabel, Properties props) throws NoSuchMethodException {
+ super(target, propertyName, useLabel, props);
+ setLayout(new BorderLayout());
+ // Check that this is actually an enumeration type
+ if (!propertyType.isEnum()) {
+ throw new IllegalArgumentException(
+ "Can't use BeanEnumComboBox on a non Enumeration property");
+ }
+ possibleValues = propertyType.getEnumConstants();
+ value = new JComboBox(possibleValues) {
+
+ private static final long serialVersionUID = -7712225463703816146L;
+
+ @Override
+ public Dimension getMinimumSize() {
+ return new Dimension(super.getMinimumSize().width, height);
+ }
+
+ @Override
+ public Dimension getPreferredSize() {
+ return new Dimension(super.getPreferredSize().width, height);
+ }
+
+ @Override
+ public Dimension getMaximumSize() {
+ return new Dimension(super.getMaximumSize().width, height);
+ }
+ };
+ value.setSelectedIndex(currentValueIndex());
+ value.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ synchronized (this) {
+ currentObjectValue = value.getSelectedItem();
+ setProperty();
+ }
+ }
+ });
+ addLabel();
+ add(value, BorderLayout.CENTER);
+ }
+
+ private int currentValueIndex() {
+ Object currentValue = getProperty();
+ for (int i = 0; i < possibleValues.length; i++) {
+ if (currentValue.equals(possibleValues[i])) {
+ return i;
+ }
+ }
+ return -1;
+ }
+
+ @Override
+ protected void updateComponent() {
+ value.setSelectedIndex(currentValueIndex());
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/BeanTextArea.java
----------------------------------------------------------------------
diff --git a/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/BeanTextArea.java b/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/BeanTextArea.java
new file mode 100644
index 0000000..740a592
--- /dev/null
+++ b/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/BeanTextArea.java
@@ -0,0 +1,89 @@
+package net.sf.taverna.t2.lang.uibuilder;
+
+import java.awt.Dimension;
+import java.awt.KeyboardFocusManager;
+import java.util.HashSet;
+import java.util.Properties;
+import java.util.Set;
+
+import javax.swing.KeyStroke;
+import javax.swing.UIManager;
+import javax.swing.text.JTextComponent;
+
+import net.sf.taverna.t2.lang.ui.DialogTextArea;
+
+/**
+ * Bean editor based on a DialogTextArea for use with longer strings such as
+ * descriptions. Supports the 'nofilter' property, if this is not specified then
+ * the text inserted initially (but not on subsequent events such as property
+ * change messages) will be filtered to remove multiple whitespace elements,
+ * replacing them with spaces, and to trim leading and trailing whitespace.
+ *
+ * @author Tom Oinn
+ *
+ */
+public class BeanTextArea extends BeanTextComponent implements
+ AlignableComponent {
+
+ private static final long serialVersionUID = 6418526320837944375L;
+ boolean initialized = false;
+
+ public BeanTextArea(Object target, String propertyName, Properties props)
+ throws NoSuchMethodException {
+ super(target, propertyName, props);
+ initialized = true;
+ }
+
+ @SuppressWarnings( { "serial", "unchecked" })
+ @Override
+ protected JTextComponent getTextComponent() {
+ DialogTextArea result = new DialogTextArea() {
+ @Override
+ public void setText(String text) {
+ if (!initialized && !getProperties().containsKey("nofilter")) {
+ super.setText(text.replaceAll("[ \\t\\n\\x0B\\f\\r]+", " ")
+ .trim());
+ } else {
+ super.setText(text);
+ }
+ }
+
+ @Override
+ public Dimension getPreferredSize() {
+ return new Dimension(0, super.getPreferredSize().height);
+ }
+
+ @Override
+ public Dimension getMinimumSize() {
+ return new Dimension(0, super.getPreferredSize().height);
+ }
+ };
+ // Fix to add borders to DialogTextArea on old look and feel implementations,
+ // the new one (Nimbus) already has this
+ if (!UIManager.getLookAndFeel().getName().equals("Nimbus")) {
+ result.setBorder(UIManager.getBorder("TextField.border"));
+ result.setFont(UIManager.getFont("TextField.font"));
+ }
+ // Change tab behaviour to allow tab to move to the next field - this
+ // effectively prevents a tab being placed in the text area but hey, we
+ // don't really want people doing that anyway in these cases.
+ Set set = new HashSet(
+ result
+ .getFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS));
+ set.add(KeyStroke.getKeyStroke("TAB"));
+ result.setFocusTraversalKeys(
+ KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, set);
+
+ set = new HashSet(
+ result
+ .getFocusTraversalKeys(KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS));
+ set.add(KeyStroke.getKeyStroke("shift TAB"));
+ result.setFocusTraversalKeys(
+ KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, set);
+
+ result.setLineWrap(true);
+ result.setWrapStyleWord(true);
+ return result;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/BeanTextComponent.java
----------------------------------------------------------------------
diff --git a/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/BeanTextComponent.java b/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/BeanTextComponent.java
new file mode 100644
index 0000000..791f1a8
--- /dev/null
+++ b/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/BeanTextComponent.java
@@ -0,0 +1,174 @@
+package net.sf.taverna.t2.lang.uibuilder;
+
+import java.awt.BorderLayout;
+import java.awt.event.FocusEvent;
+import java.awt.event.FocusListener;
+import java.lang.reflect.Constructor;
+import java.util.Properties;
+
+import javax.swing.event.DocumentEvent;
+import javax.swing.event.DocumentListener;
+import javax.swing.text.JTextComponent;
+
+/**
+ * Abstract superclass for all bean property editors based on text components
+ *
+ * @author Tom Oinn
+ */
+public abstract class BeanTextComponent extends BeanComponent {
+
+ private static final long serialVersionUID = -9133735782847457090L;
+ private String regex = null;
+ private JTextComponent text;
+ private String originalValue = null;
+ private boolean edited = false;
+
+ protected BeanTextComponent(Object target, String propertyName,
+ Properties props) throws NoSuchMethodException {
+ this(target, propertyName, true, props);
+ }
+
+ protected BeanTextComponent(Object target, String propertyName,
+ boolean useLabel, Properties props) throws NoSuchMethodException {
+ super(target, propertyName, useLabel, props);
+ setLayout(new BorderLayout());
+ if (propertyType.equals(Boolean.class)) {
+ setRegex("\\A((true)|(false))\\Z");
+ } else if (propertyType.equals(Character.class)) {
+ setRegex("\\A.\\Z");
+ }
+ text = getTextComponent();
+ originalValue = getPropertyAsString();
+ text.setText(originalValue);
+ text.setEditable(editable);
+ add(text, BorderLayout.CENTER);
+ if (editable) {
+ text.getDocument().addDocumentListener(new DocumentListener() {
+ public void changedUpdate(DocumentEvent e) {
+ valueChangedInEditor();
+ }
+
+ public void insertUpdate(DocumentEvent e) {
+ valueChangedInEditor();
+ }
+
+ public void removeUpdate(DocumentEvent e) {
+ valueChangedInEditor();
+ }
+
+ private void valueChangedInEditor() {
+ BeanTextComponent.this.valueChangedInEditor();
+ }
+ });
+ text.addFocusListener(new FocusListener() {
+ public void focusGained(FocusEvent e) {
+ //
+ }
+
+ public void focusLost(FocusEvent e) {
+ // System.out.println("Focus lost : valid = "
+ // + currentValueValid);
+ if (currentValueValid) {
+ if (isEdited()) {
+ BeanTextComponent.this.setProperty();
+ originalValue = text.getText();
+ }
+ } else {
+ originalValue = getPropertyAsString();
+ text.setText(originalValue);
+ }
+ setEdited(false);
+ }
+
+ });
+ }
+ addLabel();
+ }
+
+ private boolean isEdited() {
+ return this.edited;
+ }
+
+ private void setEdited(boolean edited) {
+ if (edited == this.edited) {
+ return;
+ }
+ this.edited = edited;
+ text.setBackground(edited ? editedColour : uneditedColour);
+ if (!edited) {
+ setValid(true);
+ }
+ }
+
+ public void updateComponent() {
+ originalValue = getPropertyAsString();
+ text.setText(originalValue);
+ setEdited(false);
+ }
+
+ private void valueChangedInEditor() {
+ if (text.getText().equals(originalValue)) {
+ setEdited(false);
+ return;
+ }
+ setEdited(true);
+ // Check for regex
+ if (regex != null) {
+ if (text.getText().matches(regex) == false) {
+ // System.out.println(text.getText() + ".matches(" + regex
+ // + ")==false");
+ setValid(false);
+ return;
+ }
+ }
+ // Delegate to constructor for non-string classes
+ if (!propertyType.equals(String.class)) {
+ try {
+ Constructor<?> cons = null;
+ if (propertyType.equals(Character.class)
+ && text.getText().length() > 0) {
+ currentObjectValue = text.getText().toCharArray()[0];
+ } else {
+ cons = propertyType.getConstructor(String.class);
+ currentObjectValue = cons.newInstance(text.getText());
+ }
+ } catch (Throwable t) {
+ setValid(false);
+ return;
+ }
+ } else {
+ currentObjectValue = text.getText();
+ }
+ setValid(true);
+ }
+
+ private void setValid(final boolean valid) {
+ if (valid == currentValueValid) {
+ return;
+ }
+ currentValueValid = valid;
+ text.setForeground(valid ? validColour : invalidColour);
+ setLabelColour(valid ? validColour : invalidColour);
+ text.repaint();
+ }
+
+ /**
+ * Implement this to provide the actual UI component used to show the
+ * content of the field. Done this way so you can choose what component to
+ * use.
+ *
+ * @return
+ */
+ protected abstract JTextComponent getTextComponent();
+
+ /**
+ * Set the regular expression used to validate the contents of the text
+ * field
+ *
+ * @param regex
+ */
+ public void setRegex(String regex) {
+ this.regex = regex;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/BeanTextField.java
----------------------------------------------------------------------
diff --git a/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/BeanTextField.java b/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/BeanTextField.java
new file mode 100644
index 0000000..63ed107
--- /dev/null
+++ b/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/BeanTextField.java
@@ -0,0 +1,60 @@
+package net.sf.taverna.t2.lang.uibuilder;
+
+import java.awt.Dimension;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.Properties;
+
+import javax.swing.JTextField;
+import javax.swing.text.JTextComponent;
+
+/**
+ * Bean field editor using a JTextField for short values
+ *
+ * @author Tom Oinn
+ */
+public class BeanTextField extends BeanTextComponent implements
+ AlignableComponent {
+
+ private static final long serialVersionUID = 5968203948656812060L;
+
+ public BeanTextField(Object target, String propertyName, boolean useLabel,
+ Properties props) throws NoSuchMethodException {
+ super(target, propertyName, useLabel, props);
+ }
+
+ public BeanTextField(Object target, String propertyName, Properties props)
+ throws NoSuchMethodException {
+ this(target, propertyName, true, props);
+ }
+
+ @SuppressWarnings("serial")
+ @Override
+ protected JTextComponent getTextComponent() {
+ final JTextField result = new JTextField() {
+
+ @Override
+ public Dimension getMinimumSize() {
+ return new Dimension(0, height);
+ }
+
+ @Override
+ public Dimension getPreferredSize() {
+ return new Dimension(0, height);
+ }
+
+ @Override
+ public Dimension getMaximumSize() {
+ return new Dimension(super.getMaximumSize().width, height);
+ }
+ };
+ result.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ setProperty();
+ result.transferFocus();
+ }
+ });
+ return new JTextField();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/Icons.java
----------------------------------------------------------------------
diff --git a/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/Icons.java b/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/Icons.java
new file mode 100644
index 0000000..b8fc58e
--- /dev/null
+++ b/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/Icons.java
@@ -0,0 +1,41 @@
+package net.sf.taverna.t2.lang.uibuilder;
+
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.swing.ImageIcon;
+
+import org.apache.log4j.Logger;
+
+/**
+ * Manage icons for the UIBuilder
+ *
+ * @author Tom Oinn
+ *
+ */
+public abstract class Icons {
+
+ private static Logger logger = Logger
+ .getLogger(Icons.class);
+
+ private static Map<String, ImageIcon> icons;
+
+ static {
+ icons = new HashMap<String, ImageIcon>();
+ }
+
+ static synchronized ImageIcon getIcon(String iconName) {
+ String iconNameLC = iconName.toLowerCase();
+ if (!icons.containsKey(iconNameLC)) {
+ try {
+ URL iconURL = Icons.class.getResource(iconName + ".png");
+ icons.put(iconNameLC, new ImageIcon(iconURL));
+ } catch (Exception ex) {
+ logger.error("Unable to get icon resource", ex);
+ }
+ }
+ return icons.get(iconNameLC);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/ListHandler.java
----------------------------------------------------------------------
diff --git a/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/ListHandler.java b/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/ListHandler.java
new file mode 100644
index 0000000..e7a2db8
--- /dev/null
+++ b/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/ListHandler.java
@@ -0,0 +1,67 @@
+package net.sf.taverna.t2.lang.uibuilder;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+
+/**
+ * The list handler is used to allow the reflection based UI builder to handle
+ * lists of non-bean value types such as String etc.
+ *
+ * @author Tom Oinn
+ *
+ */
+public class ListHandler extends
+ ArrayList<ListHandler.ListItem> {
+
+ private static Logger logger = Logger
+ .getLogger(ListHandler.class);
+
+ private static final long serialVersionUID = -1361470859975889856L;
+
+ private List<Object> wrappedList;
+
+ public ListHandler(List<Object> theList) {
+ this.wrappedList = theList;
+ for (Object o : wrappedList) {
+ this.add(new ListItem(o));
+ }
+ }
+
+ /**@Override
+ public boolean add(ListHandler.ListItem newItem) {
+ wrappedList.add((T) newItem.getValue());
+ return super.add(newItem);
+ }*/
+
+ /**
+ * Simple container class to handle list items, allowing them to present a
+ * bean interface
+ *
+ * @author Tom Oinn
+ *
+ */
+ class ListItem {
+ Object value;
+
+ public ListItem(Object o) {
+ this.value = o;
+ }
+
+ public void setValue(Object o) {
+ try {
+ wrappedList.set(indexOf(this), o);
+ this.value = o;
+ }
+ catch (Exception ex) {
+ logger.error("Unable to set value", ex);
+ }
+ }
+
+ public Object getValue() {
+ return this.value;
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/RecursiveListComponent.java
----------------------------------------------------------------------
diff --git a/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/RecursiveListComponent.java b/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/RecursiveListComponent.java
new file mode 100644
index 0000000..7db727d
--- /dev/null
+++ b/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/RecursiveListComponent.java
@@ -0,0 +1,98 @@
+package net.sf.taverna.t2.lang.uibuilder;
+
+import java.awt.Component;
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import javax.swing.Box;
+import javax.swing.BoxLayout;
+import javax.swing.JComponent;
+import javax.swing.JPanel;
+import javax.swing.JSeparator;
+import javax.swing.SwingConstants;
+
+import net.sf.taverna.t2.lang.uibuilder.UIBuilder;
+
+/**
+ * Handles lists where the elements in the list are beans with declared fields
+ * in the UIBuilder configuration.
+ *
+ * @author Tom Oinn
+ *
+ */
+public class RecursiveListComponent extends AbstractListComponent {
+
+ private static final long serialVersionUID = -3760308074241973969L;
+
+ @SuppressWarnings("unchecked")
+ public RecursiveListComponent(String fieldName, List theList,
+ Properties props, Map<String, Properties> fieldProps,
+ Class<?> newItemClass, List<String> subFields, String parent)
+ throws NoSuchMethodException, IllegalArgumentException,
+ IllegalAccessException, InvocationTargetException,
+ ClassNotFoundException {
+ super(fieldName, theList, props, fieldProps, newItemClass, subFields,
+ parent);
+ // TODO Auto-generated constructor stub
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ protected void addNewItemToList(Object o) throws IllegalArgumentException,
+ NoSuchMethodException, IllegalAccessException,
+ InvocationTargetException, ClassNotFoundException {
+ getUnderlyingList().add(0, o);
+ updateListContents();
+ }
+
+ @Override
+ protected void deleteItemAtIndex(int index)
+ throws IllegalArgumentException, NoSuchMethodException,
+ IllegalAccessException, InvocationTargetException,
+ ClassNotFoundException {
+ getUnderlyingList().remove(index);
+ updateListContents();
+ }
+
+ @Override
+ protected List<JComponent> getListComponents()
+ throws NoSuchMethodException, IllegalArgumentException,
+ IllegalAccessException, InvocationTargetException,
+ ClassNotFoundException {
+ List<JComponent> result = new ArrayList<JComponent>();
+ for (Object target : getUnderlyingList()) {
+ JPanel listItem = new JPanel();
+ listItem.setOpaque(false);
+ listItem.setLayout(new BoxLayout(listItem, BoxLayout.PAGE_AXIS));
+ UIBuilder.buildEditor(target, getSubFields(), getFieldProperties(),
+ listItem, getParentFieldName());
+ result.add(listItem);
+ }
+ return result;
+ }
+
+ @Override
+ public List<Component> getSeparatorComponents() {
+ List<Component> result = new ArrayList<Component>();
+ result.add(Box.createVerticalStrut(3));
+ result.add(new JSeparator(SwingConstants.HORIZONTAL));
+ result.add(Box.createVerticalStrut(3));
+ return result;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ protected void itemMoved(int fromIndex, int toIndex)
+ throws IllegalArgumentException, NoSuchMethodException,
+ IllegalAccessException, InvocationTargetException,
+ ClassNotFoundException {
+ Object toMove = getUnderlyingList().remove(fromIndex);
+ getUnderlyingList().add(toIndex, toMove);
+ updateListContents();
+
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/UIBuilder.java
----------------------------------------------------------------------
diff --git a/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/UIBuilder.java b/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/UIBuilder.java
new file mode 100644
index 0000000..2501046
--- /dev/null
+++ b/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/UIBuilder.java
@@ -0,0 +1,236 @@
+package net.sf.taverna.t2.lang.uibuilder;
+
+import java.awt.BorderLayout;
+import java.awt.Container;
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import javax.swing.BorderFactory;
+import javax.swing.Box;
+import javax.swing.BoxLayout;
+import javax.swing.JPanel;
+
+/**
+ * Static methods to build bean editor UIs through reflection and (minimal)
+ * configuration
+ *
+ * @author Tom Oinn
+ *
+ */
+public abstract class UIBuilder {
+
+ /**
+ * Build an editor component for the specified target, the configuration
+ * string determines which properties are exposed to the UI and whether to
+ * drill into nested collections and composite bean types
+ *
+ * @param target
+ * @param configuration
+ * @return
+ * @throws NoSuchMethodException
+ * @throws InvocationTargetException
+ * @throws IllegalAccessException
+ * @throws IllegalArgumentException
+ * @throws ClassNotFoundException
+ */
+ public static JPanel buildEditor(Object target, String configuration)
+ throws UIConstructionException {
+ String[] fields = configuration.split(";");
+ return buildEditor(target, fields);
+ }
+
+ public static JPanel buildEditor(Object target, String[] fields)
+ throws UIConstructionException {
+ // Now go through the configuration...
+ JPanel result = new JPanel();
+ result.setLayout(new BorderLayout());
+ JPanel contents = new JPanel();
+ contents.setOpaque(false);
+ contents.setLayout(new BoxLayout(contents, BoxLayout.PAGE_AXIS));
+ List<String> fieldNames = new ArrayList<String>();
+ Map<String, Properties> fieldProps = new HashMap<String, Properties>();
+ for (String field : fields) {
+ String fieldName = field.split(":")[0];
+ fieldNames.add(fieldName);
+ if (field.split(":").length > 1) {
+ String propertiesString = field.split(":")[1];
+ String[] props = propertiesString.split(",");
+ if (props.length == 0) {
+ props = new String[] { propertiesString };
+ }
+ Properties properties = new Properties();
+ for (String prop : props) {
+ if (prop.contains("=")) {
+ String[] p = prop.split("=");
+ properties.put(p[0], p[1]);
+ } else {
+ properties.put(prop, "true");
+ }
+ }
+ fieldProps.put(fieldName, properties);
+ }
+ }
+ try {
+ buildEditor(target, fieldNames, fieldProps, contents, "");
+ } catch (Exception ex) {
+ throw new UIConstructionException(
+ "Unable to construct UI from POJO", ex);
+ }
+ result.add(contents, BorderLayout.NORTH);
+ result.add(Box.createVerticalGlue(), BorderLayout.CENTER);
+ return result;
+ }
+
+ @SuppressWarnings("unchecked")
+ static void buildEditor(Object target, List<String> fieldNames,
+ Map<String, Properties> fieldProps, Container contents,
+ String parent) throws NoSuchMethodException,
+ IllegalArgumentException, IllegalAccessException,
+ InvocationTargetException, ClassNotFoundException {
+
+ // Get all top level fields to render in this pass
+ List<String> activeFields = new ArrayList<String>();
+ for (String field : fieldNames) {
+ if (!field.contains(".")) {
+ activeFields.add(field);
+ }
+ }
+ // For each field generate the appropriate component
+ for (String field : activeFields) {
+
+ // Fetch the properties block for this field
+ Properties props = getProperties(field, parent, fieldProps);
+
+ // First check whether there are any subfields for this field, in
+ // which case we need to treat it differently
+ boolean simpleField = true;
+ for (String subField : fieldNames) {
+ if (!subField.equals(field) && subField.startsWith(field + ".")) {
+ simpleField = false;
+ break;
+ }
+ }
+ List<String> subFields = new ArrayList<String>();
+ // Create filtered list of the field names
+ // to ensure that this is now the top level
+ // field and recurse
+ String newParent = field;
+ if (!parent.equals("")) {
+ newParent = parent + "." + field;
+ }
+ for (String f : fieldNames) {
+ if (f.startsWith(field + ".")) {
+ subFields.add(f.substring(field.length() + 1));
+ }
+ }
+
+ // Secondly check whether this is a list
+ boolean listField = false;
+ Class<?> fieldType = BeanComponent.getPropertyType(target, field);
+ if (List.class.isAssignableFrom(fieldType)) {
+ listField = true;
+ }
+
+ // Now handle the four possible cases. If a non-list non-compound
+ // field we have a terminator and can obtain an appropriate subclass
+ // of BeanComponent to render it
+ if (!listField) {
+ // If a non-list non-compound field we have a terminator and can
+ // obtain an appropriate subclass of BeanComponent to render it
+ if (simpleField) {
+ if (fieldType.isEnum()) {
+ contents
+ .add(new BeanEnumComboBox(target, field, props));
+ } else if (Boolean.class.isAssignableFrom(fieldType)
+ || boolean.class.isAssignableFrom(fieldType)) {
+ contents.add(new BeanCheckBox(target, field, props));
+ } else {
+ if (props.get("type") != null) {
+ if (props.get("type").equals("textarea")) {
+ BeanTextArea bta = new BeanTextArea(target,
+ field, props);
+ contents.add(bta);
+ } else {
+ contents.add(new BeanTextField(target, field,
+ props));
+ }
+ } else {
+ contents
+ .add(new BeanTextField(target, field, props));
+ }
+ }
+ } else {
+ Object value = BeanComponent.findMethodWithPrefix("get",
+ target, field).invoke(target);
+ if (value != null) {
+ String displayName = field;
+ if (props.containsKey("name")) {
+ displayName = props.getProperty("name");
+ }
+ JPanel itemContainer = new JPanel();
+ itemContainer.setOpaque(false);
+ itemContainer.setBorder(BorderFactory
+ .createTitledBorder(displayName));
+ itemContainer.setLayout(new BoxLayout(itemContainer,
+ BoxLayout.PAGE_AXIS));
+ buildEditor(value, subFields, fieldProps,
+ itemContainer, newParent);
+ contents.add(itemContainer);
+ }
+ }
+ } else {
+ // Handle the case where this is a simple field (i.e. no
+ // sub-fields defined) but is a list type. In this case we need
+ // to build an appropriate wrapper list panel around this
+ // returned list.
+ List value = (List) BeanComponent.findMethodWithPrefix("get",
+ target, field).invoke(target);
+ // If the 'new' property is defined then fetch the Class object
+ // to be used to instantiate new list items
+ Class<?> newItemClass = null;
+ if (props.containsKey("new")) {
+ String newItemClassName = props.getProperty("new");
+ newItemClass = target.getClass().getClassLoader()
+ .loadClass(newItemClassName);
+ }
+ if (value != null) {
+ if (simpleField) {
+ contents.add(new WrappedListComponent(field, value,
+ props, fieldProps, newItemClass, subFields,
+ newParent));
+ // contents.add(buildWrappedList(field, value, props,
+ // newItemClass));
+ } else {
+ contents.add(new RecursiveListComponent(field, value,
+ props, fieldProps, newItemClass, subFields,
+ newParent));
+ // contents.add(buildList(field, value, props,
+ // fieldProps,
+ // newItemClass, subFields, newParent));
+ }
+ }
+ }
+ }
+ // Finally align any labels where appropriate
+ Alignment.alignInContainer(contents);
+ }
+
+ private static Properties getProperties(String field, String parent,
+ Map<String, Properties> props) {
+ String fullName = parent;
+ if (!parent.equals("")) {
+ fullName = fullName + ".";
+ }
+ fullName = fullName + field;
+ if (props.containsKey(fullName)) {
+ return props.get(fullName);
+ } else {
+ return new Properties();
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/UIConstructionException.java
----------------------------------------------------------------------
diff --git a/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/UIConstructionException.java b/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/UIConstructionException.java
new file mode 100644
index 0000000..54167db
--- /dev/null
+++ b/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/UIConstructionException.java
@@ -0,0 +1,29 @@
+package net.sf.taverna.t2.lang.uibuilder;
+
+/**
+ * Used to wrap checked exceptions from the various reflection based UI
+ * construction methods
+ *
+ * @author Tom Oinn
+ */
+public class UIConstructionException extends RuntimeException {
+
+ private static final long serialVersionUID = 3396809563793962316L;
+
+ public UIConstructionException() {
+ //
+ }
+
+ public UIConstructionException(String message) {
+ super(message);
+ }
+
+ public UIConstructionException(Throwable cause) {
+ super(cause);
+ }
+
+ public UIConstructionException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/WrappedListComponent.java
----------------------------------------------------------------------
diff --git a/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/WrappedListComponent.java b/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/WrappedListComponent.java
new file mode 100644
index 0000000..e44b036
--- /dev/null
+++ b/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/WrappedListComponent.java
@@ -0,0 +1,105 @@
+package net.sf.taverna.t2.lang.uibuilder;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import javax.swing.BoxLayout;
+import javax.swing.JComponent;
+import javax.swing.JPanel;
+
+/**
+ * Models lists requiring use of the ListHandler helper class within the UI
+ *
+ * @author Tom Oinn
+ */
+public class WrappedListComponent extends AbstractListComponent {
+
+ private static final long serialVersionUID = -4457073442579747674L;
+ private ListHandler lh = null;
+
+ @SuppressWarnings("unchecked")
+ public WrappedListComponent(String fieldName, List theList,
+ Properties props, Map<String, Properties> fieldProps,
+ Class<?> newItemClass, List<String> subFields, String parent)
+ throws NoSuchMethodException, IllegalArgumentException,
+ IllegalAccessException, InvocationTargetException,
+ ClassNotFoundException {
+ super(fieldName, theList, props, fieldProps, newItemClass, subFields,
+ parent);
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ protected void addNewItemToList(Object o) throws IllegalArgumentException,
+ NoSuchMethodException, IllegalAccessException,
+ InvocationTargetException, ClassNotFoundException {
+ // Keep lists in sync
+ getListHandler();
+ synchronized (lh) {
+ getUnderlyingList().add(0, o);
+ lh.add(0, lh.new ListItem(o));
+ }
+ updateListContents();
+ }
+
+ @Override
+ protected void deleteItemAtIndex(int index)
+ throws IllegalArgumentException, NoSuchMethodException,
+ IllegalAccessException, InvocationTargetException,
+ ClassNotFoundException {
+ getListHandler();
+ synchronized (lh) {
+ getUnderlyingList().remove(index);
+ lh.remove(index);
+ }
+ updateListContents();
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ protected void itemMoved(int fromIndex, int toIndex)
+ throws IllegalArgumentException, NoSuchMethodException,
+ IllegalAccessException, InvocationTargetException,
+ ClassNotFoundException {
+ getListHandler();
+ synchronized (lh) {
+ Object toMove = getUnderlyingList().remove(fromIndex);
+ ListHandler.ListItem wrapperToMove = lh.remove(fromIndex);
+ getUnderlyingList().add(toIndex, toMove);
+ lh.add(toIndex, wrapperToMove);
+ }
+ updateListContents();
+ }
+
+ @Override
+ protected List<JComponent> getListComponents() throws NoSuchMethodException {
+ getListHandler();
+ List<JComponent> result = new ArrayList<JComponent>();
+ for (ListHandler.ListItem item : lh) {
+ JPanel listItem = new JPanel();
+ listItem.setOpaque(false);
+ listItem.setLayout(new BoxLayout(listItem, BoxLayout.PAGE_AXIS));
+ Class<?> itemClass = item.getValue().getClass();
+ if (itemClass.isEnum()) {
+ result.add(new BeanEnumComboBox(item, "value", false,
+ new Properties()));
+ } else {
+ result.add(new BeanTextField(item, "value", false,
+ new Properties()));
+ }
+ }
+ return result;
+ }
+
+ @SuppressWarnings("unchecked")
+ private ListHandler getListHandler() {
+ if (this.lh == null) {
+ lh = new ListHandler(getUnderlyingList());
+ }
+ return lh;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/package.html
----------------------------------------------------------------------
diff --git a/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/package.html b/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/package.html
new file mode 100644
index 0000000..7ee4684
--- /dev/null
+++ b/taverna-uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/package.html
@@ -0,0 +1,4 @@
+<body>
+Swing components to control and render the PluginManager and associated
+bean classes, most obviously PluginDescription
+</body>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/taverna-uibuilder/src/main/resources/net/sf/taverna/t2/lang/uibuilder/delete.png
----------------------------------------------------------------------
diff --git a/taverna-uibuilder/src/main/resources/net/sf/taverna/t2/lang/uibuilder/delete.png b/taverna-uibuilder/src/main/resources/net/sf/taverna/t2/lang/uibuilder/delete.png
new file mode 100644
index 0000000..4ad6a58
Binary files /dev/null and b/taverna-uibuilder/src/main/resources/net/sf/taverna/t2/lang/uibuilder/delete.png differ
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/taverna-uibuilder/src/main/resources/net/sf/taverna/t2/lang/uibuilder/down.png
----------------------------------------------------------------------
diff --git a/taverna-uibuilder/src/main/resources/net/sf/taverna/t2/lang/uibuilder/down.png b/taverna-uibuilder/src/main/resources/net/sf/taverna/t2/lang/uibuilder/down.png
new file mode 100644
index 0000000..c7b2f03
Binary files /dev/null and b/taverna-uibuilder/src/main/resources/net/sf/taverna/t2/lang/uibuilder/down.png differ
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/taverna-uibuilder/src/main/resources/net/sf/taverna/t2/lang/uibuilder/new.png
----------------------------------------------------------------------
diff --git a/taverna-uibuilder/src/main/resources/net/sf/taverna/t2/lang/uibuilder/new.png b/taverna-uibuilder/src/main/resources/net/sf/taverna/t2/lang/uibuilder/new.png
new file mode 100644
index 0000000..7c437cf
Binary files /dev/null and b/taverna-uibuilder/src/main/resources/net/sf/taverna/t2/lang/uibuilder/new.png differ
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/taverna-uibuilder/src/main/resources/net/sf/taverna/t2/lang/uibuilder/up.png
----------------------------------------------------------------------
diff --git a/taverna-uibuilder/src/main/resources/net/sf/taverna/t2/lang/uibuilder/up.png b/taverna-uibuilder/src/main/resources/net/sf/taverna/t2/lang/uibuilder/up.png
new file mode 100644
index 0000000..bace5c1
Binary files /dev/null and b/taverna-uibuilder/src/main/resources/net/sf/taverna/t2/lang/uibuilder/up.png differ
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/taverna-uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/Application.java
----------------------------------------------------------------------
diff --git a/taverna-uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/Application.java b/taverna-uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/Application.java
new file mode 100644
index 0000000..3f90241
--- /dev/null
+++ b/taverna-uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/Application.java
@@ -0,0 +1,48 @@
+package net.sf.taverna.t2.lang.uibuilder;
+
+import java.awt.Color;
+
+import javax.swing.JFrame;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
+
+import net.sf.taverna.t2.lang.uibuilder.UIBuilder;
+
+/**
+ * Torture test for the UIBuilder, run this as an application
+ *
+ * @author Tom Oinn
+ *
+ */
+public class Application {
+
+ private static final String NUMBUS = "com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel";
+
+ public static void main(String[] args) throws ClassNotFoundException,
+ InstantiationException, IllegalAccessException,
+ UnsupportedLookAndFeelException {
+ try {
+ UIManager.setLookAndFeel(NUMBUS);
+ } catch (ClassNotFoundException ex) {
+ // ignore
+ }
+ Object bean = new TopLevelBean();
+ JFrame win = new JFrame();
+ JPanel contents = UIBuilder.buildEditor(bean, new String[] {
+ "boundbean", "boundbean.string:type=textarea", "boundbean.url",
+ "boundbean.uri",
+ "boundbean.string:type=textarea", "boundbean.url",
+ "enumeratedfield", "nest", "nest.list", "nest.list.list1",
+ "nest.list.list2", "nest.list.list2.string",
+ "nest.list.list2.url" });
+ contents.setBackground(new Color(240, 230, 200));
+ win.setContentPane(new JScrollPane(contents));
+ win.setTitle("Bean test");
+ win.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+ win.pack();
+ win.setVisible(true);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/taverna-uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/Application2.java
----------------------------------------------------------------------
diff --git a/taverna-uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/Application2.java b/taverna-uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/Application2.java
new file mode 100644
index 0000000..bf689c9
--- /dev/null
+++ b/taverna-uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/Application2.java
@@ -0,0 +1,44 @@
+package net.sf.taverna.t2.lang.uibuilder;
+
+import java.awt.Color;
+
+import javax.swing.JFrame;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
+
+import net.sf.taverna.t2.lang.uibuilder.UIBuilder;
+
+/**
+ * Torture test for the UIBuilder, run this as an application
+ *
+ * @author Tom Oinn
+ *
+ */
+public class Application2 {
+
+ private static final String NUMBUS = "com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel";
+
+ public static void main(String[] args) throws ClassNotFoundException,
+ InstantiationException, IllegalAccessException,
+ UnsupportedLookAndFeelException {
+ try {
+ UIManager.setLookAndFeel(NUMBUS);
+ } catch (ClassNotFoundException ex) {
+ // ignore
+ }
+ Object bean = new PrimitiveTypeBean();
+ JFrame win = new JFrame();
+ JPanel contents = UIBuilder.buildEditor(bean, new String[] {
+ "intvalue", "shortValue", "longValue", "doubleValue",
+ "booleanValue", "byteValue", "floatValue", "charValue" });
+ contents.setBackground(new Color(240, 230, 200));
+ win.setContentPane(new JScrollPane(contents));
+ win.setTitle("Primitive type test");
+ win.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+ win.pack();
+ win.setVisible(true);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/taverna-uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/BeanWithBoundProps.java
----------------------------------------------------------------------
diff --git a/taverna-uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/BeanWithBoundProps.java b/taverna-uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/BeanWithBoundProps.java
new file mode 100644
index 0000000..3f91ea2
--- /dev/null
+++ b/taverna-uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/BeanWithBoundProps.java
@@ -0,0 +1,74 @@
+package net.sf.taverna.t2.lang.uibuilder;
+
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URL;
+
+/**
+ * Example bean with string and URL properties, both of which fire property
+ * change events
+ *
+ * @author Tom Oinn
+ *
+ */
+public class BeanWithBoundProps {
+
+ private String string = "Default value";
+ private URL url;
+ private PropertyChangeSupport pcs;
+ private URI uri;
+
+
+ public BeanWithBoundProps() {
+ try {
+ this.url = new URL("http://some.default.url");
+ this.pcs = new PropertyChangeSupport(this);
+ this.uri = URI.create("http://google.com/");
+ } catch (MalformedURLException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+ public void setUrl(URL url) {
+ URL old = this.url;
+ this.url = url;
+ this.pcs.firePropertyChange("url", old, url);
+ }
+
+ public URL getUrl() {
+ return url;
+ }
+
+
+
+ public void setString(String string) {
+ String old = this.string;
+ this.string = string;
+ this.pcs.firePropertyChange("string", old, string);
+ }
+
+ public String getString() {
+ return string;
+ }
+
+ public void addPropertyChangeListener(String propertyName,
+ PropertyChangeListener l) {
+ pcs.addPropertyChangeListener(propertyName, l);
+ }
+
+ public void removePropertyChangeListener(PropertyChangeListener l) {
+ pcs.removePropertyChangeListener(l);
+ }
+
+ public void setUri(URI uri) {
+ this.uri = uri;
+ }
+
+ public URI getUri() {
+ return uri;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/taverna-uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/BeanWithListProperties.java
----------------------------------------------------------------------
diff --git a/taverna-uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/BeanWithListProperties.java b/taverna-uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/BeanWithListProperties.java
new file mode 100644
index 0000000..90d7c6a
--- /dev/null
+++ b/taverna-uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/BeanWithListProperties.java
@@ -0,0 +1,35 @@
+package net.sf.taverna.t2.lang.uibuilder;
+
+import java.util.List;
+import java.util.ArrayList;
+
+/**
+ * Sample bean with a couple of list properties
+ *
+ * @author Tom Oinn
+ *
+ */
+public class BeanWithListProperties {
+
+ private List<String> list1;
+ private List<BeanWithBoundProps> list2;
+
+ public BeanWithListProperties() {
+ this.list1 = new ArrayList<String>();
+ this.list2 = new ArrayList<BeanWithBoundProps>();
+ list1.add("A list item");
+ list1.add("Another item");
+ for (int i = 0; i < 10; i++) {
+ list2.add(new BeanWithBoundProps());
+ }
+ }
+
+ public List<String> getList1() {
+ return this.list1;
+ }
+
+ public List<BeanWithBoundProps> getList2() {
+ return this.list2;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/taverna-uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/BeanWithNestedList.java
----------------------------------------------------------------------
diff --git a/taverna-uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/BeanWithNestedList.java b/taverna-uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/BeanWithNestedList.java
new file mode 100644
index 0000000..231f068
--- /dev/null
+++ b/taverna-uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/BeanWithNestedList.java
@@ -0,0 +1,28 @@
+package net.sf.taverna.t2.lang.uibuilder;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Simple bean with a list of the BeanWithListProperties to check nested list
+ * management
+ *
+ * @author Tom Oinn
+ *
+ */
+public class BeanWithNestedList {
+
+ private List<BeanWithListProperties> list;
+
+ public BeanWithNestedList() {
+ this.list = new ArrayList<BeanWithListProperties>();
+ for (int i = 0; i < 3; i++) {
+ list.add(new BeanWithListProperties());
+ }
+ }
+
+ public List<BeanWithListProperties> getList() {
+ return this.list;
+ }
+
+}
[18/50] [abbrv] incubator-taverna-workbench git commit: added README
Posted by st...@apache.org.
added README
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/commit/5d3a34bc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/tree/5d3a34bc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/diff/5d3a34bc
Branch: refs/heads/master
Commit: 5d3a34bc0a8de52717160ef22dea26b6483bc184
Parents: 70e36de
Author: Christian-B <br...@cs.man.ac.uk>
Authored: Fri May 9 09:08:18 2014 +0100
Committer: Christian-B <br...@cs.man.ac.uk>
Committed: Fri May 9 09:08:18 2014 +0100
----------------------------------------------------------------------
README.md | 3 +++
1 file changed, 3 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/5d3a34bc/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..58d1f52
--- /dev/null
+++ b/README.md
@@ -0,0 +1,3 @@
+Taverna Workflow system assorted support utilities
+
+This code was previously hosted at http://taverna.googlecode.com/svn/taverna/utils/net.sf.taverna.t2.lang/
\ No newline at end of file
[15/50] [abbrv] incubator-taverna-workbench git commit: Moved from
t2.lang
Posted by st...@apache.org.
Moved from t2.lang
git-svn-id: https://taverna.googlecode.com/svn/taverna/utils/net.sf.taverna.t2.lang/branches/maintenance@16888 bf327186-88b3-11dd-a302-d386e5130c1c
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/commit/c7cfb2ef
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/tree/c7cfb2ef
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/diff/c7cfb2ef
Branch: refs/heads/master
Commit: c7cfb2efb53719b1d57a412d79c03eb360a33033
Parents: 52f2960
Author: stian@mygrid.org.uk <st...@bf327186-88b3-11dd-a302-d386e5130c1c>
Authored: Wed Mar 19 16:51:06 2014 +0000
Committer: stian@mygrid.org.uk <st...@bf327186-88b3-11dd-a302-d386e5130c1c>
Committed: Wed Mar 19 16:51:06 2014 +0000
----------------------------------------------------------------------
results/pom.xml | 54 ---
.../t2/lang/baclava/BaclavaDocumentHandler.java | 133 --------
.../taverna/t2/lang/results/ResultsUtils.java | 329 -------------------
3 files changed, 516 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/c7cfb2ef/results/pom.xml
----------------------------------------------------------------------
diff --git a/results/pom.xml b/results/pom.xml
deleted file mode 100644
index 4db22ee..0000000
--- a/results/pom.xml
+++ /dev/null
@@ -1,54 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<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>
- <groupId>net.sf.taverna.t2.lang</groupId>
- <artifactId>results</artifactId>
- <parent>
- <groupId>net.sf.taverna.t2</groupId>
- <artifactId>lang</artifactId>
- <version>1.6-SNAPSHOT</version>
- </parent>
- <name>Common Results handling utilities</name>
- <description>Common utilities for handling results, in particular Baclava document handling and de-referencing T2References</description>
- <dependencies>
- <dependency>
- <groupId>uk.org.mygrid.taverna.baclava</groupId>
- <artifactId>baclava-core</artifactId>
- <version>${taverna.version}</version>
- </dependency>
- <dependency>
- <groupId>uk.org.mygrid.taverna.baclava</groupId>
- <artifactId>baclava-core</artifactId>
- <version>${taverna.version}</version>
- </dependency>
- <dependency>
- <groupId>net.sf.taverna.t2.core</groupId>
- <artifactId>reference-api</artifactId>
- <version>${t2.core.version}</version>
- </dependency>
- <dependency>
- <groupId>net.sf.taverna.t2.core</groupId>
- <artifactId>workflowmodel-api</artifactId>
- <version>${t2.core.version}</version>
- </dependency>
- <dependency>
- <groupId>uk.org.mygrid.resources.mimeutil</groupId>
- <artifactId>mime-util</artifactId>
- <version>2.1.2-7-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>uk.org.mygrid.resources.clapper</groupId>
- <artifactId>ocutil</artifactId>
- <version>2.5.1</version>
- </dependency>
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-</project>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/c7cfb2ef/results/src/main/java/net/sf/taverna/t2/lang/baclava/BaclavaDocumentHandler.java
----------------------------------------------------------------------
diff --git a/results/src/main/java/net/sf/taverna/t2/lang/baclava/BaclavaDocumentHandler.java b/results/src/main/java/net/sf/taverna/t2/lang/baclava/BaclavaDocumentHandler.java
deleted file mode 100644
index 62dbe65..0000000
--- a/results/src/main/java/net/sf/taverna/t2/lang/baclava/BaclavaDocumentHandler.java
+++ /dev/null
@@ -1,133 +0,0 @@
-package net.sf.taverna.t2.lang.baclava;
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.PrintWriter;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.Map;
-
-import net.sf.taverna.t2.invocation.InvocationContext;
-import net.sf.taverna.t2.lang.results.ResultsUtils;
-import net.sf.taverna.t2.reference.ReferenceService;
-import net.sf.taverna.t2.reference.T2Reference;
-
-import org.embl.ebi.escience.baclava.DataThing;
-import org.embl.ebi.escience.baclava.factory.DataThingFactory;
-import org.embl.ebi.escience.baclava.factory.DataThingXMLFactory;
-import org.jdom.Document;
-import org.jdom.Element;
-import org.jdom.JDOMException;
-import org.jdom.Namespace;
-import org.jdom.input.SAXBuilder;
-import org.jdom.output.Format;
-import org.jdom.output.XMLOutputter;
-
-/**
- * Handles the loading and saving of T2Reference data as Baclava documents
- *
- * @author Stuart Owen
- *
- */
-
-public class BaclavaDocumentHandler {
-
- private Map<String, T2Reference> chosenReferences;
-
- private static Namespace namespace = Namespace.getNamespace("b",
- "http://org.embl.ebi.escience/baclava/0.1alpha");
-
- protected ReferenceService referenceService;
-
- protected InvocationContext context;
-
- // private static Logger logger =
- // Logger.getLogger(BaclavaDocumentHandler.class);
-
-
- /**
- * Reads a baclava document from an InputStream and returns a map of DataThings mapped to the portName
- *
- * @throws IOException, JDOMException
- */
- public Map<String, DataThing> readData(InputStream inputStream)
- throws IOException, JDOMException {
-
- SAXBuilder builder = new SAXBuilder();
- Document inputDoc;
- inputDoc = builder.build(inputStream);
-
- return DataThingXMLFactory.parseDataDocument(inputDoc);
- }
-
- /**
- * Saves the result data to an XML Baclava file.
- *
- * @throws IOException
- */
- public void saveData(File file) throws IOException {
- // Build the string containing the XML document from the result map
- Document doc = getDataDocument();
- XMLOutputter xo = new XMLOutputter(Format.getPrettyFormat());
- PrintWriter out = new PrintWriter(new FileWriter(file));
- xo.output(doc, out);
- }
-
- /**
- * Returns a org.jdom.Document from a map of port named to DataThingS
- * containing the port's results.
- */
- public Document getDataDocument() {
- Element rootElement = new Element("dataThingMap", namespace);
- Document theDocument = new Document(rootElement);
- // Build the DataThing map from the chosenReferences
- // First convert map of references to objects into a map of real result
- // objects
- for (String portName : getChosenReferences().keySet()) {
- DataThing thing = DataThingFactory.bake(getObjectForName(portName));
- Element dataThingElement = new Element("dataThing", namespace);
- dataThingElement.setAttribute("key", portName);
- dataThingElement.addContent(thing.getElement());
- rootElement.addContent(dataThingElement);
- }
- return theDocument;
- }
-
- /**
- * @param referenceService
- * the referenceService to set
- */
- public void setReferenceService(ReferenceService referenceService) {
- this.referenceService = referenceService;
- }
-
- /**
- * Sets the InvocationContext to be used to get the Reference Service to be
- * used dereference the reference.
- */
- public void setInvocationContext(InvocationContext context) {
- this.context = context;
- }
-
- protected Object getObjectForName(String name) {
- Object result = null;
- if (getChosenReferences().containsKey(name)) {
- result = ResultsUtils.convertReferenceToObject(
- getChosenReferences().get(name), referenceService, context);
- }
- if (result == null) {
- result = "null";
- }
- return result;
- }
-
- private Map<String, T2Reference> getChosenReferences() {
- return chosenReferences;
- }
-
- public void setChosenReferences(Map<String, T2Reference> chosenReferences) {
- this.chosenReferences = chosenReferences;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/c7cfb2ef/results/src/main/java/net/sf/taverna/t2/lang/results/ResultsUtils.java
----------------------------------------------------------------------
diff --git a/results/src/main/java/net/sf/taverna/t2/lang/results/ResultsUtils.java b/results/src/main/java/net/sf/taverna/t2/lang/results/ResultsUtils.java
deleted file mode 100644
index c99a646..0000000
--- a/results/src/main/java/net/sf/taverna/t2/lang/results/ResultsUtils.java
+++ /dev/null
@@ -1,329 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.lang.results;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.Set;
-
-import javax.swing.tree.DefaultMutableTreeNode;
-
-import net.sf.taverna.t2.invocation.InvocationContext;
-import net.sf.taverna.t2.reference.ErrorDocument;
-import net.sf.taverna.t2.reference.ErrorDocumentService;
-import net.sf.taverna.t2.reference.ExternalReferenceSPI;
-import net.sf.taverna.t2.reference.IdentifiedList;
-import net.sf.taverna.t2.reference.ListService;
-import net.sf.taverna.t2.reference.ReferenceService;
-import net.sf.taverna.t2.reference.ReferenceServiceException;
-import net.sf.taverna.t2.reference.ReferenceSet;
-import net.sf.taverna.t2.reference.ReferencedDataNature;
-import net.sf.taverna.t2.reference.StackTraceElementBean;
-import net.sf.taverna.t2.reference.T2Reference;
-import net.sf.taverna.t2.reference.T2ReferenceType;
-import net.sf.taverna.t2.reference.ValueCarryingExternalReference;
-
-import org.apache.log4j.Logger;
-import org.clapper.util.misc.MIMETypeUtil;
-
-import eu.medsea.mimeutil.MimeType;
-import eu.medsea.mimeutil.MimeUtil2;
-
-/**
- * Convenience methods for displaying and storing workflow run results. For
- * example, converting result error documents into various representations (e.g.
- * StringS or JTreeS), getting MIME type of result objects, etc.
- *
- * @author Alex Nenadic
- *
- */
-public class ResultsUtils {
-
- private static Logger logger = Logger.getLogger(ResultsUtils.class);
-
- /**
- * Converts a T2Reference pointing to results to
- * a list of (lists of ...) dereferenced result object.
- * @param context
- * @param referenceService
- */
- public static Object convertReferenceToObject(T2Reference reference, ReferenceService referenceService, InvocationContext context) {
-
- if (reference.getReferenceType() == T2ReferenceType.ReferenceSet){
-
- ReferenceSet rs = referenceService.getReferenceSetService().getReferenceSet(reference);
- if (rs == null) {
- throw new ReferenceServiceException("Could not find ReferenceSet " + reference);
- }
- // Check that there are references in the set
- if (rs.getExternalReferences().isEmpty()) {
- throw new ReferenceServiceException(
- "Can't render an empty reference set to a POJO");
- }
-
- ReferencedDataNature dataNature = ReferencedDataNature.UNKNOWN;
- for (ExternalReferenceSPI ers : rs.getExternalReferences()) {
- ReferencedDataNature erDataNature = ers.getDataNature();
- if (!erDataNature.equals(ReferencedDataNature.UNKNOWN)) {
- dataNature = erDataNature;
- break;
- }
- }
-
- // Dereference the object
- Object dataValue;
- try{
- if (dataNature.equals(ReferencedDataNature.TEXT)) {
- dataValue = referenceService.renderIdentifier(reference, String.class, context);
- } else {
- dataValue = referenceService.renderIdentifier(reference, byte[].class, context);
- }
- }
- catch(ReferenceServiceException rse){
- String message = "Problem rendering T2Reference in convertReferencesToObjects().";
- logger.error("BaclavaDocumentHandler Error: "+ message, rse);
- throw rse;
- }
- return dataValue;
- }
- else if (reference.getReferenceType() == T2ReferenceType.ErrorDocument){
- // Dereference the ErrorDocument and convert it to some string representation
- ErrorDocument errorDocument = (ErrorDocument)referenceService.resolveIdentifier(reference, null, context);
- String errorString = ResultsUtils.buildErrorDocumentString(errorDocument, context);
- return errorString;
- }
- else { // it is an IdentifiedList<T2Reference> - go recursively
- IdentifiedList<T2Reference> identifiedList = referenceService.getListService().getList(reference);
- List<Object> list = new ArrayList<Object>();
-
- for (int j=0; j<identifiedList.size(); j++){
- T2Reference ref = identifiedList.get(j);
- list.add(convertReferenceToObject(ref,referenceService,context));
- }
- return list;
- }
- }
-
- /**
- * Creates a string representation of the ErrorDocument.
- */
- public static String buildErrorDocumentString(ErrorDocument errDocument,
- InvocationContext context) {
-
- String errDocumentString = "";
-
- String message = errDocument.getMessage();
- if (message != null && !message.isEmpty()) {
- errDocumentString = message + "\n";
- }
-
- String exceptionMessage = errDocument.getExceptionMessage();
- if (exceptionMessage != null && !exceptionMessage.equals("")) {
- errDocumentString += exceptionMessage + "\n";
- List<StackTraceElementBean> stackTrace = errDocument
- .getStackTraceStrings();
- if (stackTrace.size() > 0) {
- for (StackTraceElementBean stackTraceElement : stackTrace) {
- errDocumentString += getStackTraceElementString(stackTraceElement)
- + "\n";
- }
- }
-
- }
-
- Set<T2Reference> errorReferences = errDocument.getErrorReferences();
- if (!errorReferences.isEmpty()) {
- errDocumentString += "Set of ErrorDocuments to follow." + "\n";
- }
- int errorCounter = 1;
- int listCounter = 0;
- for (T2Reference reference : errorReferences) {
- if (reference.getReferenceType().equals(
- T2ReferenceType.ErrorDocument)) {
- ErrorDocumentService errorDocumentService = context
- .getReferenceService().getErrorDocumentService();
- ErrorDocument causeErrorDocument = errorDocumentService
- .getError(reference);
- if (listCounter == 0) {
- errDocumentString += "ErrorDocument " + (errorCounter++)
- + "\n";
- } else {
- errDocumentString += "ErrorDocument " + listCounter + "."
- + (errorCounter++) + "\n";
- }
- errDocumentString += buildErrorDocumentString(
- causeErrorDocument, context)
- + "\n";
- } else if (reference.getReferenceType().equals(
- T2ReferenceType.IdentifiedList)) {
- List<ErrorDocument> errorDocuments = getErrorDocuments(
- reference, context.getReferenceService());
- errDocumentString += "ErrorDocument list " + (++listCounter)
- + "\n";
- for (ErrorDocument causeErrorDocument : errorDocuments) {
- errDocumentString += buildErrorDocumentString(
- causeErrorDocument, context)
- + "\n";
- }
- }
- }
-
- return errDocumentString;
- }
-
- public static void buildErrorDocumentTree(DefaultMutableTreeNode node,
- ErrorDocument errorDocument, ReferenceService referenceService) {
- DefaultMutableTreeNode child = new DefaultMutableTreeNode(errorDocument);
- String exceptionMessage = errorDocument.getExceptionMessage();
- if (exceptionMessage != null && !exceptionMessage.equals("")) {
- DefaultMutableTreeNode exceptionMessageNode = new DefaultMutableTreeNode(
- exceptionMessage);
- child.add(exceptionMessageNode);
- List<StackTraceElementBean> stackTrace = errorDocument
- .getStackTraceStrings();
- if (stackTrace.size() > 0) {
- for (StackTraceElementBean stackTraceElement : stackTrace) {
- exceptionMessageNode.add(new DefaultMutableTreeNode(
- getStackTraceElementString(stackTraceElement)));
- }
- }
-
- }
- node.add(child);
-
- Set<T2Reference> errorReferences = errorDocument.getErrorReferences();
- for (T2Reference reference : errorReferences) {
- if (reference.getReferenceType().equals(
- T2ReferenceType.ErrorDocument)) {
- ErrorDocumentService errorDocumentService = referenceService
- .getErrorDocumentService();
- ErrorDocument causeErrorDocument = errorDocumentService
- .getError(reference);
- if (errorReferences.size() == 1) {
- buildErrorDocumentTree(node, causeErrorDocument, referenceService);
- } else {
- buildErrorDocumentTree(child, causeErrorDocument, referenceService);
- }
- } else if (reference.getReferenceType().equals(
- T2ReferenceType.IdentifiedList)) {
- List<ErrorDocument> errorDocuments = getErrorDocuments(
- reference, referenceService);
- if (errorDocuments.size() == 1) {
- buildErrorDocumentTree(node, errorDocuments.get(0), referenceService);
- } else {
- for (ErrorDocument errorDocument2 : errorDocuments) {
- buildErrorDocumentTree(child, errorDocument2, referenceService);
- }
- }
- }
- }
- }
-
- private static String getStackTraceElementString(
- StackTraceElementBean stackTraceElement) {
- StringBuilder sb = new StringBuilder();
- sb.append(stackTraceElement.getClassName());
- sb.append('.');
- sb.append(stackTraceElement.getMethodName());
- if (stackTraceElement.getFileName() == null) {
- sb.append("(unknown file)");
- } else {
- sb.append('(');
- sb.append(stackTraceElement.getFileName());
- sb.append(':');
- sb.append(stackTraceElement.getLineNumber());
- sb.append(')');
- }
- return sb.toString();
- }
-
- public static List<ErrorDocument> getErrorDocuments(T2Reference reference,
- ReferenceService referenceService) {
- List<ErrorDocument> errorDocuments = new ArrayList<ErrorDocument>();
- if (reference.getReferenceType().equals(T2ReferenceType.ErrorDocument)) {
- ErrorDocumentService errorDocumentService = referenceService
- .getErrorDocumentService();
- errorDocuments.add(errorDocumentService.getError(reference));
- } else if (reference.getReferenceType().equals(
- T2ReferenceType.IdentifiedList)) {
- ListService listService = referenceService.getListService();
- IdentifiedList<T2Reference> list = listService.getList(reference);
- for (T2Reference listReference : list) {
- errorDocuments
- .addAll(getErrorDocuments(listReference, referenceService));
- }
- }
- return errorDocuments;
- }
-
- @SuppressWarnings("unchecked")
- public static List<MimeType> getMimeTypes(
- ExternalReferenceSPI externalReference, InvocationContext context) {
- List<MimeType> mimeList = new ArrayList<MimeType>();
- MimeUtil2 mimeUtil = new MimeUtil2();
- mimeUtil
- .registerMimeDetector("eu.medsea.mimeutil.detector.ExtensionMimeDetector");
- mimeUtil
- .registerMimeDetector("eu.medsea.mimeutil.detector.MagicMimeMimeDetector");
- mimeUtil
- .registerMimeDetector("eu.medsea.mimeutil.detector.WindowsRegistryMimeDetector");
- mimeUtil
- .registerMimeDetector("eu.medsea.mimeutil.detector.ExtraMimeTypes");
- InputStream inputStream = externalReference.openStream(context);
- try {
- byte[] bytes = new byte[2048]; // need to read this much if we want to detect SVG using the hack below
- inputStream.read(bytes);
- Collection mimeTypes2 = mimeUtil.getMimeTypes(bytes);
- mimeList.addAll(mimeTypes2);
-
- // Hack for SVG that seems not to be recognised
- String bytesString = new String(bytes, "UTF-8");
- if (bytesString.contains("http://www.w3.org/2000/svg")){
- MimeType svgMimeType = new MimeType("image/svg+xml");
- if (!mimeList.contains(svgMimeType)){
- mimeList.add(svgMimeType);
- }
- }
-
- } catch (IOException e) {
- logger.error("Failed to read from stream to determine mimetype", e);
- } finally {
- try {
- inputStream.close();
- } catch (IOException e) {
- logger.error(
- "Failed to close stream after determining mimetype", e);
- }
- }
-
- return mimeList;
- }
-
- public static String getExtension(String mimeType) {
-
- String mimeTypeForFileExtension = MIMETypeUtil
- .fileExtensionForMIMEType(mimeType);
- return mimeTypeForFileExtension;
- }
-}
[04/50] [abbrv] incubator-taverna-workbench git commit: Added ability
to change tab name.
Posted by st...@apache.org.
Added ability to change tab name.
git-svn-id: https://taverna.googlecode.com/svn/taverna/utils/net.sf.taverna.t2.lang/trunk@15900 bf327186-88b3-11dd-a302-d386e5130c1c
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/commit/1704b7d9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/tree/1704b7d9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/diff/1704b7d9
Branch: refs/heads/master
Commit: 1704b7d94b4e8e9a37b217b8579ac1478248f53e
Parents: ffe467c
Author: david@mygrid.org.uk <da...@bf327186-88b3-11dd-a302-d386e5130c1c>
Authored: Mon Jul 22 13:51:22 2013 +0000
Committer: david@mygrid.org.uk <da...@bf327186-88b3-11dd-a302-d386e5130c1c>
Committed: Mon Jul 22 13:51:22 2013 +0000
----------------------------------------------------------------------
.../sf/taverna/t2/lang/ui/tabselector/Tab.java | 21 ++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/1704b7d9/ui/src/main/java/net/sf/taverna/t2/lang/ui/tabselector/Tab.java
----------------------------------------------------------------------
diff --git a/ui/src/main/java/net/sf/taverna/t2/lang/ui/tabselector/Tab.java b/ui/src/main/java/net/sf/taverna/t2/lang/ui/tabselector/Tab.java
index abc0a81..6cd9b70 100644
--- a/ui/src/main/java/net/sf/taverna/t2/lang/ui/tabselector/Tab.java
+++ b/ui/src/main/java/net/sf/taverna/t2/lang/ui/tabselector/Tab.java
@@ -50,10 +50,11 @@ public abstract class Tab<T> extends JToggleButton {
public final static Color lightGrey = new Color(200,200,200);
protected final T selection;
- private final String label;
+ private String name;
+ private JLabel label;
- public Tab(String label, T selection) {
- this.label = label;
+ public Tab(String name, T selection) {
+ this.name = name;
this.selection = selection;
initialise();
}
@@ -67,7 +68,7 @@ public abstract class Tab<T> extends JToggleButton {
GridBagConstraints c = new GridBagConstraints();
- JLabel label = new JLabel(this.label);
+ label = new JLabel(this.name);
c.anchor = GridBagConstraints.WEST;
c.fill = GridBagConstraints.BOTH;
c.insets = new Insets(0, 5, 0, 5);
@@ -88,6 +89,18 @@ public abstract class Tab<T> extends JToggleButton {
});
}
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ if (!this.name.equals(name)) {
+ this.name = name;
+ label.setText(name);
+ repaint();
+ }
+ }
+
@Override
public void updateUI() {
// override to ignore UI update
[02/50] [abbrv] incubator-taverna-workbench git commit: Added ports
to constructor.
Posted by st...@apache.org.
Added ports to constructor.
git-svn-id: https://taverna.googlecode.com/svn/taverna/utils/net.sf.taverna.t2.lang/trunk@15898 bf327186-88b3-11dd-a302-d386e5130c1c
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/commit/807910c1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/tree/807910c1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/diff/807910c1
Branch: refs/heads/master
Commit: 807910c15feac0681663a8185abfdd63ed1362db
Parents: 434e47f
Author: david@mygrid.org.uk <da...@bf327186-88b3-11dd-a302-d386e5130c1c>
Authored: Mon Jul 22 13:48:12 2013 +0000
Committer: david@mygrid.org.uk <da...@bf327186-88b3-11dd-a302-d386e5130c1c>
Committed: Mon Jul 22 13:48:12 2013 +0000
----------------------------------------------------------------------
.../sf/taverna/t2/lang/ui/KeywordDocument.java | 53 +++++++++-----------
1 file changed, 25 insertions(+), 28 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/807910c1/ui/src/main/java/net/sf/taverna/t2/lang/ui/KeywordDocument.java
----------------------------------------------------------------------
diff --git a/ui/src/main/java/net/sf/taverna/t2/lang/ui/KeywordDocument.java b/ui/src/main/java/net/sf/taverna/t2/lang/ui/KeywordDocument.java
index d417457..e8fae14 100644
--- a/ui/src/main/java/net/sf/taverna/t2/lang/ui/KeywordDocument.java
+++ b/ui/src/main/java/net/sf/taverna/t2/lang/ui/KeywordDocument.java
@@ -1,20 +1,20 @@
/*******************************************************************************
* Copyright (C) 2009 Ingo Wassink of University of Twente, Netherlands and
- * The University of Manchester
- *
+ * The University of Manchester
+ *
* Modifications to the initial code base are copyright of their
* respective authors, or their employers as appropriate.
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -28,7 +28,6 @@
package net.sf.taverna.t2.lang.ui;
import java.awt.Color;
-import java.util.HashSet;
import java.util.Set;
import javax.swing.text.AttributeSet;
@@ -46,7 +45,7 @@ public class KeywordDocument extends DefaultStyledDocument {
private static Logger logger = Logger
.getLogger(KeywordDocument.class);
-
+
private DefaultStyledDocument doc;
private Element rootElement;
@@ -56,14 +55,14 @@ public class KeywordDocument extends DefaultStyledDocument {
private MutableAttributeSet comment;
private MutableAttributeSet quote;
private MutableAttributeSet port;
-
+
private Set<String> keywords;
-
+
private Set<String> ports;
-
-
- public KeywordDocument(Set<String> keywords) {
+
+
+ public KeywordDocument(Set<String> keywords, Set<String> ports) {
doc = this;
rootElement = doc.getDefaultRootElement();
putProperty(DefaultEditorKit.EndOfLineStringProperty, "\n");
@@ -78,20 +77,18 @@ public class KeywordDocument extends DefaultStyledDocument {
keyword = new SimpleAttributeSet();
StyleConstants.setForeground(keyword, Color.blue);
StyleConstants.setBold(keyword, true);
-
-
+
+
port = new SimpleAttributeSet();
StyleConstants.setForeground(port, Color.magenta);
quote = new SimpleAttributeSet();
StyleConstants.setForeground(quote, Color.red);
-
+
this.keywords = keywords;
-
-
- ports = new HashSet<String>();
+ this.ports = ports;
}
-
+
/**
* Method for adding an port
* @param name the name of the port
@@ -100,7 +97,7 @@ public class KeywordDocument extends DefaultStyledDocument {
ports.add(name);
updateText();
}
-
+
/**
* Method for removing an port
* @param name the name of the port
@@ -108,8 +105,8 @@ public class KeywordDocument extends DefaultStyledDocument {
public void removePort(String name){
ports.remove(name);
updateText();
- }
-
+ }
+
/**
* Method for checking whether the name represents an input port
* @param name the name of the port
@@ -118,8 +115,8 @@ public class KeywordDocument extends DefaultStyledDocument {
private boolean isPort(String name){
return ports.contains(name);
}
-
-
+
+
/**
* Method for updating the whole text
*/
@@ -142,7 +139,7 @@ public class KeywordDocument extends DefaultStyledDocument {
super.insertString(offset, str, a);
processChangedLines(offset, str.length());
}
-
+
/*
* Override to apply syntax highlighting after the document has been updated
*/
@@ -384,7 +381,7 @@ public class KeywordDocument extends DefaultStyledDocument {
}
/*
- *
+ *
*/
private int getQuoteToken(String content, int startOffset, int endOffset) {
String quoteDelimiter = content.substring(startOffset, startOffset + 1);
@@ -418,7 +415,7 @@ public class KeywordDocument extends DefaultStyledDocument {
}
/*
- *
+ *
*/
private int getOtherToken(String content, int startOffset, int endOffset) {
int endOfToken = startOffset + 1;
@@ -548,7 +545,7 @@ public class KeywordDocument extends DefaultStyledDocument {
}
/*
- *
+ *
*/
protected String addMatchingBrace(int offset) throws BadLocationException {
StringBuffer whiteSpace = new StringBuffer();
[10/50] [abbrv] incubator-taverna-workbench git commit: Changed
filter so it can be easily applied to components
Posted by st...@apache.org.
Changed filter so it can be easily applied to components
git-svn-id: https://taverna.googlecode.com/svn/taverna/utils/net.sf.taverna.t2.lang/branches/maintenance@16494 bf327186-88b3-11dd-a302-d386e5130c1c
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/commit/7f23d78a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/tree/7f23d78a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/diff/7f23d78a
Branch: refs/heads/master
Commit: 7f23d78af0cdc6fc8d0f4527de4a342b6d998635
Parents: e388ce2
Author: alan@mygrid.org.uk <al...@bf327186-88b3-11dd-a302-d386e5130c1c>
Authored: Wed Jan 8 14:36:34 2014 +0000
Committer: alan@mygrid.org.uk <al...@bf327186-88b3-11dd-a302-d386e5130c1c>
Committed: Wed Jan 8 14:36:34 2014 +0000
----------------------------------------------------------------------
.../t2/lang/ui/SanitisingDocumentFilter.java | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/7f23d78a/ui/src/main/java/net/sf/taverna/t2/lang/ui/SanitisingDocumentFilter.java
----------------------------------------------------------------------
diff --git a/ui/src/main/java/net/sf/taverna/t2/lang/ui/SanitisingDocumentFilter.java b/ui/src/main/java/net/sf/taverna/t2/lang/ui/SanitisingDocumentFilter.java
index 04341d4..2a91e18 100644
--- a/ui/src/main/java/net/sf/taverna/t2/lang/ui/SanitisingDocumentFilter.java
+++ b/ui/src/main/java/net/sf/taverna/t2/lang/ui/SanitisingDocumentFilter.java
@@ -5,15 +5,32 @@ package net.sf.taverna.t2.lang.ui;
import java.util.regex.Pattern;
+import javax.swing.text.AbstractDocument;
import javax.swing.text.AttributeSet;
import javax.swing.text.BadLocationException;
+import javax.swing.text.Document;
import javax.swing.text.DocumentFilter;
+import javax.swing.text.JTextComponent;
/**
* @author alanrw
*
*/
public class SanitisingDocumentFilter extends DocumentFilter {
+
+ private static SanitisingDocumentFilter INSTANCE = new SanitisingDocumentFilter();
+
+ private SanitisingDocumentFilter () {
+ super();
+ }
+
+ public static void addFilterToComponent(JTextComponent c) {
+ Document d = c.getDocument();
+ if (d instanceof AbstractDocument) {
+ ((AbstractDocument) d).setDocumentFilter(INSTANCE);
+ }
+ }
+
public void insertString(DocumentFilter.FilterBypass fb, int offset, String string, AttributeSet attr) throws BadLocationException {
fb.insertString(offset, sanitiseString(string), attr);
@@ -23,7 +40,7 @@ public class SanitisingDocumentFilter extends DocumentFilter {
String text, javax.swing.text.AttributeSet attr)
throws BadLocationException {
- fb.insertString(offset, sanitiseString(text), attr);
+ fb.replace(offset, length, sanitiseString(text), attr);
}
private static String sanitiseString(String text) {
[38/50] [abbrv] incubator-taverna-workbench git commit: taverna-*
Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/ui/src/main/java/net/sf/taverna/t2/lang/ui/treetable/JTreeTable.java
----------------------------------------------------------------------
diff --git a/ui/src/main/java/net/sf/taverna/t2/lang/ui/treetable/JTreeTable.java b/ui/src/main/java/net/sf/taverna/t2/lang/ui/treetable/JTreeTable.java
deleted file mode 100644
index 85d3577..0000000
--- a/ui/src/main/java/net/sf/taverna/t2/lang/ui/treetable/JTreeTable.java
+++ /dev/null
@@ -1,657 +0,0 @@
-/*
- * @(#)JTreeTable.java 1.2 98/10/27
- *
- * Copyright 1997, 1998 by Sun Microsystems, Inc.,
- * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
- * All rights reserved.
- *
- * This software is the confidential and proprietary information
- * of Sun Microsystems, Inc. ("Confidential Information"). You
- * shall not disclose such Confidential Information and shall use
- * it only in accordance with the terms of the license agreement
- * you entered into with Sun.
- */
-package net.sf.taverna.t2.lang.ui.treetable;
-
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Dimension;
-import java.awt.Graphics;
-import java.awt.Insets;
-import java.awt.Point;
-import java.awt.Rectangle;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.EventObject;
-
-import javax.swing.DefaultCellEditor;
-import javax.swing.Icon;
-import javax.swing.JLabel;
-import javax.swing.JTable;
-import javax.swing.JTextField;
-import javax.swing.JTree;
-import javax.swing.ListSelectionModel;
-import javax.swing.LookAndFeel;
-import javax.swing.UIManager;
-import javax.swing.border.Border;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
-import javax.swing.table.DefaultTableCellRenderer;
-import javax.swing.table.TableCellRenderer;
-import javax.swing.tree.DefaultTreeCellRenderer;
-import javax.swing.tree.DefaultTreeSelectionModel;
-import javax.swing.tree.TreeCellRenderer;
-import javax.swing.tree.TreeModel;
-import javax.swing.tree.TreePath;
-import javax.swing.tree.TreeSelectionModel;
-
-/**
- * This example shows how to create a simple JTreeTable component, by using a
- * JTree as a renderer (and editor) for the cells in a particular column in the
- * JTable.
- *
- * @version 1.2 10/27/98
- *
- * @author Philip Milne
- * @author Scott Violet
- * @author Tom Oinn
- */
-@SuppressWarnings("serial")
-public class JTreeTable extends JTable {
- /** A subclass of JTree. */
- protected TreeTableCellRenderer tree;
-
-
- private static SimpleDateFormat ISO_8601_FORMAT = new SimpleDateFormat(
- "yyyy-MM-dd HH:mm:ss");
- private static SimpleDateFormat TIME_FORMAT = new SimpleDateFormat(
- "HH:mm:ss");
-
-
- public JTreeTable() {
- super();
- }
-
- public JTreeTable(TreeTableModel treeTableModel) {
- super();
- setModel(treeTableModel);
- }
-
- public void setModel(TreeTableModel model) {
- tree = new TreeTableCellRenderer(model);
- super.setModel(new TreeTableModelAdapter(model, tree));
-
- ListToTreeSelectionModelWrapper selectionWrapper = new ListToTreeSelectionModelWrapper();
- tree.setSelectionModel(selectionWrapper);
- setSelectionModel(selectionWrapper.getListSelectionModel());
-
- // Install the tree editor renderer and editor.
- setDefaultRenderer(TreeTableModel.class, tree);
- setDefaultRenderer(Date.class, new DateCellRenderer());
- setDefaultEditor(TreeTableModel.class, new TreeTableCellEditor());
-
- // Show grid but only if Look and Feel is not Java 6's Nimbus
- if (!UIManager.getLookAndFeel().getName().equals("Nimbus")){
- setShowGrid(true);
- setGridColor(Color.LIGHT_GRAY);
- }
- else{
- setShowGrid(false);
- }
-
- // No intercell spacing
- setIntercellSpacing(new Dimension(0, 0));
-
- // Add a mouse listener to forward events on to the tree.
- // We need this as on MAC only double clicks seem to expand the tree.
- addMouseListener(new MouseAdapter() {
- public void mousePressed(MouseEvent e) {
-
- for (int counter = getColumnCount() - 1; counter >= 0; counter--) {
- if (getColumnClass(counter) == TreeTableModel.class) {
- MouseEvent me = (MouseEvent) e;
- MouseEvent newME = new MouseEvent(tree, me.getID(), me
- .getWhen(), me.getModifiers(), me.getX()
- - getCellRect(0, counter, true).x, me.getY(),
- me.getClickCount(), me.isPopupTrigger());
- if (me.getClickCount() == 1) {
- tree.dispatchEvent(newME);
- }
- }
- else{
-
- }
- }
- }
- });
-
- // And update the height of the trees row to match that of
- // the table.
-
- if (tree.getRowHeight() < 1) {
- // Metal looks better like this.
- setRowHeight(18);
- }
-
- }
-
- /**
- * Overridden to message super and forward the method to the tree. Since the
- * tree is not actually in the component hierarchy it will never receive this
- * unless we forward it in this manner.
- */
- public void updateUI() {
- super.updateUI();
- if (tree != null) {
- tree.updateUI();
- }
- // Use the tree's default foreground and background colors in the
- // table.
- LookAndFeel.installColorsAndFont(this, "Tree.background",
- "Tree.foreground", "Tree.font");
- }
-
- /*
- * Workaround for BasicTableUI anomaly. Make sure the UI never tries to
- * paint the editor. The UI currently uses different techniques to paint the
- * renderers and editors and overriding setBounds() below is not the right
- * thing to do for an editor. Returning -1 for the editing row in this case,
- * ensures the editor is never painted.
- */
- public int getEditingRow() {
- return (getColumnClass(editingColumn) == TreeTableModel.class) ? -1
- : editingRow;
- }
-
- /**
- * Returns the actual row that is editing as <code>getEditingRow</code> will
- * always return -1.
- */
- private int realEditingRow() {
- return editingRow;
- }
-
- /**
- * This is overridden to invoke super's implementation, and then, if the
- * receiver is editing a Tree column, the editor's bounds is reset. The
- * reason we have to do this is because JTable doesn't think the table is
- * being edited, as <code>getEditingRow</code> returns -1, and therefore
- * doesn't automatically resize the editor for us.
- */
- public void sizeColumnsToFit(int resizingColumn) {
- super.sizeColumnsToFit(resizingColumn);
- if (getEditingColumn() != -1
- && getColumnClass(editingColumn) == TreeTableModel.class) {
- Rectangle cellRect = getCellRect(realEditingRow(),
- getEditingColumn(), false);
- Component component = getEditorComponent();
- component.setBounds(cellRect);
- component.validate();
- }
- }
-
- /**
- * Overridden to pass the new rowHeight to the tree.
- */
- public void setRowHeight(int rowHeight) {
- super.setRowHeight(rowHeight);
- if (tree != null && tree.getRowHeight() != rowHeight) {
- tree.setRowHeight(getRowHeight());
- }
- }
-
- /**
- * Returns the tree that is being shared between the model.
- */
- public JTree getTree() {
- return tree;
- }
-
- /**
- * Overridden to invoke repaint for the particular location if the column
- * contains the tree. This is done as the tree editor does not fill the
- * bounds of the cell, we need the renderer to paint the tree in the
- * background, and then draw the editor over it.
- */
- public boolean editCellAt(int row, int column, EventObject e) {
- boolean retValue = super.editCellAt(row, column, e);
- if (retValue && getColumnClass(column) == TreeTableModel.class) {
- repaint(getCellRect(row, column, false));
- }
- return retValue;
- }
-
- /**
- * A TreeCellRenderer that displays a JTree.
- */
- public class TreeTableCellRenderer extends JTree implements
- TableCellRenderer {
- /** Last table/tree row asked to renderer. */
- protected int visibleRow;
- protected Border highlightBorder;
-
- public TreeTableCellRenderer(TreeModel model) {
- super(model);
- }
-
- /**
- * updateUI is overridden to set the colors of the Tree's renderer to
- * match that of the table.
- */
- public void updateUI() {
- super.updateUI();
- // Make the tree's cell renderer use the table's cell selection
- // colors.
- TreeCellRenderer tcr = getCellRenderer();
- if (tcr instanceof DefaultTreeCellRenderer) {
- //DefaultTreeCellRenderer dtcr = ((DefaultTreeCellRenderer) tcr);
- // For 1.1 uncomment this, 1.2 has a bug that will cause an
- // exception to be thrown if the border selection color is
- // null.
- // dtcr.setBorderSelectionColor(null);
- // dtcr.setTextSelectionColor(UIManager.getColor
- // ("Table.selectionForeground"));
- // dtcr.setBackgroundSelectionColor(UIManager.getColor
- // ("Table.selectionBackground"));
- }
- }
-
- /**
- * Sets the row height of the tree, and forwards the row height to the
- * table.
- */
- public void setRowHeight(int rowHeight) {
- if (rowHeight > 0) {
- super.setRowHeight(rowHeight);
- if (JTreeTable.this != null
- && JTreeTable.this.getRowHeight() != rowHeight) {
- JTreeTable.this.setRowHeight(getRowHeight());
- }
- }
- }
-
- /**
- * This is overridden to set the height to match that of the JTable.
- */
- public void setBounds(int x, int y, int w, int h) {
- super.setBounds(x, 0, w, JTreeTable.this.getHeight());
- }
-
- /**
- * Subclassed to translate the graphics such that the last visible row
- * will be drawn at 0,0.
- */
- public void paint(Graphics g) {
- g.translate(0, -visibleRow * getRowHeight());
- super.paint(g);
- // Draw the Table border if we have focus.
- if (highlightBorder != null) {
- highlightBorder.paintBorder(this, g, 0, visibleRow
- * getRowHeight(), getWidth(), getRowHeight());
- }
- else{
- // Tree cell renderer get rid of the grid lines for some
- // reason so we draw them here but only if Look and Feel
- // is different from Java 6's Nimbus LaF
- // as it completely ignores the grid lines
- if (!UIManager.getLookAndFeel().getName().equals("Nimbus")){
- LinesBorder linesBorder = new LinesBorder(getGridColor(),
- new Insets(0, 0, 1, 1));
- linesBorder
- .paintBorder(this, g, 0, visibleRow * getRowHeight(),
- getWidth(), getRowHeight());
- }
- }
- }
-
- /**
- * TreeCellRenderer method. Overridden to update the visible row.
- */
- public Component getTableCellRendererComponent(JTable table,
- Object value, boolean isSelected, boolean hasFocus, int row,
- int column) {
- Color background;
- Color foreground;
-
- if (isSelected) {
- background = table.getSelectionBackground();
- foreground = table.getSelectionForeground();
- } else {
- background = table.getBackground();
- foreground = table.getForeground();
- }
- highlightBorder = null;
- if (realEditingRow() == row && getEditingColumn() == column) {
- // background = UIManager.getColor("Table.focusCellBackground");
- // foreground = UIManager.getColor("Table.focusCellForeground");
- } else if (hasFocus) {
- if (isSelected) {
- highlightBorder = UIManager.getBorder("Table.focusSelectedCellHighlightBorder");
- }
- else{
- highlightBorder = UIManager.getBorder("Table.focusCellHighlightBorder");
- }
- if (isCellEditable(row, column)) {
- // background = UIManager.getColor
- // ("Table.focusCellBackground");
- background = table.getSelectionBackground();
- foreground = table.getSelectionForeground();
- }
- }
-
- visibleRow = row;
- setBackground(background);
-
- TreeCellRenderer tcr = getCellRenderer();
- if (tcr instanceof DefaultTreeCellRenderer) {
- DefaultTreeCellRenderer dtcr = ((DefaultTreeCellRenderer) tcr);
- if (isSelected) {
- dtcr.setTextSelectionColor(foreground);
- dtcr.setBackgroundSelectionColor(background);
- } else {
- dtcr.setTextNonSelectionColor(foreground);
- dtcr.setBackgroundNonSelectionColor(background);
- }
- }
- return this;
- }
-
- }
-
- public static String formatDate(Date date) {
- final Date midnight = new Date();
- midnight.setHours(0);
- midnight.setMinutes(0);
- midnight.setSeconds(0);
- SimpleDateFormat format;
- if (date.before(midnight)) {
- // FULL DATE
- format = ISO_8601_FORMAT;
- } else {
- format = TIME_FORMAT;
- }
- final String formatted = format.format(date);
- return formatted;
- }
-
- /**
- * A TreeCellRenderer that displays a date in a "yyyy-MM-dd HH:mm:ss"
- * format.
- */
- public class DateCellRenderer extends DefaultTableCellRenderer {
- /** Last table/tree row asked to renderer. */
- protected int visibleRow;
- protected Border highlightBorder;
-
- public DateCellRenderer() {
- setOpaque(true);
- }
-
- public Component getTableCellRendererComponent(JTable table,
- Object value, boolean isSelected, boolean hasFocus, int row,
- int column) {
- super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
-
- if (isSelected) {
-// this.setBackground(table.getSelectionBackground());
-// this.setForeground(table.getSelectionForeground());
- } else {
- /*this.setBackground(table.getBackground());
- this.setForeground(table.getForeground());*/
- }
-
-
- //dtcr.setBorderSelectionColor(null);
- // dtcr.setTextSelectionColor(UIManager.getColor
- // ("Table.selectionForeground"));
- // dtcr.setBackgroundSelectionColor(UIManager.getColor
- // ("Table.selectionBackground"));
-
-
-
- Date date = (Date) ((TreeTableModelAdapter) getModel()).getValueAt(
- row, column);
- if (date != null) {
- setText(formatDate(date));
- } else {
- setText(null);
- }
- return this;
- }
-
- }
-
- /**
- * TreeTableCellEditor implementation. Component returned is the JTree.
- */
- public class TreeTableCellEditor extends DefaultCellEditor {
- public TreeTableCellEditor() {
- super(new TreeTableTextField());
- }
-
- public Component getTableCellEditorComponent(JTable table,
- Object value, boolean isSelected, int r, int c) {
- Component component = super.getTableCellEditorComponent(table,
- value, isSelected, r, c);
- JTree t = getTree();
- boolean rv = t.isRootVisible();
- int offsetRow = rv ? r : r - 1;
- Rectangle bounds = t.getRowBounds(offsetRow);
- int offset = bounds.x;
- TreeCellRenderer tcr = t.getCellRenderer();
- if (tcr instanceof DefaultTreeCellRenderer) {
- Object node = t.getPathForRow(offsetRow).getLastPathComponent();
- boolean isExpanded = t.isExpanded(t.getPathForRow(offsetRow));
- boolean isLeaf = t.getModel().isLeaf(node);
- Component renderer = tcr.getTreeCellRendererComponent(t, node,
- true, isExpanded, isLeaf, offsetRow, true);
- Icon icon = ((JLabel) renderer).getIcon();
- // if (t.getModel().isLeaf(node))
- // icon = ((DefaultTreeCellRenderer)tcr).getLeafIcon();
- // else if (tree.isExpanded(offsetRow))
- // icon = ((DefaultTreeCellRenderer)tcr).getOpenIcon();
- // else
- // icon = ((DefaultTreeCellRenderer)tcr).getClosedIcon();
- if (icon != null) {
- offset += ((DefaultTreeCellRenderer) tcr).getIconTextGap()
- + icon.getIconWidth();
- }
- }
- ((TreeTableTextField) getComponent()).offset = offset;
- return component;
- }
-
- // /**
- // * This is overridden to forward the event to the tree. This will
- // return
- // * true if the click count >= 3, or the event is null.
- // */
- // public boolean isCellEditable(EventObject e) {
- // /**
- // * if (e instanceof MouseEvent) { for (int counter =
- // * getColumnCount() - 1; counter >= 0; counter--) { if
- // * (getColumnClass(counter) == TreeTableModel.class) { MouseEvent me
- // * = (MouseEvent)e; MouseEvent newME = new MouseEvent(tree,
- // * me.getID(), me.getWhen(), me.getModifiers(), me.getX() -
- // * getCellRect(0, counter, true).x, me.getY(), me.getClickCount(),
- // * me.isPopupTrigger()); System.out.println(newME);
- // * tree.dispatchEvent(newME); break; } } }
- // */
- // if (e instanceof MouseEvent) {
- // MouseEvent me = (MouseEvent) e;
- // if (me.getClickCount() >= 3) {
- // return true;
- // }
- // }
- // if (e == null) {
- // return true;
- // }
- // return false;
- // }
-
- /**
- * This is overridden to forward the event to the tree. This will return
- * true if the click count >= 3, or the event is null.
- */
- public boolean isCellEditable(EventObject e) {
- // Edit on double click rather than the default triple
- if (e instanceof MouseEvent) {
-
- MouseEvent me = (MouseEvent) e;
- if (me.getClickCount() == 1
- && System.getProperty("os.name").equals("Mac OS X")) {
- // Workaround for buggy tree table on OS X. Open/close the
- // path
- // on any click on the column (not just on the > icon)
- for (int counter = getColumnCount() - 1; counter >= 0; counter--) {
- if (getColumnClass(counter) == TreeTableModel.class) {
- MouseEvent newME = new MouseEvent(tree, me.getID(),
- me.getWhen(), me.getModifiers(), me.getX()
- - getCellRect(0, counter, true).x,
- me.getY(), me.getClickCount(), me
- .isPopupTrigger());
- tree.dispatchEvent(newME);
-
- Point p = new Point(me.getX(), me.getY());
- int row = rowAtPoint(p);
- int column = columnAtPoint(p);
- if (column == 0) {
- boolean isExpanded = tree.isExpanded(tree
- .getPathForRow(row));
- if (isExpanded == false) {
- tree.expandPath(tree.getPathForRow(row));
- } else {
- tree.collapsePath(tree.getPathForRow(row));
- }
- }
-
- break;
- }
- }
-
- }
- /*
- * if (me.getClickCount() >= 3) { return true; }
- */// tree is no editable
- }
- if (e == null) {
- return true;
- }
- return false;
- }
-
- }
-
- /**
- * Component used by TreeTableCellEditor. The only thing this does is to
- * override the <code>reshape</code> method, and to ALWAYS make the x
- * location be <code>offset</code>.
- */
- public static class TreeTableTextField extends JTextField {
- public int offset;
-
- public void setBounds(int x, int y, int w, int h) {
- int newX = Math.max(x, offset);
- super.setBounds(newX, y, w - (newX - x), h);
- }
- }
-
- /**
- * ListToTreeSelectionModelWrapper extends DefaultTreeSelectionModel to
- * listen for changes in the ListSelectionModel it maintains. Once a change
- * in the ListSelectionModel happens, the paths are updated in the
- * DefaultTreeSelectionModel.
- */
- class ListToTreeSelectionModelWrapper extends DefaultTreeSelectionModel {
- /** Set to true when we are updating the ListSelectionModel. */
- protected boolean updatingListSelectionModel;
-
- public ListToTreeSelectionModelWrapper() {
- super();
- setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
- getListSelectionModel().addListSelectionListener(
- createListSelectionListener());
- }
-
- /**
- * Returns the list selection model. ListToTreeSelectionModelWrapper
- * listens for changes to this model and updates the selected paths
- * accordingly.
- */
- ListSelectionModel getListSelectionModel() {
- return listSelectionModel;
- }
-
- /**
- * This is overridden to set <code>updatingListSelectionModel</code> and
- * message super. This is the only place DefaultTreeSelectionModel
- * alters the ListSelectionModel.
- */
- public void resetRowSelection() {
- if (!updatingListSelectionModel) {
- updatingListSelectionModel = true;
- try {
- super.resetRowSelection();
- } finally {
- updatingListSelectionModel = false;
- }
- }
- // Notice how we don't message super if
- // updatingListSelectionModel is true. If
- // updatingListSelectionModel is true, it implies the
- // ListSelectionModel has already been updated and the
- // paths are the only thing that needs to be updated.
- }
-
- /**
- * Creates and returns an instance of ListSelectionHandler.
- */
- protected ListSelectionListener createListSelectionListener() {
- return new ListSelectionHandler();
- }
-
- /**
- * If <code>updatingListSelectionModel</code> is false, this will reset
- * the selected paths from the selected rows in the list selection
- * model.
- */
- protected void updateSelectedPathsFromSelectedRows() {
- if (!updatingListSelectionModel) {
- updatingListSelectionModel = true;
- try {
- // This is way expensive, ListSelectionModel needs an
- // enumerator for iterating.
- int min = listSelectionModel.getMinSelectionIndex();
- int max = listSelectionModel.getMaxSelectionIndex();
-
- clearSelection();
- if (min != -1 && max != -1) {
- for (int counter = min; counter <= max; counter++) {
- if (listSelectionModel.isSelectedIndex(counter)) {
- TreePath selPath = tree.getPathForRow(counter);
-
- if (selPath != null) {
- addSelectionPath(selPath);
- }
- }
- }
- }
- } finally {
- updatingListSelectionModel = false;
- }
- }
- }
-
- /**
- * Class responsible for calling updateSelectedPathsFromSelectedRows
- * when the selection of the list change.
- */
- class ListSelectionHandler implements ListSelectionListener {
- public void valueChanged(ListSelectionEvent e) {
- updateSelectedPathsFromSelectedRows();
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/ui/src/main/java/net/sf/taverna/t2/lang/ui/treetable/LinesBorder.java
----------------------------------------------------------------------
diff --git a/ui/src/main/java/net/sf/taverna/t2/lang/ui/treetable/LinesBorder.java b/ui/src/main/java/net/sf/taverna/t2/lang/ui/treetable/LinesBorder.java
deleted file mode 100644
index 45ac3bb..0000000
--- a/ui/src/main/java/net/sf/taverna/t2/lang/ui/treetable/LinesBorder.java
+++ /dev/null
@@ -1,178 +0,0 @@
-/**
- * Example from http://www.java2s.com/Code/Java/Swing-Components/CellBorderTableExample.htm
- */
-package net.sf.taverna.t2.lang.ui.treetable;
-
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Graphics;
-import java.awt.Insets;
-
-import javax.swing.SwingConstants;
-import javax.swing.border.AbstractBorder;
-
-/**
- *
- * Line border that lets you control the colour and thickness of all four edges. Needed to fix the tree cell
- * renderer in the JTreeTable that looked a bit 'naff' on Windows (i.e. Windows draws lines around table
- * cells when default Look and Feel is in use and the tree cell renderer was not drawing lines.)
- *
- */
-@SuppressWarnings("serial")
-public class LinesBorder extends AbstractBorder implements SwingConstants {
- protected int northThickness;
-
- protected int southThickness;
-
- protected int eastThickness;
-
- protected int westThickness;
-
- protected Color northColor;
-
- protected Color southColor;
-
- protected Color eastColor;
-
- protected Color westColor;
-
- public LinesBorder(Color color) {
- this(color, 1);
- }
-
- public LinesBorder(Color color, int thickness) {
- setColor(color);
- setThickness(thickness);
- }
-
- public LinesBorder(Color color, Insets insets) {
- setColor(color);
- setThickness(insets);
- }
-
- public void paintBorder(Component c, Graphics g, int x, int y, int width,
- int height) {
- Color oldColor = g.getColor();
-
- g.setColor(northColor);
- for (int i = 0; i < northThickness; i++) {
- g.drawLine(x, y + i, x + width - 1, y + i);
- }
- g.setColor(southColor);
- for (int i = 0; i < southThickness; i++) {
- g
- .drawLine(x, y + height - i - 1, x + width - 1, y + height
- - i - 1);
- }
- g.setColor(eastColor);
- for (int i = 0; i < westThickness; i++) {
- g.drawLine(x + i, y, x + i, y + height - 1);
- }
- g.setColor(westColor);
- for (int i = 0; i < eastThickness; i++) {
- g.drawLine(x + width - i - 1, y, x + width - i - 1, y + height - 1);
- }
-
- g.setColor(oldColor);
- }
-
- public Insets getBorderInsets(Component c) {
- return new Insets(northThickness, westThickness, southThickness,
- eastThickness);
- }
-
- public Insets getBorderInsets(Component c, Insets insets) {
- return new Insets(northThickness, westThickness, southThickness,
- eastThickness);
- }
-
- public boolean isBorderOpaque() {
- return true;
- }
-
- public void setColor(Color c) {
- northColor = c;
- southColor = c;
- eastColor = c;
- westColor = c;
- }
-
- public void setColor(Color c, int direction) {
- switch (direction) {
- case NORTH:
- northColor = c;
- break;
- case SOUTH:
- southColor = c;
- break;
- case EAST:
- eastColor = c;
- break;
- case WEST:
- westColor = c;
- break;
- default:
- }
- }
-
- public void setThickness(int n) {
- northThickness = n;
- southThickness = n;
- eastThickness = n;
- westThickness = n;
- }
-
- public void setThickness(Insets insets) {
- northThickness = insets.top;
- southThickness = insets.bottom;
- eastThickness = insets.right;
- westThickness = insets.left;
- }
-
- public void setThickness(int n, int direction) {
- switch (direction) {
- case NORTH:
- northThickness = n;
- break;
- case SOUTH:
- southThickness = n;
- break;
- case EAST:
- eastThickness = n;
- break;
- case WEST:
- westThickness = n;
- break;
- default:
- }
- }
-
- public void append(LinesBorder b, boolean isReplace) {
- if (isReplace) {
- northThickness = b.northThickness;
- southThickness = b.southThickness;
- eastThickness = b.eastThickness;
- westThickness = b.westThickness;
- } else {
- northThickness = Math.max(northThickness, b.northThickness);
- southThickness = Math.max(southThickness, b.southThickness);
- eastThickness = Math.max(eastThickness, b.eastThickness);
- westThickness = Math.max(westThickness, b.westThickness);
- }
- }
-
- public void append(Insets insets, boolean isReplace) {
- if (isReplace) {
- northThickness = insets.top;
- southThickness = insets.bottom;
- eastThickness = insets.right;
- westThickness = insets.left;
- } else {
- northThickness = Math.max(northThickness, insets.top);
- southThickness = Math.max(southThickness, insets.bottom);
- eastThickness = Math.max(eastThickness, insets.right);
- westThickness = Math.max(westThickness, insets.left);
- }
- }
-
- }
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/ui/src/main/java/net/sf/taverna/t2/lang/ui/treetable/TreeTableModel.java
----------------------------------------------------------------------
diff --git a/ui/src/main/java/net/sf/taverna/t2/lang/ui/treetable/TreeTableModel.java b/ui/src/main/java/net/sf/taverna/t2/lang/ui/treetable/TreeTableModel.java
deleted file mode 100644
index 36fa4fe..0000000
--- a/ui/src/main/java/net/sf/taverna/t2/lang/ui/treetable/TreeTableModel.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * TreeTableModel.java
- *
- * Copyright (c) 1998 Sun Microsystems, Inc. All Rights Reserved.
- *
- * This software is the confidential and proprietary information of Sun
- * Microsystems, Inc. ("Confidential Information"). You shall not
- * disclose such Confidential Information and shall use it only in
- * accordance with the terms of the license agreement you entered into
- * with Sun.
- *
- * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
- * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
- * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
- * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
- * THIS SOFTWARE OR ITS DERIVATIVES.
- *
- */
-package net.sf.taverna.t2.lang.ui.treetable;
-
-import javax.swing.tree.TreeModel;
-
-/**
- * TreeTableModel is the model used by a JTreeTable. It extends TreeModel
- * to add methods for getting inforamtion about the set of columns each
- * node in the TreeTableModel may have. Each column, like a column in
- * a TableModel, has a name and a type associated with it. Each node in
- * the TreeTableModel can return a value for each of the columns and
- * set that value if isCellEditable() returns true.
- *
- * @author Philip Milne
- * @author Scott Violet
- */
-public interface TreeTableModel extends TreeModel
-{
- /**
- * Returns the number ofs availible column.
- */
- public int getColumnCount();
-
- /**
- * Returns the name for column number <code>column</code>.
- */
- public String getColumnName(int column);
-
- /**
- * Returns the type for column number <code>column</code>.
- */
- public Class getColumnClass(int column);
-
- /**
- * Returns the value to be displayed for node <code>node</code>,
- * at column number <code>column</code>.
- */
- public Object getValueAt(Object node, int column);
-
- /**
- * Indicates whether the the value for node <code>node</code>,
- * at column number <code>column</code> is editable.
- */
- public boolean isCellEditable(Object node, int column);
-
- /**
- * Sets the value for node <code>node</code>,
- * at column number <code>column</code>.
- */
- public void setValueAt(Object aValue, Object node, int column);
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/ui/src/main/java/net/sf/taverna/t2/lang/ui/treetable/TreeTableModelAdapter.java
----------------------------------------------------------------------
diff --git a/ui/src/main/java/net/sf/taverna/t2/lang/ui/treetable/TreeTableModelAdapter.java b/ui/src/main/java/net/sf/taverna/t2/lang/ui/treetable/TreeTableModelAdapter.java
deleted file mode 100644
index a6cdd24..0000000
--- a/ui/src/main/java/net/sf/taverna/t2/lang/ui/treetable/TreeTableModelAdapter.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * @(#)TreeTableModelAdapter.java 1.2 98/10/27
- *
- * Copyright 1997, 1998 by Sun Microsystems, Inc.,
- * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
- * All rights reserved.
- *
- * This software is the confidential and proprietary information
- * of Sun Microsystems, Inc. ("Confidential Information"). You
- * shall not disclose such Confidential Information and shall use
- * it only in accordance with the terms of the license agreement
- * you entered into with Sun.
- */
-package net.sf.taverna.t2.lang.ui.treetable;
-
-import javax.swing.JTree;
-import javax.swing.SwingUtilities;
-import javax.swing.event.TreeExpansionEvent;
-import javax.swing.event.TreeExpansionListener;
-import javax.swing.event.TreeModelEvent;
-import javax.swing.event.TreeModelListener;
-import javax.swing.table.AbstractTableModel;
-import javax.swing.tree.TreePath;
-
-/**
- * This is a wrapper class takes a TreeTableModel and implements
- * the table model interface. The implementation is trivial, with
- * all of the event dispatching support provided by the superclass:
- * the AbstractTableModel.
- *
- * @version 1.2 10/27/98
- *
- * @author Philip Milne
- * @author Scott Violet
- */
-@SuppressWarnings("serial")
-public class TreeTableModelAdapter extends AbstractTableModel
-{
- JTree tree;
- TreeTableModel treeTableModel;
-
- public TreeTableModelAdapter(TreeTableModel treeTableModel, JTree tree) {
- this.tree = tree;
- this.treeTableModel = treeTableModel;
-
- tree.addTreeExpansionListener(new TreeExpansionListener() {
- // Don't use fireTableRowsInserted() here; the selection model
- // would get updated twice.
- public void treeExpanded(TreeExpansionEvent event) {
- fireTableDataChanged();
- }
- public void treeCollapsed(TreeExpansionEvent event) {
- fireTableDataChanged();
- }
- });
-
- // Install a TreeModelListener that can update the table when
- // tree changes. We use delayedFireTableDataChanged as we can
- // not be guaranteed the tree will have finished processing
- // the event before us.
- treeTableModel.addTreeModelListener(new TreeModelListener() {
- public void treeNodesChanged(TreeModelEvent e) {
- delayedFireTableDataChanged();
- }
-
- public void treeNodesInserted(TreeModelEvent e) {
- delayedFireTableDataChanged();
- }
-
- public void treeNodesRemoved(TreeModelEvent e) {
- delayedFireTableDataChanged();
- }
-
- public void treeStructureChanged(TreeModelEvent e) {
- delayedFireTableDataChanged();
- }
- });
- }
-
- // Wrappers, implementing TableModel interface.
-
- public int getColumnCount() {
- return treeTableModel.getColumnCount();
- }
-
- public String getColumnName(int column) {
- return treeTableModel.getColumnName(column);
- }
-
- public Class getColumnClass(int column) {
- return treeTableModel.getColumnClass(column);
- }
-
- public int getRowCount() {
- return tree.getRowCount();
- }
-
- protected Object nodeForRow(int row) {
- TreePath treePath = tree.getPathForRow(row);
- if (treePath == null) {
- return null;
- }
- return treePath.getLastPathComponent();
- }
-
- public Object getValueAt(int row, int column) {
- return treeTableModel.getValueAt(nodeForRow(row), column);
- }
-
- public boolean isCellEditable(int row, int column) {
- return treeTableModel.isCellEditable(nodeForRow(row), column);
- }
-
- public void setValueAt(Object value, int row, int column) {
- treeTableModel.setValueAt(value, nodeForRow(row), column);
- }
-
- /**
- * Invokes fireTableDataChanged after all the pending events have been
- * processed. SwingUtilities.invokeLater is used to handle this.
- */
- protected void delayedFireTableDataChanged() {
- SwingUtilities.invokeLater(new Runnable() {
- public void run() {
- TreePath[] selected = tree.getSelectionPaths();
- fireTableDataChanged();
- tree.setSelectionPaths(selected);
- }
- });
- }
-}
-
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/ui/src/main/resources/net/sf/taverna/t2/lang/ui/icons/ok.png
----------------------------------------------------------------------
diff --git a/ui/src/main/resources/net/sf/taverna/t2/lang/ui/icons/ok.png b/ui/src/main/resources/net/sf/taverna/t2/lang/ui/icons/ok.png
deleted file mode 100644
index ac479f2..0000000
Binary files a/ui/src/main/resources/net/sf/taverna/t2/lang/ui/icons/ok.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/ui/src/main/resources/net/sf/taverna/t2/lang/ui/icons/severe.png
----------------------------------------------------------------------
diff --git a/ui/src/main/resources/net/sf/taverna/t2/lang/ui/icons/severe.png b/ui/src/main/resources/net/sf/taverna/t2/lang/ui/icons/severe.png
deleted file mode 100644
index a69364d..0000000
Binary files a/ui/src/main/resources/net/sf/taverna/t2/lang/ui/icons/severe.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/ui/src/main/resources/net/sf/taverna/t2/lang/ui/icons/warning.png
----------------------------------------------------------------------
diff --git a/ui/src/main/resources/net/sf/taverna/t2/lang/ui/icons/warning.png b/ui/src/main/resources/net/sf/taverna/t2/lang/ui/icons/warning.png
deleted file mode 100644
index f09e60f..0000000
Binary files a/ui/src/main/resources/net/sf/taverna/t2/lang/ui/icons/warning.png and /dev/null differ
[37/50] [abbrv] incubator-taverna-workbench git commit:
taverna-observer
Posted by st...@apache.org.
taverna-observer
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/commit/09b80e17
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/tree/09b80e17
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/diff/09b80e17
Branch: refs/heads/master
Commit: 09b80e177fafacd7f3b848b7a38db183ed88b1be
Parents: 47ed9d6
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Fri Mar 6 22:17:30 2015 +0000
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Fri Mar 6 22:17:30 2015 +0000
----------------------------------------------------------------------
taverna-workbench-activity-palette-impl/pom.xml | 2 +-
taverna-workbench-contextual-views-api/pom.xml | 2 +-
taverna-workbench-edits-api/pom.xml | 2 +-
taverna-workbench-file-api/pom.xml | 2 +-
taverna-workbench-file-impl/pom.xml | 2 +-
taverna-workbench-graph-model/pom.xml | 2 +-
taverna-workbench-graph-view/pom.xml | 2 +-
taverna-workbench-menu-api/pom.xml | 2 +-
taverna-workbench-report-api/pom.xml | 2 +-
taverna-workbench-report-view/pom.xml | 2 +-
taverna-workbench-selection-api/pom.xml | 2 +-
taverna-workbench-workbench-impl/pom.xml | 2 +-
taverna-workbench-workflow-view/pom.xml | 2 +-
13 files changed, 13 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/09b80e17/taverna-workbench-activity-palette-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-activity-palette-impl/pom.xml b/taverna-workbench-activity-palette-impl/pom.xml
index 3508f38..6feab09 100644
--- a/taverna-workbench-activity-palette-impl/pom.xml
+++ b/taverna-workbench-activity-palette-impl/pom.xml
@@ -40,7 +40,7 @@
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.lang</groupId>
- <artifactId>observer</artifactId>
+ <artifactId>taverna-observer</artifactId>
<version>${t2.lang.version}</version>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/09b80e17/taverna-workbench-contextual-views-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-contextual-views-api/pom.xml b/taverna-workbench-contextual-views-api/pom.xml
index 3e772b4..417769a 100644
--- a/taverna-workbench-contextual-views-api/pom.xml
+++ b/taverna-workbench-contextual-views-api/pom.xml
@@ -70,7 +70,7 @@
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.lang</groupId>
- <artifactId>observer</artifactId>
+ <artifactId>taverna-observer</artifactId>
</dependency>
<dependency>
<groupId>org.apache.taverna.language</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/09b80e17/taverna-workbench-edits-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-edits-api/pom.xml b/taverna-workbench-edits-api/pom.xml
index 369eebd..bbde761 100644
--- a/taverna-workbench-edits-api/pom.xml
+++ b/taverna-workbench-edits-api/pom.xml
@@ -34,7 +34,7 @@
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.lang</groupId>
- <artifactId>observer</artifactId>
+ <artifactId>taverna-observer</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/09b80e17/taverna-workbench-file-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-file-api/pom.xml b/taverna-workbench-file-api/pom.xml
index 0a13ad5..2f49ec7 100644
--- a/taverna-workbench-file-api/pom.xml
+++ b/taverna-workbench-file-api/pom.xml
@@ -37,7 +37,7 @@
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.lang</groupId>
- <artifactId>observer</artifactId>
+ <artifactId>taverna-observer</artifactId>
</dependency>
<dependency>
<groupId>org.apache.taverna.language</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/09b80e17/taverna-workbench-file-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-file-impl/pom.xml b/taverna-workbench-file-impl/pom.xml
index f0a57d2..3843c1f 100644
--- a/taverna-workbench-file-impl/pom.xml
+++ b/taverna-workbench-file-impl/pom.xml
@@ -58,7 +58,7 @@
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.lang</groupId>
- <artifactId>observer</artifactId>
+ <artifactId>taverna-observer</artifactId>
<version>${t2.lang.version}</version>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/09b80e17/taverna-workbench-graph-model/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-graph-model/pom.xml b/taverna-workbench-graph-model/pom.xml
index 9476990..8f83db6 100644
--- a/taverna-workbench-graph-model/pom.xml
+++ b/taverna-workbench-graph-model/pom.xml
@@ -108,7 +108,7 @@
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.lang</groupId>
- <artifactId>observer</artifactId>
+ <artifactId>taverna-observer</artifactId>
<version>${t2.lang.version}</version>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/09b80e17/taverna-workbench-graph-view/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-graph-view/pom.xml b/taverna-workbench-graph-view/pom.xml
index d765362..8ce5c43 100644
--- a/taverna-workbench-graph-view/pom.xml
+++ b/taverna-workbench-graph-view/pom.xml
@@ -64,7 +64,7 @@
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.lang</groupId>
- <artifactId>observer</artifactId>
+ <artifactId>taverna-observer</artifactId>
<version>${t2.lang.version}</version>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/09b80e17/taverna-workbench-menu-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-menu-api/pom.xml b/taverna-workbench-menu-api/pom.xml
index 1758bfe..ad0e3d5 100644
--- a/taverna-workbench-menu-api/pom.xml
+++ b/taverna-workbench-menu-api/pom.xml
@@ -37,7 +37,7 @@
<dependency>
<groupId>net.sf.taverna.t2.lang</groupId>
- <artifactId>observer</artifactId>
+ <artifactId>taverna-observer</artifactId>
</dependency>
</dependencies>
</project>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/09b80e17/taverna-workbench-report-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-report-api/pom.xml b/taverna-workbench-report-api/pom.xml
index 2046a0b..d32e8b4 100644
--- a/taverna-workbench-report-api/pom.xml
+++ b/taverna-workbench-report-api/pom.xml
@@ -45,7 +45,7 @@
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.lang</groupId>
- <artifactId>observer</artifactId>
+ <artifactId>taverna-observer</artifactId>
</dependency>
</dependencies>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/09b80e17/taverna-workbench-report-view/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-report-view/pom.xml b/taverna-workbench-report-view/pom.xml
index c130d57..febf81c 100644
--- a/taverna-workbench-report-view/pom.xml
+++ b/taverna-workbench-report-view/pom.xml
@@ -37,7 +37,7 @@
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.lang</groupId>
- <artifactId>observer</artifactId>
+ <artifactId>taverna-observer</artifactId>
<version>${t2.lang.version}</version>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/09b80e17/taverna-workbench-selection-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-selection-api/pom.xml b/taverna-workbench-selection-api/pom.xml
index 7b56fef..e2e3492 100644
--- a/taverna-workbench-selection-api/pom.xml
+++ b/taverna-workbench-selection-api/pom.xml
@@ -41,7 +41,7 @@
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.lang</groupId>
- <artifactId>observer</artifactId>
+ <artifactId>taverna-observer</artifactId>
</dependency>
</dependencies>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/09b80e17/taverna-workbench-workbench-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-workbench-impl/pom.xml b/taverna-workbench-workbench-impl/pom.xml
index 3300d88..147ed4b 100644
--- a/taverna-workbench-workbench-impl/pom.xml
+++ b/taverna-workbench-workbench-impl/pom.xml
@@ -79,7 +79,7 @@
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.lang</groupId>
- <artifactId>observer</artifactId>
+ <artifactId>taverna-observer</artifactId>
<version>${t2.lang.version}</version>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/09b80e17/taverna-workbench-workflow-view/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-workflow-view/pom.xml b/taverna-workbench-workflow-view/pom.xml
index d9f97f8..ada6386 100644
--- a/taverna-workbench-workflow-view/pom.xml
+++ b/taverna-workbench-workflow-view/pom.xml
@@ -29,7 +29,7 @@
<dependencies>
<dependency>
<groupId>net.sf.taverna.t2.lang</groupId>
- <artifactId>observer</artifactId>
+ <artifactId>taverna-observer</artifactId>
<version>${t2.lang.version}</version>
</dependency>
<dependency>
[03/50] [abbrv] incubator-taverna-workbench git commit: Removed child
component - now handled by parent component.
Posted by st...@apache.org.
Removed child component - now handled by parent component.
git-svn-id: https://taverna.googlecode.com/svn/taverna/utils/net.sf.taverna.t2.lang/trunk@15899 bf327186-88b3-11dd-a302-d386e5130c1c
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/commit/ffe467c7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/tree/ffe467c7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/diff/ffe467c7
Branch: refs/heads/master
Commit: ffe467c789e189ab959cacfcfa73e96a30331f31
Parents: 807910c
Author: david@mygrid.org.uk <da...@bf327186-88b3-11dd-a302-d386e5130c1c>
Authored: Mon Jul 22 13:50:57 2013 +0000
Committer: david@mygrid.org.uk <da...@bf327186-88b3-11dd-a302-d386e5130c1c>
Committed: Mon Jul 22 13:50:57 2013 +0000
----------------------------------------------------------------------
.../ui/tabselector/TabSelectorComponent.java | 42 +++++++++-----------
1 file changed, 19 insertions(+), 23 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/ffe467c7/ui/src/main/java/net/sf/taverna/t2/lang/ui/tabselector/TabSelectorComponent.java
----------------------------------------------------------------------
diff --git a/ui/src/main/java/net/sf/taverna/t2/lang/ui/tabselector/TabSelectorComponent.java b/ui/src/main/java/net/sf/taverna/t2/lang/ui/tabselector/TabSelectorComponent.java
index fbacc1c..23e6343 100644
--- a/ui/src/main/java/net/sf/taverna/t2/lang/ui/tabselector/TabSelectorComponent.java
+++ b/ui/src/main/java/net/sf/taverna/t2/lang/ui/tabselector/TabSelectorComponent.java
@@ -21,14 +21,12 @@
package net.sf.taverna.t2.lang.ui.tabselector;
import java.awt.BorderLayout;
-import java.awt.Component;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.util.HashMap;
import java.util.Map;
import javax.swing.ButtonGroup;
-import javax.swing.JComponent;
import javax.swing.JPanel;
/**
@@ -42,29 +40,25 @@ public abstract class TabSelectorComponent<T> extends JPanel {
private Map<T, Tab<T>> tabMap;
private ButtonGroup tabGroup;
- private JComponent tabBar;
private ScrollController scrollController;
- public TabSelectorComponent(Component component) {
+ public TabSelectorComponent() {
tabMap = new HashMap<T, Tab<T>>();
tabGroup = new ButtonGroup();
setLayout(new BorderLayout());
- tabBar = new JPanel() {
- @Override
- protected void paintComponent(Graphics g) {
- super.paintComponent(g);
- Graphics2D g2 = (Graphics2D) g.create();
- g2.setColor(Tab.midGrey);
- g2.drawLine(0, getHeight() - 1, getWidth(), getHeight() - 1);
- g2.dispose();
- }
- };
- scrollController = new ScrollController(tabBar);
- tabBar.add(scrollController.getScrollLeft());
- tabBar.add(scrollController.getScrollRight());
- tabBar.setLayout(new TabLayout(scrollController));
- add(tabBar, BorderLayout.NORTH);
- add(component, BorderLayout.CENTER);
+ scrollController = new ScrollController(this);
+ add(scrollController.getScrollLeft());
+ add(scrollController.getScrollRight());
+ setLayout(new TabLayout(scrollController));
+ }
+
+ @Override
+ protected void paintComponent(Graphics g) {
+ super.paintComponent(g);
+ Graphics2D g2 = (Graphics2D) g.create();
+ g2.setColor(Tab.midGrey);
+ g2.drawLine(0, getHeight() - 1, getWidth(), getHeight() - 1);
+ g2.dispose();
}
protected abstract Tab<T> createTab(T object);
@@ -73,7 +67,9 @@ public abstract class TabSelectorComponent<T> extends JPanel {
Tab<T> button = createTab(object);
tabMap.put(object, button);
tabGroup.add(button);
- tabBar.add(button);
+ add(button);
+ revalidate();
+ repaint();
button.setSelected(true);
}
@@ -81,8 +77,8 @@ public abstract class TabSelectorComponent<T> extends JPanel {
Tab<T> button = tabMap.remove(object);
if (button != null) {
tabGroup.remove(button);
- tabBar.remove(button);
- tabBar.repaint();
+ remove(button);
+ repaint();
}
}
[21/50] [abbrv] incubator-taverna-workbench git commit: Parent now
2.6-SNAPSHOT
Posted by st...@apache.org.
Parent now 2.6-SNAPSHOT
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/commit/2c6e9c21
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/tree/2c6e9c21
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/diff/2c6e9c21
Branch: refs/heads/master
Commit: 2c6e9c21c3ba60d5eb9ba426e95b82332537564d
Parents: 5d3a34b
Author: Christian-B <br...@cs.man.ac.uk>
Authored: Mon May 12 12:00:06 2014 +0100
Committer: Christian-B <br...@cs.man.ac.uk>
Committed: Mon May 12 12:00:06 2014 +0100
----------------------------------------------------------------------
pom.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/2c6e9c21/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 7d4387d..961c438 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,12 +4,12 @@
<parent>
<groupId>net.sf.taverna</groupId>
<artifactId>taverna-parent</artifactId>
- <version>2.5-SNAPSHOT</version>
+ <version>2.6-SNAPSHOT</version>
<relativePath>../../taverna-parent/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
- <name>Taverna 2 language extensions</name>
+ <name>Taverna support utilities</name>
<groupId>net.sf.taverna.t2</groupId>
<version>1.6-SNAPSHOT</version>
<artifactId>lang</artifactId>
[32/50] [abbrv] incubator-taverna-workbench git commit:
org.apache.taverna.workbench parent
Posted by st...@apache.org.
org.apache.taverna.workbench parent
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/commit/e103aa7e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/tree/e103aa7e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/diff/e103aa7e
Branch: refs/heads/master
Commit: e103aa7efc85b1fc83f0bcbdf37aa9eda9459a8f
Parents: 3f67f4f
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Fri Mar 6 22:00:28 2015 +0000
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Fri Mar 6 22:00:28 2015 +0000
----------------------------------------------------------------------
pom.xml | 19 +++++-
taverna-dataflow-activity-ui/pom.xml | 67 ++++++++------------
taverna-disabled-activity-ui/pom.xml | 26 ++++++--
taverna-stringconstant-activity-ui/pom.xml | 26 ++++++--
taverna-unrecognized-activity-ui/pom.xml | 26 ++++++--
taverna-workbench-activity-icons-api/pom.xml | 26 ++++++--
taverna-workbench-activity-palette-api/pom.xml | 23 +++++--
taverna-workbench-activity-palette-impl/pom.xml | 23 +++++--
taverna-workbench-activity-palette-ui/pom.xml | 23 +++++--
taverna-workbench-activity-tools/pom.xml | 26 ++++++--
taverna-workbench-configuration-api/pom.xml | 23 +++++--
taverna-workbench-configuration-impl/pom.xml | 26 ++++++--
taverna-workbench-contextual-views-api/pom.xml | 23 +++++--
taverna-workbench-contextual-views-impl/pom.xml | 23 +++++--
taverna-workbench-contextual-views/pom.xml | 26 ++++++--
taverna-workbench-credential-manager-ui/pom.xml | 26 ++++++--
.../pom.xml | 23 +++++--
taverna-workbench-design-ui/pom.xml | 26 ++++++--
taverna-workbench-edits-api/pom.xml | 26 ++++++--
taverna-workbench-edits-impl/pom.xml | 26 ++++++--
taverna-workbench-file-api/pom.xml | 26 ++++++--
taverna-workbench-file-impl/pom.xml | 26 ++++++--
taverna-workbench-graph-model/pom.xml | 23 +++++--
taverna-workbench-graph-view/pom.xml | 26 ++++++--
taverna-workbench-helper-api/pom.xml | 23 +++++--
taverna-workbench-helper/pom.xml | 26 ++++++--
taverna-workbench-httpproxy-config/pom.xml | 26 ++++++--
taverna-workbench-iteration-strategy-ui/pom.xml | 26 ++++++--
taverna-workbench-loop-ui/pom.xml | 32 +++++++---
taverna-workbench-menu-api/pom.xml | 23 +++++--
taverna-workbench-menu-impl/pom.xml | 26 ++++++--
taverna-workbench-menu-items/pom.xml | 23 +++++--
taverna-workbench-monitor-view/pom.xml | 23 +++++--
taverna-workbench-parallelize-ui/pom.xml | 23 +++++--
.../pom.xml | 43 ++++++-------
taverna-workbench-perspective-design/pom.xml | 23 +++++--
.../pom.xml | 23 +++++--
taverna-workbench-perspective-results/pom.xml | 26 ++++++--
taverna-workbench-plugin-manager/pom.xml | 26 ++++++--
taverna-workbench-plugins-gui/pom.xml | 26 ++++++--
taverna-workbench-reference-ui/pom.xml | 23 +++++--
taverna-workbench-renderers-api/pom.xml | 23 +++++--
taverna-workbench-renderers-exts/pom.xml | 23 +++++--
taverna-workbench-renderers-impl/pom.xml | 23 +++++--
taverna-workbench-report-api/pom.xml | 23 +++++--
taverna-workbench-report-explainer/pom.xml | 26 ++++++--
taverna-workbench-report-impl/pom.xml | 26 ++++++--
taverna-workbench-report-view/pom.xml | 26 ++++++--
taverna-workbench-results-view/pom.xml | 23 +++++--
taverna-workbench-retry-ui/pom.xml | 23 +++++--
taverna-workbench-run-ui/pom.xml | 26 ++++++--
taverna-workbench-selection-api/pom.xml | 26 ++++++--
taverna-workbench-selection-impl/pom.xml | 26 ++++++--
taverna-workbench-update-manager/pom.xml | 26 ++++++--
taverna-workbench-workbench-api/pom.xml | 16 +++++
taverna-workbench-workbench-impl/pom.xml | 23 +++++--
taverna-workbench-workflow-explorer/pom.xml | 26 ++++++--
taverna-workbench-workflow-view/pom.xml | 23 +++++--
58 files changed, 1169 insertions(+), 314 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 925cd4a..4d24ebf 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,5 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
<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/xsd/maven-4.0.0.xsd">
+ 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.apache.taverna</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/taverna-dataflow-activity-ui/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-dataflow-activity-ui/pom.xml b/taverna-dataflow-activity-ui/pom.xml
index 00812ff..ae77887 100644
--- a/taverna-dataflow-activity-ui/pom.xml
+++ b/taverna-dataflow-activity-ui/pom.xml
@@ -1,4 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
<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>
@@ -55,66 +71,39 @@
<dependency>
<groupId>javax.help</groupId>
<artifactId>javahelp</artifactId>
- <version>${javahelp.version}</version>
+ <version>${javahelp.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${parent.project.groupId}</groupId>
<artifactId>activity-tools</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${parent.project.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${parent.project.groupId}</groupId>
<artifactId>helper-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${parent.project.version}</version>
</dependency>
<!-- testing dependencies -->
<dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- <version> ${junit.version}</version>
- </dependency>
- <dependency>
- <groupId>net.sf.taverna.t2.ui-impl</groupId>
+ <groupId>${parent.project.groupId}</groupId>
<artifactId>file-impl</artifactId>
- <version>${t2.ui.impl.version}</version>
+ <version>${parent.project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-impl</groupId>
+ <groupId>${parent.project.groupId}</groupId>
<artifactId>edits-impl</artifactId>
- <version>${t2.ui.impl.version}</version>
+ <version>${parent.project.version}</version>
<scope>test</scope>
</dependency>
<!-- <dependency>
- <groupId>uk.org.taverna.scufl2</groupId>
- <artifactId>scufl2-t2flow</artifactId>
- <version>${scufl2.version}</version>
+ <groupId>org.apache.taverna.language</groupId>
+ <artifactId>taverna-scufl2-t2flow</artifactId>
+ <version>${taverna.language.version}</version>
<scope>test</scope>
</dependency> -->
</dependencies>
- <repositories>
- <repository>
- <releases />
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- <id>mygrid-repository</id>
- <name>myGrid Repository</name>
- <url>http://www.mygrid.org.uk/maven/repository
- </url>
- </repository>
- <repository>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots />
- <id>mygrid-snapshot-repository</id>
- <name>myGrid Snapshot Repository</name>
- <url>http://www.mygrid.org.uk/maven/snapshot-repository</url>
- </repository>
- </repositories>
</project>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/taverna-disabled-activity-ui/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-disabled-activity-ui/pom.xml b/taverna-disabled-activity-ui/pom.xml
index ddbaf29..3e132e2 100644
--- a/taverna-disabled-activity-ui/pom.xml
+++ b/taverna-disabled-activity-ui/pom.xml
@@ -1,12 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
-<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">
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<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>net.sf.taverna</groupId>
- <artifactId>taverna-parent</artifactId>
- <version>3.0.1-SNAPSHOT</version>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.ui-activities</groupId>
<artifactId>disabled-activity-ui</artifactId>
<version>2.0.1-SNAPSHOT</version>
<packaging>bundle</packaging>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/taverna-stringconstant-activity-ui/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-stringconstant-activity-ui/pom.xml b/taverna-stringconstant-activity-ui/pom.xml
index 761981f..d4e70df 100644
--- a/taverna-stringconstant-activity-ui/pom.xml
+++ b/taverna-stringconstant-activity-ui/pom.xml
@@ -1,12 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
-<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">
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<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>net.sf.taverna</groupId>
- <artifactId>taverna-parent</artifactId>
- <version>3.0.1-SNAPSHOT</version>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.ui-activities</groupId>
<artifactId>stringconstant-activity-ui</artifactId>
<version>2.0-SNAPSHOT</version>
<packaging>bundle</packaging>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/taverna-unrecognized-activity-ui/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-unrecognized-activity-ui/pom.xml b/taverna-unrecognized-activity-ui/pom.xml
index eb7a7c6..e0d0d92 100644
--- a/taverna-unrecognized-activity-ui/pom.xml
+++ b/taverna-unrecognized-activity-ui/pom.xml
@@ -1,12 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
-<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">
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<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>net.sf.taverna</groupId>
- <artifactId>taverna-parent</artifactId>
- <version>3.0.1-SNAPSHOT</version>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.ui-activities</groupId>
<artifactId>unrecognized-activity-ui</artifactId>
<version>2.0-SNAPSHOT</version>
<packaging>bundle</packaging>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/taverna-workbench-activity-icons-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-activity-icons-api/pom.xml b/taverna-workbench-activity-icons-api/pom.xml
index 0024571..94f41b0 100644
--- a/taverna-workbench-activity-icons-api/pom.xml
+++ b/taverna-workbench-activity-icons-api/pom.xml
@@ -1,12 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
-<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">
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<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>net.sf.taverna.t2</groupId>
- <artifactId>ui-api</artifactId>
- <version>2.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>activity-icons-api</artifactId>
<packaging>bundle</packaging>
<name>Activity icon manager API</name>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/taverna-workbench-activity-palette-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-activity-palette-api/pom.xml b/taverna-workbench-activity-palette-api/pom.xml
index 1c9ab8c..2970793 100644
--- a/taverna-workbench-activity-palette-api/pom.xml
+++ b/taverna-workbench-activity-palette-api/pom.xml
@@ -1,13 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
<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>net.sf.taverna.t2</groupId>
- <artifactId>ui-api</artifactId>
- <version>2.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>activity-palette-api</artifactId>
<packaging>bundle</packaging>
<name>Activity Palette API</name>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/taverna-workbench-activity-palette-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-activity-palette-impl/pom.xml b/taverna-workbench-activity-palette-impl/pom.xml
index 4926a94..442b03e 100644
--- a/taverna-workbench-activity-palette-impl/pom.xml
+++ b/taverna-workbench-activity-palette-impl/pom.xml
@@ -1,13 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
<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>net.sf.taverna.t2</groupId>
- <artifactId>ui-impl</artifactId>
- <version>2.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.ui-impl</groupId>
<artifactId>activity-palette-impl</artifactId>
<packaging>bundle</packaging>
<name>Activity Palette Impl</name>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/taverna-workbench-activity-palette-ui/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-activity-palette-ui/pom.xml b/taverna-workbench-activity-palette-ui/pom.xml
index 52549d0..cd2b0bc 100644
--- a/taverna-workbench-activity-palette-ui/pom.xml
+++ b/taverna-workbench-activity-palette-ui/pom.xml
@@ -1,13 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
<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>net.sf.taverna.t2</groupId>
- <artifactId>ui-components</artifactId>
- <version>2.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.ui-components</groupId>
<artifactId>activity-palette-ui</artifactId>
<packaging>bundle</packaging>
<name>Activity Palette UI Component</name>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/taverna-workbench-activity-tools/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-activity-tools/pom.xml b/taverna-workbench-activity-tools/pom.xml
index c84a263..8a28b08 100644
--- a/taverna-workbench-activity-tools/pom.xml
+++ b/taverna-workbench-activity-tools/pom.xml
@@ -1,12 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
-<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">
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<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>net.sf.taverna.t2</groupId>
- <artifactId>ui-api</artifactId>
- <version>2.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>activity-tools</artifactId>
<packaging>bundle</packaging>
<name>Activity tools</name>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/taverna-workbench-configuration-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-configuration-api/pom.xml b/taverna-workbench-configuration-api/pom.xml
index 81e819f..c5d9a62 100644
--- a/taverna-workbench-configuration-api/pom.xml
+++ b/taverna-workbench-configuration-api/pom.xml
@@ -1,13 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
<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>net.sf.taverna.t2</groupId>
- <artifactId>ui-api</artifactId>
- <version>2.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>configuration-api</artifactId>
<packaging>bundle</packaging>
<name>Configuration Management API</name>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/taverna-workbench-configuration-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-configuration-impl/pom.xml b/taverna-workbench-configuration-impl/pom.xml
index 19356bb..c21f725 100644
--- a/taverna-workbench-configuration-impl/pom.xml
+++ b/taverna-workbench-configuration-impl/pom.xml
@@ -1,12 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
-<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">
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<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>net.sf.taverna.t2</groupId>
- <artifactId>ui-impl</artifactId>
- <version>2.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.ui-impl</groupId>
<artifactId>configuration-impl</artifactId>
<packaging>bundle</packaging>
<name>Configuration Management Implementations</name>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/taverna-workbench-contextual-views-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-contextual-views-api/pom.xml b/taverna-workbench-contextual-views-api/pom.xml
index 5b8608f..7a75d4b 100644
--- a/taverna-workbench-contextual-views-api/pom.xml
+++ b/taverna-workbench-contextual-views-api/pom.xml
@@ -1,13 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
<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>net.sf.taverna.t2</groupId>
- <artifactId>ui-api</artifactId>
- <version>2.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>contextual-views-api</artifactId>
<packaging>bundle</packaging>
<name>Contextual Views API</name>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/taverna-workbench-contextual-views-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-contextual-views-impl/pom.xml b/taverna-workbench-contextual-views-impl/pom.xml
index 1cafa80..b8e16cc 100644
--- a/taverna-workbench-contextual-views-impl/pom.xml
+++ b/taverna-workbench-contextual-views-impl/pom.xml
@@ -1,13 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
<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>net.sf.taverna.t2</groupId>
- <artifactId>ui-impl</artifactId>
- <version>2.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.ui-impl</groupId>
<artifactId>contextual-views-impl</artifactId>
<packaging>bundle</packaging>
<name>Contextual Views Implementation</name>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/taverna-workbench-contextual-views/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-contextual-views/pom.xml b/taverna-workbench-contextual-views/pom.xml
index 2a07c7e..5440265 100644
--- a/taverna-workbench-contextual-views/pom.xml
+++ b/taverna-workbench-contextual-views/pom.xml
@@ -1,12 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
-<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">
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<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>net.sf.taverna.t2</groupId>
- <artifactId>ui-components</artifactId>
- <version>2.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.ui-components</groupId>
<artifactId>contextual-views</artifactId>
<packaging>bundle</packaging>
<name>Contextual views</name>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/taverna-workbench-credential-manager-ui/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-credential-manager-ui/pom.xml b/taverna-workbench-credential-manager-ui/pom.xml
index 601c546..2bfa252 100644
--- a/taverna-workbench-credential-manager-ui/pom.xml
+++ b/taverna-workbench-credential-manager-ui/pom.xml
@@ -1,12 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
-<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">
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<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>net.sf.taverna.t2</groupId>
- <artifactId>ui-components</artifactId>
- <version>2.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.ui-components</groupId>
<artifactId>credential-manager-ui</artifactId>
<packaging>bundle</packaging>
<name>Credential Manager UI</name>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/taverna-workbench-data-management-config-ui/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-data-management-config-ui/pom.xml b/taverna-workbench-data-management-config-ui/pom.xml
index 4afb4ad..fddcc2a 100644
--- a/taverna-workbench-data-management-config-ui/pom.xml
+++ b/taverna-workbench-data-management-config-ui/pom.xml
@@ -1,13 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
<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>net.sf.taverna.t2</groupId>
- <artifactId>ui-components</artifactId>
- <version>2.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.ui-components</groupId>
<artifactId>data-management-config-ui</artifactId>
<packaging>bundle</packaging>
<name>Data management configuration UI components</name>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/taverna-workbench-design-ui/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-design-ui/pom.xml b/taverna-workbench-design-ui/pom.xml
index f88f676..62efdeb 100644
--- a/taverna-workbench-design-ui/pom.xml
+++ b/taverna-workbench-design-ui/pom.xml
@@ -1,12 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
-<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">
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<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>net.sf.taverna.t2</groupId>
- <artifactId>ui-components</artifactId>
- <version>2.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.ui-components</groupId>
<artifactId>design-ui</artifactId>
<name>Design UI</name>
<packaging>bundle</packaging>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/taverna-workbench-edits-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-edits-api/pom.xml b/taverna-workbench-edits-api/pom.xml
index 1b52630..59fab76 100644
--- a/taverna-workbench-edits-api/pom.xml
+++ b/taverna-workbench-edits-api/pom.xml
@@ -1,12 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
-<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">
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<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>net.sf.taverna.t2</groupId>
- <artifactId>ui-api</artifactId>
- <version>2.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>edits-api</artifactId>
<packaging>bundle</packaging>
<name>Edits API</name>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/taverna-workbench-edits-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-edits-impl/pom.xml b/taverna-workbench-edits-impl/pom.xml
index b5b725a..54b844e 100644
--- a/taverna-workbench-edits-impl/pom.xml
+++ b/taverna-workbench-edits-impl/pom.xml
@@ -1,12 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
-<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">
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<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>net.sf.taverna.t2</groupId>
- <artifactId>ui-impl</artifactId>
- <version>2.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.ui-impl</groupId>
<artifactId>edits-impl</artifactId>
<packaging>bundle</packaging>
<name>Edits implementation</name>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/taverna-workbench-file-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-file-api/pom.xml b/taverna-workbench-file-api/pom.xml
index 2b6205d..0e4aa55 100644
--- a/taverna-workbench-file-api/pom.xml
+++ b/taverna-workbench-file-api/pom.xml
@@ -1,12 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
-<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">
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<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>net.sf.taverna.t2</groupId>
- <artifactId>ui-api</artifactId>
- <version>2.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>file-api</artifactId>
<packaging>bundle</packaging>
<name>File opening API</name>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/taverna-workbench-file-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-file-impl/pom.xml b/taverna-workbench-file-impl/pom.xml
index 98dcce7..2792edc 100644
--- a/taverna-workbench-file-impl/pom.xml
+++ b/taverna-workbench-file-impl/pom.xml
@@ -1,12 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
-<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">
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<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>net.sf.taverna.t2</groupId>
- <artifactId>ui-impl</artifactId>
- <version>2.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.ui-impl</groupId>
<artifactId>file-impl</artifactId>
<packaging>bundle</packaging>
<name>File opening implementation</name>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/taverna-workbench-graph-model/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-graph-model/pom.xml b/taverna-workbench-graph-model/pom.xml
index 8e255ba..62bdd02 100644
--- a/taverna-workbench-graph-model/pom.xml
+++ b/taverna-workbench-graph-model/pom.xml
@@ -1,13 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
<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>net.sf.taverna.t2</groupId>
- <artifactId>ui-components</artifactId>
- <version>2.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.ui-components</groupId>
<artifactId>graph-model</artifactId>
<packaging>bundle</packaging>
<name>Graph Model</name>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/taverna-workbench-graph-view/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-graph-view/pom.xml b/taverna-workbench-graph-view/pom.xml
index df8cdc9..210e845 100644
--- a/taverna-workbench-graph-view/pom.xml
+++ b/taverna-workbench-graph-view/pom.xml
@@ -1,12 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
-<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">
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<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>net.sf.taverna.t2</groupId>
- <artifactId>ui-components</artifactId>
- <version>2.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.ui-components</groupId>
<artifactId>graph-view</artifactId>
<packaging>bundle</packaging>
<name>Graph View</name>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/taverna-workbench-helper-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-helper-api/pom.xml b/taverna-workbench-helper-api/pom.xml
index 9f3945f..4da2343 100644
--- a/taverna-workbench-helper-api/pom.xml
+++ b/taverna-workbench-helper-api/pom.xml
@@ -1,13 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
<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>net.sf.taverna.t2</groupId>
- <artifactId>ui-api</artifactId>
- <version>2.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>helper-api</artifactId>
<packaging>bundle</packaging>
<name>Help System</name>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/taverna-workbench-helper/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-helper/pom.xml b/taverna-workbench-helper/pom.xml
index 70c0621..005a281 100644
--- a/taverna-workbench-helper/pom.xml
+++ b/taverna-workbench-helper/pom.xml
@@ -1,12 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
-<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">
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<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>net.sf.taverna.t2</groupId>
- <artifactId>ui-impl</artifactId>
- <version>2.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.ui-impl</groupId>
<artifactId>helper</artifactId>
<name>Help System (legacy dependency)</name>
<dependencies>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/taverna-workbench-httpproxy-config/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-httpproxy-config/pom.xml b/taverna-workbench-httpproxy-config/pom.xml
index f1a8328..fcdf2eb 100644
--- a/taverna-workbench-httpproxy-config/pom.xml
+++ b/taverna-workbench-httpproxy-config/pom.xml
@@ -1,12 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
-<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">
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<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>net.sf.taverna.t2</groupId>
- <artifactId>ui-impl</artifactId>
- <version>2.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.ui-impl</groupId>
<artifactId>httpproxy-config</artifactId>
<packaging>bundle</packaging>
<name>HTTP Proxy configuration</name>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/taverna-workbench-iteration-strategy-ui/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-iteration-strategy-ui/pom.xml b/taverna-workbench-iteration-strategy-ui/pom.xml
index 0b6ff81..9ed49f5 100644
--- a/taverna-workbench-iteration-strategy-ui/pom.xml
+++ b/taverna-workbench-iteration-strategy-ui/pom.xml
@@ -1,12 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
-<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">
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<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>net.sf.taverna.t2</groupId>
- <artifactId>ui-components</artifactId>
- <version>2.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.ui-components</groupId>
<artifactId>iteration-strategy-ui</artifactId>
<packaging>bundle</packaging>
<name>Menu generation API</name>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/taverna-workbench-loop-ui/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-loop-ui/pom.xml b/taverna-workbench-loop-ui/pom.xml
index f639bea..9a7a6d7 100644
--- a/taverna-workbench-loop-ui/pom.xml
+++ b/taverna-workbench-loop-ui/pom.xml
@@ -1,14 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
-<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>net.sf.taverna.t2</groupId>
- <artifactId>ui-exts</artifactId>
- <version>2.0-SNAPSHOT</version>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
- </parent>
- <groupId>net.sf.taverna.t2.ui-exts</groupId>
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<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.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
+ </parent>
<artifactId>loop-ui</artifactId>
<packaging>bundle</packaging>
<name>Loop layer contextual view</name>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/taverna-workbench-menu-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-menu-api/pom.xml b/taverna-workbench-menu-api/pom.xml
index 247cd41..90130b8 100644
--- a/taverna-workbench-menu-api/pom.xml
+++ b/taverna-workbench-menu-api/pom.xml
@@ -1,13 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
<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>net.sf.taverna.t2</groupId>
- <artifactId>ui-api</artifactId>
- <version>2.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>menu-api</artifactId>
<packaging>bundle</packaging>
<name>Menu generation API</name>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/taverna-workbench-menu-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-menu-impl/pom.xml b/taverna-workbench-menu-impl/pom.xml
index d95bf49..18aec40 100644
--- a/taverna-workbench-menu-impl/pom.xml
+++ b/taverna-workbench-menu-impl/pom.xml
@@ -1,12 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
-<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">
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<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>net.sf.taverna.t2</groupId>
- <artifactId>ui-impl</artifactId>
- <version>2.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.ui-impl</groupId>
<artifactId>menu-impl</artifactId>
<packaging>bundle</packaging>
<name>Menu generation implementation</name>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/taverna-workbench-menu-items/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-menu-items/pom.xml b/taverna-workbench-menu-items/pom.xml
index c7007e3..143bb6c 100644
--- a/taverna-workbench-menu-items/pom.xml
+++ b/taverna-workbench-menu-items/pom.xml
@@ -1,13 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
<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>net.sf.taverna.t2</groupId>
- <artifactId>ui-exts</artifactId>
- <version>2.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.ui-exts</groupId>
<artifactId>menu-items</artifactId>
<packaging>bundle</packaging>
<name>Additional menu items</name>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/taverna-workbench-monitor-view/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-monitor-view/pom.xml b/taverna-workbench-monitor-view/pom.xml
index b4e102f..a2a76bb 100644
--- a/taverna-workbench-monitor-view/pom.xml
+++ b/taverna-workbench-monitor-view/pom.xml
@@ -1,13 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
<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>net.sf.taverna.t2</groupId>
- <artifactId>ui-components</artifactId>
- <version>2.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.ui-components</groupId>
<artifactId>monitor-view</artifactId>
<packaging>bundle</packaging>
<name>Monitor View</name>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/taverna-workbench-parallelize-ui/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-parallelize-ui/pom.xml b/taverna-workbench-parallelize-ui/pom.xml
index 6fba337..914f9d2 100644
--- a/taverna-workbench-parallelize-ui/pom.xml
+++ b/taverna-workbench-parallelize-ui/pom.xml
@@ -1,13 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
<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>net.sf.taverna.t2</groupId>
- <artifactId>ui-exts</artifactId>
- <version>2.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.ui-exts</groupId>
<artifactId>parallelize-ui</artifactId>
<packaging>bundle</packaging>
<name>Parallelize layer contextual view</name>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/taverna-workbench-perspective-biocatalogue/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-perspective-biocatalogue/pom.xml b/taverna-workbench-perspective-biocatalogue/pom.xml
index 3f5457a..7a6d502 100644
--- a/taverna-workbench-perspective-biocatalogue/pom.xml
+++ b/taverna-workbench-perspective-biocatalogue/pom.xml
@@ -1,13 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
<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>net.sf.taverna.t2</groupId>
- <artifactId>ui-exts</artifactId>
- <version>2.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.ui-exts</groupId>
<artifactId>perspective-biocatalogue</artifactId>
<name>BioCatalogue Perspective</name>
<repositories>
@@ -16,30 +31,10 @@
<snapshots>
<enabled>false</enabled>
</snapshots>
- <id>mygrid-repository</id>
- <name>myGrid Repository</name>
- <url>http://www.mygrid.org.uk/maven/repository</url>
- </repository>
- <repository>
- <releases />
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
<id>fuse</id>
<name>fuseRepository</name>
<url>http://repo.fusesource.com/maven2-all/</url>
</repository>
- <repository>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots />
- <id>mygrid-snapshot-repository</id>
- <name>myGrid Snapshot Repository</name>
- <url>
- http://www.mygrid.org.uk/maven/snapshot-repository
- </url>
- </repository>
</repositories>
<dependencies>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/taverna-workbench-perspective-design/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-perspective-design/pom.xml b/taverna-workbench-perspective-design/pom.xml
index cde090a..d9db4c3 100644
--- a/taverna-workbench-perspective-design/pom.xml
+++ b/taverna-workbench-perspective-design/pom.xml
@@ -1,13 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
<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>net.sf.taverna.t2</groupId>
- <artifactId>ui-components</artifactId>
- <version>2.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.ui-components</groupId>
<artifactId>perspective-design</artifactId>
<packaging>bundle</packaging>
<name>Design perspective</name>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/taverna-workbench-perspective-myexperiment/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-perspective-myexperiment/pom.xml b/taverna-workbench-perspective-myexperiment/pom.xml
index 9406580..83555db 100644
--- a/taverna-workbench-perspective-myexperiment/pom.xml
+++ b/taverna-workbench-perspective-myexperiment/pom.xml
@@ -1,13 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
<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>net.sf.taverna.t2</groupId>
- <artifactId>ui-exts</artifactId>
- <version>2.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.ui-exts</groupId>
<artifactId>perspective-myexperiment</artifactId>
<name>myExperiment perspective</name>
<repositories>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/taverna-workbench-perspective-results/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-perspective-results/pom.xml b/taverna-workbench-perspective-results/pom.xml
index f4efdd9..ae730eb 100644
--- a/taverna-workbench-perspective-results/pom.xml
+++ b/taverna-workbench-perspective-results/pom.xml
@@ -1,12 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
-<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">
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<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>net.sf.taverna.t2</groupId>
- <artifactId>ui-components</artifactId>
- <version>2.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.ui-components</groupId>
<artifactId>perspective-results</artifactId>
<packaging>bundle</packaging>
<name>Results Perspective</name>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/taverna-workbench-plugin-manager/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-plugin-manager/pom.xml b/taverna-workbench-plugin-manager/pom.xml
index 4e9f0c1..9b24ea2 100644
--- a/taverna-workbench-plugin-manager/pom.xml
+++ b/taverna-workbench-plugin-manager/pom.xml
@@ -1,12 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
<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/xsd/maven-4.0.0.xsd">
+ 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>net.sf.taverna.t2</groupId>
- <artifactId>ui-impl</artifactId>
- <version>2.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.ui-impl</groupId>
<artifactId>plugin-manager</artifactId>
<packaging>bundle</packaging>
<name>Taverna Workbench Plugin Manager</name>
[07/50] [abbrv] incubator-taverna-workbench git commit: T3-851 Fixed
redraw problem when removing tabs.
Posted by st...@apache.org.
T3-851 Fixed redraw problem when removing tabs.
git-svn-id: https://taverna.googlecode.com/svn/taverna/utils/net.sf.taverna.t2.lang/trunk@16128 bf327186-88b3-11dd-a302-d386e5130c1c
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/commit/abbb57ae
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/tree/abbb57ae
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/diff/abbb57ae
Branch: refs/heads/master
Commit: abbb57ae82c1f2b11ea2fb30f7b1417622c36921
Parents: ef5ec64
Author: david@mygrid.org.uk <da...@bf327186-88b3-11dd-a302-d386e5130c1c>
Authored: Fri Oct 11 10:03:59 2013 +0000
Committer: david@mygrid.org.uk <da...@bf327186-88b3-11dd-a302-d386e5130c1c>
Committed: Fri Oct 11 10:03:59 2013 +0000
----------------------------------------------------------------------
.../net/sf/taverna/t2/lang/ui/tabselector/TabSelectorComponent.java | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/abbb57ae/ui/src/main/java/net/sf/taverna/t2/lang/ui/tabselector/TabSelectorComponent.java
----------------------------------------------------------------------
diff --git a/ui/src/main/java/net/sf/taverna/t2/lang/ui/tabselector/TabSelectorComponent.java b/ui/src/main/java/net/sf/taverna/t2/lang/ui/tabselector/TabSelectorComponent.java
index 23e6343..a918143 100644
--- a/ui/src/main/java/net/sf/taverna/t2/lang/ui/tabselector/TabSelectorComponent.java
+++ b/ui/src/main/java/net/sf/taverna/t2/lang/ui/tabselector/TabSelectorComponent.java
@@ -78,6 +78,7 @@ public abstract class TabSelectorComponent<T> extends JPanel {
if (button != null) {
tabGroup.remove(button);
remove(button);
+ revalidate();
repaint();
}
}
[50/50] [abbrv] incubator-taverna-workbench git commit: Merge branch
'taverna-support-utilities'
Posted by st...@apache.org.
Merge branch 'taverna-support-utilities'
>From https://github.com/taverna/taverna-support-utilities master
Conflicts:
pom.xml
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/commit/4357f05e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/tree/4357f05e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/diff/4357f05e
Branch: refs/heads/master
Commit: 4357f05ec52750928cee98b8bc0aeade3622cb91
Parents: 09b80e1 71d2d4f
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Fri Mar 6 22:31:48 2015 +0000
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Fri Mar 6 22:31:48 2015 +0000
----------------------------------------------------------------------
.gitignore | 24 +
1/pom.xml | 75 +++
pom.xml | 6 +
taverna-beaninfo/pom.xml | 21 +
.../t2/lang/beans/PropertyAnnotated.java | 74 +++
.../t2/lang/beans/PropertyAnnotation.java | 109 +++
.../lang/beans/PropertyAnnotationExtractor.java | 202 ++++++
taverna-io/pom.xml | 20 +
.../net/sf/taverna/t2/lang/io/StreamCopier.java | 69 ++
.../sf/taverna/t2/lang/io/StreamDevourer.java | 106 +++
taverna-partition/pom.xml | 22 +
.../sf/taverna/t2/partition/HashSetModel.java | 116 ++++
.../net/sf/taverna/t2/partition/Partition.java | 441 +++++++++++++
.../t2/partition/PartitionAlgorithm.java | 47 ++
.../t2/partition/PartitionAlgorithmSetSPI.java | 36 +
.../t2/partition/PropertyExtractorRegistry.java | 37 ++
.../t2/partition/PropertyExtractorSPI.java | 44 ++
.../java/net/sf/taverna/t2/partition/Query.java | 56 ++
.../sf/taverna/t2/partition/RootPartition.java | 394 +++++++++++
.../net/sf/taverna/t2/partition/SetModel.java | 53 ++
.../t2/partition/SetModelChangeListener.java | 42 ++
.../algorithms/CustomPartitionAlgorithm.java | 98 +++
.../LiteralValuePartitionAlgorithm.java | 106 +++
.../ui/PartitionAlgorithmListEditor.java | 224 +++++++
.../t2/partition/ui/TableTreeNodeColumn.java | 69 ++
.../t2/partition/ui/TableTreeNodeRenderer.java | 554 ++++++++++++++++
.../net/sf/taverna/t2/partition/ui/UITest.java | 58 ++
.../t2/partition/PartitionTestApplication.java | 280 ++++++++
.../LiteralValuePartitionAlgorithmTest.java | 68 ++
taverna-ui/pom.xml | 35 +
.../net/sf/taverna/t2/lang/ui/CArrowImage.java | 198 ++++++
.../t2/lang/ui/CTransferableTreePath.java | 66 ++
.../taverna/t2/lang/ui/DeselectingButton.java | 45 ++
.../sf/taverna/t2/lang/ui/DialogTextArea.java | 83 +++
.../sf/taverna/t2/lang/ui/EdgeLineBorder.java | 91 +++
.../sf/taverna/t2/lang/ui/EditorKeySetUtil.java | 67 ++
.../taverna/t2/lang/ui/ExtensionFileFilter.java | 105 +++
.../net/sf/taverna/t2/lang/ui/FileTools.java | 117 ++++
.../net/sf/taverna/t2/lang/ui/HtmlUtils.java | 87 +++
.../sf/taverna/t2/lang/ui/JSplitPaneExt.java | 56 ++
.../sf/taverna/t2/lang/ui/KeywordDocument.java | 568 ++++++++++++++++
.../t2/lang/ui/LineEnabledTextPanel.java | 106 +++
.../net/sf/taverna/t2/lang/ui/LinePainter.java | 163 +++++
.../t2/lang/ui/LineWrappingTextArea.java | 217 ++++++
.../sf/taverna/t2/lang/ui/NoWrapEditorKit.java | 77 +++
.../sf/taverna/t2/lang/ui/ReadOnlyTextArea.java | 50 ++
.../t2/lang/ui/SanitisingDocumentFilter.java | 60 ++
.../net/sf/taverna/t2/lang/ui/ShadedLabel.java | 126 ++++
.../net/sf/taverna/t2/lang/ui/TableMap.java | 69 ++
.../net/sf/taverna/t2/lang/ui/TableSorter.java | 341 ++++++++++
.../t2/lang/ui/ValidatingUserInputDialog.java | 274 ++++++++
.../net/sf/taverna/t2/lang/ui/icons/Icons.java | 48 ++
.../lang/ui/tabselector/ScrollController.java | 85 +++
.../sf/taverna/t2/lang/ui/tabselector/Tab.java | 200 ++++++
.../t2/lang/ui/tabselector/TabLayout.java | 135 ++++
.../ui/tabselector/TabSelectorComponent.java | 99 +++
.../lang/ui/treetable/AbstractCellEditor.java | 81 +++
.../ui/treetable/AbstractTreeTableModel.java | 198 ++++++
.../t2/lang/ui/treetable/JTreeTable.LICENSE | 59 ++
.../t2/lang/ui/treetable/JTreeTable.java | 657 +++++++++++++++++++
.../t2/lang/ui/treetable/LinesBorder.java | 178 +++++
.../t2/lang/ui/treetable/TreeTableModel.java | 69 ++
.../ui/treetable/TreeTableModelAdapter.java | 132 ++++
.../net/sf/taverna/t2/lang/ui/icons/ok.png | Bin 0 -> 3318 bytes
.../net/sf/taverna/t2/lang/ui/icons/severe.png | Bin 0 -> 867 bytes
.../net/sf/taverna/t2/lang/ui/icons/warning.png | Bin 0 -> 3459 bytes
taverna-uibuilder/pom.xml | 25 +
.../lang/uibuilder/AbstractListComponent.java | 521 +++++++++++++++
.../t2/lang/uibuilder/AlignableComponent.java | 29 +
.../sf/taverna/t2/lang/uibuilder/Alignment.java | 66 ++
.../taverna/t2/lang/uibuilder/BeanCheckBox.java | 54 ++
.../t2/lang/uibuilder/BeanComponent.java | 420 ++++++++++++
.../t2/lang/uibuilder/BeanEnumComboBox.java | 89 +++
.../taverna/t2/lang/uibuilder/BeanTextArea.java | 89 +++
.../t2/lang/uibuilder/BeanTextComponent.java | 174 +++++
.../t2/lang/uibuilder/BeanTextField.java | 60 ++
.../net/sf/taverna/t2/lang/uibuilder/Icons.java | 41 ++
.../taverna/t2/lang/uibuilder/ListHandler.java | 67 ++
.../lang/uibuilder/RecursiveListComponent.java | 98 +++
.../sf/taverna/t2/lang/uibuilder/UIBuilder.java | 236 +++++++
.../lang/uibuilder/UIConstructionException.java | 29 +
.../t2/lang/uibuilder/WrappedListComponent.java | 105 +++
.../sf/taverna/t2/lang/uibuilder/package.html | 4 +
.../net/sf/taverna/t2/lang/uibuilder/delete.png | Bin 0 -> 1120 bytes
.../net/sf/taverna/t2/lang/uibuilder/down.png | Bin 0 -> 1077 bytes
.../net/sf/taverna/t2/lang/uibuilder/new.png | Bin 0 -> 1146 bytes
.../net/sf/taverna/t2/lang/uibuilder/up.png | Bin 0 -> 1074 bytes
.../taverna/t2/lang/uibuilder/Application.java | 48 ++
.../taverna/t2/lang/uibuilder/Application2.java | 44 ++
.../t2/lang/uibuilder/BeanWithBoundProps.java | 74 +++
.../lang/uibuilder/BeanWithListProperties.java | 35 +
.../t2/lang/uibuilder/BeanWithNestedList.java | 28 +
.../t2/lang/uibuilder/PrimitiveTypeBean.java | 101 +++
.../taverna/t2/lang/uibuilder/SampleEnum.java | 13 +
.../taverna/t2/lang/uibuilder/TopLevelBean.java | 43 ++
95 files changed, 10886 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/4357f05e/pom.xml
----------------------------------------------------------------------
diff --cc pom.xml
index 8db98c2,7e5841f..0339d1b
--- a/pom.xml
+++ b/pom.xml
@@@ -19,96 -3,73 +19,102 @@@
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>net.sf.taverna</groupId>
+ <groupId>org.apache.taverna</groupId>
<artifactId>taverna-parent</artifactId>
- <version>3.0.1-SNAPSHOT</version>
+ <version>1-incubating-SNAPSHOT</version>
</parent>
-
- <name>Taverna support utilities</name>
- <groupId>net.sf.taverna.t2</groupId>
- <artifactId>lang</artifactId>
- <version>2.0.1-SNAPSHOT</version>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
<packaging>pom</packaging>
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>${junit.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.log4j</groupId>
- <artifactId>com.springsource.org.apache.log4j</artifactId>
- <version>${log4j.version}</version>
- </dependency>
- </dependencies>
- </dependencyManagement>
- <repositories>
- <repository>
- <releases />
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- <id>mygrid-repository</id>
- <name>myGrid Repository</name>
- <url>http://www.mygrid.org.uk/maven/repository</url>
- </repository>
- <repository>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots />
- <id>mygrid-snapshot-repository</id>
- <name>myGrid Snapshot Repository</name>
- <url>http://www.mygrid.org.uk/maven/snapshot-repository</url>
- </repository>
- <repository>
- <id>com.springsource.repository.bundles.release</id>
- <name>SpringSource Enterprise Bundle Repository - SpringSource Bundle Releases</name>
- <url>http://repository.springsource.com/maven/bundles/release</url>
- </repository>
- <repository>
- <id>com.springsource.repository.bundles.external</id>
- <name>SpringSource Enterprise Bundle Repository - External Bundle Releases</name>
- <url>http://repository.springsource.com/maven/bundles/external</url>
- </repository>
- </repositories>
+ <name>Apache Taverna Workbench</name>
+ <description>Graphical workbench for editing and running Apache Taverna workflows</description>
+ <properties>
+ <taverna.language.version>0.15.0-incubating-SNAPSHOT</taverna.language.version>
+ <taverna.osgi.version>0.2.0-incubating-SNAPSHOT</taverna.osgi.version>
+ <taverna.engine.version>3.1.0-incubating-SNAPSHOT</taverna.engine.version>
+ <taverna.commonactivities.version>2.1.0-incubating-SNAPSHOT</taverna.commonactivities.version>
+ </properties>
<modules>
- <module>beans</module>
- <module>io</module>
- <module>observer</module>
- <module>partition</module>
- <module>ui</module>
- <module>uibuilder</module>
- </modules>
- <scm>
- <connection>scm:git:https://github.com/taverna/taverna-support-utilities.git</connection>
- <developerConnection>scm:git:ssh://git@github.com:taverna/taverna-support-utilities.git</developerConnection>
- <url>https://github.com/taverna/taverna-support-utilities</url>
- <tag>HEAD</tag>
- </scm>
+ <module>taverna-dataflow-activity-ui</module>
+ <module>taverna-disabled-activity-ui</module>
+ <module>taverna-stringconstant-activity-ui</module>
+ <module>taverna-unrecognized-activity-ui</module>
+ <module>taverna-workbench-activity-icons-api</module>
+ <module>taverna-workbench-activity-palette-api</module>
+ <module>taverna-workbench-activity-palette-impl</module>
+ <module>taverna-workbench-activity-palette-ui</module>
+ <module>taverna-workbench-activity-tools</module>
+ <module>taverna-workbench-configuration-api</module>
+ <module>taverna-workbench-configuration-impl</module>
+ <module>taverna-workbench-contextual-views</module>
+ <module>taverna-workbench-contextual-views-api</module>
+ <module>taverna-workbench-contextual-views-impl</module>
+ <module>taverna-workbench-credential-manager-ui</module>
+ <module>taverna-workbench-data-management-config-ui</module>
+ <module>taverna-workbench-design-ui</module>
+ <module>taverna-workbench-edits-api</module>
+ <module>taverna-workbench-edits-impl</module>
+ <module>taverna-workbench-file-api</module>
+ <module>taverna-workbench-file-impl</module>
+ <module>taverna-workbench-graph-model</module>
+ <module>taverna-workbench-graph-view</module>
+ <module>taverna-workbench-helper</module>
+ <module>taverna-workbench-helper-api</module>
+ <module>taverna-workbench-httpproxy-config</module>
+ <module>taverna-workbench-iteration-strategy-ui</module>
+ <module>taverna-workbench-loop-ui</module>
+ <module>taverna-workbench-menu-api</module>
+ <module>taverna-workbench-menu-impl</module>
+ <module>taverna-workbench-menu-items</module>
+ <module>taverna-workbench-monitor-view</module>
+ <module>taverna-workbench-parallelize-ui</module>
+ <module>taverna-workbench-perspective-biocatalogue</module>
+ <module>taverna-workbench-perspective-design</module>
+ <module>taverna-workbench-perspective-myexperiment</module>
+ <module>taverna-workbench-perspective-results</module>
+ <module>taverna-workbench-plugin-manager</module>
+ <module>taverna-workbench-plugins-gui</module>
+ <module>taverna-workbench-reference-ui</module>
+ <module>taverna-workbench-renderers-api</module>
+ <module>taverna-workbench-renderers-exts</module>
+ <module>taverna-workbench-renderers-impl</module>
+ <module>taverna-workbench-report-api</module>
+ <module>taverna-workbench-report-explainer</module>
+ <module>taverna-workbench-report-impl</module>
+ <module>taverna-workbench-report-view</module>
+ <module>taverna-workbench-results-view</module>
+ <module>taverna-workbench-retry-ui</module>
+ <module>taverna-workbench-run-ui</module>
+ <module>taverna-workbench-selection-api</module>
+ <module>taverna-workbench-selection-impl</module>
+ <module>taverna-workbench-update-manager</module>
+ <module>taverna-workbench-workbench-api</module>
+ <module>taverna-workbench-workbench-impl</module>
+ <module>taverna-workbench-workflow-explorer</module>
+ <module>taverna-workbench-workflow-view</module>
++ <module>taverna-beans</module>
++ <module>taverna-io</module>
++ <module>taverna-observer</module>
++ <module>taverna-partition</module>
++ <module>taverna-ui</module>
++ <module>taverna-uibuilder</module>
+ </modules>
+ <scm>
+ <connection>scm:git:https://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench.git</connection>
+ <developerConnection>scm:git:https://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench.git</developerConnection>
+ <url>https://github.com/apache/incubator-taverna-workbench</url>
+ <tag>HEAD</tag>
+ </scm>
+ <repositories>
+ <repository>
+ <id>apache.snapshots</id>
+ <name>Apache Snapshot Repository</name>
+ <url>http://repository.apache.org/snapshots</url>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ </repository>
+ </repositories>
+
</project>
[47/50] [abbrv] incubator-taverna-workbench git commit: taverna-*
Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/taverna-uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/PrimitiveTypeBean.java
----------------------------------------------------------------------
diff --git a/taverna-uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/PrimitiveTypeBean.java b/taverna-uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/PrimitiveTypeBean.java
new file mode 100644
index 0000000..8240fea
--- /dev/null
+++ b/taverna-uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/PrimitiveTypeBean.java
@@ -0,0 +1,101 @@
+package net.sf.taverna.t2.lang.uibuilder;
+
+/**
+ * Bean containing all the primitive types in Java (AFAIK)
+ *
+ * @author Tom Oinn
+ *
+ */
+public class PrimitiveTypeBean {
+
+ private int intValue = 1;
+ private short shortValue = 2;
+ private long longValue = (long) 3.0123;
+ private double doubleValue = 4.01234;
+ private boolean booleanValue = false;
+ private byte byteValue = 5;
+ private float floatValue = 6.012345f;
+ private char charValue = 'a';
+
+ public PrimitiveTypeBean() {
+ //
+ }
+
+ public void setIntValue(int intValue) {
+ this.intValue = intValue;
+ }
+
+ public String toString() {
+ return intValue + "," + shortValue + "," + longValue + ","
+ + doubleValue + "," + booleanValue + "," + byteValue + ","
+ + floatValue + "," + charValue;
+ }
+
+ public int getIntValue() {
+ return intValue;
+ }
+
+ public void setShortValue(short shortValue) {
+ this.shortValue = shortValue;
+ System.out.println(this);
+ }
+
+ public short getShortValue() {
+ return shortValue;
+ }
+
+ public void setLongValue(long longValue) {
+ this.longValue = longValue;
+ System.out.println(this);
+ }
+
+ public long getLongValue() {
+ return longValue;
+ }
+
+ public void setDoubleValue(double doubleValue) {
+ this.doubleValue = doubleValue;
+ System.out.println(this);
+ }
+
+ public double getDoubleValue() {
+ return doubleValue;
+ }
+
+ public void setBooleanValue(boolean booleanValue) {
+ this.booleanValue = booleanValue;
+ System.out.println(this);
+ }
+
+ public boolean getBooleanValue() {
+ return booleanValue;
+ }
+
+ public void setByteValue(byte byteValue) {
+ this.byteValue = byteValue;
+ System.out.println(this);
+ }
+
+ public byte getByteValue() {
+ return byteValue;
+ }
+
+ public void setFloatValue(float floatValue) {
+ this.floatValue = floatValue;
+ System.out.println(this);
+ }
+
+ public float getFloatValue() {
+ return floatValue;
+ }
+
+ public void setCharValue(char charValue) {
+ this.charValue = charValue;
+ System.out.println(this);
+ }
+
+ public char getCharValue() {
+ return charValue;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/taverna-uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/SampleEnum.java
----------------------------------------------------------------------
diff --git a/taverna-uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/SampleEnum.java b/taverna-uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/SampleEnum.java
new file mode 100644
index 0000000..c5ed446
--- /dev/null
+++ b/taverna-uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/SampleEnum.java
@@ -0,0 +1,13 @@
+package net.sf.taverna.t2.lang.uibuilder;
+
+/**
+ * Very simple example enumeration
+ *
+ * @author Tom Oinn
+ *
+ */
+public enum SampleEnum {
+
+ ABCD, EFGH, IJKL;
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/taverna-uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/TopLevelBean.java
----------------------------------------------------------------------
diff --git a/taverna-uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/TopLevelBean.java b/taverna-uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/TopLevelBean.java
new file mode 100644
index 0000000..3a4d74e
--- /dev/null
+++ b/taverna-uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/TopLevelBean.java
@@ -0,0 +1,43 @@
+package net.sf.taverna.t2.lang.uibuilder;
+
+/**
+ * Bean containing the various other sub-beans
+ *
+ * @author Tom Oinn
+ *
+ */
+public class TopLevelBean {
+
+ private SampleEnum enumeratedField = SampleEnum.ABCD;
+ private BeanWithBoundProps boundBean = new BeanWithBoundProps();
+ private BeanWithNestedList nest = new BeanWithNestedList();
+
+ public TopLevelBean() {
+ //
+ }
+
+ public void setEnumeratedField(SampleEnum enumeratedField) {
+ this.enumeratedField = enumeratedField;
+ }
+
+ public SampleEnum getEnumeratedField() {
+ return enumeratedField;
+ }
+
+ public void setBoundBean(BeanWithBoundProps boundBean) {
+ this.boundBean = boundBean;
+ }
+
+ public BeanWithBoundProps getBoundBean() {
+ return boundBean;
+ }
+
+ public void setNest(BeanWithNestedList nest) {
+ this.nest = nest;
+ }
+
+ public BeanWithNestedList getNest() {
+ return nest;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/uibuilder/pom.xml
----------------------------------------------------------------------
diff --git a/uibuilder/pom.xml b/uibuilder/pom.xml
deleted file mode 100644
index bc84391..0000000
--- a/uibuilder/pom.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<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>net.sf.taverna.t2</groupId>
- <artifactId>lang</artifactId>
- <version>2.0.1-SNAPSHOT</version>
- </parent>
- <groupId>net.sf.taverna.t2.lang</groupId>
- <artifactId>uibuilder</artifactId>
- <packaging>bundle</packaging>
- <name>UI builder based on beans</name>
- <dependencies>
- <dependency>
- <groupId>net.sf.taverna.t2.lang</groupId>
- <artifactId>ui</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.log4j</groupId>
- <artifactId>com.springsource.org.apache.log4j</artifactId>
- <version>${log4j.version}</version>
- </dependency>
- </dependencies>
-</project>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/AbstractListComponent.java
----------------------------------------------------------------------
diff --git a/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/AbstractListComponent.java b/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/AbstractListComponent.java
deleted file mode 100644
index 9a7761c..0000000
--- a/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/AbstractListComponent.java
+++ /dev/null
@@ -1,521 +0,0 @@
-package net.sf.taverna.t2.lang.uibuilder;
-
-import static net.sf.taverna.t2.lang.uibuilder.Icons.getIcon;
-
-import java.awt.BorderLayout;
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Dimension;
-import java.awt.GridLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.lang.reflect.InvocationTargetException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Timer;
-import java.util.TimerTask;
-
-import javax.swing.BorderFactory;
-import javax.swing.Box;
-import javax.swing.BoxLayout;
-import javax.swing.JButton;
-import javax.swing.JComponent;
-import javax.swing.JPanel;
-import javax.swing.JSeparator;
-import javax.swing.SwingConstants;
-import javax.swing.SwingUtilities;
-
-import org.apache.log4j.Logger;
-
-/**
- * Superclass for list and wrapped list components generated by the UI builder.
- * Accepts properties to determine whether the 'new', 'move' and 'delete'
- * controls should be displayed and what, if any, concrete class should be used
- * when constructing new items. Properties are as follows:
- * <p>
- * <ul>
- * <li><code>nodelete</code> If set do not show the 'delete item' button</li>
- * <li><code>nomove</code> If set do not show the 'move up' and 'move down'
- * buttons</li>
- * <li><code>new=some.class.Name</code> If set then use the specified class,
- * loaded with the target object's classloader, when adding new items. Also adds
- * the 'New Item' button to the top of the list panel. The specified class must
- * be valid to insert into the list and must have a no-argument constructor</li>
- * </ul>
- *
- * @author Tom Oinn
- *
- */
-public abstract class AbstractListComponent extends JPanel {
-
- private static final long serialVersionUID = 2067559836729348490L;
-
- private static Logger logger = Logger
- .getLogger(AbstractListComponent.class);
-
- private String fieldName;
- @SuppressWarnings("unchecked")
- private List theList;
- private Properties props;
- private Map<String, Properties> fieldProps;
- private List<String> subFields;
- private String parent;
- private JPanel listItemContainer;
- private boolean showDelete = true;
- private boolean showMove = true;
- @SuppressWarnings("unchecked")
- private Class newItemClass = null;
- protected static Color deferredButtonColour = Color.orange;
- private static Object[] prototypes;
-
- static {
- try {
- prototypes = new Object[] { new URL("http://some.host.com/path"),
- new Boolean(true), new Integer(1), new Float(1),
- new Short((short) 1), new Long((long) 1),
- new Character('a'), new Double((double) 1),
- new Byte((byte) 1) };
- } catch (MalformedURLException e) {
- logger.error("Unable to generate URL", e);
- }
- }
-
- /**
- * Build a generic list component
- *
- * @param fieldName
- * the name of the field this component represents in its parent
- * bean
- * @param theList
- * the list value of the field
- * @param props
- * properties for this field
- * @param fieldProps
- * aggregated properties for all fields in the UI builder scope
- * @param newItemClass
- * the class to use for construction of new item instances, or
- * null if this is not supported
- * @param subFields
- * all field names within this field, this will be empty for a
- * wrapped list
- * @param parent
- * the parent field ID used to access subfield properties
- * @throws NoSuchMethodException
- * @throws ClassNotFoundException
- * @throws InvocationTargetException
- * @throws IllegalAccessException
- * @throws IllegalArgumentException
- */
- @SuppressWarnings("unchecked")
- protected AbstractListComponent(String fieldName, List theList,
- Properties props, Map<String, Properties> fieldProps,
- final Class<?> newItemClass, List<String> subFields, String parent)
- throws NoSuchMethodException, IllegalArgumentException,
- IllegalAccessException, InvocationTargetException,
- ClassNotFoundException {
- super();
- this.fieldName = fieldName;
- this.theList = theList;
- this.props = props;
- this.fieldProps = fieldProps;
- this.subFields = subFields;
- this.parent = parent;
- if (props.containsKey("nodelete")) {
- showDelete = false;
- }
- if (props.containsKey("nomove")) {
- showMove = false;
- }
- this.newItemClass = newItemClass;
- setOpaque(false);
- setLayout(new BorderLayout());
- String displayName = fieldName;
- if (props.containsKey("name")) {
- displayName = props.getProperty("name");
- }
- setBorder(BorderFactory.createTitledBorder(displayName));
- if (newItemClass != null) {
- // Generate 'add new' UI here
- JPanel newItemPanel = new JPanel();
- newItemPanel.setOpaque(false);
- newItemPanel.setLayout(new BoxLayout(newItemPanel,
- BoxLayout.LINE_AXIS));
- newItemPanel.add(Box.createHorizontalGlue());
-
- final JButton newItemButton = new JButton("New Item",
- getIcon("new"));
- newItemPanel.add(newItemButton);
- newItemButton.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- try {
- Object instance = null;
- try {
- instance = newItemClass.newInstance();
- } catch (InstantiationException ie) {
- // Probably because the class has no default
- // constructor, use the prototype list
- for (Object prototype : prototypes) {
- if (newItemClass.isAssignableFrom(prototype
- .getClass())) {
- instance = prototype;
- break;
- }
- }
- if (instance == null) {
- throw ie;
- }
- }
- addNewItemToList(instance);
- newItemButton.setForeground(BeanComponent.validColour);
- } catch (Exception ex) {
- newItemButton
- .setForeground(BeanComponent.invalidColour);
- logger.error("", ex);
- }
- }
- });
- add(newItemPanel, BorderLayout.NORTH);
- }
- listItemContainer = new JPanel();
- listItemContainer.setOpaque(false);
- listItemContainer.setLayout(new BoxLayout(listItemContainer,
- BoxLayout.PAGE_AXIS));
- updateListContents();
- add(listItemContainer, BorderLayout.CENTER);
- }
-
- protected void updateListContents() throws NoSuchMethodException,
- IllegalArgumentException, IllegalAccessException,
- InvocationTargetException, ClassNotFoundException {
- listItemContainer.removeAll();
- boolean first = true;
- int index = 0;
- List<JComponent> listComponents = getListComponents();
- for (JComponent component : listComponents) {
- if (first && newItemClass == null) {
- first = false;
- } else {
- List<Component> c = getSeparatorComponents();
- if (c != null) {
- for (Component jc : c) {
- listItemContainer.add(jc);
- }
- }
- }
- JComponent wrappedComponent = wrapWithControls(component, index++,
- listComponents.size());
- if (wrappedComponent != null) {
- listItemContainer.add(wrappedComponent);
- } else {
- listItemContainer.add(component);
- }
- }
- revalidate();
- }
-
- /**
- * Wrap the given component in a panel including whatever list manipulation
- * controls are needed. The index of the item being wrapped is supplied to
- * inform the various actions the controls can perform. By default this
- * returns a JPanel with delete and move controls
- *
- * @param component
- * @param index
- * @return
- */
- protected JPanel wrapWithControls(JComponent component, final int index,
- int listSize) {
- int numberOfButtons = 3;
- if (!showDelete) {
- numberOfButtons--;
- }
- if (!showMove) {
- numberOfButtons -= 2;
- }
- if (numberOfButtons == 0) {
- return null;
- }
- JPanel result = new JPanel();
- result.setOpaque(false);
- result.setLayout(new BorderLayout());
- result.add(component, BorderLayout.CENTER);
- // Construct the controls
- JPanel controls = new JPanel();
- controls.setOpaque(false);
- controls.setLayout(new BorderLayout());
- controls
- .add(new JSeparator(SwingConstants.VERTICAL), BorderLayout.WEST);
- result.add(controls, BorderLayout.EAST);
- JPanel buttons = new JPanel();
- buttons.setOpaque(false);
- buttons.setLayout(new GridLayout(0, numberOfButtons));
-
- if (showMove) {
- // Move up button, or spacer if already at index 0
- if (index > 0) {
- JButton moveUpButton = createButton("up", false);
- moveUpButton.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- try {
- itemMoved(index, index - 1);
- } catch (Exception ex) {
- logger.error("Unable to move item", ex);
- }
- }
- });
- buttons.add(moveUpButton);
- } else {
- buttons.add(Box.createGlue());
- }
-
- // Move down button, or spacer if index == listSize-1
- if (index < (listSize - 1)) {
- JButton moveDownButton = createButton("down", false);
- moveDownButton.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- try {
- itemMoved(index, index + 1);
- } catch (Exception ex) {
- logger.error("Unable to move item", ex);
- }
- }
- });
- buttons.add(moveDownButton);
- } else {
- buttons.add(Box.createGlue());
- }
- }
-
- if (showDelete) {
- // Delete button
- JButton deleteButton = createButton("delete", true);
- deleteButton.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- try {
- deleteItemAtIndex(index);
- } catch (Exception ex) {
- logger.error("Unable to delete item", ex);
- }
- }
- });
- buttons.add(deleteButton);
- }
- JPanel buttonWrapper = new JPanel();
- buttonWrapper.setLayout(new BorderLayout());
- buttonWrapper.setOpaque(false);
- buttonWrapper.add(buttons, BorderLayout.NORTH);
- controls.add(buttonWrapper, BorderLayout.CENTER);
- return result;
- }
-
- private static Timer timer = new Timer();
-
- @SuppressWarnings("serial")
- private JButton createButton(String iconName, final boolean deferActions) {
- JButton result = new JButton(getIcon(iconName)) {
- @Override
- public Dimension getPreferredSize() {
- return new Dimension(getIcon().getIconWidth() + 8, (int) super
- .getPreferredSize().getHeight());
- }
-
- @Override
- public Dimension getMinimumSize() {
- return new Dimension(getIcon().getIconWidth() + 8, (int) super
- .getMinimumSize().getHeight());
- }
-
- private boolean active = false;
- private Color defaultBackground = null;
-
- @Override
- public void addActionListener(final ActionListener theListener) {
- if (defaultBackground == null) {
- defaultBackground = getBackground();
- }
- if (!deferActions) {
- super.addActionListener(theListener);
- return;
- } else {
- super.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent ae) {
- if (active) {
- theListener.actionPerformed(ae);
- } else {
- setActive(true);
- timer.schedule(new TimerTask() {
-
- @Override
- public void run() {
- SwingUtilities
- .invokeLater(new Runnable() {
- public void run() {
- setActive(false);
- }
- });
- }
- }, 1000);
- }
- }
- });
- }
- }
-
- private synchronized void setActive(boolean isActive) {
- if (isActive == active) {
- return;
- } else {
- active = isActive;
- setBackground(active ? deferredButtonColour
- : defaultBackground);
-
- }
- }
- };
- result.setFocusable(false);
- return result;
- }
-
- /**
- * Called when building the UI, must return a list of editor components
- * corresponding to items in the list
- *
- * @throws NoSuchMethodException
- * @throws ClassNotFoundException
- * @throws InvocationTargetException
- * @throws IllegalAccessException
- * @throws IllegalArgumentException
- */
- protected abstract List<JComponent> getListComponents()
- throws NoSuchMethodException, IllegalArgumentException,
- IllegalAccessException, InvocationTargetException,
- ClassNotFoundException;
-
- /**
- * Override to specify a separator component to be used inbetween internal
- * list components, by default no component is used (this returns null).
- *
- * @return
- */
- protected List<Component> getSeparatorComponents() {
- return null;
- }
-
- /**
- * Called when the user has clicked on the 'new item' button, this method is
- * passed the new instance of the specified type and should handle the
- * addition of this item to the list and the update of the UI to reflect
- * this change
- *
- * @param o
- * the object to add to the list
- * @throws ClassNotFoundException
- * @throws InvocationTargetException
- * @throws IllegalAccessException
- * @throws NoSuchMethodException
- * @throws IllegalArgumentException
- */
- protected abstract void addNewItemToList(Object o)
- throws IllegalArgumentException, NoSuchMethodException,
- IllegalAccessException, InvocationTargetException,
- ClassNotFoundException;
-
- /**
- * Called when the user has clicked on the 'delete item' button next to a
- * particular item in the list, this method is passed the index within the
- * list of the item to be deleted and must update the UI appropriately
- *
- * @param index
- * @throws ClassNotFoundException
- * @throws InvocationTargetException
- * @throws IllegalAccessException
- * @throws NoSuchMethodException
- * @throws IllegalArgumentException
- */
- protected abstract void deleteItemAtIndex(int index)
- throws IllegalArgumentException, NoSuchMethodException,
- IllegalAccessException, InvocationTargetException,
- ClassNotFoundException;
-
- /**
- * Called when the user has moved an item from one index to another, passed
- * the old index of the item and the desired new index. This method must
- * effect the actual move within the list and the update of the UI.
- *
- * @throws ClassNotFoundException
- * @throws InvocationTargetException
- * @throws IllegalAccessException
- * @throws NoSuchMethodException
- * @throws IllegalArgumentException
- */
- protected abstract void itemMoved(int fromIndex, int toIndex)
- throws IllegalArgumentException, NoSuchMethodException,
- IllegalAccessException, InvocationTargetException,
- ClassNotFoundException;
-
- /**
- * Get the field name of this component
- *
- * @return
- */
- protected final String getFieldName() {
- return this.fieldName;
- }
-
- /**
- * Return the underlying list presented by this component
- *
- * @return
- */
- @SuppressWarnings("unchecked")
- protected final List getUnderlyingList() {
- return this.theList;
- }
-
- /**
- * Get a list of (renamed) sub-fields of this field, so if this field was
- * foo.bar.someList and had a foo.bar.someList.urgle this would contain
- * 'urgle'
- *
- * @return
- */
- protected final List<String> getSubFields() {
- return this.subFields;
- }
-
- /**
- * Get the properties applied to this list component
- *
- * @return
- */
- protected final Properties getProperties() {
- return this.props;
- }
-
- /**
- * The parent field name is the name of this field plus its parent string
- * and is used when recursively building sub-panels within the list. Pass
- * this into the 'parent' argument of the UIBuilder's construction methods.
- *
- * @return
- */
- protected final String getParentFieldName() {
- return this.parent;
- }
-
- /**
- * Get the map of all field->property object block defined by the UI builder
- * constructing this component. This is used along with the parent field
- * name to determine properties of sub-components when recursing into a
- * nested collection.
- *
- * @return
- */
- protected final Map<String, Properties> getFieldProperties() {
- return this.fieldProps;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/AlignableComponent.java
----------------------------------------------------------------------
diff --git a/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/AlignableComponent.java b/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/AlignableComponent.java
deleted file mode 100644
index 483771b..0000000
--- a/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/AlignableComponent.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package net.sf.taverna.t2.lang.uibuilder;
-
-/**
- * Superinterface for components which have a label and which may be mutually
- * aligned within a panel. This assumes the component is laid out with a label
- * to the left of the main editing area, and that we want to ensure that all
- * editing areas line up and can do this by setting the preferred size of the
- * label.
- *
- * @author Tom Oinn
- *
- */
-public interface AlignableComponent {
-
- /**
- * Set the preferred width of the label for this alignable component
- *
- * @param newWidth
- */
- public void setLabelWidth(int newWidth);
-
- /**
- * Get the current preferred width of the label for this alignable component
- *
- * @return
- */
- public int getLabelWidth();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/Alignment.java
----------------------------------------------------------------------
diff --git a/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/Alignment.java b/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/Alignment.java
deleted file mode 100644
index 6143887..0000000
--- a/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/Alignment.java
+++ /dev/null
@@ -1,66 +0,0 @@
-package net.sf.taverna.t2.lang.uibuilder;
-
-import java.awt.Component;
-import java.awt.Container;
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.swing.SwingUtilities;
-
-import org.apache.log4j.Logger;
-
-/**
- * Static utility method to align alignable components within a container
- *
- * @author Tom Oinn
- *
- */
-public abstract class Alignment {
-
- private static Logger logger = Logger
- .getLogger(Alignment.class);
-
- /**
- * Find all instances of BeanFieldTextArea in the specified container and
- * set all label widths to the same as the widest of them, aligning the
- * content areas as a result
- *
- * @param container
- */
- public static void alignInContainer(Container container) {
- int widestLabel = 0;
- final List<AlignableComponent> fields = new ArrayList<AlignableComponent>();
- for (Component comp : container.getComponents()) {
- if (comp instanceof AlignableComponent) {
- AlignableComponent field = (AlignableComponent) comp;
- int fieldWidth = field.getLabelWidth();
- if (fieldWidth > widestLabel) {
- widestLabel = fieldWidth;
- }
- fields.add(field);
- }
- }
- final int widestLabelVal = widestLabel;
- if (!SwingUtilities.isEventDispatchThread()) {
- try {
- SwingUtilities.invokeAndWait(new Runnable() {
- public void run() {
- for (AlignableComponent field : fields) {
- field.setLabelWidth(widestLabelVal);
- }
- }
- });
- } catch (InterruptedException e) {
- logger.error("", e);
- } catch (InvocationTargetException e) {
- logger.error("", e);
- }
- } else {
- for (AlignableComponent field : fields) {
- field.setLabelWidth(widestLabelVal);
- }
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/BeanCheckBox.java
----------------------------------------------------------------------
diff --git a/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/BeanCheckBox.java b/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/BeanCheckBox.java
deleted file mode 100644
index 1d86f4a..0000000
--- a/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/BeanCheckBox.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package net.sf.taverna.t2.lang.uibuilder;
-
-import java.awt.BorderLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.util.Properties;
-
-import javax.swing.Box;
-import javax.swing.JCheckBox;
-
-/**
- * Bean field editor using a JCheckBox to handle boolean and Boolean field types
- *
- * @author Tom Oinn
- */
-public class BeanCheckBox extends BeanComponent implements AlignableComponent {
-
- private static final long serialVersionUID = -2842617445268734650L;
- private JCheckBox value;
-
- public BeanCheckBox(Object target, String propertyName, Properties props)
- throws NoSuchMethodException {
- this(target, propertyName, true, props);
- }
-
- public BeanCheckBox(Object target, String propertyName, boolean useLabel,
- Properties props) throws NoSuchMethodException {
- super(target, propertyName, useLabel, props);
- setLayout(new BorderLayout());
- value = new JCheckBox();
- value.setSelected(getBooleanProperty());
- value.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent ae) {
- boolean isSelected = value.isSelected();
- currentObjectValue = isSelected;
- setProperty();
- }
- });
- addLabel();
- value.setOpaque(false);
- add(Box.createHorizontalGlue(), BorderLayout.CENTER);
- add(value, BorderLayout.EAST);
- }
-
- @Override
- protected void updateComponent() {
- value.setSelected(getBooleanProperty());
- }
-
- private boolean getBooleanProperty() {
- return (Boolean) getProperty();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/BeanComponent.java
----------------------------------------------------------------------
diff --git a/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/BeanComponent.java b/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/BeanComponent.java
deleted file mode 100644
index 27014e1..0000000
--- a/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/BeanComponent.java
+++ /dev/null
@@ -1,420 +0,0 @@
-package net.sf.taverna.t2.lang.uibuilder;
-
-import java.awt.BorderLayout;
-import java.awt.Color;
-import java.awt.Dimension;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.Properties;
-
-import javax.swing.Box;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.SwingUtilities;
-import javax.swing.event.AncestorEvent;
-import javax.swing.event.AncestorListener;
-
-import org.apache.log4j.Logger;
-
-/**
- * Superclass of all bean component editors acting on a single (non collection)
- * property within a POJO. This handles bound properties, using reflection to
- * determine whether an appropriate addPropertyChangeListener method exists on
- * the target bean and registering a listener if so. It also registers an
- * ancestor listener to de-register this property listener if the component is
- * removed from the display heirarchy and to re-attach it if the component is
- * added. Implement updateComponent with the code to update the UI state from
- * the underlying object, this is called when a property change is received by
- * the listener (but not used for unbound properties).
- * <p>
- * This superclass also defines the name property:
- * <ul>
- * <li><code>name=SomeName</code> by default field labels use the field name
- * defined in the configuration, including any case used. If this property is
- * defined then the specified name is used instead</li>
- * </ul>
- *
- * @author Tom Oinn
- */
-public abstract class BeanComponent extends JPanel {
-
- private static Logger logger = Logger
- .getLogger(BeanComponent.class);
-
- private static final long serialVersionUID = -6044009506938335937L;
- protected Object target;
- protected String propertyName;
- protected Method getMethod, setMethod = null;
- protected boolean editable = true;
- protected Class<?> propertyType;
- protected static Color invalidColour = Color.red;
- protected static Color validColour = Color.black;
- protected static Color uneditedColour = Color.white;
- protected static Color editedColour = new Color(255, 245, 200);
- protected boolean currentValueValid = true;
- protected Object currentObjectValue = null;
- protected JLabel label;
- private boolean useLabel = false;
- protected static int height = 16;
- private Properties properties;
- private PropertyChangeListener propertyListener = null;
-
- /**
- * Equivalent to BeanComponent(target, propertyName, true, props)
- */
- public BeanComponent(Object target, String propertyName, Properties props)
- throws NoSuchMethodException {
- this(target, propertyName, true, props);
- }
-
- /**
- * Superclass constructor for BeanComponent instances.
- *
- * @param target
- * the object containing the property this component acts as a
- * view and controller for
- * @param propertyName
- * name of the property in the target object
- * @param useLabel
- * whether to show the label component (we set this to false for
- * wrapped lists, for example)
- * @param props
- * a component specific properties object, passing in any
- * properties defined in the configuration passed to UIBuilder
- * @throws NoSuchMethodException
- * if the appropriate get method for the named property can't be
- * found
- */
- public BeanComponent(Object target, String propertyName, boolean useLabel,
- Properties props) throws NoSuchMethodException {
- super();
- setOpaque(false);
- // Find methods
- this.properties = props;
- this.useLabel = useLabel;
- this.target = target;
- this.propertyName = propertyName;
-
- // If the target implements property change support then we can attach a
- // listener to update the UI if the bound property changes. This
- // listener is attached and detached in response to an ancestor listener
- // so the bound property is only monitored when the component is visible
- // in the UI.
- try {
- target.getClass().getMethod("addPropertyChangeListener",
- String.class, PropertyChangeListener.class);
- setUpPropertyListener();
- addAncestorListener(new AncestorListener() {
- public void ancestorAdded(AncestorEvent event) {
- setUpPropertyListener();
- }
-
- public void ancestorMoved(AncestorEvent event) {
- // Ignore
- }
-
- public void ancestorRemoved(AncestorEvent event) {
- tearDownPropertyListener();
- }
- });
- } catch (NoSuchMethodException nsme) {
- // Means we don't have a bound property listener
- }
-
- getMethod = findMethodWithPrefix("get");
- try {
- setMethod = findMethodWithPrefix("set");
- } catch (NoSuchMethodException nsme) {
- logger.error("Unable to find set method", nsme);
- editable = false;
- }
- propertyType = getPropertyType(target, propertyName);
- }
-
- /**
- * Attempts to create and bind a property change listener to the target
- * bean, failing silently if the bean doesn't implement the appropriate
- * methods
- */
- private synchronized void setUpPropertyListener() {
- if (propertyListener == null) {
- Method addListener = null;
- try {
- addListener = target.getClass().getMethod(
- "addPropertyChangeListener", String.class,
- PropertyChangeListener.class);
- } catch (NoSuchMethodException nsme) {
- return;
- }
- propertyListener = new PropertyChangeListener() {
- public void propertyChange(PropertyChangeEvent evt) {
- Object newValue = evt.getNewValue();
- if (currentObjectValue == null
- || (newValue != currentObjectValue && !newValue
- .equals(currentObjectValue))) {
- // System.out.println("Property change, source was "+evt.getSource());
- if (SwingUtilities.isEventDispatchThread()) {
- updateComponent();
- } else {
- // try {
- SwingUtilities.invokeLater(new Runnable() {
- public void run() {
- updateComponent();
- }
- });
- }
- }
- }
- };
- try {
- addListener.invoke(target, propertyName, propertyListener);
- } catch (IllegalArgumentException e) {
- logger.error("Unable to set up property listener", e);
- } catch (IllegalAccessException e) {
- logger.error("Unable to set up property listener", e);
- } catch (InvocationTargetException e) {
- logger.error("Unable to set up property listener", e);
- }
- }
- }
-
- /**
- * If the property listener for bound properties exists then this method
- * unregisters it from the target, attempting to use a variety of the
- * standard method names to do so
- */
- private synchronized void tearDownPropertyListener() {
- if (propertyListener == null) {
- return;
- }
- try {
- Method removeListener = null;
- try {
- removeListener = target.getClass().getMethod(
- "removePropertyChangeListener", String.class,
- PropertyChangeListener.class);
- removeListener.invoke(target, propertyName, propertyListener);
- } catch (NoSuchMethodException nsme) {
- try {
- removeListener = target.getClass().getMethod(
- "removePropertyChangeListener",
- PropertyChangeListener.class);
- removeListener.invoke(target, propertyListener);
- } catch (NoSuchMethodException nsme2) {
- return;
- }
- }
- } catch (IllegalArgumentException e) {
- logger.error("Unable to remove property listener", e);
- } catch (IllegalAccessException e) {
- logger.error("Unable to remove property listener", e);
- } catch (InvocationTargetException e) {
- logger.error("Unable to remove property listener", e);
- }
- propertyListener = null;
- }
-
- /**
- * Called by the bound property listener, implementing components must
- * update their UI state in this method to match the value of the underlying
- * component. This method is always called in the AWT dispatch thread so
- * implementations can safely modify the state of UI components without
- * worrying about swing thread handling
- */
- protected abstract void updateComponent();
-
- /**
- * Adds the label to the component if labels are enabled
- */
- protected void addLabel() {
- if (useLabel) {
- String labelName = propertyName;
- if (getProperties().containsKey("name")) {
- labelName = getProperties().getProperty("name");
- }
- label = new JLabel(labelName);
- label.setOpaque(false);
- label.setPreferredSize(new Dimension(
- label.getPreferredSize().width, height));
- JPanel labelPanel = new JPanel();
- labelPanel.setOpaque(false);
- labelPanel.add(label);
- labelPanel.add(Box.createHorizontalStrut(5));
- add(labelPanel, BorderLayout.WEST);
- }
- }
-
- /**
- * Return the type of the property on the target object, trying to locate a
- * matching 'get' method for the supplied property name and returning the
- * class of that method's return type.
- * <p>
- * Attempts to, in order :
- * <ol>
- * <li>Call the method and get the concrete type of the returned value</li>
- * <li>Get the declared return type of the get method</li>
- * </ol>
- *
- * @param target
- * @param propertyName
- * @return
- * @throws NoSuchMethodException
- * if the get method can't be found for the given property name
- * on the target
- */
- public static Class<?> getPropertyType(Object target, String propertyName)
- throws NoSuchMethodException {
- Method getMethod = findMethodWithPrefix("get", target, propertyName);
- try {
- Object value = getMethod.invoke(target);
- if (value != null) {
- return value.getClass();
- }
- } catch (InvocationTargetException ite) {
- //
- } catch (IllegalArgumentException e) {
- //
- } catch (IllegalAccessException e) {
- //
- }
- // if (target instanceof ListHandler.ListItem) {
- // return ((ListHandler.ListItem) target).getTargetClass();
- // }
- return getMethod.getReturnType();
- }
-
- /**
- * Searches for the specified method on the target object, throwing an
- * exception if it can't be found. Searches for
- * target.[prefix][propertyname]()
- *
- * @throws NoSuchMethodException
- */
- static Method findMethodWithPrefix(String prefix, Object target,
- String propertyName) throws NoSuchMethodException {
- for (Method m : target.getClass().getMethods()) {
- if (m.getName().equalsIgnoreCase(prefix + propertyName)) {
- return m;
- }
- }
- throw new NoSuchMethodException("Can't find method matching '" + prefix
- + propertyName + "' in " + target.getClass().getCanonicalName());
- }
-
- /**
- * Calls the static findMethodWithPrefix passing in the property name and
- * the target assigned to this instance
- *
- * @param prefix
- * a string prefix to use when finding the name, searches for
- * [prefix][propertyname]()
- * @return a Method matching the query
- * @throws NoSuchMethodException
- * if the method can't be found.
- */
- protected final Method findMethodWithPrefix(String prefix)
- throws NoSuchMethodException {
- return findMethodWithPrefix(prefix, target, propertyName);
- }
-
- /**
- * Returns the toString value of the current bean property, or the empty
- * string if the get method returns null
- */
- protected final String getPropertyAsString() {
- Object value = getProperty();
- if (value == null) {
- return "";
- }
- currentObjectValue = value;
- return value.toString();
- }
-
- /**
- * Uses reflection to call the get[property name] method on the target bean
- * and returns the result
- *
- * @return current value of the bean property
- */
- protected final Object getProperty() {
- try {
- Object value = getMethod.invoke(target);
- return value;
- } catch (Exception ex) {
- logger.error("Unable to get property", ex);
- return null;
- }
- }
-
- /**
- * Sets the property on the object to the current object value for this UI
- * component, effectively pushing any changes into the underlying target
- * bean
- */
- protected final void setProperty() {
- if (currentValueValid && editable) {
- if (setMethod != null) {
- try {
- setMethod.invoke(target, currentObjectValue);
- } catch (IllegalArgumentException e) {
- logger.error("Unable to set property", e);
- } catch (IllegalAccessException e) {
- logger.error("Unable to set property", e);
- } catch (InvocationTargetException e) {
- logger.error("Unable to set property", e);
- }
- }
- }
- }
-
- /**
- * If using labels (as determined by the useLabel property) this sets the
- * preferred width of the label for this component
- *
- * @param newWidth
- * new label width in pixels
- */
- public void setLabelWidth(int newWidth) {
- if (useLabel) {
- label.setPreferredSize(new Dimension(newWidth, height));
- }
- }
-
- /**
- * If using labels (as determined by the useLabel property) this returns the
- * current preferred size of the label associated with this component
- *
- * @return label width in pixels
- */
- public int getLabelWidth() {
- if (useLabel) {
- return this.label.getPreferredSize().width;
- } else {
- return 0;
- }
- }
-
- /**
- * If using the label then set its text (foreground) colour
- *
- * @param colour
- */
- public void setLabelColour(Color colour) {
- if (useLabel) {
- this.label.setForeground(colour);
- }
- }
-
- /**
- * Get the properties object associated with this component. This is
- * generated from the configuration passed to UIBuilder
- *
- * @return a Properties object containing named properties applying to this
- * component in the UI
- */
- public Properties getProperties() {
- return this.properties;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/BeanEnumComboBox.java
----------------------------------------------------------------------
diff --git a/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/BeanEnumComboBox.java b/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/BeanEnumComboBox.java
deleted file mode 100644
index 34646a4..0000000
--- a/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/BeanEnumComboBox.java
+++ /dev/null
@@ -1,89 +0,0 @@
-package net.sf.taverna.t2.lang.uibuilder;
-
-import java.awt.BorderLayout;
-import java.awt.Dimension;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.util.Properties;
-
-import javax.swing.JComboBox;
-
-/**
- * Bean property editor for enumerated property types, rendering the enumeration
- * as a combo box
- *
- * @author Tom Oinn
- *
- */
-public class BeanEnumComboBox extends BeanComponent implements
- AlignableComponent {
-
- private static final long serialVersionUID = -6892016525599793149L;
-
- private Object[] possibleValues;
- private static int height = 24;
- private JComboBox value;
-
- public BeanEnumComboBox(Object target, String propertyName, Properties props)
- throws NoSuchMethodException {
- this(target, propertyName, true, props);
- }
-
- public BeanEnumComboBox(Object target, String propertyName,
- boolean useLabel, Properties props) throws NoSuchMethodException {
- super(target, propertyName, useLabel, props);
- setLayout(new BorderLayout());
- // Check that this is actually an enumeration type
- if (!propertyType.isEnum()) {
- throw new IllegalArgumentException(
- "Can't use BeanEnumComboBox on a non Enumeration property");
- }
- possibleValues = propertyType.getEnumConstants();
- value = new JComboBox(possibleValues) {
-
- private static final long serialVersionUID = -7712225463703816146L;
-
- @Override
- public Dimension getMinimumSize() {
- return new Dimension(super.getMinimumSize().width, height);
- }
-
- @Override
- public Dimension getPreferredSize() {
- return new Dimension(super.getPreferredSize().width, height);
- }
-
- @Override
- public Dimension getMaximumSize() {
- return new Dimension(super.getMaximumSize().width, height);
- }
- };
- value.setSelectedIndex(currentValueIndex());
- value.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- synchronized (this) {
- currentObjectValue = value.getSelectedItem();
- setProperty();
- }
- }
- });
- addLabel();
- add(value, BorderLayout.CENTER);
- }
-
- private int currentValueIndex() {
- Object currentValue = getProperty();
- for (int i = 0; i < possibleValues.length; i++) {
- if (currentValue.equals(possibleValues[i])) {
- return i;
- }
- }
- return -1;
- }
-
- @Override
- protected void updateComponent() {
- value.setSelectedIndex(currentValueIndex());
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/BeanTextArea.java
----------------------------------------------------------------------
diff --git a/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/BeanTextArea.java b/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/BeanTextArea.java
deleted file mode 100644
index 740a592..0000000
--- a/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/BeanTextArea.java
+++ /dev/null
@@ -1,89 +0,0 @@
-package net.sf.taverna.t2.lang.uibuilder;
-
-import java.awt.Dimension;
-import java.awt.KeyboardFocusManager;
-import java.util.HashSet;
-import java.util.Properties;
-import java.util.Set;
-
-import javax.swing.KeyStroke;
-import javax.swing.UIManager;
-import javax.swing.text.JTextComponent;
-
-import net.sf.taverna.t2.lang.ui.DialogTextArea;
-
-/**
- * Bean editor based on a DialogTextArea for use with longer strings such as
- * descriptions. Supports the 'nofilter' property, if this is not specified then
- * the text inserted initially (but not on subsequent events such as property
- * change messages) will be filtered to remove multiple whitespace elements,
- * replacing them with spaces, and to trim leading and trailing whitespace.
- *
- * @author Tom Oinn
- *
- */
-public class BeanTextArea extends BeanTextComponent implements
- AlignableComponent {
-
- private static final long serialVersionUID = 6418526320837944375L;
- boolean initialized = false;
-
- public BeanTextArea(Object target, String propertyName, Properties props)
- throws NoSuchMethodException {
- super(target, propertyName, props);
- initialized = true;
- }
-
- @SuppressWarnings( { "serial", "unchecked" })
- @Override
- protected JTextComponent getTextComponent() {
- DialogTextArea result = new DialogTextArea() {
- @Override
- public void setText(String text) {
- if (!initialized && !getProperties().containsKey("nofilter")) {
- super.setText(text.replaceAll("[ \\t\\n\\x0B\\f\\r]+", " ")
- .trim());
- } else {
- super.setText(text);
- }
- }
-
- @Override
- public Dimension getPreferredSize() {
- return new Dimension(0, super.getPreferredSize().height);
- }
-
- @Override
- public Dimension getMinimumSize() {
- return new Dimension(0, super.getPreferredSize().height);
- }
- };
- // Fix to add borders to DialogTextArea on old look and feel implementations,
- // the new one (Nimbus) already has this
- if (!UIManager.getLookAndFeel().getName().equals("Nimbus")) {
- result.setBorder(UIManager.getBorder("TextField.border"));
- result.setFont(UIManager.getFont("TextField.font"));
- }
- // Change tab behaviour to allow tab to move to the next field - this
- // effectively prevents a tab being placed in the text area but hey, we
- // don't really want people doing that anyway in these cases.
- Set set = new HashSet(
- result
- .getFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS));
- set.add(KeyStroke.getKeyStroke("TAB"));
- result.setFocusTraversalKeys(
- KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, set);
-
- set = new HashSet(
- result
- .getFocusTraversalKeys(KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS));
- set.add(KeyStroke.getKeyStroke("shift TAB"));
- result.setFocusTraversalKeys(
- KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, set);
-
- result.setLineWrap(true);
- result.setWrapStyleWord(true);
- return result;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/BeanTextComponent.java
----------------------------------------------------------------------
diff --git a/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/BeanTextComponent.java b/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/BeanTextComponent.java
deleted file mode 100644
index 791f1a8..0000000
--- a/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/BeanTextComponent.java
+++ /dev/null
@@ -1,174 +0,0 @@
-package net.sf.taverna.t2.lang.uibuilder;
-
-import java.awt.BorderLayout;
-import java.awt.event.FocusEvent;
-import java.awt.event.FocusListener;
-import java.lang.reflect.Constructor;
-import java.util.Properties;
-
-import javax.swing.event.DocumentEvent;
-import javax.swing.event.DocumentListener;
-import javax.swing.text.JTextComponent;
-
-/**
- * Abstract superclass for all bean property editors based on text components
- *
- * @author Tom Oinn
- */
-public abstract class BeanTextComponent extends BeanComponent {
-
- private static final long serialVersionUID = -9133735782847457090L;
- private String regex = null;
- private JTextComponent text;
- private String originalValue = null;
- private boolean edited = false;
-
- protected BeanTextComponent(Object target, String propertyName,
- Properties props) throws NoSuchMethodException {
- this(target, propertyName, true, props);
- }
-
- protected BeanTextComponent(Object target, String propertyName,
- boolean useLabel, Properties props) throws NoSuchMethodException {
- super(target, propertyName, useLabel, props);
- setLayout(new BorderLayout());
- if (propertyType.equals(Boolean.class)) {
- setRegex("\\A((true)|(false))\\Z");
- } else if (propertyType.equals(Character.class)) {
- setRegex("\\A.\\Z");
- }
- text = getTextComponent();
- originalValue = getPropertyAsString();
- text.setText(originalValue);
- text.setEditable(editable);
- add(text, BorderLayout.CENTER);
- if (editable) {
- text.getDocument().addDocumentListener(new DocumentListener() {
- public void changedUpdate(DocumentEvent e) {
- valueChangedInEditor();
- }
-
- public void insertUpdate(DocumentEvent e) {
- valueChangedInEditor();
- }
-
- public void removeUpdate(DocumentEvent e) {
- valueChangedInEditor();
- }
-
- private void valueChangedInEditor() {
- BeanTextComponent.this.valueChangedInEditor();
- }
- });
- text.addFocusListener(new FocusListener() {
- public void focusGained(FocusEvent e) {
- //
- }
-
- public void focusLost(FocusEvent e) {
- // System.out.println("Focus lost : valid = "
- // + currentValueValid);
- if (currentValueValid) {
- if (isEdited()) {
- BeanTextComponent.this.setProperty();
- originalValue = text.getText();
- }
- } else {
- originalValue = getPropertyAsString();
- text.setText(originalValue);
- }
- setEdited(false);
- }
-
- });
- }
- addLabel();
- }
-
- private boolean isEdited() {
- return this.edited;
- }
-
- private void setEdited(boolean edited) {
- if (edited == this.edited) {
- return;
- }
- this.edited = edited;
- text.setBackground(edited ? editedColour : uneditedColour);
- if (!edited) {
- setValid(true);
- }
- }
-
- public void updateComponent() {
- originalValue = getPropertyAsString();
- text.setText(originalValue);
- setEdited(false);
- }
-
- private void valueChangedInEditor() {
- if (text.getText().equals(originalValue)) {
- setEdited(false);
- return;
- }
- setEdited(true);
- // Check for regex
- if (regex != null) {
- if (text.getText().matches(regex) == false) {
- // System.out.println(text.getText() + ".matches(" + regex
- // + ")==false");
- setValid(false);
- return;
- }
- }
- // Delegate to constructor for non-string classes
- if (!propertyType.equals(String.class)) {
- try {
- Constructor<?> cons = null;
- if (propertyType.equals(Character.class)
- && text.getText().length() > 0) {
- currentObjectValue = text.getText().toCharArray()[0];
- } else {
- cons = propertyType.getConstructor(String.class);
- currentObjectValue = cons.newInstance(text.getText());
- }
- } catch (Throwable t) {
- setValid(false);
- return;
- }
- } else {
- currentObjectValue = text.getText();
- }
- setValid(true);
- }
-
- private void setValid(final boolean valid) {
- if (valid == currentValueValid) {
- return;
- }
- currentValueValid = valid;
- text.setForeground(valid ? validColour : invalidColour);
- setLabelColour(valid ? validColour : invalidColour);
- text.repaint();
- }
-
- /**
- * Implement this to provide the actual UI component used to show the
- * content of the field. Done this way so you can choose what component to
- * use.
- *
- * @return
- */
- protected abstract JTextComponent getTextComponent();
-
- /**
- * Set the regular expression used to validate the contents of the text
- * field
- *
- * @param regex
- */
- public void setRegex(String regex) {
- this.regex = regex;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/BeanTextField.java
----------------------------------------------------------------------
diff --git a/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/BeanTextField.java b/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/BeanTextField.java
deleted file mode 100644
index 63ed107..0000000
--- a/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/BeanTextField.java
+++ /dev/null
@@ -1,60 +0,0 @@
-package net.sf.taverna.t2.lang.uibuilder;
-
-import java.awt.Dimension;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.util.Properties;
-
-import javax.swing.JTextField;
-import javax.swing.text.JTextComponent;
-
-/**
- * Bean field editor using a JTextField for short values
- *
- * @author Tom Oinn
- */
-public class BeanTextField extends BeanTextComponent implements
- AlignableComponent {
-
- private static final long serialVersionUID = 5968203948656812060L;
-
- public BeanTextField(Object target, String propertyName, boolean useLabel,
- Properties props) throws NoSuchMethodException {
- super(target, propertyName, useLabel, props);
- }
-
- public BeanTextField(Object target, String propertyName, Properties props)
- throws NoSuchMethodException {
- this(target, propertyName, true, props);
- }
-
- @SuppressWarnings("serial")
- @Override
- protected JTextComponent getTextComponent() {
- final JTextField result = new JTextField() {
-
- @Override
- public Dimension getMinimumSize() {
- return new Dimension(0, height);
- }
-
- @Override
- public Dimension getPreferredSize() {
- return new Dimension(0, height);
- }
-
- @Override
- public Dimension getMaximumSize() {
- return new Dimension(super.getMaximumSize().width, height);
- }
- };
- result.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- setProperty();
- result.transferFocus();
- }
- });
- return new JTextField();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/Icons.java
----------------------------------------------------------------------
diff --git a/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/Icons.java b/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/Icons.java
deleted file mode 100644
index b8fc58e..0000000
--- a/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/Icons.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package net.sf.taverna.t2.lang.uibuilder;
-
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.swing.ImageIcon;
-
-import org.apache.log4j.Logger;
-
-/**
- * Manage icons for the UIBuilder
- *
- * @author Tom Oinn
- *
- */
-public abstract class Icons {
-
- private static Logger logger = Logger
- .getLogger(Icons.class);
-
- private static Map<String, ImageIcon> icons;
-
- static {
- icons = new HashMap<String, ImageIcon>();
- }
-
- static synchronized ImageIcon getIcon(String iconName) {
- String iconNameLC = iconName.toLowerCase();
- if (!icons.containsKey(iconNameLC)) {
- try {
- URL iconURL = Icons.class.getResource(iconName + ".png");
- icons.put(iconNameLC, new ImageIcon(iconURL));
- } catch (Exception ex) {
- logger.error("Unable to get icon resource", ex);
- }
- }
- return icons.get(iconNameLC);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/ListHandler.java
----------------------------------------------------------------------
diff --git a/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/ListHandler.java b/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/ListHandler.java
deleted file mode 100644
index e7a2db8..0000000
--- a/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/ListHandler.java
+++ /dev/null
@@ -1,67 +0,0 @@
-package net.sf.taverna.t2.lang.uibuilder;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-
-/**
- * The list handler is used to allow the reflection based UI builder to handle
- * lists of non-bean value types such as String etc.
- *
- * @author Tom Oinn
- *
- */
-public class ListHandler extends
- ArrayList<ListHandler.ListItem> {
-
- private static Logger logger = Logger
- .getLogger(ListHandler.class);
-
- private static final long serialVersionUID = -1361470859975889856L;
-
- private List<Object> wrappedList;
-
- public ListHandler(List<Object> theList) {
- this.wrappedList = theList;
- for (Object o : wrappedList) {
- this.add(new ListItem(o));
- }
- }
-
- /**@Override
- public boolean add(ListHandler.ListItem newItem) {
- wrappedList.add((T) newItem.getValue());
- return super.add(newItem);
- }*/
-
- /**
- * Simple container class to handle list items, allowing them to present a
- * bean interface
- *
- * @author Tom Oinn
- *
- */
- class ListItem {
- Object value;
-
- public ListItem(Object o) {
- this.value = o;
- }
-
- public void setValue(Object o) {
- try {
- wrappedList.set(indexOf(this), o);
- this.value = o;
- }
- catch (Exception ex) {
- logger.error("Unable to set value", ex);
- }
- }
-
- public Object getValue() {
- return this.value;
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/RecursiveListComponent.java
----------------------------------------------------------------------
diff --git a/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/RecursiveListComponent.java b/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/RecursiveListComponent.java
deleted file mode 100644
index 7db727d..0000000
--- a/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/RecursiveListComponent.java
+++ /dev/null
@@ -1,98 +0,0 @@
-package net.sf.taverna.t2.lang.uibuilder;
-
-import java.awt.Component;
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
-import javax.swing.Box;
-import javax.swing.BoxLayout;
-import javax.swing.JComponent;
-import javax.swing.JPanel;
-import javax.swing.JSeparator;
-import javax.swing.SwingConstants;
-
-import net.sf.taverna.t2.lang.uibuilder.UIBuilder;
-
-/**
- * Handles lists where the elements in the list are beans with declared fields
- * in the UIBuilder configuration.
- *
- * @author Tom Oinn
- *
- */
-public class RecursiveListComponent extends AbstractListComponent {
-
- private static final long serialVersionUID = -3760308074241973969L;
-
- @SuppressWarnings("unchecked")
- public RecursiveListComponent(String fieldName, List theList,
- Properties props, Map<String, Properties> fieldProps,
- Class<?> newItemClass, List<String> subFields, String parent)
- throws NoSuchMethodException, IllegalArgumentException,
- IllegalAccessException, InvocationTargetException,
- ClassNotFoundException {
- super(fieldName, theList, props, fieldProps, newItemClass, subFields,
- parent);
- // TODO Auto-generated constructor stub
- }
-
- @SuppressWarnings("unchecked")
- @Override
- protected void addNewItemToList(Object o) throws IllegalArgumentException,
- NoSuchMethodException, IllegalAccessException,
- InvocationTargetException, ClassNotFoundException {
- getUnderlyingList().add(0, o);
- updateListContents();
- }
-
- @Override
- protected void deleteItemAtIndex(int index)
- throws IllegalArgumentException, NoSuchMethodException,
- IllegalAccessException, InvocationTargetException,
- ClassNotFoundException {
- getUnderlyingList().remove(index);
- updateListContents();
- }
-
- @Override
- protected List<JComponent> getListComponents()
- throws NoSuchMethodException, IllegalArgumentException,
- IllegalAccessException, InvocationTargetException,
- ClassNotFoundException {
- List<JComponent> result = new ArrayList<JComponent>();
- for (Object target : getUnderlyingList()) {
- JPanel listItem = new JPanel();
- listItem.setOpaque(false);
- listItem.setLayout(new BoxLayout(listItem, BoxLayout.PAGE_AXIS));
- UIBuilder.buildEditor(target, getSubFields(), getFieldProperties(),
- listItem, getParentFieldName());
- result.add(listItem);
- }
- return result;
- }
-
- @Override
- public List<Component> getSeparatorComponents() {
- List<Component> result = new ArrayList<Component>();
- result.add(Box.createVerticalStrut(3));
- result.add(new JSeparator(SwingConstants.HORIZONTAL));
- result.add(Box.createVerticalStrut(3));
- return result;
- }
-
- @SuppressWarnings("unchecked")
- @Override
- protected void itemMoved(int fromIndex, int toIndex)
- throws IllegalArgumentException, NoSuchMethodException,
- IllegalAccessException, InvocationTargetException,
- ClassNotFoundException {
- Object toMove = getUnderlyingList().remove(fromIndex);
- getUnderlyingList().add(toIndex, toMove);
- updateListContents();
-
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/UIBuilder.java
----------------------------------------------------------------------
diff --git a/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/UIBuilder.java b/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/UIBuilder.java
deleted file mode 100644
index 2501046..0000000
--- a/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/UIBuilder.java
+++ /dev/null
@@ -1,236 +0,0 @@
-package net.sf.taverna.t2.lang.uibuilder;
-
-import java.awt.BorderLayout;
-import java.awt.Container;
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
-import javax.swing.BorderFactory;
-import javax.swing.Box;
-import javax.swing.BoxLayout;
-import javax.swing.JPanel;
-
-/**
- * Static methods to build bean editor UIs through reflection and (minimal)
- * configuration
- *
- * @author Tom Oinn
- *
- */
-public abstract class UIBuilder {
-
- /**
- * Build an editor component for the specified target, the configuration
- * string determines which properties are exposed to the UI and whether to
- * drill into nested collections and composite bean types
- *
- * @param target
- * @param configuration
- * @return
- * @throws NoSuchMethodException
- * @throws InvocationTargetException
- * @throws IllegalAccessException
- * @throws IllegalArgumentException
- * @throws ClassNotFoundException
- */
- public static JPanel buildEditor(Object target, String configuration)
- throws UIConstructionException {
- String[] fields = configuration.split(";");
- return buildEditor(target, fields);
- }
-
- public static JPanel buildEditor(Object target, String[] fields)
- throws UIConstructionException {
- // Now go through the configuration...
- JPanel result = new JPanel();
- result.setLayout(new BorderLayout());
- JPanel contents = new JPanel();
- contents.setOpaque(false);
- contents.setLayout(new BoxLayout(contents, BoxLayout.PAGE_AXIS));
- List<String> fieldNames = new ArrayList<String>();
- Map<String, Properties> fieldProps = new HashMap<String, Properties>();
- for (String field : fields) {
- String fieldName = field.split(":")[0];
- fieldNames.add(fieldName);
- if (field.split(":").length > 1) {
- String propertiesString = field.split(":")[1];
- String[] props = propertiesString.split(",");
- if (props.length == 0) {
- props = new String[] { propertiesString };
- }
- Properties properties = new Properties();
- for (String prop : props) {
- if (prop.contains("=")) {
- String[] p = prop.split("=");
- properties.put(p[0], p[1]);
- } else {
- properties.put(prop, "true");
- }
- }
- fieldProps.put(fieldName, properties);
- }
- }
- try {
- buildEditor(target, fieldNames, fieldProps, contents, "");
- } catch (Exception ex) {
- throw new UIConstructionException(
- "Unable to construct UI from POJO", ex);
- }
- result.add(contents, BorderLayout.NORTH);
- result.add(Box.createVerticalGlue(), BorderLayout.CENTER);
- return result;
- }
-
- @SuppressWarnings("unchecked")
- static void buildEditor(Object target, List<String> fieldNames,
- Map<String, Properties> fieldProps, Container contents,
- String parent) throws NoSuchMethodException,
- IllegalArgumentException, IllegalAccessException,
- InvocationTargetException, ClassNotFoundException {
-
- // Get all top level fields to render in this pass
- List<String> activeFields = new ArrayList<String>();
- for (String field : fieldNames) {
- if (!field.contains(".")) {
- activeFields.add(field);
- }
- }
- // For each field generate the appropriate component
- for (String field : activeFields) {
-
- // Fetch the properties block for this field
- Properties props = getProperties(field, parent, fieldProps);
-
- // First check whether there are any subfields for this field, in
- // which case we need to treat it differently
- boolean simpleField = true;
- for (String subField : fieldNames) {
- if (!subField.equals(field) && subField.startsWith(field + ".")) {
- simpleField = false;
- break;
- }
- }
- List<String> subFields = new ArrayList<String>();
- // Create filtered list of the field names
- // to ensure that this is now the top level
- // field and recurse
- String newParent = field;
- if (!parent.equals("")) {
- newParent = parent + "." + field;
- }
- for (String f : fieldNames) {
- if (f.startsWith(field + ".")) {
- subFields.add(f.substring(field.length() + 1));
- }
- }
-
- // Secondly check whether this is a list
- boolean listField = false;
- Class<?> fieldType = BeanComponent.getPropertyType(target, field);
- if (List.class.isAssignableFrom(fieldType)) {
- listField = true;
- }
-
- // Now handle the four possible cases. If a non-list non-compound
- // field we have a terminator and can obtain an appropriate subclass
- // of BeanComponent to render it
- if (!listField) {
- // If a non-list non-compound field we have a terminator and can
- // obtain an appropriate subclass of BeanComponent to render it
- if (simpleField) {
- if (fieldType.isEnum()) {
- contents
- .add(new BeanEnumComboBox(target, field, props));
- } else if (Boolean.class.isAssignableFrom(fieldType)
- || boolean.class.isAssignableFrom(fieldType)) {
- contents.add(new BeanCheckBox(target, field, props));
- } else {
- if (props.get("type") != null) {
- if (props.get("type").equals("textarea")) {
- BeanTextArea bta = new BeanTextArea(target,
- field, props);
- contents.add(bta);
- } else {
- contents.add(new BeanTextField(target, field,
- props));
- }
- } else {
- contents
- .add(new BeanTextField(target, field, props));
- }
- }
- } else {
- Object value = BeanComponent.findMethodWithPrefix("get",
- target, field).invoke(target);
- if (value != null) {
- String displayName = field;
- if (props.containsKey("name")) {
- displayName = props.getProperty("name");
- }
- JPanel itemContainer = new JPanel();
- itemContainer.setOpaque(false);
- itemContainer.setBorder(BorderFactory
- .createTitledBorder(displayName));
- itemContainer.setLayout(new BoxLayout(itemContainer,
- BoxLayout.PAGE_AXIS));
- buildEditor(value, subFields, fieldProps,
- itemContainer, newParent);
- contents.add(itemContainer);
- }
- }
- } else {
- // Handle the case where this is a simple field (i.e. no
- // sub-fields defined) but is a list type. In this case we need
- // to build an appropriate wrapper list panel around this
- // returned list.
- List value = (List) BeanComponent.findMethodWithPrefix("get",
- target, field).invoke(target);
- // If the 'new' property is defined then fetch the Class object
- // to be used to instantiate new list items
- Class<?> newItemClass = null;
- if (props.containsKey("new")) {
- String newItemClassName = props.getProperty("new");
- newItemClass = target.getClass().getClassLoader()
- .loadClass(newItemClassName);
- }
- if (value != null) {
- if (simpleField) {
- contents.add(new WrappedListComponent(field, value,
- props, fieldProps, newItemClass, subFields,
- newParent));
- // contents.add(buildWrappedList(field, value, props,
- // newItemClass));
- } else {
- contents.add(new RecursiveListComponent(field, value,
- props, fieldProps, newItemClass, subFields,
- newParent));
- // contents.add(buildList(field, value, props,
- // fieldProps,
- // newItemClass, subFields, newParent));
- }
- }
- }
- }
- // Finally align any labels where appropriate
- Alignment.alignInContainer(contents);
- }
-
- private static Properties getProperties(String field, String parent,
- Map<String, Properties> props) {
- String fullName = parent;
- if (!parent.equals("")) {
- fullName = fullName + ".";
- }
- fullName = fullName + field;
- if (props.containsKey(fullName)) {
- return props.get(fullName);
- } else {
- return new Properties();
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/UIConstructionException.java
----------------------------------------------------------------------
diff --git a/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/UIConstructionException.java b/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/UIConstructionException.java
deleted file mode 100644
index 54167db..0000000
--- a/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/UIConstructionException.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package net.sf.taverna.t2.lang.uibuilder;
-
-/**
- * Used to wrap checked exceptions from the various reflection based UI
- * construction methods
- *
- * @author Tom Oinn
- */
-public class UIConstructionException extends RuntimeException {
-
- private static final long serialVersionUID = 3396809563793962316L;
-
- public UIConstructionException() {
- //
- }
-
- public UIConstructionException(String message) {
- super(message);
- }
-
- public UIConstructionException(Throwable cause) {
- super(cause);
- }
-
- public UIConstructionException(String message, Throwable cause) {
- super(message, cause);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/WrappedListComponent.java
----------------------------------------------------------------------
diff --git a/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/WrappedListComponent.java b/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/WrappedListComponent.java
deleted file mode 100644
index e44b036..0000000
--- a/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/WrappedListComponent.java
+++ /dev/null
@@ -1,105 +0,0 @@
-package net.sf.taverna.t2.lang.uibuilder;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
-import javax.swing.BoxLayout;
-import javax.swing.JComponent;
-import javax.swing.JPanel;
-
-/**
- * Models lists requiring use of the ListHandler helper class within the UI
- *
- * @author Tom Oinn
- */
-public class WrappedListComponent extends AbstractListComponent {
-
- private static final long serialVersionUID = -4457073442579747674L;
- private ListHandler lh = null;
-
- @SuppressWarnings("unchecked")
- public WrappedListComponent(String fieldName, List theList,
- Properties props, Map<String, Properties> fieldProps,
- Class<?> newItemClass, List<String> subFields, String parent)
- throws NoSuchMethodException, IllegalArgumentException,
- IllegalAccessException, InvocationTargetException,
- ClassNotFoundException {
- super(fieldName, theList, props, fieldProps, newItemClass, subFields,
- parent);
- }
-
- @SuppressWarnings("unchecked")
- @Override
- protected void addNewItemToList(Object o) throws IllegalArgumentException,
- NoSuchMethodException, IllegalAccessException,
- InvocationTargetException, ClassNotFoundException {
- // Keep lists in sync
- getListHandler();
- synchronized (lh) {
- getUnderlyingList().add(0, o);
- lh.add(0, lh.new ListItem(o));
- }
- updateListContents();
- }
-
- @Override
- protected void deleteItemAtIndex(int index)
- throws IllegalArgumentException, NoSuchMethodException,
- IllegalAccessException, InvocationTargetException,
- ClassNotFoundException {
- getListHandler();
- synchronized (lh) {
- getUnderlyingList().remove(index);
- lh.remove(index);
- }
- updateListContents();
- }
-
- @SuppressWarnings("unchecked")
- @Override
- protected void itemMoved(int fromIndex, int toIndex)
- throws IllegalArgumentException, NoSuchMethodException,
- IllegalAccessException, InvocationTargetException,
- ClassNotFoundException {
- getListHandler();
- synchronized (lh) {
- Object toMove = getUnderlyingList().remove(fromIndex);
- ListHandler.ListItem wrapperToMove = lh.remove(fromIndex);
- getUnderlyingList().add(toIndex, toMove);
- lh.add(toIndex, wrapperToMove);
- }
- updateListContents();
- }
-
- @Override
- protected List<JComponent> getListComponents() throws NoSuchMethodException {
- getListHandler();
- List<JComponent> result = new ArrayList<JComponent>();
- for (ListHandler.ListItem item : lh) {
- JPanel listItem = new JPanel();
- listItem.setOpaque(false);
- listItem.setLayout(new BoxLayout(listItem, BoxLayout.PAGE_AXIS));
- Class<?> itemClass = item.getValue().getClass();
- if (itemClass.isEnum()) {
- result.add(new BeanEnumComboBox(item, "value", false,
- new Properties()));
- } else {
- result.add(new BeanTextField(item, "value", false,
- new Properties()));
- }
- }
- return result;
- }
-
- @SuppressWarnings("unchecked")
- private ListHandler getListHandler() {
- if (this.lh == null) {
- lh = new ListHandler(getUnderlyingList());
- }
- return lh;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/package.html
----------------------------------------------------------------------
diff --git a/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/package.html b/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/package.html
deleted file mode 100644
index 7ee4684..0000000
--- a/uibuilder/src/main/java/net/sf/taverna/t2/lang/uibuilder/package.html
+++ /dev/null
@@ -1,4 +0,0 @@
-<body>
-Swing components to control and render the PluginManager and associated
-bean classes, most obviously PluginDescription
-</body>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/uibuilder/src/main/resources/net/sf/taverna/t2/lang/uibuilder/delete.png
----------------------------------------------------------------------
diff --git a/uibuilder/src/main/resources/net/sf/taverna/t2/lang/uibuilder/delete.png b/uibuilder/src/main/resources/net/sf/taverna/t2/lang/uibuilder/delete.png
deleted file mode 100644
index 4ad6a58..0000000
Binary files a/uibuilder/src/main/resources/net/sf/taverna/t2/lang/uibuilder/delete.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/uibuilder/src/main/resources/net/sf/taverna/t2/lang/uibuilder/down.png
----------------------------------------------------------------------
diff --git a/uibuilder/src/main/resources/net/sf/taverna/t2/lang/uibuilder/down.png b/uibuilder/src/main/resources/net/sf/taverna/t2/lang/uibuilder/down.png
deleted file mode 100644
index c7b2f03..0000000
Binary files a/uibuilder/src/main/resources/net/sf/taverna/t2/lang/uibuilder/down.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/uibuilder/src/main/resources/net/sf/taverna/t2/lang/uibuilder/new.png
----------------------------------------------------------------------
diff --git a/uibuilder/src/main/resources/net/sf/taverna/t2/lang/uibuilder/new.png b/uibuilder/src/main/resources/net/sf/taverna/t2/lang/uibuilder/new.png
deleted file mode 100644
index 7c437cf..0000000
Binary files a/uibuilder/src/main/resources/net/sf/taverna/t2/lang/uibuilder/new.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/uibuilder/src/main/resources/net/sf/taverna/t2/lang/uibuilder/up.png
----------------------------------------------------------------------
diff --git a/uibuilder/src/main/resources/net/sf/taverna/t2/lang/uibuilder/up.png b/uibuilder/src/main/resources/net/sf/taverna/t2/lang/uibuilder/up.png
deleted file mode 100644
index bace5c1..0000000
Binary files a/uibuilder/src/main/resources/net/sf/taverna/t2/lang/uibuilder/up.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/Application.java
----------------------------------------------------------------------
diff --git a/uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/Application.java b/uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/Application.java
deleted file mode 100644
index 3f90241..0000000
--- a/uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/Application.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package net.sf.taverna.t2.lang.uibuilder;
-
-import java.awt.Color;
-
-import javax.swing.JFrame;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.UIManager;
-import javax.swing.UnsupportedLookAndFeelException;
-
-import net.sf.taverna.t2.lang.uibuilder.UIBuilder;
-
-/**
- * Torture test for the UIBuilder, run this as an application
- *
- * @author Tom Oinn
- *
- */
-public class Application {
-
- private static final String NUMBUS = "com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel";
-
- public static void main(String[] args) throws ClassNotFoundException,
- InstantiationException, IllegalAccessException,
- UnsupportedLookAndFeelException {
- try {
- UIManager.setLookAndFeel(NUMBUS);
- } catch (ClassNotFoundException ex) {
- // ignore
- }
- Object bean = new TopLevelBean();
- JFrame win = new JFrame();
- JPanel contents = UIBuilder.buildEditor(bean, new String[] {
- "boundbean", "boundbean.string:type=textarea", "boundbean.url",
- "boundbean.uri",
- "boundbean.string:type=textarea", "boundbean.url",
- "enumeratedfield", "nest", "nest.list", "nest.list.list1",
- "nest.list.list2", "nest.list.list2.string",
- "nest.list.list2.url" });
- contents.setBackground(new Color(240, 230, 200));
- win.setContentPane(new JScrollPane(contents));
- win.setTitle("Bean test");
- win.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- win.pack();
- win.setVisible(true);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/Application2.java
----------------------------------------------------------------------
diff --git a/uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/Application2.java b/uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/Application2.java
deleted file mode 100644
index bf689c9..0000000
--- a/uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/Application2.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package net.sf.taverna.t2.lang.uibuilder;
-
-import java.awt.Color;
-
-import javax.swing.JFrame;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.UIManager;
-import javax.swing.UnsupportedLookAndFeelException;
-
-import net.sf.taverna.t2.lang.uibuilder.UIBuilder;
-
-/**
- * Torture test for the UIBuilder, run this as an application
- *
- * @author Tom Oinn
- *
- */
-public class Application2 {
-
- private static final String NUMBUS = "com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel";
-
- public static void main(String[] args) throws ClassNotFoundException,
- InstantiationException, IllegalAccessException,
- UnsupportedLookAndFeelException {
- try {
- UIManager.setLookAndFeel(NUMBUS);
- } catch (ClassNotFoundException ex) {
- // ignore
- }
- Object bean = new PrimitiveTypeBean();
- JFrame win = new JFrame();
- JPanel contents = UIBuilder.buildEditor(bean, new String[] {
- "intvalue", "shortValue", "longValue", "doubleValue",
- "booleanValue", "byteValue", "floatValue", "charValue" });
- contents.setBackground(new Color(240, 230, 200));
- win.setContentPane(new JScrollPane(contents));
- win.setTitle("Primitive type test");
- win.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- win.pack();
- win.setVisible(true);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/BeanWithBoundProps.java
----------------------------------------------------------------------
diff --git a/uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/BeanWithBoundProps.java b/uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/BeanWithBoundProps.java
deleted file mode 100644
index 3f91ea2..0000000
--- a/uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/BeanWithBoundProps.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package net.sf.taverna.t2.lang.uibuilder;
-
-import java.beans.PropertyChangeListener;
-import java.beans.PropertyChangeSupport;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URL;
-
-/**
- * Example bean with string and URL properties, both of which fire property
- * change events
- *
- * @author Tom Oinn
- *
- */
-public class BeanWithBoundProps {
-
- private String string = "Default value";
- private URL url;
- private PropertyChangeSupport pcs;
- private URI uri;
-
-
- public BeanWithBoundProps() {
- try {
- this.url = new URL("http://some.default.url");
- this.pcs = new PropertyChangeSupport(this);
- this.uri = URI.create("http://google.com/");
- } catch (MalformedURLException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-
- public void setUrl(URL url) {
- URL old = this.url;
- this.url = url;
- this.pcs.firePropertyChange("url", old, url);
- }
-
- public URL getUrl() {
- return url;
- }
-
-
-
- public void setString(String string) {
- String old = this.string;
- this.string = string;
- this.pcs.firePropertyChange("string", old, string);
- }
-
- public String getString() {
- return string;
- }
-
- public void addPropertyChangeListener(String propertyName,
- PropertyChangeListener l) {
- pcs.addPropertyChangeListener(propertyName, l);
- }
-
- public void removePropertyChangeListener(PropertyChangeListener l) {
- pcs.removePropertyChangeListener(l);
- }
-
- public void setUri(URI uri) {
- this.uri = uri;
- }
-
- public URI getUri() {
- return uri;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/BeanWithListProperties.java
----------------------------------------------------------------------
diff --git a/uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/BeanWithListProperties.java b/uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/BeanWithListProperties.java
deleted file mode 100644
index 90d7c6a..0000000
--- a/uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/BeanWithListProperties.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package net.sf.taverna.t2.lang.uibuilder;
-
-import java.util.List;
-import java.util.ArrayList;
-
-/**
- * Sample bean with a couple of list properties
- *
- * @author Tom Oinn
- *
- */
-public class BeanWithListProperties {
-
- private List<String> list1;
- private List<BeanWithBoundProps> list2;
-
- public BeanWithListProperties() {
- this.list1 = new ArrayList<String>();
- this.list2 = new ArrayList<BeanWithBoundProps>();
- list1.add("A list item");
- list1.add("Another item");
- for (int i = 0; i < 10; i++) {
- list2.add(new BeanWithBoundProps());
- }
- }
-
- public List<String> getList1() {
- return this.list1;
- }
-
- public List<BeanWithBoundProps> getList2() {
- return this.list2;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/fb641cfc/uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/BeanWithNestedList.java
----------------------------------------------------------------------
diff --git a/uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/BeanWithNestedList.java b/uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/BeanWithNestedList.java
deleted file mode 100644
index 231f068..0000000
--- a/uibuilder/src/test/java/net/sf/taverna/t2/lang/uibuilder/BeanWithNestedList.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package net.sf.taverna.t2.lang.uibuilder;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Simple bean with a list of the BeanWithListProperties to check nested list
- * management
- *
- * @author Tom Oinn
- *
- */
-public class BeanWithNestedList {
-
- private List<BeanWithListProperties> list;
-
- public BeanWithNestedList() {
- this.list = new ArrayList<BeanWithListProperties>();
- for (int i = 0; i < 3; i++) {
- list.add(new BeanWithListProperties());
- }
- }
-
- public List<BeanWithListProperties> getList() {
- return this.list;
- }
-
-}
[39/50] [abbrv] incubator-taverna-workbench git commit: taverna-*
Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/ui/src/main/java/net/sf/taverna/t2/lang/ui/LinePainter.java
----------------------------------------------------------------------
diff --git a/ui/src/main/java/net/sf/taverna/t2/lang/ui/LinePainter.java b/ui/src/main/java/net/sf/taverna/t2/lang/ui/LinePainter.java
deleted file mode 100644
index 0fb2926..0000000
--- a/ui/src/main/java/net/sf/taverna/t2/lang/ui/LinePainter.java
+++ /dev/null
@@ -1,163 +0,0 @@
-package net.sf.taverna.t2.lang.ui;
-
-import java.awt.*;
-import java.awt.event.*;
-import javax.swing.*;
-import javax.swing.event.*;
-import javax.swing.text.*;
-
-/*
- * Track the movement of the Caret by painting a background line at the
- * current caret position.
- *
- * Copied from http://www.camick.com/java/source/LinePainter.java
- *
- * Written by Rob Camick
- */
-public class LinePainter
- implements Highlighter.HighlightPainter, CaretListener, MouseListener, MouseMotionListener
-{
- private JTextComponent component;
-
- private Color color;
-
- private Rectangle lastView;
-
- /*
- * The line color will be calculated automatically by attempting
- * to make the current selection lighter by a factor of 1.2.
- *
- * @param component text component that requires background line painting
- */
- public LinePainter(JTextComponent component)
- {
- this(component, null);
- setLighter(component.getSelectionColor());
- }
-
- /*
- * Manually control the line color
- *
- * @param component text component that requires background line painting
- * @param color the color of the background line
- */
- public LinePainter(JTextComponent component, Color color)
- {
- this.component = component;
- setColor( color );
-
- // Add listeners so we know when to change highlighting
-
- component.addCaretListener( this );
- component.addMouseListener( this );
- component.addMouseMotionListener( this );
-
- // Turn highlighting on by adding a dummy highlight
-
- try
- {
- component.getHighlighter().addHighlight(0, 0, this);
- }
- catch(BadLocationException ble) {}
- }
-
- /*
- * You can reset the line color at any time
- *
- * @param color the color of the background line
- */
- public void setColor(Color color)
- {
- this.color = color;
- }
-
- /*
- * Calculate the line color by making the selection color lighter
- *
- * @return the color of the background line
- */
- public void setLighter(Color color)
- {
- int red = Math.min(255, (int)(color.getRed() * 1.2));
- int green = Math.min(255, (int)(color.getGreen() * 1.2));
- int blue = Math.min(255, (int)(color.getBlue() * 1.2));
- setColor(new Color(red, green, blue));
- }
-
- // Paint the background highlight
-
- public void paint(Graphics g, int p0, int p1, Shape bounds, JTextComponent c)
- {
- try
- {
- Rectangle r = c.modelToView(c.getCaretPosition());
- g.setColor( color );
- g.fillRect(0, r.y, c.getWidth(), r.height);
-
- if (lastView == null)
- lastView = r;
- }
- catch(BadLocationException ble) {System.out.println(ble);}
- }
-
- /*
- * Caret position has changed, remove the highlight
- */
- private void resetHighlight()
- {
- // Use invokeLater to make sure updates to the Document are completed,
- // otherwise Undo processing causes the modelToView method to loop.
-
- SwingUtilities.invokeLater(new Runnable()
- {
- public void run()
- {
- try
- {
- int offset = component.getCaretPosition();
- Rectangle currentView = component.modelToView(offset);
-
- if (lastView == null) {
- lastView = currentView;
- } else {
- // Remove the highlighting from the previously highlighted line
- if (lastView.y != currentView.y)
- {
- component.repaint(0, lastView.y, component.getWidth(), lastView.height);
- lastView = currentView;
- }
- }
- }
- catch(BadLocationException ble) {}
- }
- });
- }
-
- // Implement CaretListener
-
- public void caretUpdate(CaretEvent e)
- {
- resetHighlight();
- }
-
- // Implement MouseListener
-
- public void mousePressed(MouseEvent e)
- {
- resetHighlight();
- }
-
- public void mouseClicked(MouseEvent e) {}
- public void mouseEntered(MouseEvent e) {}
- public void mouseExited(MouseEvent e) {}
- public void mouseReleased(MouseEvent e) {}
-
- // Implement MouseMotionListener
-
- public void mouseDragged(MouseEvent e)
- {
- resetHighlight();
- }
-
- public void mouseMoved(MouseEvent e) {}
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/ui/src/main/java/net/sf/taverna/t2/lang/ui/LineWrappingTextArea.java
----------------------------------------------------------------------
diff --git a/ui/src/main/java/net/sf/taverna/t2/lang/ui/LineWrappingTextArea.java b/ui/src/main/java/net/sf/taverna/t2/lang/ui/LineWrappingTextArea.java
deleted file mode 100644
index dde1566..0000000
--- a/ui/src/main/java/net/sf/taverna/t2/lang/ui/LineWrappingTextArea.java
+++ /dev/null
@@ -1,217 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.lang.ui;
-
-import java.awt.Component;
-import java.awt.Font;
-import java.awt.FontMetrics;
-import java.text.BreakIterator;
-import java.util.ArrayList;
-
-import javax.swing.JScrollPane;
-import javax.swing.JTextArea;
-
-/**
- * A JTextArea whose text can be line wrapped either
- * based on the size of the scroll pane that holds the text area or by a given
- * line width in characters.
- *
- * @author Alex Nenadic
- *
- */
-@SuppressWarnings("serial")
-public class LineWrappingTextArea extends JTextArea{
-
- String originalText;
- String[] wrappedLines;
- int lineWidth;
-
- final FontMetrics fontMetrics;
-
- public LineWrappingTextArea(String text){
- super(text);
- setFont(new Font("Monospaced", Font.PLAIN,12));
- fontMetrics = this.getFontMetrics(this.getFont());
- setCaretPosition(0);
- originalText = text;
- }
-
- /**
- * Based on:
- * @author Robert Hanson
- * http://progcookbook.blogspot.com/2006/02/text-wrapping-function-for-java.html
- *
- * This function takes a string value and a line length, and returns an array of
- * lines. Lines are cut on word boundaries, where the word boundary is a space
- * character. Spaces are included as the last character of a word, so most lines
- * will actually end with a space. This isn't too problematic, but will cause a
- * word to wrap if that space pushes it past the max line length.
- *
- * This is a modified version - added various word boundaries based on Java's word's
- * BreakIterator in addition to simply space character as in the original function.
- *
- *
- */
- private String [] wrapTextIntoLines (String text, int len)
- {
- // BreakIterator will take care of word boundary characters for us
- BreakIterator wordIterator = BreakIterator.getWordInstance();
- wordIterator.setText(text);
-
- // return empty array for null text
- if (text == null)
- return new String[] {};
-
- // return text if len is zero or less
- if (len <= 0)
- return new String[] { text };
-
- // return text if less than length
- if (text.length() <= len)
- return new String[] { text };
-
- //char[] chars = text.toCharArray(); // no need to copy the text once again
- ArrayList<String> lines = new ArrayList<String>();
- StringBuffer line = new StringBuffer();
- StringBuffer word = new StringBuffer();
-
- for (int i = 0; i < text.length(); i++) {
- //for (int i = 0; i < chars.length; i++) {
- word.append(text.charAt(i));
- //word.append(chars[i]);
-
- if (wordIterator.isBoundary(i)){ // is this character a word boundary?
- //if (chars[i] == ' ') {
- if ((line.length() + word.length()) > len) {
- lines.add(line.toString());
- line.delete(0, line.length());
- }
-
- line.append(word);
- word.delete(0, word.length());
- }
- }
-
- // handle any extra chars in current word
- if (word.length() > 0) {
- if ((line.length() + word.length()) > len) {
- lines.add(line.toString());
- line.delete(0, line.length());
- }
- line.append(word);
- }
-
- // handle extra line
- if (line.length() > 0) {
- lines.add(line.toString());
- }
-
- String[] ret = new String[lines.size()];
- int c = 0; // counter
- for (String line2 : lines) {
- ret[c++] = line2;
- }
-
- return ret;
- }
-
- public void wrapText() {
- // Figure out how many characters to leave in one line
- // Based on the size of JTextArea on the screen and font
- // size - modified from
- // http://www.coderanch.com/t/517006/GUI/java/Visible-column-row-count-JTextArea
-
- // Get width of any char (font is monospaced)
- final int charWidth = fontMetrics.charWidth('M');
- // Get the width of the visible viewport of the scroll pane
- // that contains the lot - loop until such a scroll pane is found
- JScrollPane scrollPane = null;
- Component currentComponent = getParent();
- while (true) {
- if (currentComponent == null) {
- break;
- }
- if (currentComponent instanceof JScrollPane) {
- scrollPane = (JScrollPane) currentComponent;
- break;
- } else {
- currentComponent = currentComponent.getParent();
- }
- }
- int prefWidth;
- int maxChars;
- if (scrollPane == null) { // We did not find the parent scroll pane
- maxChars = 80; // wrap into lines of 80 characters
- } else {
- prefWidth = scrollPane.getVisibleRect().width;
-// if (scrollPane.getVerticalScrollBar().isVisible()){
-// prefWidth = prefWidth - scrollPane.getVerticalScrollBar().getWidth();
-// }
- maxChars = prefWidth / charWidth - 3; // -3 because there is some
- // space between the text
- // area and the edge of
- // scroll pane so just to be sure
- }
-
- // If we have not wrapped lines before or the
- // width of the textarea has changed
- if (wrappedLines == null || lineWidth != maxChars) {
- lineWidth = maxChars;
- wrappedLines = wrapTextIntoLines(getText(), lineWidth);
- }
-
- if (wrappedLines.length >= 1) {
- setText(""); // clear the text area
- StringBuffer buff = new StringBuffer();
- for (int i = 0; i < wrappedLines.length; i++) {
- buff.append(wrappedLines[i] + "\n");
- }
- // Remove the last \n
- setText(buff.substring(0, buff.length()-1));
- repaint();
- }
- }
-
- public void wrapText(int numCharactersPerLine){
- // If we have not wrapped lines before or the
- // number of characters per line has changed since last
- // we wrapped
- if (wrappedLines == null || lineWidth != numCharactersPerLine) {
- lineWidth = numCharactersPerLine;
- wrappedLines = wrapTextIntoLines(getText(), lineWidth);
- }
-
- if (wrappedLines.length >= 1) {
- setText(""); // clear the text area
- for (int i = 0; i < wrappedLines.length; i++) {
- append(wrappedLines[i] + "\n");
- }
- repaint();
- }
-
- }
-
- public void unwrapText(){
- setText(originalText);
- repaint();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/ui/src/main/java/net/sf/taverna/t2/lang/ui/NoWrapEditorKit.java
----------------------------------------------------------------------
diff --git a/ui/src/main/java/net/sf/taverna/t2/lang/ui/NoWrapEditorKit.java b/ui/src/main/java/net/sf/taverna/t2/lang/ui/NoWrapEditorKit.java
deleted file mode 100644
index f032d67..0000000
--- a/ui/src/main/java/net/sf/taverna/t2/lang/ui/NoWrapEditorKit.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/**
- *
- */
-package net.sf.taverna.t2.lang.ui;
-
-import javax.swing.text.AbstractDocument;
-import javax.swing.text.BoxView;
-import javax.swing.text.ComponentView;
-import javax.swing.text.Element;
-import javax.swing.text.IconView;
-import javax.swing.text.LabelView;
-import javax.swing.text.ParagraphView;
-import javax.swing.text.StyleConstants;
-import javax.swing.text.StyledEditorKit;
-import javax.swing.text.View;
-import javax.swing.text.ViewFactory;
-
-
-/**
- *
- * The following class is copied from http://forums.sun.com/thread.jspa?threadID=622683
- *
- */
-public class NoWrapEditorKit extends StyledEditorKit
-{
- public ViewFactory getViewFactory()
- {
- return new StyledViewFactory();
- }
-
- static class StyledViewFactory implements ViewFactory
- {
- public View create(Element elem)
- {
- String kind = elem.getName();
-
- if (kind != null)
- {
- if (kind.equals(AbstractDocument.ContentElementName))
- {
- return new LabelView(elem);
- }
- else if (kind.equals(AbstractDocument.ParagraphElementName))
- {
- return new ParagraphView(elem);
- }
- else if (kind.equals(AbstractDocument.SectionElementName))
- {
- return new NoWrapBoxView(elem, View.Y_AXIS);
- }
- else if (kind.equals(StyleConstants.ComponentElementName))
- {
- return new ComponentView(elem);
- }
- else if (kind.equals(StyleConstants.IconElementName))
- {
- return new IconView(elem);
- }
- }
-
- return new LabelView(elem);
- }
- }
-
- static class NoWrapBoxView extends BoxView {
- public NoWrapBoxView(Element elem, int axis) {
- super(elem, axis);
- }
-
- public void layout(int width, int height) {
- super.layout(32768, height);
- }
- public float getMinimumSpan(int axis) {
- return super.getPreferredSpan(axis);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/ui/src/main/java/net/sf/taverna/t2/lang/ui/ReadOnlyTextArea.java
----------------------------------------------------------------------
diff --git a/ui/src/main/java/net/sf/taverna/t2/lang/ui/ReadOnlyTextArea.java b/ui/src/main/java/net/sf/taverna/t2/lang/ui/ReadOnlyTextArea.java
deleted file mode 100644
index 0759605..0000000
--- a/ui/src/main/java/net/sf/taverna/t2/lang/ui/ReadOnlyTextArea.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- *
- */
-package net.sf.taverna.t2.lang.ui;
-
-import javax.swing.JTextArea;
-import javax.swing.text.Document;
-
-/**
- * @author alanrw
- *
- */
-public class ReadOnlyTextArea extends JTextArea {
-
- public ReadOnlyTextArea () {
- super();
- setFields();
- }
-
- public ReadOnlyTextArea(Document doc) {
- super(doc);
- setFields();
- }
-
- public ReadOnlyTextArea (Document doc, String text, int rows, int columns) {
- super(doc,text,rows,columns);
- setFields();
- }
-
- public ReadOnlyTextArea(int rows, int columns) {
- super(rows, columns);
- setFields();
- }
-
- public ReadOnlyTextArea(String text) {
- super(text);
- setFields();
- }
-
- public ReadOnlyTextArea(String text, int rows, int columns) {
- super(text, rows, columns);
- setFields();
- }
-
- private void setFields() {
- super.setEditable(false);
- super.setLineWrap(true);
- super.setWrapStyleWord(true);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/ui/src/main/java/net/sf/taverna/t2/lang/ui/SanitisingDocumentFilter.java
----------------------------------------------------------------------
diff --git a/ui/src/main/java/net/sf/taverna/t2/lang/ui/SanitisingDocumentFilter.java b/ui/src/main/java/net/sf/taverna/t2/lang/ui/SanitisingDocumentFilter.java
deleted file mode 100644
index 2a91e18..0000000
--- a/ui/src/main/java/net/sf/taverna/t2/lang/ui/SanitisingDocumentFilter.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/**
- *
- */
-package net.sf.taverna.t2.lang.ui;
-
-import java.util.regex.Pattern;
-
-import javax.swing.text.AbstractDocument;
-import javax.swing.text.AttributeSet;
-import javax.swing.text.BadLocationException;
-import javax.swing.text.Document;
-import javax.swing.text.DocumentFilter;
-import javax.swing.text.JTextComponent;
-
-/**
- * @author alanrw
- *
- */
-public class SanitisingDocumentFilter extends DocumentFilter {
-
- private static SanitisingDocumentFilter INSTANCE = new SanitisingDocumentFilter();
-
- private SanitisingDocumentFilter () {
- super();
- }
-
- public static void addFilterToComponent(JTextComponent c) {
- Document d = c.getDocument();
- if (d instanceof AbstractDocument) {
- ((AbstractDocument) d).setDocumentFilter(INSTANCE);
- }
- }
-
- public void insertString(DocumentFilter.FilterBypass fb, int offset, String string, AttributeSet attr) throws BadLocationException {
-
- fb.insertString(offset, sanitiseString(string), attr);
- }
-
- public void replace(DocumentFilter.FilterBypass fb, int offset, int length,
- String text, javax.swing.text.AttributeSet attr)
-
- throws BadLocationException {
- fb.replace(offset, length, sanitiseString(text), attr);
- }
-
- private static String sanitiseString(String text) {
- String result = text;
- if (Pattern.matches("\\w++", text) == false) {
- result = "";
- for (char c : text.toCharArray()) {
- if (Character.isLetterOrDigit(c) || c == '_') {
- result += c;
- } else {
- result += "_";
- }
- }
- }
- return result;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/ui/src/main/java/net/sf/taverna/t2/lang/ui/ShadedLabel.java
----------------------------------------------------------------------
diff --git a/ui/src/main/java/net/sf/taverna/t2/lang/ui/ShadedLabel.java b/ui/src/main/java/net/sf/taverna/t2/lang/ui/ShadedLabel.java
deleted file mode 100644
index 27ebe33..0000000
--- a/ui/src/main/java/net/sf/taverna/t2/lang/ui/ShadedLabel.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-/**
- * This file is a component of the Taverna project,
- * and is licensed under the GNU LGPL.
- * Copyright Tom Oinn, EMBL-EBI
- */
-package net.sf.taverna.t2.lang.ui;
-
-import java.awt.Color;
-import java.awt.FlowLayout;
-import java.awt.GradientPaint;
-import java.awt.Graphics;
-import java.awt.Graphics2D;
-import java.awt.Paint;
-
-import javax.swing.Box;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.SwingConstants;
-
-/**
- * A JLabel like component with a shaded background
- *
- * @author Tom Oinn
- */
-public class ShadedLabel extends JPanel {
-
- // If you change these, please make sure BLUE is really blue, etc.. :-)
-
- public static Color ORANGE = new Color(238, 206, 143);
-
- public static Color BLUE = new Color(213, 229, 246);
-
- public static Color GREEN = new Color(161, 198, 157);
-
- final JLabel label;
-
- Color colour;
-
- Color toColour = Color.WHITE;
-
- private String text;
-
- /**
- * Create a ShadedLabel blending from the specified colour to white (left to
- * right) and with the specified text.
- */
- public ShadedLabel(String text, Color colour) {
- this(text, colour, false);
- }
-
- /**
- * Create a ShadedLabel blending from the specified colour to either white
- * if halfShade is false or to a colour halfway between the specified colour
- * and white if true and with the specified text
- */
- public ShadedLabel(String text, Color colour, boolean halfShade) {
- super(new FlowLayout(FlowLayout.LEFT, 0, 3));
-
- if (halfShade) {
- toColour = halfShade(colour);
- }
- label = new JLabel("",
- SwingConstants.LEFT);
- setText(text);
- label.setOpaque(false);
- add(Box.createHorizontalStrut(5));
- add(label);
- add(Box.createHorizontalStrut(5));
- setOpaque(false);
- this.colour = colour;
- }
-
- public void setText(String text) {
- this.text = text;
- label.setText("<html><body><b>" + text + "</b></body></html>");
- invalidate();
- }
-
- public String getText() {
- return text;
- }
-
- @Override
- protected void paintComponent(Graphics g) {
- final int width = getWidth();
- final int height = getHeight();
- Graphics2D g2d = (Graphics2D) g;
- Paint oldPaint = g2d.getPaint();
- g2d.setPaint(new GradientPaint(0, 0, this.colour, width, height,
- toColour));
- g2d.fillRect(0, 0, width, height);
- g2d.setPaint(oldPaint);
- super.paintComponent(g);
- }
-
- public static Color halfShade(Color colour) {
- return new Color((colour.getRed() + 510) / 3,
- (colour.getGreen() + 510) / 3, (colour.getBlue() + 510) / 3);
- }
-
- @Override
- public boolean isFocusable() {
- return false;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/ui/src/main/java/net/sf/taverna/t2/lang/ui/TableMap.java
----------------------------------------------------------------------
diff --git a/ui/src/main/java/net/sf/taverna/t2/lang/ui/TableMap.java b/ui/src/main/java/net/sf/taverna/t2/lang/ui/TableMap.java
deleted file mode 100644
index dbef4c0..0000000
--- a/ui/src/main/java/net/sf/taverna/t2/lang/ui/TableMap.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/**
- *
- */
-package net.sf.taverna.t2.lang.ui;
-
-import javax.swing.table.AbstractTableModel;
-import javax.swing.table.TableModel;
-import javax.swing.event.TableModelListener;
-import javax.swing.event.TableModelEvent;
-
-/**
- * Copied from code found at http://www.informit.com/guides/content.aspx?g=java&seqNum=57
- *
- */
-public class TableMap extends AbstractTableModel implements TableModelListener {
- protected TableModel model;
-
- public TableModel getModel() {
- return model;
- }
-
- public void setModel(TableModel model) {
- this.model = model;
- model.addTableModelListener(this);
- }
-
- // By default, implement TableModel by forwarding all messages
- // to the model.
-
- public Object getValueAt(int aRow, int aColumn) {
- return model.getValueAt(aRow, aColumn);
- }
-
- public void setValueAt(Object aValue, int aRow, int aColumn) {
- model.setValueAt(aValue, aRow, aColumn);
- }
-
- public int getRowCount() {
- return (model == null) ? 0 : model.getRowCount();
- }
-
- public int getColumnCount() {
- return (model == null) ? 0 : model.getColumnCount();
- }
-
- public String getColumnName(int aColumn) {
- return model.getColumnName(aColumn);
- }
-
- public Class getColumnClass(int aColumn) {
- return model.getColumnClass(aColumn);
- }
-
- public boolean isCellEditable(int row, int column) {
- return model.isCellEditable(row, column);
- }
-
- public int transposeRow(int row) {
- return row;
- }
-
- //
- // Implementation of the TableModelListener interface,
- //
- // By default forward all events to all the listeners.
- public void tableChanged(TableModelEvent e) {
- fireTableChanged(e);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/ui/src/main/java/net/sf/taverna/t2/lang/ui/TableSorter.java
----------------------------------------------------------------------
diff --git a/ui/src/main/java/net/sf/taverna/t2/lang/ui/TableSorter.java b/ui/src/main/java/net/sf/taverna/t2/lang/ui/TableSorter.java
deleted file mode 100644
index 7c7083d..0000000
--- a/ui/src/main/java/net/sf/taverna/t2/lang/ui/TableSorter.java
+++ /dev/null
@@ -1,341 +0,0 @@
-/**
- *
- */
-package net.sf.taverna.t2.lang.ui;
-
-/**
- * Copied from code found at http://www.informit.com/guides/content.aspx?g=java&seqNum=57
- */
-
-import java.util.Date;
-import java.util.Vector;
-
-import javax.swing.table.TableModel;
-import javax.swing.event.TableModelEvent;
-
-//Imports for picking up mouse events from the JTable.
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.awt.event.InputEvent;
-import javax.swing.JTable;
-import javax.swing.table.JTableHeader;
-import javax.swing.table.TableColumnModel;
-
-public class TableSorter extends TableMap {
- int indexes[];
- Vector sortingColumns = new Vector();
- boolean ascending = true;
- int compares;
-
- public TableSorter() {
- indexes = new int[0]; // for consistency
- }
-
- public TableSorter(TableModel model) {
- setModel(model);
- }
-
- public void setModel(TableModel model) {
- super.setModel(model);
- reallocateIndexes();
- }
-
- public int compareRowsByColumn(int row1, int row2, int column) {
- Class type = model.getColumnClass(column);
- TableModel data = model;
-
- // Check for nulls.
-
- Object o1 = data.getValueAt(row1, column);
- Object o2 = data.getValueAt(row2, column);
-
- // If both values are null, return 0.
- if (o1 == null && o2 == null) {
- return 0;
- } else if (o1 == null) { // Define null less than everything.
- return -1;
- } else if (o2 == null) {
- return 1;
- }
-
- if (o1 instanceof Comparable) {
- return ((Comparable) o1).compareTo(o2);
- }
- /*
- * We copy all returned values from the getValue call in case an
- * optimised model is reusing one object to return many values. The
- * Number subclasses in the JDK are immutable and so will not be used in
- * this way but other subclasses of Number might want to do this to save
- * space and avoid unnecessary heap allocation.
- */
-
- if (type.getSuperclass() == java.lang.Number.class) {
- Number n1 = (Number) data.getValueAt(row1, column);
- double d1 = n1.doubleValue();
- Number n2 = (Number) data.getValueAt(row2, column);
- double d2 = n2.doubleValue();
-
- if (d1 < d2) {
- return -1;
- } else if (d1 > d2) {
- return 1;
- } else {
- return 0;
- }
- } else if (type == java.util.Date.class) {
- Date d1 = (Date) data.getValueAt(row1, column);
- long n1 = d1.getTime();
- Date d2 = (Date) data.getValueAt(row2, column);
- long n2 = d2.getTime();
-
- if (n1 < n2) {
- return -1;
- } else if (n1 > n2) {
- return 1;
- } else {
- return 0;
- }
- } else if (type == String.class) {
- String s1 = (String) data.getValueAt(row1, column);
- String s2 = (String) data.getValueAt(row2, column);
- int result = s1.compareTo(s2);
-
- if (result < 0) {
- return -1;
- } else if (result > 0) {
- return 1;
- } else {
- return 0;
- }
- } else if (type == Boolean.class) {
- Boolean bool1 = (Boolean) data.getValueAt(row1, column);
- boolean b1 = bool1.booleanValue();
- Boolean bool2 = (Boolean) data.getValueAt(row2, column);
- boolean b2 = bool2.booleanValue();
-
- if (b1 == b2) {
- return 0;
- } else if (b1) { // Define false < true
- return 1;
- } else {
- return -1;
- }
- } else {
- Object v1 = data.getValueAt(row1, column);
- String s1 = v1.toString();
- Object v2 = data.getValueAt(row2, column);
- String s2 = v2.toString();
- int result = s1.compareTo(s2);
-
- if (result < 0) {
- return -1;
- } else if (result > 0) {
- return 1;
- } else {
- return 0;
- }
- }
- }
-
- public int compare(int row1, int row2) {
- compares++;
- for (int level = 0; level < sortingColumns.size(); level++) {
- Integer column = (Integer) sortingColumns.elementAt(level);
- int result = compareRowsByColumn(row1, row2, column.intValue());
- if (result != 0) {
- return ascending ? result : -result;
- }
- }
- return 0;
- }
-
- public void reallocateIndexes() {
- int rowCount = model.getRowCount();
-
- // Set up a new array of indexes with the right number of elements
- // for the new data model.
- indexes = new int[rowCount];
-
- // Initialise with the identity mapping.
- for (int row = 0; row < rowCount; row++) {
- indexes[row] = row;
- }
- }
-
- public void tableChanged(TableModelEvent e) {
- // System.out.println("Sorter: tableChanged");
- reallocateIndexes();
-
- super.tableChanged(e);
- }
-
- public void checkModel() {
- if (indexes.length != model.getRowCount()) {
- System.err.println("Sorter not informed of a change in model.");
- }
- }
-
- public void sort(Object sender) {
- checkModel();
-
- compares = 0;
- // n2sort();
- // qsort(0, indexes.length-1);
- shuttlesort((int[]) indexes.clone(), indexes, 0, indexes.length);
- // System.out.println("Compares: "+compares);
- }
-
- public void n2sort() {
- for (int i = 0; i < getRowCount(); i++) {
- for (int j = i + 1; j < getRowCount(); j++) {
- if (compare(indexes[i], indexes[j]) == -1) {
- swap(i, j);
- }
- }
- }
- }
-
- // This is a home-grown implementation which we have not had time
- // to research - it may perform poorly in some circumstances. It
- // requires twice the space of an in-place algorithm and makes
- // NlogN assigments shuttling the values between the two
- // arrays. The number of compares appears to vary between N-1 and
- // NlogN depending on the initial order but the main reason for
- // using it here is that, unlike qsort, it is stable.
- public void shuttlesort(int from[], int to[], int low, int high) {
- if (high - low < 2) {
- return;
- }
- int middle = (low + high) / 2;
- shuttlesort(to, from, low, middle);
- shuttlesort(to, from, middle, high);
-
- int p = low;
- int q = middle;
-
- /*
- * This is an optional short-cut; at each recursive call, check to see
- * if the elements in this subset are already ordered. If so, no further
- * comparisons are needed; the sub-array can just be copied. The array
- * must be copied rather than assigned otherwise sister calls in the
- * recursion might get out of sinc. When the number of elements is three
- * they are partitioned so that the first set, [low, mid), has one
- * element and and the second, [mid, high), has two. We skip the
- * optimisation when the number of elements is three or less as the
- * first compare in the normal merge will produce the same sequence of
- * steps. This optimisation seems to be worthwhile for partially ordered
- * lists but some analysis is needed to find out how the performance
- * drops to Nlog(N) as the initial order diminishes - it may drop very
- * quickly.
- */
-
- if (high - low >= 4 && compare(from[middle - 1], from[middle]) <= 0) {
- for (int i = low; i < high; i++) {
- to[i] = from[i];
- }
- return;
- }
-
- // A normal merge.
-
- for (int i = low; i < high; i++) {
- if (q >= high || (p < middle && compare(from[p], from[q]) <= 0)) {
- to[i] = from[p++];
- } else {
- to[i] = from[q++];
- }
- }
- }
-
- public void swap(int i, int j) {
- int tmp = indexes[i];
- indexes[i] = indexes[j];
- indexes[j] = tmp;
- }
-
- // The mapping only affects the contents of the data rows.
- // Pass all requests to these rows through the mapping array: "indexes".
-
- public Object getValueAt(int aRow, int aColumn) {
- checkModel();
- return model.getValueAt(indexes[aRow], aColumn);
- }
-
- public void setValueAt(Object aValue, int aRow, int aColumn) {
- checkModel();
- model.setValueAt(aValue, indexes[aRow], aColumn);
- }
-
- public void sortByColumn(int column) {
- sortByColumn(column, true);
- }
-
- public void sortByColumn(int column, boolean ascending) {
- this.ascending = ascending;
- sortingColumns.removeAllElements();
- sortingColumns.addElement(new Integer(column));
- sort(this);
- super.tableChanged(new TableModelEvent(this));
- }
-
- private int lastSortedColumn = -1;
- private boolean lastAscending = false;
-
- public void sortColumn(JTable tableView, int column) {
- int currentlySelectedRow = tableView.getSelectedRow();
- int underlyingSelectedRow = -1;
- if (currentlySelectedRow != -1) {
- underlyingSelectedRow = transposeRow(currentlySelectedRow);
- }
- // System.out.println("Sorting ...");
- boolean ascendingColumn = true;
- if (lastSortedColumn == column) {
- ascendingColumn = !lastAscending;
- }
- lastSortedColumn = column;
- lastAscending = ascendingColumn;
- this.sortByColumn(column, ascendingColumn);
- if (underlyingSelectedRow != -1) {
- for (int row = 0; row < indexes.length; row++) {
- if (transposeRow(row) == underlyingSelectedRow) {
- tableView.setRowSelectionInterval(row, row);
- }
- }
- }
- }
-
- public void resort(JTable tableView) {
- if (lastSortedColumn != -1) {
- lastAscending = !lastAscending;
- sortColumn(tableView, lastSortedColumn);
- }
- }
-
- // There is no-where else to put this.
- // Add a mouse listener to the Table to trigger a table sort
- // when a column heading is clicked in the JTable.
- public void addMouseListenerToHeaderInTable(JTable table) {
- final TableSorter sorter = this;
- final JTable tableView = table;
- tableView.setColumnSelectionAllowed(false);
- MouseAdapter listMouseListener = new MouseAdapter() {
-
- private int lastClickedColumn = -1;
- private boolean lastAscending = false;
- public void mouseClicked(MouseEvent e) {
- TableColumnModel columnModel = tableView.getColumnModel();
- int viewColumn = columnModel.getColumnIndexAtX(e.getX());
- int column = tableView.convertColumnIndexToModel(viewColumn);
- if (e.getClickCount() == 1 && column != -1) {
- sortColumn(tableView, column);
- }
- }
- };
- JTableHeader th = tableView.getTableHeader();
- th.addMouseListener(listMouseListener);
- }
-
- public int transposeRow(int row) {
- return indexes[row];
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/ui/src/main/java/net/sf/taverna/t2/lang/ui/ValidatingUserInputDialog.java
----------------------------------------------------------------------
diff --git a/ui/src/main/java/net/sf/taverna/t2/lang/ui/ValidatingUserInputDialog.java b/ui/src/main/java/net/sf/taverna/t2/lang/ui/ValidatingUserInputDialog.java
deleted file mode 100644
index 005b4b4..0000000
--- a/ui/src/main/java/net/sf/taverna/t2/lang/ui/ValidatingUserInputDialog.java
+++ /dev/null
@@ -1,274 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.lang.ui;
-
-import java.awt.BorderLayout;
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Dimension;
-import java.awt.FlowLayout;
-import java.awt.Font;
-import java.awt.Insets;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.FocusAdapter;
-import java.awt.event.FocusEvent;
-import java.awt.event.KeyAdapter;
-import java.awt.event.KeyEvent;
-import java.util.Set;
-
-import javax.swing.JButton;
-import javax.swing.JDialog;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JTextArea;
-import javax.swing.border.EmptyBorder;
-import javax.swing.event.DocumentEvent;
-import javax.swing.event.DocumentListener;
-import javax.swing.text.JTextComponent;
-
-import net.sf.taverna.t2.lang.ui.icons.Icons;
-
-/**
- * A user input dialog that validates the input as the user is entering the
- * input and gives feedback on why the input is invalid.
- *
- * @author David Withers
- */
-public class ValidatingUserInputDialog extends JDialog {
-
- private static final long serialVersionUID = 1L;
-
- private String inputTitle;
-
- private JButton okButton;
-
- private JButton cancelButton;
-
- private JTextArea inputText;
-
- private JPanel inputPanel;
-
- private JLabel iconLabel;
-
- private boolean valid = true;
-
- private boolean result = false;
-
- /**
- * Constructs a new instance of ValidatingUserInputDialog.
- *
- * @param inputTitle
- * the title for the dialog.
- * @param inputMessage
- * the message describing what the user should input.
- */
- public ValidatingUserInputDialog(String inputTitle, JPanel inputPanel) {
- this.inputTitle = inputTitle;
- this.inputPanel = inputPanel;
- initialize();
- }
-
- /**
- * Adds a text component and the rules for a valid user entry.
- *
- * @param textComponent
- * the text component to validate
- * @param invalidInputs
- * a set of inputs that are not valid. This is typically a set of
- * already used identifiers to avoid name clashes. Can be an
- * empty set or null.
- * @param invalidInputsMessage
- * the message to display if the user enters a value that is in
- * invalidInputs.
- * @param inputRegularExpression
- * a regular expression that specifies a valid user input. Can be
- * null.
- * @param inputRegularExpressionMessage
- * the message to display if the user enters a value that doesn't
- * match the inputRegularExpression.
- */
- public void addTextComponentValidation(final JTextComponent textComponent,
- final String inputMessage, final Set<String> invalidInputs,
- final String invalidInputsMessage,
- final String inputRegularExpression,
- final String inputRegularExpressionMessage) {
- textComponent.getDocument().addDocumentListener(new DocumentListener() {
- public void changedUpdate(DocumentEvent e) {
- }
-
- public void insertUpdate(DocumentEvent e) {
- verify(textComponent.getText(), inputMessage, invalidInputs,
- invalidInputsMessage, inputRegularExpression,
- inputRegularExpressionMessage);
- }
-
- public void removeUpdate(DocumentEvent e) {
- verify(textComponent.getText(), inputMessage, invalidInputs,
- invalidInputsMessage, inputRegularExpression,
- inputRegularExpressionMessage);
- }
- });
- textComponent.addKeyListener(new KeyAdapter() {
- boolean okDown = false;
-
- public void keyPressed(KeyEvent e) {
- if (okButton.isEnabled() && e.getKeyCode() == KeyEvent.VK_ENTER) {
- okDown = true;
- }
- }
- public void keyReleased(KeyEvent e) {
- if (okDown && okButton.isEnabled() && e.getKeyCode() == KeyEvent.VK_ENTER) {
- okButton.doClick();
- }
- }
- });
- textComponent.addFocusListener(new FocusAdapter() {
- public void focusGained(FocusEvent e) {
- if (valid) {
- setMessage(inputMessage);
- }
- }
- });
- }
-
- /**
- * Adds a component and a message to display when the component is in focus.
- *
- * @param component
- * the component to add
- * @param message
- * the message to display when the component is in focus
- */
- public void addMessageComponent(Component component, final String message) {
- component.addFocusListener(new FocusAdapter() {
- public void focusGained(FocusEvent e) {
- if (valid) {
- setMessage(message);
- }
- }
- });
- }
-
- private void initialize() {
- setLayout(new BorderLayout());
-
- JPanel messagePanel = new JPanel(new BorderLayout());
- messagePanel.setBorder(new EmptyBorder(5, 5, 0, 0));
- messagePanel.setBackground(Color.WHITE);
-
- add(messagePanel, BorderLayout.NORTH);
-
- JLabel inputLabel = new JLabel(inputTitle);
- inputLabel.setBackground(Color.WHITE);
- Font baseFont = inputLabel.getFont();
- inputLabel.setFont(baseFont.deriveFont(Font.BOLD));
- messagePanel.add(inputLabel, BorderLayout.NORTH);
-
- inputText = new JTextArea();
- inputText.setMargin(new Insets(5, 10, 10, 10));
- inputText.setMinimumSize(new Dimension(0, 30));
- inputText.setFont(baseFont.deriveFont(11f));
- inputText.setEditable(false);
- inputText.setFocusable(false);
- messagePanel.add(inputText, BorderLayout.CENTER);
-
- iconLabel = new JLabel();
- messagePanel.add(iconLabel, BorderLayout.WEST);
-
- add(inputPanel, BorderLayout.CENTER);
-
- JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.TRAILING));
- add(buttonPanel, BorderLayout.SOUTH);
-
- okButton = new JButton("OK");
- okButton.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- result = valid;
- setVisible(false);
- }
- });
- okButton.setEnabled(false);
- buttonPanel.add(okButton);
-
- cancelButton = new JButton("Cancel");
- cancelButton.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- setVisible(false);
- }
- });
- buttonPanel.add(cancelButton);
-
- setModal(true);
- setDefaultCloseOperation(HIDE_ON_CLOSE);
- }
-
- public void setMessage(String message) {
- iconLabel.setIcon(null);
- inputText.setText(message);
- }
-
- public void setWarningMessage(String message) {
- iconLabel.setIcon(Icons.warningIcon);
- inputText.setText(message);
- }
-
- public void setErrorMessage(String message) {
- iconLabel.setIcon(Icons.severeIcon);
- inputText.setText(message);
- }
-
- private void verify(String text, String inputMessage,
- Set<String> invalidInputs, String invalidInputsMessage,
- String inputRegularExpression, String inputRegularExpressionMessage) {
- if (invalidInputs != null && invalidInputs.contains(text)) {
- setErrorMessage(invalidInputsMessage);
- valid = false;
- } else if (inputRegularExpression != null
- && !text.matches(inputRegularExpression)) {
- setErrorMessage(inputRegularExpressionMessage);
- valid = false;
- } else {
- setMessage(inputMessage);
- valid = true;
- }
- okButton.setEnabled(valid);
-// okButton.setSelected(valid);
- }
-
- /**
- * Show the dialog relative to the component. If the component is null then
- * the dialog is shown in the centre of the screen.
- *
- * Returns true if the user input is valid.
- *
- * @param component
- * the component that the dialog is shown relative to
- * @return true if the user input is valid
- */
- public boolean show(Component component) {
- setLocationRelativeTo(component);
- setVisible(true);
- dispose();
- return result;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/ui/src/main/java/net/sf/taverna/t2/lang/ui/icons/Icons.java
----------------------------------------------------------------------
diff --git a/ui/src/main/java/net/sf/taverna/t2/lang/ui/icons/Icons.java b/ui/src/main/java/net/sf/taverna/t2/lang/ui/icons/Icons.java
deleted file mode 100644
index 398b3f4..0000000
--- a/ui/src/main/java/net/sf/taverna/t2/lang/ui/icons/Icons.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.lang.ui.icons;
-
-import javax.swing.ImageIcon;
-
-import org.apache.log4j.Logger;
-
-public class Icons {
-
- private static Logger logger = Logger.getLogger(Icons.class);
-
-
-
- public static ImageIcon okIcon;
- public static ImageIcon severeIcon;
- public static ImageIcon warningIcon;
-
- static {
- try {
- Class c = Icons.class;
- okIcon = new ImageIcon(c.getResource("ok.png"));
- severeIcon = new ImageIcon(c.getResource("severe.png"));
- warningIcon = new ImageIcon(c.getResource("warning.png"));
-
- } catch (Exception ex) {
- logger.error("Unable to load standard icons", ex);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/ui/src/main/java/net/sf/taverna/t2/lang/ui/tabselector/ScrollController.java
----------------------------------------------------------------------
diff --git a/ui/src/main/java/net/sf/taverna/t2/lang/ui/tabselector/ScrollController.java b/ui/src/main/java/net/sf/taverna/t2/lang/ui/tabselector/ScrollController.java
deleted file mode 100644
index f7218a6..0000000
--- a/ui/src/main/java/net/sf/taverna/t2/lang/ui/tabselector/ScrollController.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2013 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.lang.ui.tabselector;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-import javax.swing.JButton;
-import javax.swing.JComponent;
-
-/**
- * Controls tab scrolling when there is not enough space to show all the tabs.
- *
- * @author David Withers
- */
-public class ScrollController {
-
- private int position;
- private final JButton scrollLeft;
- private final JButton scrollRight;
-
- public ScrollController(final JComponent component) {
- scrollLeft = new JButton("<");
- scrollRight = new JButton(">");
- scrollLeft.setOpaque(true);
- scrollRight.setOpaque(true);
- scrollLeft.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- increment();
- component.doLayout();
- }
- });
- scrollRight.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- decrement();
- component.doLayout();
- }
- });
- }
-
- public JButton getScrollLeft() {
- return scrollLeft;
- }
-
- public JButton getScrollRight() {
- return scrollRight;
- }
-
- public int getPosition() {
- return position;
- }
-
- public void reset() {
- position = 0;
- }
-
- public void increment() {
- position++;
- }
-
- public void decrement() {
- position--;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/ui/src/main/java/net/sf/taverna/t2/lang/ui/tabselector/Tab.java
----------------------------------------------------------------------
diff --git a/ui/src/main/java/net/sf/taverna/t2/lang/ui/tabselector/Tab.java b/ui/src/main/java/net/sf/taverna/t2/lang/ui/tabselector/Tab.java
deleted file mode 100644
index 3c40b42..0000000
--- a/ui/src/main/java/net/sf/taverna/t2/lang/ui/tabselector/Tab.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2012 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.lang.ui.tabselector;
-
-import java.awt.BasicStroke;
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.Graphics;
-import java.awt.Graphics2D;
-import java.awt.GridBagConstraints;
-import java.awt.GridBagLayout;
-import java.awt.Insets;
-import java.awt.RenderingHints;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-import javax.swing.Icon;
-import javax.swing.JButton;
-import javax.swing.JLabel;
-import javax.swing.JToggleButton;
-import javax.swing.plaf.basic.BasicButtonUI;
-
-/**
- * Tab button that includes a label and a close button.
- *
- * @author David Withers
- */
-public abstract class Tab<T> extends JToggleButton {
-
- private static final long serialVersionUID = 1L;
-
- public final static Color midGrey = new Color(160,160,160);
- public final static Color lightGrey = new Color(200,200,200);
-
- protected final T selection;
- private String name;
- private Icon icon;
- private JLabel label;
-
- public Tab(String name, T selection) {
- this(name, null, selection);
- }
-
- public Tab(String name, Icon icon, T selection) {
- this.name = name;
- this.icon = icon;
- this.selection = selection;
- initialise();
- }
-
- private void initialise() {
- setUI(new BasicButtonUI());
- setLayout(new GridBagLayout());
- setOpaque(false);
- setBackground(Color.red);
- setBorder(null);
-
- GridBagConstraints c = new GridBagConstraints();
-
- label = new JLabel(this.name);
- label.setIcon(icon);
- c.anchor = GridBagConstraints.WEST;
- c.fill = GridBagConstraints.BOTH;
- c.insets = new Insets(0, 5, 0, 5);
- c.weightx = 1;
- add(label, c);
-
- JButton button = new CloseWorkflowButton();
- c.fill = GridBagConstraints.NONE;
- c.insets = new Insets(0, 0, 0, 5);
- c.weightx = 0;
- add(button, c);
-
- addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- clickTabAction();
- }
- });
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- if (!this.name.equals(name)) {
- this.name = name;
- label.setText(name);
- repaint();
- }
- }
-
- public void setIcon(Icon icon) {
- label.setIcon(icon);
- repaint();
- }
-
- @Override
- public void updateUI() {
- // override to ignore UI update
- }
-
- @Override
- protected void paintComponent(Graphics g) {
- super.paintComponent(g);
- Graphics2D g2 = (Graphics2D) g.create();
- if (getModel().isPressed()) {
- g2.translate(1, 1);
- }
- if (!getModel().isSelected()) {
- g2.setColor(lightGrey);
- g2.fillRoundRect(1, 0, getWidth() - 3, getHeight() - 1, 4, 10);
- }
- g2.setColor(midGrey);
- g2.drawRoundRect(1, 0, getWidth() - 3, getHeight(), 4, 10);
- if (getModel().isSelected()) {
- g2.setColor(getParent().getBackground());
- g2.drawLine(1, getHeight() - 1, getWidth() - 2, getHeight() - 1);
- }
- g2.dispose();
- }
-
- protected abstract void clickTabAction();
-
- protected abstract void closeTabAction();
-
- @SuppressWarnings("serial")
- private class CloseWorkflowButton extends JButton {
-
- private final int size = 15;
- private final int border = 4;
-
- public CloseWorkflowButton() {
- setUI(new BasicButtonUI());
- setPreferredSize(new Dimension(size, size));
- setMinimumSize(new Dimension(size, size));
- setContentAreaFilled(false);
- setFocusable(false);
- setToolTipText("Close workflow");
-
- setRolloverEnabled(true);
- addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- closeTabAction();
- }
- });
- }
-
- @Override
- public void updateUI() {
- // override to ignore UI update
- }
-
- @Override
- protected void paintComponent(Graphics g) {
- super.paintComponent(g);
- Graphics2D g2 = (Graphics2D) g.create();
- // animate button press
- if (getModel().isPressed()) {
- g2.translate(1, 1);
- }
- g2.setColor(midGrey);
- if (getModel().isRollover()) {
- // draw armed button
- g2.fillRoundRect(0, 0, size - 1, size - 1, 4, 4);
- g2.setColor(Color.GRAY);
- g2.drawRoundRect(0, 0, size - 1, size - 1, 4, 4);
- g2.setColor(Color.RED);
- }
- // draw 'x'
- g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE);
- g2.setStroke(new BasicStroke(2.5f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_BEVEL));
- g2.drawLine(border, border, size - border, size - border);
- g2.drawLine(border, size - border, size - border, border);
- g2.dispose();
- }
-
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/ui/src/main/java/net/sf/taverna/t2/lang/ui/tabselector/TabLayout.java
----------------------------------------------------------------------
diff --git a/ui/src/main/java/net/sf/taverna/t2/lang/ui/tabselector/TabLayout.java b/ui/src/main/java/net/sf/taverna/t2/lang/ui/tabselector/TabLayout.java
deleted file mode 100644
index 2a12f0e..0000000
--- a/ui/src/main/java/net/sf/taverna/t2/lang/ui/tabselector/TabLayout.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2012 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.lang.ui.tabselector;
-
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.Dimension;
-import java.awt.Insets;
-import java.awt.LayoutManager;
-
-/**
- * LayoutManager for laying out tabs.
- * <p>
- * Tabs are made all the same width and prefer to be maximumTabWidth. If there is more than
- * preferred width available extra space is left blank. If there is not enough width for tabs to be
- * maximumTabWidth tab width is reduced until it reaches minimumTabWidth. If there is not enough
- * width to show tabs at minimumTabWidth scroll buttons are shows and tabs can be scrolled within
- * the available width.
- *
- * @author David Withers
- */
-public class TabLayout implements LayoutManager {
-
- public static final int DEFAULT_MINIMUM_TAB_WIDTH = 100;
- public static final int DEFAULT_MAXIMUM_TAB_WIDTH = 250;
- public static final int DEFAULT_TAB_HEIGHT = 22;
- public static final int DEFAULT_SCROLL_BUTTON_WIDTH = 22;
-
- private final int minimumTabWidth, maximumTabWidth, tabHeight, scrollButtonWidth;
- private final ScrollController scrollController;
-
- public TabLayout(ScrollController scrollController) {
- this(scrollController, DEFAULT_MINIMUM_TAB_WIDTH, DEFAULT_MAXIMUM_TAB_WIDTH,
- DEFAULT_TAB_HEIGHT, DEFAULT_SCROLL_BUTTON_WIDTH);
- }
-
- public TabLayout(ScrollController scrollController, int minimumTabWidth, int maximumTabWidth,
- int tabHeight, int scrollButtonWidth) {
- this.scrollController = scrollController;
- this.minimumTabWidth = minimumTabWidth;
- this.maximumTabWidth = maximumTabWidth;
- this.tabHeight = tabHeight;
- this.scrollButtonWidth = scrollButtonWidth;
- }
-
- @Override
- public void removeLayoutComponent(Component comp) {
- }
-
- @Override
- public void layoutContainer(Container parent) {
- Component[] components = parent.getComponents();
- int tabs = components.length - 2;
- if (tabs > 0) {
- Insets insets = parent.getInsets();
- int x = insets.left;
- int y = insets.top;
- int availableWidth = parent.getWidth() - insets.left - insets.right;
- int tabWidth = availableWidth / tabs;
- boolean showScrollButtons = false;
- if (tabWidth < minimumTabWidth) {
- tabWidth = minimumTabWidth;
- showScrollButtons = true;
- } else if (tabWidth > maximumTabWidth) {
- tabWidth = maximumTabWidth;
- }
- if (showScrollButtons) {
- scrollController.getScrollLeft().setLocation(x, y);
- scrollController.getScrollLeft().setSize(
- new Dimension(scrollButtonWidth, tabHeight));
- scrollController.getScrollLeft().setVisible(true);
- scrollController.getScrollLeft().setEnabled(shouldScrollLeft(tabs, availableWidth));
- x = x + scrollButtonWidth - (scrollController.getPosition() * minimumTabWidth);
- scrollController.getScrollRight()
- .setLocation(availableWidth - scrollButtonWidth, y);
- scrollController.getScrollRight().setSize(
- new Dimension(scrollButtonWidth, tabHeight));
- scrollController.getScrollRight().setVisible(true);
- scrollController.getScrollRight().setEnabled(scrollController.getPosition() > 0);
- } else {
- scrollController.getScrollLeft().setVisible(false);
- scrollController.getScrollRight().setVisible(false);
- scrollController.reset();
- }
- for (int i = 2; i < components.length; i++) {
- components[i].setLocation(x, y);
- components[i].setSize(new Dimension(tabWidth, tabHeight));
- x = x + tabWidth;
- }
- }
- }
-
- @Override
- public void addLayoutComponent(String name, Component comp) {
- }
-
- @Override
- public Dimension minimumLayoutSize(Container parent) {
- return calculateSize(parent.getInsets(), 2, minimumTabWidth);
- }
-
- @Override
- public Dimension preferredLayoutSize(Container parent) {
- return calculateSize(parent.getInsets(), parent.getComponents().length, maximumTabWidth);
- }
-
- private Dimension calculateSize(Insets insets, int tabs, int tabWidth) {
- int width = insets.left + insets.right + tabs * tabWidth;
- int height = insets.top + insets.bottom + tabHeight;
- return new Dimension(width, height);
- }
-
- private boolean shouldScrollLeft(int tabs, int availableWidth) {
- int tabsToShow = tabs - scrollController.getPosition();
- return (tabsToShow * minimumTabWidth) > (availableWidth - (scrollButtonWidth * 2));
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/ui/src/main/java/net/sf/taverna/t2/lang/ui/tabselector/TabSelectorComponent.java
----------------------------------------------------------------------
diff --git a/ui/src/main/java/net/sf/taverna/t2/lang/ui/tabselector/TabSelectorComponent.java b/ui/src/main/java/net/sf/taverna/t2/lang/ui/tabselector/TabSelectorComponent.java
deleted file mode 100644
index d09b6ec..0000000
--- a/ui/src/main/java/net/sf/taverna/t2/lang/ui/tabselector/TabSelectorComponent.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2012 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.lang.ui.tabselector;
-
-import java.awt.BorderLayout;
-import java.awt.Graphics;
-import java.awt.Graphics2D;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.swing.ButtonGroup;
-import javax.swing.JPanel;
-
-/**
- * Component for selecting objects using tabs.
- *
- * @author David Withers
- */
-public abstract class TabSelectorComponent<T> extends JPanel {
-
- private static final long serialVersionUID = 1L;
-
- private Map<T, Tab<T>> tabMap;
- private ButtonGroup tabGroup;
- private ScrollController scrollController;
-
- public TabSelectorComponent() {
- tabMap = new HashMap<T, Tab<T>>();
- tabGroup = new ButtonGroup();
- setLayout(new BorderLayout());
- scrollController = new ScrollController(this);
- add(scrollController.getScrollLeft());
- add(scrollController.getScrollRight());
- setLayout(new TabLayout(scrollController));
- }
-
- @Override
- protected void paintComponent(Graphics g) {
- super.paintComponent(g);
- Graphics2D g2 = (Graphics2D) g.create();
- g2.setColor(Tab.midGrey);
- g2.drawLine(0, getHeight() - 1, getWidth(), getHeight() - 1);
- g2.dispose();
- }
-
- protected abstract Tab<T> createTab(T object);
-
- public Tab<T> getTab(T object) {
- return tabMap.get(object);
- }
-
- public void addObject(T object) {
- Tab<T> button = createTab(object);
- tabMap.put(object, button);
- tabGroup.add(button);
- add(button);
- revalidate();
- repaint();
- button.setSelected(true);
- }
-
- public void removeObject(T object) {
- Tab<T> button = tabMap.remove(object);
- if (button != null) {
- tabGroup.remove(button);
- remove(button);
- revalidate();
- repaint();
- }
- }
-
- public void selectObject(T object) {
- Tab<T> button = tabMap.get(object);
- if (button != null) {
- button.setSelected(true);
- } else {
- addObject(object);
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/ui/src/main/java/net/sf/taverna/t2/lang/ui/treetable/AbstractCellEditor.java
----------------------------------------------------------------------
diff --git a/ui/src/main/java/net/sf/taverna/t2/lang/ui/treetable/AbstractCellEditor.java b/ui/src/main/java/net/sf/taverna/t2/lang/ui/treetable/AbstractCellEditor.java
deleted file mode 100644
index 63827bb..0000000
--- a/ui/src/main/java/net/sf/taverna/t2/lang/ui/treetable/AbstractCellEditor.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.lang.ui.treetable;
-
-import java.util.EventObject;
-
-import javax.swing.CellEditor;
-import javax.swing.event.CellEditorListener;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.EventListenerList;
-
-public class AbstractCellEditor implements CellEditor {
-
- protected EventListenerList listenerList = new EventListenerList();
-
- public Object getCellEditorValue() { return null; }
- public boolean isCellEditable(EventObject e) { return true; }
- public boolean shouldSelectCell(EventObject anEvent) { return false; }
- public boolean stopCellEditing() { return true; }
- public void cancelCellEditing() {}
-
- public void addCellEditorListener(CellEditorListener l) {
- listenerList.add(CellEditorListener.class, l);
- }
-
- public void removeCellEditorListener(CellEditorListener l) {
- listenerList.remove(CellEditorListener.class, l);
- }
-
- /*
- * Notify all listeners that have registered interest for
- * notification on this event type.
- * @see EventListenerList
- */
- protected void fireEditingStopped() {
- // Guaranteed to return a non-null array
- Object[] listeners = listenerList.getListenerList();
- // Process the listeners last to first, notifying
- // those that are interested in this event
- for (int i = listeners.length-2; i>=0; i-=2) {
- if (listeners[i]==CellEditorListener.class) {
- ((CellEditorListener)listeners[i+1]).editingStopped(new ChangeEvent(this));
- }
- }
- }
-
- /*
- * Notify all listeners that have registered interest for
- * notification on this event type.
- * @see EventListenerList
- */
- protected void fireEditingCanceled() {
- // Guaranteed to return a non-null array
- Object[] listeners = listenerList.getListenerList();
- // Process the listeners last to first, notifying
- // those that are interested in this event
- for (int i = listeners.length-2; i>=0; i-=2) {
- if (listeners[i]==CellEditorListener.class) {
- ((CellEditorListener)listeners[i+1]).editingCanceled(new ChangeEvent(this));
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/ui/src/main/java/net/sf/taverna/t2/lang/ui/treetable/AbstractTreeTableModel.java
----------------------------------------------------------------------
diff --git a/ui/src/main/java/net/sf/taverna/t2/lang/ui/treetable/AbstractTreeTableModel.java b/ui/src/main/java/net/sf/taverna/t2/lang/ui/treetable/AbstractTreeTableModel.java
deleted file mode 100644
index afec8f3..0000000
--- a/ui/src/main/java/net/sf/taverna/t2/lang/ui/treetable/AbstractTreeTableModel.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
- * @(#)AbstractTreeTableModel.java 1.2 98/10/27
- *
- * Copyright 1997, 1998 by Sun Microsystems, Inc.,
- * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
- * All rights reserved.
- *
- * This software is the confidential and proprietary information
- * of Sun Microsystems, Inc. ("Confidential Information"). You
- * shall not disclose such Confidential Information and shall use
- * it only in accordance with the terms of the license agreement
- * you entered into with Sun.
- */
-package net.sf.taverna.t2.lang.ui.treetable;
-
-import javax.swing.event.EventListenerList;
-import javax.swing.event.TreeModelEvent;
-import javax.swing.event.TreeModelListener;
-import javax.swing.tree.TreePath;
-
-/**
- * @version 1.2 10/27/98
- * An abstract implementation of the TreeTableModel interface, handling the list
- * of listeners.
- * @author Philip Milne
- */
-
-public abstract class AbstractTreeTableModel implements TreeTableModel {
- protected Object root;
- protected EventListenerList listenerList = new EventListenerList();
-
- public AbstractTreeTableModel(Object root) {
- this.root = root;
- }
-
- //
- // Default implementations for methods in the TreeModel interface.
- //
-
- public Object getRoot() {
- return root;
- }
-
- public boolean isLeaf(Object node) {
- return getChildCount(node) == 0;
- }
-
- public void valueForPathChanged(TreePath path, Object newValue) {}
-
- // This is not called in the JTree's default mode: use a naive implementation.
- public int getIndexOfChild(Object parent, Object child) {
- for (int i = 0; i < getChildCount(parent); i++) {
- if (getChild(parent, i).equals(child)) {
- return i;
- }
- }
- return -1;
- }
-
- public void addTreeModelListener(TreeModelListener l) {
- listenerList.add(TreeModelListener.class, l);
- }
-
- public void removeTreeModelListener(TreeModelListener l) {
- listenerList.remove(TreeModelListener.class, l);
- }
-
- /*
- * Notify all listeners that have registered interest for
- * notification on this event type. The event instance
- * is lazily created using the parameters passed into
- * the fire method.
- * @see EventListenerList
- */
- protected void fireTreeNodesChanged(Object source, Object[] path,
- int[] childIndices,
- Object[] children) {
- // Guaranteed to return a non-null array
- Object[] listeners = listenerList.getListenerList();
- TreeModelEvent e = null;
- // Process the listeners last to first, notifying
- // those that are interested in this event
- for (int i = listeners.length-2; i>=0; i-=2) {
- if (listeners[i]==TreeModelListener.class) {
- // Lazily create the event:
- if (e == null)
- e = new TreeModelEvent(source, path,
- childIndices, children);
- ((TreeModelListener)listeners[i+1]).treeNodesChanged(e);
- }
- }
- }
-
- /*
- * Notify all listeners that have registered interest for
- * notification on this event type. The event instance
- * is lazily created using the parameters passed into
- * the fire method.
- * @see EventListenerList
- */
- protected void fireTreeNodesInserted(Object source, Object[] path,
- int[] childIndices,
- Object[] children) {
- // Guaranteed to return a non-null array
- Object[] listeners = listenerList.getListenerList();
- TreeModelEvent e = null;
- // Process the listeners last to first, notifying
- // those that are interested in this event
- for (int i = listeners.length-2; i>=0; i-=2) {
- if (listeners[i]==TreeModelListener.class) {
- // Lazily create the event:
- if (e == null)
- e = new TreeModelEvent(source, path,
- childIndices, children);
- ((TreeModelListener)listeners[i+1]).treeNodesInserted(e);
- }
- }
- }
-
- /*
- * Notify all listeners that have registered interest for
- * notification on this event type. The event instance
- * is lazily created using the parameters passed into
- * the fire method.
- * @see EventListenerList
- */
- protected void fireTreeNodesRemoved(Object source, Object[] path,
- int[] childIndices,
- Object[] children) {
- // Guaranteed to return a non-null array
- Object[] listeners = listenerList.getListenerList();
- TreeModelEvent e = null;
- // Process the listeners last to first, notifying
- // those that are interested in this event
- for (int i = listeners.length-2; i>=0; i-=2) {
- if (listeners[i]==TreeModelListener.class) {
- // Lazily create the event:
- if (e == null)
- e = new TreeModelEvent(source, path,
- childIndices, children);
- ((TreeModelListener)listeners[i+1]).treeNodesRemoved(e);
- }
- }
- }
-
- /*
- * Notify all listeners that have registered interest for
- * notification on this event type. The event instance
- * is lazily created using the parameters passed into
- * the fire method.
- * @see EventListenerList
- */
- protected void fireTreeStructureChanged(Object source, Object[] path,
- int[] childIndices,
- Object[] children) {
- // Guaranteed to return a non-null array
- Object[] listeners = listenerList.getListenerList();
- TreeModelEvent e = null;
- // Process the listeners last to first, notifying
- // those that are interested in this event
- for (int i = listeners.length-2; i>=0; i-=2) {
- if (listeners[i]==TreeModelListener.class) {
- // Lazily create the event:
- if (e == null)
- e = new TreeModelEvent(source, path,
- childIndices, children);
- ((TreeModelListener)listeners[i+1]).treeStructureChanged(e);
- }
- }
- }
-
- //
- // Default impelmentations for methods in the TreeTableModel interface.
- //
-
- public Class getColumnClass(int column) { return Object.class; }
-
- /** By default, make the column with the Tree in it the only editable one.
- * Making this column editable causes the JTable to forward mouse
- * and keyboard events in the Tree column to the underlying JTree.
- */
- public boolean isCellEditable(Object node, int column) {
- return getColumnClass(column) == TreeTableModel.class;
- }
-
- public void setValueAt(Object aValue, Object node, int column) {}
-
-
- // Left to be implemented in the subclass:
-
- /*
- * public Object getChild(Object parent, int index)
- * public int getChildCount(Object parent)
- * public int getColumnCount()
- * public String getColumnName(Object node, int column)
- * public Object getValueAt(Object node, int column)
- */
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/ui/src/main/java/net/sf/taverna/t2/lang/ui/treetable/JTreeTable.LICENSE
----------------------------------------------------------------------
diff --git a/ui/src/main/java/net/sf/taverna/t2/lang/ui/treetable/JTreeTable.LICENSE b/ui/src/main/java/net/sf/taverna/t2/lang/ui/treetable/JTreeTable.LICENSE
deleted file mode 100644
index 7500c7a..0000000
--- a/ui/src/main/java/net/sf/taverna/t2/lang/ui/treetable/JTreeTable.LICENSE
+++ /dev/null
@@ -1,59 +0,0 @@
-The license below applies to the classes contained within the
-package net.sf.taverna.t2.lang.ui.treetable package. These classes have been taken
-from the Sun Developer Network tutorial on using JTree components within JTables. The URLs for the tutorials are as follows :
-
-http://java.sun.com/products/jfc/tsc/articles/treetable1/index.html
-http://java.sun.com/products/jfc/tsc/articles/treetable2/index.html
-http://java.sun.com/products/jfc/tsc/articles/bookmarks/index.html#editableJTreeTable
-
-The original web page form of this license is available at :
-
-http://developers.sun.com/license/berkeley_license.html?uid=6910008
-
-Tom Oinn, tmo@ebi.ac.uk, 23rd Feb 2004
-
--------------------------------------------------------------------------------------
-
-Code sample
-
-License
-
- Copyright 1994-2004 Sun Microsystems, Inc. All Rights Reserved.
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are
- met:
-
-
- 1 Redistribution of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
-
- 2 Redistribution in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
-
- Neither the name of Sun Microsystems, Inc. or the names of contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
-
- This software is provided "AS IS," without a warranty of any kind. ALL
- EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING
- ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
- OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN")
- AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE
- AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
- DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST
- REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL,
- INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE
- THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS
- SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-
-
-
- You acknowledge that this software is not designed, licensed or intended
- for use in the design, construction, operation or maintenance of any
- nuclear facility.
-
--------------------------------------------------------------------------------------
\ No newline at end of file
[35/50] [abbrv] incubator-taverna-workbench git commit: scufl2
dependencies updated
Posted by st...@apache.org.
scufl2 dependencies updated
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/commit/1e681443
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/tree/1e681443
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/diff/1e681443
Branch: refs/heads/master
Commit: 1e681443a3f827c46dc3d9d657d21adb0ce98e5a
Parents: c19de83
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Fri Mar 6 22:09:45 2015 +0000
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Fri Mar 6 22:09:45 2015 +0000
----------------------------------------------------------------------
taverna-dataflow-activity-ui/pom.xml | 2 +-
taverna-workbench-activity-icons-api/pom.xml | 2 +-
taverna-workbench-activity-palette-api/pom.xml | 2 +-
taverna-workbench-activity-tools/pom.xml | 2 +-
taverna-workbench-contextual-views-api/pom.xml | 2 +-
taverna-workbench-contextual-views-impl/pom.xml | 4 ++--
taverna-workbench-design-ui/pom.xml | 2 +-
taverna-workbench-edits-api/pom.xml | 2 +-
taverna-workbench-edits-impl/pom.xml | 4 ++--
taverna-workbench-file-api/pom.xml | 2 +-
taverna-workbench-file-impl/pom.xml | 12 ++++++------
taverna-workbench-graph-model/pom.xml | 2 +-
taverna-workbench-graph-view/pom.xml | 2 +-
taverna-workbench-report-api/pom.xml | 4 ++--
taverna-workbench-selection-api/pom.xml | 2 +-
taverna-workbench-workbench-impl/pom.xml | 4 ++--
taverna-workbench-workflow-explorer/pom.xml | 2 +-
taverna-workbench-workflow-view/pom.xml | 2 +-
18 files changed, 27 insertions(+), 27 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/1e681443/taverna-dataflow-activity-ui/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-dataflow-activity-ui/pom.xml b/taverna-dataflow-activity-ui/pom.xml
index 9153274..fc54db1 100644
--- a/taverna-dataflow-activity-ui/pom.xml
+++ b/taverna-dataflow-activity-ui/pom.xml
@@ -100,7 +100,7 @@
</dependency>
<!-- <dependency>
<groupId>org.apache.taverna.language</groupId>
- <artifactId>taverna-scufl2-t2flow</artifactId>
+ <artifactId>taverna-scufl2-wfbundle</artifactId>
<version>${taverna.language.version}</version>
<scope>test</scope>
</dependency> -->
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/1e681443/taverna-workbench-activity-icons-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-activity-icons-api/pom.xml b/taverna-workbench-activity-icons-api/pom.xml
index 6f73b2f..ec9114e 100644
--- a/taverna-workbench-activity-icons-api/pom.xml
+++ b/taverna-workbench-activity-icons-api/pom.xml
@@ -30,7 +30,7 @@
<dependencies>
<dependency>
<groupId>org.apache.taverna.language</groupId>
- <artifactId>scufl2-api</artifactId>
+ <artifactId>taverna-scufl2-api</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/1e681443/taverna-workbench-activity-palette-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-activity-palette-api/pom.xml b/taverna-workbench-activity-palette-api/pom.xml
index 1ba3c41..6f21df4 100644
--- a/taverna-workbench-activity-palette-api/pom.xml
+++ b/taverna-workbench-activity-palette-api/pom.xml
@@ -64,7 +64,7 @@
</dependency>
<dependency>
<groupId>org.apache.taverna.language</groupId>
- <artifactId>scufl2-api</artifactId>
+ <artifactId>taverna-scufl2-api</artifactId>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/1e681443/taverna-workbench-activity-tools/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-activity-tools/pom.xml b/taverna-workbench-activity-tools/pom.xml
index a3d9ded..9132ae1 100644
--- a/taverna-workbench-activity-tools/pom.xml
+++ b/taverna-workbench-activity-tools/pom.xml
@@ -40,7 +40,7 @@
</dependency>
<dependency>
<groupId>org.apache.taverna.language</groupId>
- <artifactId>scufl2-api</artifactId>
+ <artifactId>taverna-scufl2-api</artifactId>
</dependency>
</dependencies>
</project>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/1e681443/taverna-workbench-contextual-views-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-contextual-views-api/pom.xml b/taverna-workbench-contextual-views-api/pom.xml
index e396c15..3e772b4 100644
--- a/taverna-workbench-contextual-views-api/pom.xml
+++ b/taverna-workbench-contextual-views-api/pom.xml
@@ -74,7 +74,7 @@
</dependency>
<dependency>
<groupId>org.apache.taverna.language</groupId>
- <artifactId>scufl2-api</artifactId>
+ <artifactId>taverna-scufl2-api</artifactId>
</dependency>
<dependency>
<groupId>uk.org.taverna.commons</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/1e681443/taverna-workbench-contextual-views-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-contextual-views-impl/pom.xml b/taverna-workbench-contextual-views-impl/pom.xml
index bb078e4..dbb4e42 100644
--- a/taverna-workbench-contextual-views-impl/pom.xml
+++ b/taverna-workbench-contextual-views-impl/pom.xml
@@ -40,8 +40,8 @@
</dependency>
<dependency>
<groupId>org.apache.taverna.language</groupId>
- <artifactId>scufl2-api</artifactId>
- <version>${scufl2.version}</version>
+ <artifactId>taverna-scufl2-api</artifactId>
+ <version>${taverna.language.version}</version>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/1e681443/taverna-workbench-design-ui/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-design-ui/pom.xml b/taverna-workbench-design-ui/pom.xml
index 9046a52..e4a2cc8 100644
--- a/taverna-workbench-design-ui/pom.xml
+++ b/taverna-workbench-design-ui/pom.xml
@@ -54,7 +54,7 @@
</dependency>
<dependency>
<groupId>org.apache.taverna.language</groupId>
- <artifactId>scufl2-api</artifactId>
+ <artifactId>taverna-scufl2-api</artifactId>
</dependency>
</dependencies>
</project>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/1e681443/taverna-workbench-edits-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-edits-api/pom.xml b/taverna-workbench-edits-api/pom.xml
index 178b077..369eebd 100644
--- a/taverna-workbench-edits-api/pom.xml
+++ b/taverna-workbench-edits-api/pom.xml
@@ -30,7 +30,7 @@
<dependencies>
<dependency>
<groupId>org.apache.taverna.language</groupId>
- <artifactId>scufl2-api</artifactId>
+ <artifactId>taverna-scufl2-api</artifactId>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.lang</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/1e681443/taverna-workbench-edits-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-edits-impl/pom.xml b/taverna-workbench-edits-impl/pom.xml
index 0e3e072..8e3eb56 100644
--- a/taverna-workbench-edits-impl/pom.xml
+++ b/taverna-workbench-edits-impl/pom.xml
@@ -52,8 +52,8 @@
</dependency>
<dependency>
<groupId>org.apache.taverna.language</groupId>
- <artifactId>scufl2-api</artifactId>
- <version>${scufl2.version}</version>
+ <artifactId>taverna-scufl2-api</artifactId>
+ <version>${taverna.language.version}</version>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/1e681443/taverna-workbench-file-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-file-api/pom.xml b/taverna-workbench-file-api/pom.xml
index 197cabf..0a13ad5 100644
--- a/taverna-workbench-file-api/pom.xml
+++ b/taverna-workbench-file-api/pom.xml
@@ -41,7 +41,7 @@
</dependency>
<dependency>
<groupId>org.apache.taverna.language</groupId>
- <artifactId>scufl2-api</artifactId>
+ <artifactId>taverna-scufl2-api</artifactId>
</dependency>
</dependencies>
</project>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/1e681443/taverna-workbench-file-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-file-impl/pom.xml b/taverna-workbench-file-impl/pom.xml
index c96712b..f0a57d2 100644
--- a/taverna-workbench-file-impl/pom.xml
+++ b/taverna-workbench-file-impl/pom.xml
@@ -68,8 +68,8 @@
</dependency>
<dependency>
<groupId>org.apache.taverna.language</groupId>
- <artifactId>scufl2-api</artifactId>
- <version>${scufl2.version}</version>
+ <artifactId>taverna-scufl2-api</artifactId>
+ <version>${taverna.language.version}</version>
</dependency>
<dependency>
@@ -106,14 +106,14 @@
</dependency>
<dependency>
<groupId>org.apache.taverna.language</groupId>
- <artifactId>scufl2-t2flow</artifactId>
- <version>${scufl2.version}</version>
+ <artifactId>taverna-scufl2-wfbundle</artifactId>
+ <version>${taverna.language.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.taverna.language</groupId>
- <artifactId>scufl2-rdfxml</artifactId>
- <version>${scufl2.version}</version>
+ <artifactId>taverna-scufl2-rdfxml</artifactId>
+ <version>${taverna.language.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/1e681443/taverna-workbench-graph-model/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-graph-model/pom.xml b/taverna-workbench-graph-model/pom.xml
index 26dd8a2..9476990 100644
--- a/taverna-workbench-graph-model/pom.xml
+++ b/taverna-workbench-graph-model/pom.xml
@@ -118,7 +118,7 @@
</dependency>
<dependency>
<groupId>org.apache.taverna.language</groupId>
- <artifactId>scufl2-api</artifactId>
+ <artifactId>taverna-scufl2-api</artifactId>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/1e681443/taverna-workbench-graph-view/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-graph-view/pom.xml b/taverna-workbench-graph-view/pom.xml
index dcb0d3b..d765362 100644
--- a/taverna-workbench-graph-view/pom.xml
+++ b/taverna-workbench-graph-view/pom.xml
@@ -83,7 +83,7 @@
</dependency>
<dependency>
<groupId>org.apache.taverna.language</groupId>
- <artifactId>scufl2-api</artifactId>
+ <artifactId>taverna-scufl2-api</artifactId>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/1e681443/taverna-workbench-report-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-report-api/pom.xml b/taverna-workbench-report-api/pom.xml
index a692450..2046a0b 100644
--- a/taverna-workbench-report-api/pom.xml
+++ b/taverna-workbench-report-api/pom.xml
@@ -37,11 +37,11 @@
</dependency>
<dependency>
<groupId>org.apache.taverna.language</groupId>
- <artifactId>scufl2-api</artifactId>
+ <artifactId>taverna-scufl2-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.taverna.language</groupId>
- <artifactId>scufl2-validation</artifactId>
+ <artifactId>taverna-scufl2-validation</artifactId>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.lang</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/1e681443/taverna-workbench-selection-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-selection-api/pom.xml b/taverna-workbench-selection-api/pom.xml
index 7697433..7b56fef 100644
--- a/taverna-workbench-selection-api/pom.xml
+++ b/taverna-workbench-selection-api/pom.xml
@@ -37,7 +37,7 @@
<dependency>
<groupId>org.apache.taverna.language</groupId>
- <artifactId>scufl2-api</artifactId>
+ <artifactId>taverna-scufl2-api</artifactId>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.lang</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/1e681443/taverna-workbench-workbench-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-workbench-impl/pom.xml b/taverna-workbench-workbench-impl/pom.xml
index 6200015..3300d88 100644
--- a/taverna-workbench-workbench-impl/pom.xml
+++ b/taverna-workbench-workbench-impl/pom.xml
@@ -104,8 +104,8 @@
</dependency>
<dependency>
<groupId>org.apache.taverna.language</groupId>
- <artifactId>scufl2-api</artifactId>
- <version>${scufl2.version}</version>
+ <artifactId>taverna-scufl2-api</artifactId>
+ <version>${taverna.language.version}</version>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/1e681443/taverna-workbench-workflow-explorer/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-workflow-explorer/pom.xml b/taverna-workbench-workflow-explorer/pom.xml
index 855e1f3..71d84f6 100644
--- a/taverna-workbench-workflow-explorer/pom.xml
+++ b/taverna-workbench-workflow-explorer/pom.xml
@@ -79,7 +79,7 @@
</dependency>
<dependency>
<groupId>org.apache.taverna.language</groupId>
- <artifactId>scufl2-api</artifactId>
+ <artifactId>taverna-scufl2-api</artifactId>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/1e681443/taverna-workbench-workflow-view/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-workflow-view/pom.xml b/taverna-workbench-workflow-view/pom.xml
index 4147d56..d9f97f8 100644
--- a/taverna-workbench-workflow-view/pom.xml
+++ b/taverna-workbench-workflow-view/pom.xml
@@ -78,7 +78,7 @@
</dependency>
<dependency>
<groupId>org.apache.taverna.language</groupId>
- <artifactId>scufl2-api</artifactId>
+ <artifactId>taverna-scufl2-api</artifactId>
</dependency>
<dependency>
[27/50] [abbrv] incubator-taverna-workbench git commit: Reinstated
the but kept paramters for all depencies. T3-1195
Posted by st...@apache.org.
Reinstated the <dependencyManagement> but kept paramters for all depencies. T3-1195
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/commit/efc39a3d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/tree/efc39a3d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/diff/efc39a3d
Branch: refs/heads/master
Commit: efc39a3dcf22814802f8bfccc11cf28b25771db2
Parents: 34705a0
Author: Christian-B <br...@cs.man.ac.uk>
Authored: Fri Jun 20 13:27:02 2014 +0100
Committer: Christian-B <br...@cs.man.ac.uk>
Committed: Fri Jun 20 13:27:02 2014 +0100
----------------------------------------------------------------------
pom.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/efc39a3d/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index e659896..7e5841f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -13,7 +13,7 @@
<artifactId>lang</artifactId>
<version>2.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
- <!--dependencyManagement>
+ <dependencyManagement>
<dependencies>
<dependency>
<groupId>junit</groupId>
@@ -27,7 +27,7 @@
<version>${log4j.version}</version>
</dependency>
</dependencies>
- </dependencyManagement-->
+ </dependencyManagement>
<repositories>
<repository>
<releases />
[26/50] [abbrv] incubator-taverna-workbench git commit: Removed
dependencyManagement T3-1195
Posted by st...@apache.org.
Removed dependencyManagement T3-1195
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/commit/34705a0d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/tree/34705a0d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/diff/34705a0d
Branch: refs/heads/master
Commit: 34705a0deb418a7cb0d335e6f68c127d2b29caee
Parents: 699d008
Author: Christian-B <br...@cs.man.ac.uk>
Authored: Thu Jun 19 16:33:11 2014 +0100
Committer: Christian-B <br...@cs.man.ac.uk>
Committed: Thu Jun 19 16:33:11 2014 +0100
----------------------------------------------------------------------
beans/pom.xml | 1 +
io/pom.xml | 1 +
observer/pom.xml | 2 ++
partition/pom.xml | 1 +
pom.xml | 4 ++--
ui/pom.xml | 1 +
uibuilder/pom.xml | 1 +
7 files changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/34705a0d/beans/pom.xml
----------------------------------------------------------------------
diff --git a/beans/pom.xml b/beans/pom.xml
index 54b9dcd..ea51b1a 100644
--- a/beans/pom.xml
+++ b/beans/pom.xml
@@ -15,6 +15,7 @@
<dependency>
<groupId>org.apache.log4j</groupId>
<artifactId>com.springsource.org.apache.log4j</artifactId>
+ <version>${log4j.version}</version>
</dependency>
</dependencies>
</project>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/34705a0d/io/pom.xml
----------------------------------------------------------------------
diff --git a/io/pom.xml b/io/pom.xml
index e908f9b..1512fd7 100644
--- a/io/pom.xml
+++ b/io/pom.xml
@@ -15,6 +15,7 @@
<dependency>
<groupId>org.apache.log4j</groupId>
<artifactId>com.springsource.org.apache.log4j</artifactId>
+ <version>${log4j.version}</version>
</dependency>
</dependencies>
</project>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/34705a0d/observer/pom.xml
----------------------------------------------------------------------
diff --git a/observer/pom.xml b/observer/pom.xml
index 4854322..76e8140 100644
--- a/observer/pom.xml
+++ b/observer/pom.xml
@@ -16,10 +16,12 @@
<dependency>
<groupId>org.apache.log4j</groupId>
<artifactId>com.springsource.org.apache.log4j</artifactId>
+ <version>${log4j.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
+ <version>${junit.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/34705a0d/partition/pom.xml
----------------------------------------------------------------------
diff --git a/partition/pom.xml b/partition/pom.xml
index f2d690a..ba5088a 100644
--- a/partition/pom.xml
+++ b/partition/pom.xml
@@ -16,6 +16,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
+ <version>${junit.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/34705a0d/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 7e5841f..e659896 100644
--- a/pom.xml
+++ b/pom.xml
@@ -13,7 +13,7 @@
<artifactId>lang</artifactId>
<version>2.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
- <dependencyManagement>
+ <!--dependencyManagement>
<dependencies>
<dependency>
<groupId>junit</groupId>
@@ -27,7 +27,7 @@
<version>${log4j.version}</version>
</dependency>
</dependencies>
- </dependencyManagement>
+ </dependencyManagement-->
<repositories>
<repository>
<releases />
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/34705a0d/ui/pom.xml
----------------------------------------------------------------------
diff --git a/ui/pom.xml b/ui/pom.xml
index d0b8895..7e0d708 100644
--- a/ui/pom.xml
+++ b/ui/pom.xml
@@ -30,6 +30,7 @@
<dependency>
<groupId>org.apache.log4j</groupId>
<artifactId>com.springsource.org.apache.log4j</artifactId>
+ <version>${log4j.version}</version>
</dependency>
</dependencies>
</project>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/34705a0d/uibuilder/pom.xml
----------------------------------------------------------------------
diff --git a/uibuilder/pom.xml b/uibuilder/pom.xml
index b4fb1bf..bc84391 100644
--- a/uibuilder/pom.xml
+++ b/uibuilder/pom.xml
@@ -20,6 +20,7 @@
<dependency>
<groupId>org.apache.log4j</groupId>
<artifactId>com.springsource.org.apache.log4j</artifactId>
+ <version>${log4j.version}</version>
</dependency>
</dependencies>
</project>
[33/50] [abbrv] incubator-taverna-workbench git commit:
project.parent.version etc. for our own dependencies
Posted by st...@apache.org.
project.parent.version etc. for our own dependencies
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/commit/4d2409ad
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/tree/4d2409ad
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/diff/4d2409ad
Branch: refs/heads/master
Commit: 4d2409adb2fcf399f51a57962751bf5b60c27ee7
Parents: e103aa7
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Fri Mar 6 22:03:53 2015 +0000
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Fri Mar 6 22:03:53 2015 +0000
----------------------------------------------------------------------
taverna-dataflow-activity-ui/pom.xml | 44 ++++++++++----------
taverna-disabled-activity-ui/pom.xml | 14 +++----
taverna-stringconstant-activity-ui/pom.xml | 16 +++----
taverna-unrecognized-activity-ui/pom.xml | 4 +-
taverna-workbench-activity-palette-api/pom.xml | 4 +-
taverna-workbench-activity-palette-impl/pom.xml | 2 +-
taverna-workbench-activity-palette-ui/pom.xml | 10 ++---
taverna-workbench-activity-tools/pom.xml | 4 +-
taverna-workbench-configuration-impl/pom.xml | 6 +--
taverna-workbench-contextual-views-impl/pom.xml | 4 +-
taverna-workbench-contextual-views/pom.xml | 8 ++--
taverna-workbench-credential-manager-ui/pom.xml | 6 +--
.../pom.xml | 2 +-
taverna-workbench-design-ui/pom.xml | 8 ++--
taverna-workbench-edits-impl/pom.xml | 6 +--
taverna-workbench-file-impl/pom.xml | 10 ++---
taverna-workbench-graph-model/pom.xml | 10 ++---
taverna-workbench-graph-view/pom.xml | 10 ++---
taverna-workbench-helper/pom.xml | 2 +-
taverna-workbench-httpproxy-config/pom.xml | 2 +-
taverna-workbench-iteration-strategy-ui/pom.xml | 10 ++---
taverna-workbench-loop-ui/pom.xml | 16 +++----
taverna-workbench-menu-impl/pom.xml | 6 +--
taverna-workbench-menu-items/pom.xml | 16 +++----
taverna-workbench-monitor-view/pom.xml | 2 +-
taverna-workbench-parallelize-ui/pom.xml | 8 ++--
.../pom.xml | 12 +++---
taverna-workbench-perspective-design/pom.xml | 22 +++++-----
.../pom.xml | 6 +--
taverna-workbench-perspective-results/pom.xml | 8 ++--
taverna-workbench-plugin-manager/pom.xml | 4 +-
taverna-workbench-plugins-gui/pom.xml | 4 +-
taverna-workbench-reference-ui/pom.xml | 2 +-
taverna-workbench-renderers-exts/pom.xml | 4 +-
taverna-workbench-renderers-impl/pom.xml | 2 +-
taverna-workbench-report-explainer/pom.xml | 12 +++---
taverna-workbench-report-view/pom.xml | 18 ++++----
taverna-workbench-results-view/pom.xml | 6 +--
taverna-workbench-retry-ui/pom.xml | 8 ++--
taverna-workbench-run-ui/pom.xml | 8 ++--
taverna-workbench-selection-impl/pom.xml | 6 +--
taverna-workbench-update-manager/pom.xml | 2 +-
taverna-workbench-workbench-impl/pom.xml | 14 +++----
taverna-workbench-workflow-explorer/pom.xml | 14 +++----
taverna-workbench-workflow-view/pom.xml | 10 ++---
45 files changed, 196 insertions(+), 196 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/4d2409ad/taverna-dataflow-activity-ui/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-dataflow-activity-ui/pom.xml b/taverna-dataflow-activity-ui/pom.xml
index ae77887..9153274 100644
--- a/taverna-dataflow-activity-ui/pom.xml
+++ b/taverna-dataflow-activity-ui/pom.xml
@@ -28,39 +28,39 @@
<name>Apache Taverna Dataflow Activity UI</name>
<dependencies>
<dependency>
- <groupId>${parent.project.groupId}</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>activity-icons-api</artifactId>
- <version>${parent.project.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>${parent.project.groupId}</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>activity-palette-api</artifactId>
- <version>${parent.project.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>${parent.project.groupId}</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>contextual-views-api</artifactId>
- <version>${parent.project.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>${parent.project.groupId}</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>file-api</artifactId>
- <version>${parent.project.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>${parent.project.groupId}</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>edits-api</artifactId>
- <version>${parent.project.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>${parent.project.groupId}</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>workflow-view</artifactId>
- <version>${parent.project.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>${parent.project.groupId}</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>graph-view</artifactId>
- <version>${parent.project.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>org.apache.taverna.language</groupId>
@@ -75,27 +75,27 @@
</dependency>
<dependency>
- <groupId>${parent.project.groupId}</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>activity-tools</artifactId>
- <version>${parent.project.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>${parent.project.groupId}</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>helper-api</artifactId>
- <version>${parent.project.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<!-- testing dependencies -->
<dependency>
- <groupId>${parent.project.groupId}</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>file-impl</artifactId>
- <version>${parent.project.version}</version>
+ <version>${project.parent.version}</version>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>${parent.project.groupId}</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>edits-impl</artifactId>
- <version>${parent.project.version}</version>
+ <version>${project.parent.version}</version>
<scope>test</scope>
</dependency>
<!-- <dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/4d2409ad/taverna-disabled-activity-ui/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-disabled-activity-ui/pom.xml b/taverna-disabled-activity-ui/pom.xml
index 3e132e2..b02dd87 100644
--- a/taverna-disabled-activity-ui/pom.xml
+++ b/taverna-disabled-activity-ui/pom.xml
@@ -31,32 +31,32 @@
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>activity-icons-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>menu-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>report-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-impl</groupId>
<artifactId>contextual-views-impl</artifactId>
- <version>${t2.ui.impl.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>activity-tools</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-components</groupId>
<artifactId>workflow-view</artifactId>
- <version>${t2.ui.components.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.activities</groupId>
@@ -76,7 +76,7 @@
<dependency>
<groupId>net.sf.taverna.t2.ui-impl</groupId>
<artifactId>helper</artifactId>
- <version>${t2.ui.impl.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
</dependencies>
<repositories>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/4d2409ad/taverna-stringconstant-activity-ui/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-stringconstant-activity-ui/pom.xml b/taverna-stringconstant-activity-ui/pom.xml
index d4e70df..ced319e 100644
--- a/taverna-stringconstant-activity-ui/pom.xml
+++ b/taverna-stringconstant-activity-ui/pom.xml
@@ -31,27 +31,27 @@
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>activity-icons-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>activity-palette-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>menu-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>contextual-views-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-components</groupId>
<artifactId>workflow-view</artifactId>
- <version>${t2.ui.components.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>uk.org.taverna.commons</groupId>
@@ -74,18 +74,18 @@
<!-- <dependency>
<groupId>net.sf.taverna.t2.ui-impl</groupId>
<artifactId>activity-palette-impl</artifactId>
- <version>${t2.ui.impl.version}</version>
+ <version>${project.parent.version}</version>
<scope>test</scope>
</dependency> -->
<!-- <dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>activity-tools</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency> -->
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>activity-tools</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
</dependencies>
<repositories>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/4d2409ad/taverna-unrecognized-activity-ui/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-unrecognized-activity-ui/pom.xml b/taverna-unrecognized-activity-ui/pom.xml
index e0d0d92..c69f4b4 100644
--- a/taverna-unrecognized-activity-ui/pom.xml
+++ b/taverna-unrecognized-activity-ui/pom.xml
@@ -31,12 +31,12 @@
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>configuration-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-impl</groupId>
<artifactId>contextual-views-impl</artifactId>
- <version>${t2.ui.impl.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
</dependencies>
<repositories>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/4d2409ad/taverna-workbench-activity-palette-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-activity-palette-api/pom.xml b/taverna-workbench-activity-palette-api/pom.xml
index 2970793..56ed37b 100644
--- a/taverna-workbench-activity-palette-api/pom.xml
+++ b/taverna-workbench-activity-palette-api/pom.xml
@@ -46,12 +46,12 @@
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>workbench-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>edits-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.lang</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/4d2409ad/taverna-workbench-activity-palette-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-activity-palette-impl/pom.xml b/taverna-workbench-activity-palette-impl/pom.xml
index 442b03e..38178ec 100644
--- a/taverna-workbench-activity-palette-impl/pom.xml
+++ b/taverna-workbench-activity-palette-impl/pom.xml
@@ -31,7 +31,7 @@
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>activity-palette-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.core</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/4d2409ad/taverna-workbench-activity-palette-ui/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-activity-palette-ui/pom.xml b/taverna-workbench-activity-palette-ui/pom.xml
index cd2b0bc..fb25d1e 100644
--- a/taverna-workbench-activity-palette-ui/pom.xml
+++ b/taverna-workbench-activity-palette-ui/pom.xml
@@ -31,27 +31,27 @@
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>activity-icons-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>activity-palette-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>workbench-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>menu-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>helper-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-components</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/4d2409ad/taverna-workbench-activity-tools/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-activity-tools/pom.xml b/taverna-workbench-activity-tools/pom.xml
index 8a28b08..4524c47 100644
--- a/taverna-workbench-activity-tools/pom.xml
+++ b/taverna-workbench-activity-tools/pom.xml
@@ -31,12 +31,12 @@
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>menu-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>workbench-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>uk.org.taverna.scufl2</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/4d2409ad/taverna-workbench-configuration-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-configuration-impl/pom.xml b/taverna-workbench-configuration-impl/pom.xml
index c21f725..3e94509 100644
--- a/taverna-workbench-configuration-impl/pom.xml
+++ b/taverna-workbench-configuration-impl/pom.xml
@@ -32,17 +32,17 @@
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>menu-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>helper-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>configuration-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>uk.org.taverna.configuration</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/4d2409ad/taverna-workbench-contextual-views-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-contextual-views-impl/pom.xml b/taverna-workbench-contextual-views-impl/pom.xml
index b8e16cc..c36e1e5 100644
--- a/taverna-workbench-contextual-views-impl/pom.xml
+++ b/taverna-workbench-contextual-views-impl/pom.xml
@@ -31,12 +31,12 @@
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>contextual-views-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>selection-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>uk.org.taverna.scufl2</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/4d2409ad/taverna-workbench-contextual-views/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-contextual-views/pom.xml b/taverna-workbench-contextual-views/pom.xml
index 5440265..dbcd271 100644
--- a/taverna-workbench-contextual-views/pom.xml
+++ b/taverna-workbench-contextual-views/pom.xml
@@ -30,22 +30,22 @@
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>contextual-views-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>edits-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>file-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>selection-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/4d2409ad/taverna-workbench-credential-manager-ui/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-credential-manager-ui/pom.xml b/taverna-workbench-credential-manager-ui/pom.xml
index 2bfa252..ca06780 100644
--- a/taverna-workbench-credential-manager-ui/pom.xml
+++ b/taverna-workbench-credential-manager-ui/pom.xml
@@ -33,17 +33,17 @@
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>menu-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>helper-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>workbench-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.security</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/4d2409ad/taverna-workbench-data-management-config-ui/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-data-management-config-ui/pom.xml b/taverna-workbench-data-management-config-ui/pom.xml
index fddcc2a..355cc5f 100644
--- a/taverna-workbench-data-management-config-ui/pom.xml
+++ b/taverna-workbench-data-management-config-ui/pom.xml
@@ -35,7 +35,7 @@
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>helper-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<!--<dependency>
<groupId>net.sf.taverna.t2.ui-components</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/4d2409ad/taverna-workbench-design-ui/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-design-ui/pom.xml b/taverna-workbench-design-ui/pom.xml
index 62efdeb..77533da 100644
--- a/taverna-workbench-design-ui/pom.xml
+++ b/taverna-workbench-design-ui/pom.xml
@@ -30,22 +30,22 @@
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>activity-icons-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>edits-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>contextual-views-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>selection-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.lang</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/4d2409ad/taverna-workbench-edits-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-edits-impl/pom.xml b/taverna-workbench-edits-impl/pom.xml
index 54b844e..8e5c6a4 100644
--- a/taverna-workbench-edits-impl/pom.xml
+++ b/taverna-workbench-edits-impl/pom.xml
@@ -33,17 +33,17 @@
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>edits-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>menu-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>selection-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.lang</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/4d2409ad/taverna-workbench-file-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-file-impl/pom.xml b/taverna-workbench-file-impl/pom.xml
index 2792edc..4be85f1 100644
--- a/taverna-workbench-file-impl/pom.xml
+++ b/taverna-workbench-file-impl/pom.xml
@@ -34,27 +34,27 @@
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>file-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>edits-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>helper-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>menu-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>workbench-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.lang</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/4d2409ad/taverna-workbench-graph-model/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-graph-model/pom.xml b/taverna-workbench-graph-model/pom.xml
index 62bdd02..88ee714 100644
--- a/taverna-workbench-graph-model/pom.xml
+++ b/taverna-workbench-graph-model/pom.xml
@@ -84,27 +84,27 @@
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>configuration-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>edits-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>menu-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>selection-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-impl</groupId>
<artifactId>configuration-impl</artifactId>
- <version>${t2.ui.impl.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.lang</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/4d2409ad/taverna-workbench-graph-view/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-graph-view/pom.xml b/taverna-workbench-graph-view/pom.xml
index 210e845..efdd637 100644
--- a/taverna-workbench-graph-view/pom.xml
+++ b/taverna-workbench-graph-view/pom.xml
@@ -30,27 +30,27 @@
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>workbench-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>configuration-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>file-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>menu-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-components</groupId>
<artifactId>design-ui</artifactId>
- <version>${t2.ui.components.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-components</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/4d2409ad/taverna-workbench-helper/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-helper/pom.xml b/taverna-workbench-helper/pom.xml
index 005a281..2ad3e43 100644
--- a/taverna-workbench-helper/pom.xml
+++ b/taverna-workbench-helper/pom.xml
@@ -29,7 +29,7 @@
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>helper-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
</dependencies>
</project>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/4d2409ad/taverna-workbench-httpproxy-config/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-httpproxy-config/pom.xml b/taverna-workbench-httpproxy-config/pom.xml
index fcdf2eb..5ed865b 100644
--- a/taverna-workbench-httpproxy-config/pom.xml
+++ b/taverna-workbench-httpproxy-config/pom.xml
@@ -40,7 +40,7 @@
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>helper-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
</dependencies>
</project>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/4d2409ad/taverna-workbench-iteration-strategy-ui/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-iteration-strategy-ui/pom.xml b/taverna-workbench-iteration-strategy-ui/pom.xml
index 9ed49f5..a61fe99 100644
--- a/taverna-workbench-iteration-strategy-ui/pom.xml
+++ b/taverna-workbench-iteration-strategy-ui/pom.xml
@@ -41,27 +41,27 @@
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>workbench-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>contextual-views-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>edits-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>file-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>helper-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/4d2409ad/taverna-workbench-loop-ui/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-loop-ui/pom.xml b/taverna-workbench-loop-ui/pom.xml
index 9a7a6d7..1250986 100644
--- a/taverna-workbench-loop-ui/pom.xml
+++ b/taverna-workbench-loop-ui/pom.xml
@@ -30,24 +30,24 @@
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>contextual-views-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>file-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>edits-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>helper-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-activities</groupId>
@@ -58,26 +58,26 @@
<dependency>
<groupId>net.sf.taverna.t2.ui-impl</groupId>
<artifactId>edits-impl</artifactId>
- <version>${t2.ui.impl.version}</version>
+ <version>${project.parent.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-impl</groupId>
<artifactId>file-impl</artifactId>
- <version>${t2.ui.impl.version}</version>
+ <version>${project.parent.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-impl</groupId>
<artifactId>contextual-views-impl</artifactId>
- <version>${t2.ui.impl.version}</version>
+ <version>${project.parent.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-impl</groupId>
<artifactId>selection-impl</artifactId>
- <version>${t2.ui.impl.version}</version>
+ <version>${project.parent.version}</version>
<scope>test</scope>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/4d2409ad/taverna-workbench-menu-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-menu-impl/pom.xml b/taverna-workbench-menu-impl/pom.xml
index 18aec40..33df6ea 100644
--- a/taverna-workbench-menu-impl/pom.xml
+++ b/taverna-workbench-menu-impl/pom.xml
@@ -45,17 +45,17 @@
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>workbench-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>menu-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>helper-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.lang</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/4d2409ad/taverna-workbench-menu-items/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-menu-items/pom.xml b/taverna-workbench-menu-items/pom.xml
index 143bb6c..dc4c66c 100644
--- a/taverna-workbench-menu-items/pom.xml
+++ b/taverna-workbench-menu-items/pom.xml
@@ -30,37 +30,37 @@
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>menu-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>report-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>selection-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>workbench-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-components</groupId>
<artifactId>design-ui</artifactId>
- <version>${t2.ui.components.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-components</groupId>
<artifactId>graph-view</artifactId>
- <version>${t2.ui.components.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-components</groupId>
<artifactId>workflow-view</artifactId>
- <version>${t2.ui.components.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.lang</groupId>
@@ -82,7 +82,7 @@
<dependency>
<groupId>net.sf.taverna.t2.ui-impl</groupId>
<artifactId>contextual-views-impl</artifactId>
- <version>${t2.ui.impl.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/4d2409ad/taverna-workbench-monitor-view/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-monitor-view/pom.xml b/taverna-workbench-monitor-view/pom.xml
index a2a76bb..70762ad 100644
--- a/taverna-workbench-monitor-view/pom.xml
+++ b/taverna-workbench-monitor-view/pom.xml
@@ -30,7 +30,7 @@
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>workbench-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-components</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/4d2409ad/taverna-workbench-parallelize-ui/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-parallelize-ui/pom.xml b/taverna-workbench-parallelize-ui/pom.xml
index 914f9d2..799de45 100644
--- a/taverna-workbench-parallelize-ui/pom.xml
+++ b/taverna-workbench-parallelize-ui/pom.xml
@@ -30,22 +30,22 @@
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>contextual-views-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>menu-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>edits-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>selection-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/4d2409ad/taverna-workbench-perspective-biocatalogue/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-perspective-biocatalogue/pom.xml b/taverna-workbench-perspective-biocatalogue/pom.xml
index 7a6d502..3750fda 100644
--- a/taverna-workbench-perspective-biocatalogue/pom.xml
+++ b/taverna-workbench-perspective-biocatalogue/pom.xml
@@ -39,7 +39,7 @@
<dependencies>
<!-- <dependency> <groupId>net.sf.taverna.t2.ui-api</groupId> <artifactId>perspective-core</artifactId>
- <version>${t2.ui.api.version}</version> </dependency> -->
+ <version>${project.parent.version}</version> </dependency> -->
<dependency>
<groupId>net.sf.taverna.t2.core</groupId>
<artifactId>workflowmodel-impl</artifactId>
@@ -48,12 +48,12 @@
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>menu-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>file-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.lang</groupId>
@@ -65,7 +65,7 @@
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>contextual-views-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<!-- required for inserting a SOAP processor into the current workflow -->
<dependency>
@@ -83,13 +83,13 @@
<dependency>
<groupId>net.sf.taverna.t2.ui-components</groupId>
<artifactId>workflow-view</artifactId>
- <version>${t2.ui.components.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<!-- required registering with and opening help window -->
<dependency>
<groupId>net.sf.taverna.t2.ui-impl</groupId>
<artifactId>helper</artifactId>
- <version>${t2.ui.impl.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>uk.org.taverna.configuration</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/4d2409ad/taverna-workbench-perspective-design/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-perspective-design/pom.xml b/taverna-workbench-perspective-design/pom.xml
index d9db4c3..eadee0f 100644
--- a/taverna-workbench-perspective-design/pom.xml
+++ b/taverna-workbench-perspective-design/pom.xml
@@ -30,52 +30,52 @@
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>edits-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>file-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>menu-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>report-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>selection-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>workbench-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-components</groupId>
<artifactId>activity-palette-ui</artifactId>
- <version>${t2.ui.components.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-components</groupId>
<artifactId>graph-view</artifactId>
- <version>${t2.ui.components.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-components</groupId>
<artifactId>workflow-explorer</artifactId>
- <version>${t2.ui.components.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<!-- <dependency>
<groupId>net.sf.taverna.t2.ui-components</groupId>
<artifactId>report-view</artifactId>
- <version>${t2.ui.components.version}</version>
+ <version>${project.parent.version}</version>
</dependency> -->
<dependency>
<groupId>net.sf.taverna.t2.lang</groupId>
@@ -86,7 +86,7 @@
<dependency>
<groupId>net.sf.taverna.t2.ui-impl</groupId>
<artifactId>contextual-views-impl</artifactId>
- <version>${t2.ui.impl.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/4d2409ad/taverna-workbench-perspective-myexperiment/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-perspective-myexperiment/pom.xml b/taverna-workbench-perspective-myexperiment/pom.xml
index 83555db..370cc97 100644
--- a/taverna-workbench-perspective-myexperiment/pom.xml
+++ b/taverna-workbench-perspective-myexperiment/pom.xml
@@ -53,17 +53,17 @@
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>menu-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>workbench-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>file-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-activities</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/4d2409ad/taverna-workbench-perspective-results/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-perspective-results/pom.xml b/taverna-workbench-perspective-results/pom.xml
index ae730eb..a00d1ac 100644
--- a/taverna-workbench-perspective-results/pom.xml
+++ b/taverna-workbench-perspective-results/pom.xml
@@ -32,22 +32,22 @@
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>selection-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>workbench-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-components</groupId>
<artifactId>monitor-view</artifactId>
- <version>${t2.ui.components.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-components</groupId>
<artifactId>results-view</artifactId>
- <version>${t2.ui.components.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.lang</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/4d2409ad/taverna-workbench-plugin-manager/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-plugin-manager/pom.xml b/taverna-workbench-plugin-manager/pom.xml
index 9b24ea2..9168aa3 100644
--- a/taverna-workbench-plugin-manager/pom.xml
+++ b/taverna-workbench-plugin-manager/pom.xml
@@ -30,12 +30,12 @@
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>menu-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>workbench-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>uk.org.taverna.commons</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/4d2409ad/taverna-workbench-plugins-gui/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-plugins-gui/pom.xml b/taverna-workbench-plugins-gui/pom.xml
index c8d6634..2d5b3dd 100644
--- a/taverna-workbench-plugins-gui/pom.xml
+++ b/taverna-workbench-plugins-gui/pom.xml
@@ -29,12 +29,12 @@
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>workbench-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>helper-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>uk.org.taverna.configuration</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/4d2409ad/taverna-workbench-reference-ui/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-reference-ui/pom.xml b/taverna-workbench-reference-ui/pom.xml
index 5335306..2e3e223 100644
--- a/taverna-workbench-reference-ui/pom.xml
+++ b/taverna-workbench-reference-ui/pom.xml
@@ -36,7 +36,7 @@
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>report-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-components</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/4d2409ad/taverna-workbench-renderers-exts/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-renderers-exts/pom.xml b/taverna-workbench-renderers-exts/pom.xml
index b10233a..aa2b0f3 100644
--- a/taverna-workbench-renderers-exts/pom.xml
+++ b/taverna-workbench-renderers-exts/pom.xml
@@ -29,12 +29,12 @@
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>renderers-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-impl</groupId>
<artifactId>workbench-impl</artifactId>
- <version>${t2.ui.impl.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>uk.org.taverna.databundle</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/4d2409ad/taverna-workbench-renderers-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-renderers-impl/pom.xml b/taverna-workbench-renderers-impl/pom.xml
index 4e91d87..a49783e 100644
--- a/taverna-workbench-renderers-impl/pom.xml
+++ b/taverna-workbench-renderers-impl/pom.xml
@@ -44,7 +44,7 @@
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>renderers-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.lang</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/4d2409ad/taverna-workbench-report-explainer/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-report-explainer/pom.xml b/taverna-workbench-report-explainer/pom.xml
index 87d5a74..09ef9d6 100644
--- a/taverna-workbench-report-explainer/pom.xml
+++ b/taverna-workbench-report-explainer/pom.xml
@@ -33,7 +33,7 @@
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>report-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-exts</groupId>
@@ -73,27 +73,27 @@
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>edits-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>file-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-impl</groupId>
<artifactId>configuration-impl</artifactId>
- <version>${t2.ui.impl.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-components</groupId>
<artifactId>report-view</artifactId>
- <version>${t2.ui.components.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-components</groupId>
<artifactId>design-ui</artifactId>
- <version>${t2.ui.components.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.core</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/4d2409ad/taverna-workbench-report-view/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-report-view/pom.xml b/taverna-workbench-report-view/pom.xml
index a357b70..f095fad 100644
--- a/taverna-workbench-report-view/pom.xml
+++ b/taverna-workbench-report-view/pom.xml
@@ -43,47 +43,47 @@
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>edits-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>report-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>file-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>helper-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>menu-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>workbench-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<!-- <dependency>
<groupId>net.sf.taverna.t2.ui-impl</groupId>
<artifactId>workbench-impl</artifactId>
- <version>${t2.ui.impl.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
--> <dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>configuration-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-components</groupId>
<artifactId>workflow-view</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/4d2409ad/taverna-workbench-results-view/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-results-view/pom.xml b/taverna-workbench-results-view/pom.xml
index c66099c..e576519 100644
--- a/taverna-workbench-results-view/pom.xml
+++ b/taverna-workbench-results-view/pom.xml
@@ -54,17 +54,17 @@
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>menu-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>workbench-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>renderers-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-components</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/4d2409ad/taverna-workbench-retry-ui/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-retry-ui/pom.xml b/taverna-workbench-retry-ui/pom.xml
index 3ef6ef8..5345c61 100644
--- a/taverna-workbench-retry-ui/pom.xml
+++ b/taverna-workbench-retry-ui/pom.xml
@@ -30,22 +30,22 @@
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>contextual-views-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>menu-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>edits-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>selection-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/4d2409ad/taverna-workbench-run-ui/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-run-ui/pom.xml b/taverna-workbench-run-ui/pom.xml
index eb73392..79c5cac 100644
--- a/taverna-workbench-run-ui/pom.xml
+++ b/taverna-workbench-run-ui/pom.xml
@@ -30,22 +30,22 @@
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>menu-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>report-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>workbench-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>file-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-components</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/4d2409ad/taverna-workbench-selection-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-selection-impl/pom.xml b/taverna-workbench-selection-impl/pom.xml
index ea997f2..6adac93 100644
--- a/taverna-workbench-selection-impl/pom.xml
+++ b/taverna-workbench-selection-impl/pom.xml
@@ -30,17 +30,17 @@
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>edits-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>file-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>selection-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/4d2409ad/taverna-workbench-update-manager/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-update-manager/pom.xml b/taverna-workbench-update-manager/pom.xml
index 60b6086..392f9be 100644
--- a/taverna-workbench-update-manager/pom.xml
+++ b/taverna-workbench-update-manager/pom.xml
@@ -31,7 +31,7 @@
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>menu-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>uk.org.taverna.commons</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/4d2409ad/taverna-workbench-workbench-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-workbench-impl/pom.xml b/taverna-workbench-workbench-impl/pom.xml
index 092da29..c6fb5dd 100644
--- a/taverna-workbench-workbench-impl/pom.xml
+++ b/taverna-workbench-workbench-impl/pom.xml
@@ -45,37 +45,37 @@
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>workbench-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>edits-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>configuration-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>file-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>helper-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>menu-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>selection-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.lang</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/4d2409ad/taverna-workbench-workflow-explorer/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-workflow-explorer/pom.xml b/taverna-workbench-workflow-explorer/pom.xml
index 2fc0ba3..36c14b0 100644
--- a/taverna-workbench-workflow-explorer/pom.xml
+++ b/taverna-workbench-workflow-explorer/pom.xml
@@ -31,27 +31,27 @@
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>workbench-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>file-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>report-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-impl</groupId>
<artifactId>menu-impl</artifactId>
- <version>${t2.ui.impl.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>activity-icons-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-components</groupId>
@@ -61,12 +61,12 @@
<dependency>
<groupId>net.sf.taverna.t2.ui-impl</groupId>
<artifactId>helper</artifactId>
- <version>${t2.ui.impl.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-impl</groupId>
<artifactId>workbench-impl</artifactId>
- <version>${t2.ui.impl.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-components</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/4d2409ad/taverna-workbench-workflow-view/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-workflow-view/pom.xml b/taverna-workbench-workflow-view/pom.xml
index 1755c6b..c80d7b5 100644
--- a/taverna-workbench-workflow-view/pom.xml
+++ b/taverna-workbench-workflow-view/pom.xml
@@ -45,27 +45,27 @@
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>workbench-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>edits-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>activity-palette-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>contextual-views-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>activity-tools</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna.t2.ui-components</groupId>
[42/50] [abbrv] incubator-taverna-workbench git commit: taverna-*
Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-partition/src/main/java/net/sf/taverna/t2/partition/ui/TableTreeNodeRenderer.java
----------------------------------------------------------------------
diff --git a/taverna-partition/src/main/java/net/sf/taverna/t2/partition/ui/TableTreeNodeRenderer.java b/taverna-partition/src/main/java/net/sf/taverna/t2/partition/ui/TableTreeNodeRenderer.java
new file mode 100644
index 0000000..12fd2a4
--- /dev/null
+++ b/taverna-partition/src/main/java/net/sf/taverna/t2/partition/ui/TableTreeNodeRenderer.java
@@ -0,0 +1,554 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.partition.ui;
+
+import java.awt.BasicStroke;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.Paint;
+import java.awt.Rectangle;
+import java.awt.RenderingHints;
+import java.awt.Stroke;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.GeneralPath;
+
+import javax.swing.JComponent;
+import javax.swing.JLabel;
+import javax.swing.JTree;
+import javax.swing.UIManager;
+import javax.swing.plaf.TreeUI;
+import javax.swing.tree.TreeCellRenderer;
+import javax.swing.tree.TreeModel;
+import javax.swing.tree.TreePath;
+
+public abstract class TableTreeNodeRenderer implements TreeCellRenderer {
+
+ private static final long serialVersionUID = -7291631337751330696L;
+
+ // The difference in indentation between a node and its child nodes, there
+ // isn't an easy way to get this other than constructing a JTree and
+ // measuring it - you'd think it would be a property of TreeUI but
+ // apparently not.
+ private static int perNodeOffset = -1;
+
+ // Use this to rubber stamp the original node renderer in before rendering
+ // the table
+ private TreeCellRenderer nodeRenderer;
+
+ // Determines the space allocated to leaf nodes and their parents when
+ // applying the stamp defined by the nodeRenderer
+ private int nodeWidth;
+
+ // Number of pixels of space to leave between the node label and the table
+ // header or rows
+ private int labelToTablePad = 3;
+
+ // Number of pixels to leave around the label rendered into the table cells
+ private int cellPadding = 4;
+
+ // Drawing borders?
+ private boolean drawingBorders = true;
+
+ // The number of pixels by which the height of the header is reduced
+ // compared to the row height, this leaves a small border above the header
+ // and separates it from the last row of the table above, if any.
+ private int headerTopPad = 4;
+
+ // The proportion of colour : black or colour : white used to create the
+ // darker or lighter shades is blendFactor : 1
+ private int blendFactor = 2;
+
+ // Colour to use to draw the table borders when they're enabled
+ private Color borderColour = Color.black;
+
+ /**
+ * Set the colour to be used to draw the borders if they are displayed at
+ * all. Defaults to black.
+ */
+ public void setBorderColour(Color borderColour) {
+ this.borderColour = borderColour;
+ }
+
+ /**
+ * The blend factor determines how strong the colour component is in the
+ * shadow and highlight colours used in the bevelled boxes, the ratio of
+ * black / white to colour is 1 : blendFactor
+ *
+ * @param blendFactor
+ */
+ public void setBlendFactor(int blendFactor) {
+ this.blendFactor = blendFactor;
+ }
+
+ /**
+ * Set whether the renderer will draw borders around the table cells - if
+ * this is false the table still has the bevelled edges of the cell painters
+ * so will still look semi-bordered. Defaults to true if not otherwise set.
+ *
+ * @param drawingBorders
+ */
+ public void setDrawBorders(boolean drawingBorders) {
+ this.drawingBorders = drawingBorders;
+ }
+
+ /**
+ * Override and implement to get the list of columns for a given partition
+ * node - currently assumes all partitions use the same column structure
+ * which I need to fix so it doesn't take a partition as argument (yet).
+ *
+ * @return an array of column specifications used to drive the renderer
+ */
+ public abstract TableTreeNodeColumn[] getColumns();
+
+ /**
+ * Construct a new TableTreeNodeRenderer
+ *
+ * @param nodeRenderer
+ * The inner renderer used to render the node labels
+ * @param nodeWidth
+ * Width of the cell space into which the node label is rendered
+ * in the table header and row nodes
+ */
+ public TableTreeNodeRenderer(TreeCellRenderer nodeRenderer, int nodeWidth) {
+ super();
+ this.nodeRenderer = nodeRenderer;
+ this.nodeWidth = nodeWidth;
+ }
+
+ /**
+ * Do the magic!
+ */
+ public Component getTreeCellRendererComponent(final JTree tree,
+ final Object value, final boolean selected, final boolean expanded,
+ final boolean leaf, final int row, final boolean hasFocus) {
+ final Component nodeLabel = nodeRenderer.getTreeCellRendererComponent(
+ tree, value, false, expanded, leaf, row, false);
+ final int nodeLabelHeight = (int) nodeLabel.getPreferredSize()
+ .getHeight();
+ if (leaf) {
+ // Rendering the leaf nodes, therefore use the table rendering
+ // strategy
+ getPerNodeIndentation(tree, row);
+ return new JComponent() {
+ private static final long serialVersionUID = 4993815558563895266L;
+
+ @Override
+ public Dimension getPreferredSize() {
+ int width = nodeWidth + labelToTablePad;
+ for (TableTreeNodeColumn column : getColumns()) {
+ width += column.getColumnWidth();
+ }
+ return new Dimension(width, nodeLabelHeight);
+ }
+
+ @Override
+ protected void paintComponent(Graphics g) {
+
+ Graphics2D g2d = (Graphics2D) g.create();
+ AffineTransform originalTransform = g2d.getTransform();
+ // Enable anti-aliasing for the curved lines
+ g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
+ RenderingHints.VALUE_ANTIALIAS_ON);
+
+ // This method should paint a bevelled container for the
+ // original label but it doesn't really work terribly well
+ // as we can't ensure that the original label is actually
+ // honouring any opaque flags.
+ if (drawingBorders) {
+ paintRectangleWithBevel(g2d, nodeWidth
+ + labelToTablePad, getHeight(), Color.white);
+ }
+
+ // Paint original node label
+ nodeLabel.setSize(new Dimension(
+ nodeWidth - cellPadding * 2, getHeight()
+ - (drawingBorders ? 2 : 1)));
+ g2d.translate(cellPadding, 0);
+ nodeLabel.paint(g2d);
+ g2d.translate(-cellPadding, 0);
+
+ if (drawingBorders) {
+ paintRectangleBorder(g2d, nodeWidth + labelToTablePad,
+ getHeight(), 0, 0, 1, 1, borderColour);
+ }
+
+ g2d.translate(nodeWidth + labelToTablePad, 0);
+ boolean first = true;
+ for (TableTreeNodeColumn column : getColumns()) {
+
+ Color fillColour = column.getColour().brighter();
+ Object parentNode = tree.getPathForRow(row)
+ .getParentPath().getLastPathComponent();
+ int indexInParent = tree.getModel().getIndexOfChild(
+ parentNode, value);
+ if ((indexInParent & 1) == 1) {
+ fillColour = new Color(
+ (fillColour.getRed() + column.getColour()
+ .getRed()) / 2, (fillColour
+ .getGreen() + column.getColour()
+ .getGreen()) / 2, (fillColour
+ .getBlue() + column.getColour()
+ .getBlue()) / 2);
+ }
+
+ // Paint background and bevel
+ paintRectangleWithBevel(g2d, column.getColumnWidth(),
+ getHeight(), fillColour);
+
+ // Paint cell component
+ Component cellComponent = column.getCellRenderer(value);
+ cellComponent.setSize(new Dimension(column
+ .getColumnWidth()
+ - cellPadding * 2, getHeight()));
+ g2d.translate(cellPadding, 0);
+ cellComponent.paint(g2d);
+ g2d.translate(-cellPadding, 0);
+
+ // Draw border
+ if (drawingBorders) {
+ paintRectangleBorder(g2d, column.getColumnWidth(),
+ getHeight(), 0, 1, 1, first ? 1 : 0,
+ borderColour);
+ }
+ first = false;
+
+ g2d.translate(column.getColumnWidth(), 0);
+
+ }
+ if (selected) {
+ g2d.setTransform(originalTransform);
+ g2d.translate(2, 0);
+ paintRectangleWithHighlightColour(g2d, getWidth()
+ - (drawingBorders ? 4 : 2), getHeight()
+ - (drawingBorders ? 2 : 0));
+ }
+ }
+ };
+ } else {
+ // If there are no child nodes, or there are child nodes but they
+ // aren't leaves then we render the cell as normal. If there are
+ // child nodes and the first one is a leaf (we assume this means
+ // they all are!) then we render the table header after the label.
+ if (!expanded) {
+ return getLabelWithHighlight(nodeLabel, selected);
+ }
+ // Expanded so do the model check...
+ TreeModel model = tree.getModel();
+ int childCount = model.getChildCount(value);
+ if (childCount == 0) {
+ return getLabelWithHighlight(nodeLabel, selected);
+ }
+ Object childNode = model.getChild(value, 0);
+ if (!model.isLeaf(childNode)) {
+ return getLabelWithHighlight(nodeLabel, selected);
+ }
+ getPerNodeIndentation(tree, row);
+ // Got to here so we need to render a table header.
+ return new JComponent() {
+ private static final long serialVersionUID = -4923965850510357216L;
+
+ @Override
+ public Dimension getPreferredSize() {
+ int width = nodeWidth + labelToTablePad + perNodeOffset;
+ for (TableTreeNodeColumn column : getColumns()) {
+ width += column.getColumnWidth();
+ }
+ return new Dimension(width, nodeLabelHeight);
+ }
+
+ @Override
+ protected void paintComponent(Graphics g) {
+
+ Graphics2D g2d = (Graphics2D) g.create();
+ AffineTransform originalTransform = g2d.getTransform();
+ // Enable anti-aliasing for the curved lines
+ g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
+ RenderingHints.VALUE_ANTIALIAS_ON);
+
+ // Paint original node label
+ nodeLabel.setSize(new Dimension(nodeWidth + perNodeOffset,
+ getHeight()));
+ nodeLabel.paint(g2d);
+
+ // Draw line under label to act as line above table row
+ // below
+ if (drawingBorders) {
+ GeneralPath path = new GeneralPath();
+ path.moveTo(perNodeOffset, getHeight() - 1);
+ path.lineTo(
+ perNodeOffset + nodeWidth + labelToTablePad,
+ getHeight() - 1);
+ g2d.setStroke(new BasicStroke(1, BasicStroke.CAP_BUTT,
+ BasicStroke.JOIN_MITER));
+ g2d.setPaint(borderColour);
+ g2d.draw(path);
+ }
+
+ // Move painting origin to the start of the header row
+ g2d.translate(nodeWidth + perNodeOffset + labelToTablePad,
+ 0);
+
+ // Paint columns
+ boolean first = true;
+ for (TableTreeNodeColumn column : getColumns()) {
+
+ // Paint header cell background with bevel
+ g2d.translate(0, headerTopPad);
+ paintRectangleWithBevel(g2d, column.getColumnWidth(),
+ getHeight() - headerTopPad, column.getColour());
+
+ // Paint header label
+ JLabel columnLabel = new JLabel(column.getShortName());
+ columnLabel.setSize(new Dimension(column
+ .getColumnWidth()
+ - cellPadding * 2, getHeight() - headerTopPad));
+ g2d.translate(cellPadding, 0);
+ columnLabel.paint(g2d);
+ g2d.translate(-cellPadding, 0);
+
+ // Paint header borders
+ if (drawingBorders) {
+ paintRectangleBorder(g2d, column.getColumnWidth(),
+ getHeight() - headerTopPad, 1, 1, 1,
+ first ? 1 : 0, borderColour);
+ }
+ g2d.translate(0, -headerTopPad);
+ first = false;
+ g2d.translate(column.getColumnWidth(), 0);
+
+ }
+ if (selected) {
+ g2d.setTransform(originalTransform);
+ g2d.translate(1, headerTopPad);
+ paintRectangleWithHighlightColour(g2d, perNodeOffset
+ + nodeWidth + labelToTablePad
+ - (drawingBorders ? 2 : 0), getHeight()
+ - (headerTopPad + 2));
+ }
+ }
+ };
+
+ }
+
+ }
+
+ private static Component getLabelWithHighlight(final Component c,
+ boolean selected) {
+ if (!selected) {
+ return c;
+ } else {
+ return new JComponent() {
+ private static final long serialVersionUID = -9175635475959046704L;
+
+ @Override
+ public Dimension getPreferredSize() {
+ return c.getPreferredSize();
+ }
+
+ @Override
+ protected void paintComponent(Graphics g) {
+ Graphics2D g2d = (Graphics2D) g.create();
+ c.setSize(new Dimension(getWidth(), getHeight()));
+ c.paint(g2d);
+ g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
+ RenderingHints.VALUE_ANTIALIAS_ON);
+ g2d.translate(1, 1);
+ paintRectangleWithHighlightColour(g2d, getWidth() - 2,
+ getHeight() - 2);
+ }
+ };
+ }
+ }
+
+ private static void paintRectangleBorder(Graphics2D g2d, int width,
+ int height, int north, int east, int south, int west, Color c) {
+ Paint oldPaint = g2d.getPaint();
+ Stroke oldStroke = g2d.getStroke();
+
+ g2d.setPaint(c);
+
+ GeneralPath path;
+
+ if (north > 0) {
+ g2d.setStroke(new BasicStroke(north, BasicStroke.CAP_BUTT,
+ BasicStroke.JOIN_MITER));
+ path = new GeneralPath();
+ path.moveTo(0, north - 1);
+ path.lineTo(width - 1, north - 1);
+ g2d.draw(path);
+ }
+ if (east > 0) {
+ g2d.setStroke(new BasicStroke(east, BasicStroke.CAP_BUTT,
+ BasicStroke.JOIN_MITER));
+ path = new GeneralPath();
+ path.moveTo(width - east, 0);
+ path.lineTo(width - east, height - 1);
+ g2d.draw(path);
+ }
+ if (south > 0) {
+ g2d.setStroke(new BasicStroke(south, BasicStroke.CAP_BUTT,
+ BasicStroke.JOIN_MITER));
+ path = new GeneralPath();
+ path.moveTo(0, height - south);
+ path.lineTo(width - 1, height - south);
+ g2d.draw(path);
+ }
+ if (west > 0) {
+ g2d.setStroke(new BasicStroke(west, BasicStroke.CAP_BUTT,
+ BasicStroke.JOIN_MITER));
+ path = new GeneralPath();
+ path.moveTo(west - 1, 0);
+ path.lineTo(west - 1, height - 1);
+ g2d.draw(path);
+ }
+
+ g2d.setPaint(oldPaint);
+ g2d.setStroke(oldStroke);
+ }
+
+ /**
+ * Paint a rectangle with the border colour set from the UIManager
+ * 'textHighlight' property and filled with the same colour at alpha 50/255.
+ * Paints from 0,0 to width-1,height-1 into the specified Graphics2D,
+ * preserving the existing paint and stroke properties on exit.
+ */
+ private static void paintRectangleWithHighlightColour(Graphics2D g2d,
+ int width, int height) {
+ GeneralPath path = new GeneralPath();
+ path.moveTo(0, 0);
+ path.lineTo(width - 1, 0);
+ path.lineTo(width - 1, height - 1);
+ path.lineTo(0, height - 1);
+ path.closePath();
+
+ Paint oldPaint = g2d.getPaint();
+ Stroke oldStroke = g2d.getStroke();
+
+ Color c = UIManager.getColor("textHighlight");
+
+ g2d.setStroke(new BasicStroke(2, BasicStroke.CAP_BUTT,
+ BasicStroke.JOIN_MITER));
+ g2d.setPaint(c);
+ g2d.draw(path);
+
+ Color alpha = new Color(c.getRed(), c.getGreen(), c.getBlue(), 50);
+ g2d.setPaint(alpha);
+ g2d.fill(path);
+
+ g2d.setPaint(oldPaint);
+ g2d.setStroke(oldStroke);
+
+ }
+
+ /**
+ * Paint a bevelled rectangle into the specified Graphics2D with shape from
+ * 0,0 to width-1,height-1 using the specified colour as a base and
+ * preserving colour and stroke in the Graphics2D
+ */
+ private void paintRectangleWithBevel(Graphics2D g2d, int width, int height,
+ Color c) {
+ if (drawingBorders) {
+ width = width - 1;
+ height = height - 1;
+ }
+
+ GeneralPath path = new GeneralPath();
+ path.moveTo(0, 0);
+ path.lineTo(width - 1, 0);
+ path.lineTo(width - 1, height - 1);
+ path.lineTo(0, height - 1);
+ path.closePath();
+
+ Paint oldPaint = g2d.getPaint();
+ Stroke oldStroke = g2d.getStroke();
+
+ g2d.setPaint(c);
+ g2d.fill(path);
+
+ g2d.setStroke(new BasicStroke(1, BasicStroke.CAP_BUTT,
+ BasicStroke.JOIN_MITER));
+
+ // Draw highlight (Northeast)
+ path = new GeneralPath();
+ path.moveTo(0, 0);
+ path.lineTo(width - 1, 0);
+ path.lineTo(width - 1, height - 1);
+ Color highlightColour = new Color((c.getRed() * blendFactor + 255)
+ / (blendFactor + 1), (c.getGreen() * blendFactor + 255)
+ / (blendFactor + 1), (c.getBlue() * blendFactor + 255)
+ / (blendFactor + 1));
+ g2d.setPaint(highlightColour);
+ g2d.draw(path);
+
+ // Draw shadow (Southwest)
+ path = new GeneralPath();
+ path.moveTo(0, 0);
+ path.lineTo(0, height - 1);
+ path.lineTo(width - 1, height - 1);
+ Color shadowColour = new Color((c.getRed() * blendFactor)
+ / (blendFactor + 1), (c.getGreen() * blendFactor)
+ / (blendFactor + 1), (c.getBlue() * blendFactor)
+ / (blendFactor + 1));
+ g2d.setPaint(shadowColour);
+ g2d.draw(path);
+
+ g2d.setPaint(oldPaint);
+ g2d.setStroke(oldStroke);
+
+ }
+
+ /**
+ * The TreeUI which was used to determine the per node indentation in the
+ * JTree for which this is a renderer. If this hasn't been set yet then this
+ * is null.
+ */
+ private static TreeUI cachedTreeUI = null;
+
+ /**
+ * Use the current TreeUI to determine the indentation per-node in the tree,
+ * this only works when the treeRow passed in is not the root as it has to
+ * traverse up to the parent to do anything sensible. Cached and associated
+ * with the TreeUI so in theory if the look and feel changes the UI changes
+ * and this is re-generated within the renderer code.
+ *
+ * @param tree
+ * @param treeRow
+ * @return
+ */
+ private static int getPerNodeIndentation(JTree tree, int treeRow) {
+ if (perNodeOffset > 0 && tree.getUI() == cachedTreeUI) {
+ return perNodeOffset;
+ }
+ TreeUI uiModel = tree.getUI();
+ cachedTreeUI = uiModel;
+ TreePath path = tree.getPathForRow(treeRow);
+ Rectangle nodeBounds = uiModel.getPathBounds(tree, path);
+ Rectangle parentNodeBounds = uiModel.getPathBounds(tree, path
+ .getParentPath());
+ perNodeOffset = (int) nodeBounds.getMinX()
+ - (int) parentNodeBounds.getMinX();
+ return perNodeOffset;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-partition/src/main/java/net/sf/taverna/t2/partition/ui/UITest.java
----------------------------------------------------------------------
diff --git a/taverna-partition/src/main/java/net/sf/taverna/t2/partition/ui/UITest.java b/taverna-partition/src/main/java/net/sf/taverna/t2/partition/ui/UITest.java
new file mode 100644
index 0000000..05a6112
--- /dev/null
+++ b/taverna-partition/src/main/java/net/sf/taverna/t2/partition/ui/UITest.java
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.partition.ui;
+
+import java.awt.BorderLayout;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+
+import net.sf.taverna.t2.partition.PartitionAlgorithm;
+import net.sf.taverna.t2.partition.algorithms.LiteralValuePartitionAlgorithm;
+
+public class UITest extends JFrame {
+
+ private static final long serialVersionUID = -734851883737477053L;
+
+ public UITest() {
+ super();
+ getContentPane().setLayout(new BorderLayout());
+ List<PartitionAlgorithm<?>> paList = new ArrayList<PartitionAlgorithm<?>>();
+ paList.add(new LiteralValuePartitionAlgorithm());
+ paList.add(new LiteralValuePartitionAlgorithm());
+ paList.add(new LiteralValuePartitionAlgorithm());
+ PartitionAlgorithmListEditor pale = new PartitionAlgorithmListEditor(paList);
+ getContentPane().add(pale, BorderLayout.NORTH);
+ setVisible(true);
+
+ }
+
+ public static void main(String[] args) {
+ JLabel l = new JLabel("Foo");
+ System.out.println(l.getPreferredSize());
+ System.out.println(l.getWidth());
+
+ new UITest();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-partition/src/test/java/net/sf/taverna/t2/partition/PartitionTestApplication.java
----------------------------------------------------------------------
diff --git a/taverna-partition/src/test/java/net/sf/taverna/t2/partition/PartitionTestApplication.java b/taverna-partition/src/test/java/net/sf/taverna/t2/partition/PartitionTestApplication.java
new file mode 100644
index 0000000..07364f1
--- /dev/null
+++ b/taverna-partition/src/test/java/net/sf/taverna/t2/partition/PartitionTestApplication.java
@@ -0,0 +1,280 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.partition;
+
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.FlowLayout;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.swing.BoxLayout;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JScrollPane;
+import javax.swing.JTree;
+import javax.swing.SwingUtilities;
+import javax.swing.UIManager;
+import javax.swing.event.TreeModelEvent;
+import javax.swing.tree.TreeCellRenderer;
+import javax.swing.tree.TreeModel;
+import javax.swing.tree.TreePath;
+
+import net.sf.taverna.t2.partition.algorithms.LiteralValuePartitionAlgorithm;
+import net.sf.taverna.t2.partition.ui.TableTreeNodeColumn;
+import net.sf.taverna.t2.partition.ui.TableTreeNodeRenderer;
+
+/**
+ * Exercise the partition algorithm codes
+ *
+ * @author Tom Oinn
+ *
+ */
+public class PartitionTestApplication {
+
+ final static PropertyExtractorRegistry reg = new ExampleExtractorRegistry();
+
+ public static void main(String[] args) throws InterruptedException {
+ try {
+ // Set System L&F
+ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+ } catch (Exception e) {
+ //
+ }
+
+ JFrame frame = new JFrame("Partition test");
+ frame.addWindowListener(new WindowAdapter() {
+ @Override
+ public void windowClosing(WindowEvent e) {
+ System.exit(0);
+ }
+
+ });
+
+ RootPartition<ExampleItem> partition = new RootPartition<ExampleItem>(
+ getAlgorithms(), reg);
+ JTree partitionTree = new AlwaysOpenJTree(partition);
+ partitionTree.setRowHeight(24);
+ TreeCellRenderer oldRenderer = partitionTree.getCellRenderer();
+ TableTreeNodeRenderer ttnr = new TableTreeNodeRenderer(oldRenderer, 50) {
+ @Override
+ public TableTreeNodeColumn[] getColumns() {
+ return new TableTreeNodeColumn[] {
+ new TableTreeNodeColumnImpl("int", new Color(150, 150,
+ 210), 60,reg),
+ new TableTreeNodeColumnImpl("float", new Color(150,
+ 210, 150), 60,reg),
+ new TableTreeNodeColumnImpl("name", new Color(210, 150,
+ 150), 60,reg) ,
+ new TableTreeNodeColumnImpl("Fish", new Color(210, 150,
+ 150), 60,reg) };
+ }
+ };
+
+ ttnr.setBorderColour(new Color(150, 150, 150));
+
+ partitionTree.setCellRenderer(ttnr);
+
+ frame.getContentPane().setLayout(new BoxLayout(frame.getContentPane(),BoxLayout.Y_AXIS));
+ frame.getContentPane().add(new JScrollPane(partitionTree));
+ frame.getContentPane().add(new JScrollPane(partitionTree));
+ frame.setSize(400, 200);
+ frame.setVisible(true);
+ boolean showFrames = false;
+ //while (true) {
+ ttnr.setDrawBorders(showFrames);
+ showFrames = !showFrames;
+ for (ExampleItem item : exampleItems) {
+ Thread.sleep(200);
+ partition.addOrUpdateItem(item);
+ }
+// Thread.sleep(1000);
+// for (ExampleItem item : exampleItems) {
+// Thread.sleep(400);
+// partition.removeItem(item);
+// }
+ //}
+ }
+
+ static ExampleItem[] exampleItems = new ExampleItem[] {
+ new ExampleItem("foo", 1, 2.0f), new ExampleItem("bar", 1, 2.0f),
+ new ExampleItem("foo", 4, 3.7f), new ExampleItem("foo", 3, 2.0f),
+ new ExampleItem("bar", 1, 3.5f), new ExampleItem("bar", 1, 7.5f),
+ new ExampleItem("foo", 1, 2.1f), new ExampleItem("bar", 1, 2.3f),
+ new ExampleItem("foo", 4, 3.8f), new ExampleItem("foo", 3, 2.4f) };
+
+ static class TableTreeNodeColumnImpl implements TableTreeNodeColumn {
+
+ private String propertyName;
+ private Color colour;
+ private int columnWidth;
+ private PropertyExtractorRegistry reg;
+
+ public TableTreeNodeColumnImpl(String propertyName, Color colour,
+ int width,PropertyExtractorRegistry reg) {
+ this.propertyName = propertyName;
+ this.colour = colour;
+ this.columnWidth = width;
+ this.reg=reg;
+ }
+
+ public Component getCellRenderer(Object value) {
+ Object propertyValue = reg.getAllPropertiesFor(value).get(
+ propertyName);
+ if (propertyValue == null) {
+ propertyValue = "Not defined";
+ }
+ return new JLabel(propertyValue.toString());
+ }
+
+ public Color getColour() {
+ return this.colour;
+ }
+
+ public int getColumnWidth() {
+ return columnWidth;
+ }
+
+ public String getDescription() {
+ return "A description...";
+ }
+
+ public String getShortName() {
+ return propertyName;
+ }
+
+ }
+
+ static List<PartitionAlgorithm<?>> getAlgorithms() {
+ List<PartitionAlgorithm<?>> paList = new ArrayList<PartitionAlgorithm<?>>();
+ LiteralValuePartitionAlgorithm lvpa = new LiteralValuePartitionAlgorithm();
+ lvpa.setPropertyName("float");
+
+ LiteralValuePartitionAlgorithm lvpa2 = new LiteralValuePartitionAlgorithm();
+ lvpa2.setPropertyName("int");
+ LiteralValuePartitionAlgorithm lvpa3 = new LiteralValuePartitionAlgorithm();
+ lvpa3.setPropertyName("name");
+
+ paList.add(lvpa2);
+ paList.add(lvpa);
+ paList.add(lvpa3);
+
+ return paList;
+ }
+
+ static class ExampleItem implements Comparable<Object>{
+ private String name;
+ private int intValue;
+ private float floatValue;
+
+ public String getName() {
+ return this.name;
+ }
+
+ public int getIntValue() {
+ return this.intValue;
+ }
+
+ public float getFloatValue() {
+ return this.floatValue;
+ }
+
+ public ExampleItem(String name, int intValue, float floatValue) {
+ this.name = name;
+ this.intValue = intValue;
+ this.floatValue = floatValue;
+ }
+
+ @Override
+ public String toString() {
+ return this.name;
+ }
+
+ public int compareTo(Object o) {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+ }
+
+ static class ExampleExtractorRegistry implements PropertyExtractorRegistry {
+ public Map<String, Object> getAllPropertiesFor(Object target) {
+ Map<String, Object> properties = new HashMap<String, Object>();
+ if (target instanceof ExampleItem) {
+ ExampleItem item = (ExampleItem) target;
+ properties.put("name", item.getName());
+ properties.put("int", item.getIntValue());
+ properties.put("float", item.getFloatValue());
+ properties.put("Fish", "Soup");
+ }
+
+ return properties;
+ }
+ }
+
+ static class AlwaysOpenJTree extends JTree {
+
+ private static final long serialVersionUID = -3769998854485605447L;
+
+ public AlwaysOpenJTree(TreeModel newModel) {
+ super(newModel);
+ setEditable(false);
+ setExpandsSelectedPaths(false);
+ setDragEnabled(false);
+ setScrollsOnExpand(false);
+ // setSelectionModel(SingleSelectionModel.sharedInstance());
+ }
+
+ @Override
+ public void setModel(TreeModel model) {
+ if (treeModel == model)
+ return;
+ if (treeModelListener == null)
+ treeModelListener = new TreeModelHandler() {
+ @Override
+ public void treeNodesInserted(final TreeModelEvent ev) {
+ if (ev.getChildren()[0] instanceof Partition == false) {
+ SwingUtilities.invokeLater(new Runnable() {
+ public void run() {
+ TreePath path = ev.getTreePath();
+ setExpandedState(path, true);
+ fireTreeExpanded(path);
+ }
+ });
+ }
+
+ }
+
+ };
+ if (model != null) {
+ model.addTreeModelListener(treeModelListener);
+ }
+ TreeModel oldValue = treeModel;
+ treeModel = model;
+ firePropertyChange(TREE_MODEL_PROPERTY, oldValue, model);
+ }
+
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-partition/src/test/java/net/sf/taverna/t2/partition/algorithms/LiteralValuePartitionAlgorithmTest.java
----------------------------------------------------------------------
diff --git a/taverna-partition/src/test/java/net/sf/taverna/t2/partition/algorithms/LiteralValuePartitionAlgorithmTest.java b/taverna-partition/src/test/java/net/sf/taverna/t2/partition/algorithms/LiteralValuePartitionAlgorithmTest.java
new file mode 100644
index 0000000..4e8f93c
--- /dev/null
+++ b/taverna-partition/src/test/java/net/sf/taverna/t2/partition/algorithms/LiteralValuePartitionAlgorithmTest.java
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.partition.algorithms;
+
+import static org.junit.Assert.*;
+import net.sf.taverna.t2.partition.algorithms.LiteralValuePartitionAlgorithm;
+
+import org.junit.Test;
+
+public class LiteralValuePartitionAlgorithmTest {
+
+ @Test
+ public void testEquals() {
+ LiteralValuePartitionAlgorithm a = new LiteralValuePartitionAlgorithm();
+ LiteralValuePartitionAlgorithm b = new LiteralValuePartitionAlgorithm();
+ LiteralValuePartitionAlgorithm c = new LiteralValuePartitionAlgorithm();
+
+ a.setPropertyName("cheese");
+ b.setPropertyName("cheese");
+ c.setPropertyName("butter");
+
+ assertEquals("They should be equal",a,a);
+ assertEquals("They should be equal",a,b);
+ assertFalse("They should not be equal",a.equals(c));
+ assertFalse("They should not be equal",a.equals("cheese"));
+ }
+
+ @Test
+ public void testHashcode() {
+ LiteralValuePartitionAlgorithm a = new LiteralValuePartitionAlgorithm();
+ LiteralValuePartitionAlgorithm b = new LiteralValuePartitionAlgorithm();
+ LiteralValuePartitionAlgorithm c = new LiteralValuePartitionAlgorithm();
+
+ a.setPropertyName("cheese");
+ b.setPropertyName("cheese");
+ c.setPropertyName("Z");
+
+ assertEquals("They should have the same hashcode",a.hashCode(),b.hashCode());
+ }
+
+ @Test
+ public void testConstructor() {
+ LiteralValuePartitionAlgorithm p = new LiteralValuePartitionAlgorithm();
+ assertNull("The property shoudl default to null",p.getPropertyName());
+
+ p=new LiteralValuePartitionAlgorithm("pea");
+ assertEquals("The property name should default to 'pea'","pea",p.getPropertyName());
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-ui/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-ui/pom.xml b/taverna-ui/pom.xml
new file mode 100644
index 0000000..6d42dc3
--- /dev/null
+++ b/taverna-ui/pom.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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>net.sf.taverna.t2</groupId>
+ <artifactId>lang</artifactId>
+ <version>2.0.1-SNAPSHOT</version>
+ </parent>
+ <groupId>net.sf.taverna.t2.lang</groupId>
+ <artifactId>ui</artifactId>
+ <packaging>bundle</packaging>
+ <name>User interface (Swing) utility classes</name>
+ <dependencies>
+ <dependency>
+ <groupId>net.sf.taverna.t2.lang</groupId>
+ <artifactId>observer</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.taverna.jedit</groupId>
+ <artifactId>jedit-syntax</artifactId>
+ <version>${jedit.syntax.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>${commons.io.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.log4j</groupId>
+ <artifactId>com.springsource.org.apache.log4j</artifactId>
+ <version>${log4j.version}</version>
+ </dependency>
+ </dependencies>
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/CArrowImage.java
----------------------------------------------------------------------
diff --git a/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/CArrowImage.java b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/CArrowImage.java
new file mode 100644
index 0000000..6a258de
--- /dev/null
+++ b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/CArrowImage.java
@@ -0,0 +1,198 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.lang.ui;
+
+import java.awt.Color;
+import java.awt.GradientPaint;
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
+import java.awt.SystemColor;
+import java.awt.RenderingHints.Key;
+import java.awt.geom.GeneralPath;
+import java.awt.geom.Line2D;
+import java.awt.image.BufferedImage;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * A BufferedImage of one of four types of arrow (up, down, left or right) drawn
+ * to the size specified on the constructor.
+ */
+public class CArrowImage extends BufferedImage {
+ // Constants...
+ public static final int ARROW_UP = 0;
+
+ public static final int ARROW_DOWN = 1;
+
+ public static final int ARROW_LEFT = 2;
+
+ public static final int ARROW_RIGHT = 3;
+
+ // Member variables...
+ private GeneralPath _pathArrow = new GeneralPath();
+
+ // Constructor...
+ public CArrowImage(int nArrowDirection) {
+ this(15, 9, nArrowDirection);
+ }
+
+ public CArrowImage(int nWidth, int nHeight, int nArrowDirection) {
+ super(nWidth, nHeight, TYPE_INT_ARGB_PRE); // Set the width, height and
+ // image type
+
+ Map<Key, Object> map = new HashMap<Key, Object>();
+ map.put(RenderingHints.KEY_ANTIALIASING,
+ RenderingHints.VALUE_ANTIALIAS_ON);
+ map.put(RenderingHints.KEY_RENDERING,
+ RenderingHints.VALUE_RENDER_QUALITY);
+ RenderingHints hints = new RenderingHints(map);
+
+ Graphics2D g2 = this.createGraphics(); // Create a graphics context for
+ // this buffered image
+ g2.setRenderingHints(hints);
+
+ float h = getHeight();
+ float w = getWidth();
+ float w13 = w / 3;
+ float w12 = w / 2;
+ float w23 = w * 2 / 3;
+ float h13 = h / 3;
+ float h12 = h / 2;
+ float h23 = h * 2 / 3;
+
+ switch (nArrowDirection) {
+ case ARROW_UP:
+ _pathArrow.moveTo(w12, h12);
+ _pathArrow.lineTo(w12, 0);
+ _pathArrow.lineTo(w, h - 1);
+ _pathArrow.lineTo(0, h - 1);
+ _pathArrow.closePath();
+ g2.setPaint(new GradientPaint(w13, h13,
+ SystemColor.controlLtHighlight, w, h - 1,
+ SystemColor.controlShadow));
+
+ g2.fill(_pathArrow);
+
+ g2.setColor(SystemColor.controlDkShadow);
+ g2.draw(new Line2D.Float(0, h - 1, w, h - 1));
+ g2.setColor(SystemColor.controlShadow);
+ g2.draw(new Line2D.Float(w12, 0, w, h - 1));
+ g2.setColor(SystemColor.controlLtHighlight);
+ g2.draw(new Line2D.Float(0, h - 1, w12, 0));
+ break;
+
+ case ARROW_DOWN:
+ _pathArrow.moveTo(w12, h12);
+ _pathArrow.lineTo(w, 0);
+ _pathArrow.lineTo(w12, h - 1);
+ _pathArrow.closePath();
+ g2.setPaint(new GradientPaint(0, 0, SystemColor.controlLtHighlight,
+ w23, h23, SystemColor.controlShadow));
+ g2.fill(_pathArrow);
+
+ g2.setColor(SystemColor.controlDkShadow);
+ g2.draw(new Line2D.Float(w, 0, w12, h - 1));
+ g2.setColor(SystemColor.controlShadow);
+ g2.draw(new Line2D.Float(w12, h - 1, 0, 0));
+ g2.setColor(SystemColor.controlLtHighlight);
+ g2.draw(new Line2D.Float(0, 0, w, 0));
+ break;
+
+ case ARROW_LEFT:
+ _pathArrow.moveTo(w - 1, h13);
+ _pathArrow.lineTo(w13, h13);
+ _pathArrow.lineTo(w13, 0);
+ _pathArrow.lineTo(0, h12);
+ _pathArrow.lineTo(w13, h - 1);
+ _pathArrow.lineTo(w13, h23);
+ _pathArrow.lineTo(w - 1, h23);
+ _pathArrow.closePath();
+ g2.setPaint(new GradientPaint(0, 0, Color.white, // SystemColor.
+ // controlLtHighlight
+ // ,
+ 0, h, SystemColor.controlShadow));
+ g2.fill(_pathArrow);
+
+ _pathArrow.reset();
+ _pathArrow.moveTo(w13, 0);
+ _pathArrow.lineTo(w13, h13);
+ _pathArrow.moveTo(w - 1, h13);
+ _pathArrow.lineTo(w - 1, h23);
+ _pathArrow.lineTo(w13, h23);
+ _pathArrow.lineTo(w13, h - 1);
+ g2.setColor(SystemColor.controlDkShadow);
+ g2.draw(_pathArrow);
+
+ g2.setColor(SystemColor.controlShadow);
+ g2.draw(new Line2D.Float(0, h12, w13, h - 1));
+
+ _pathArrow.reset();
+ _pathArrow.moveTo(0, h12);
+ _pathArrow.lineTo(w13, 0);
+ _pathArrow.moveTo(w13, h13);
+ _pathArrow.lineTo(w - 1, h13);
+ g2.setColor(SystemColor.controlLtHighlight);
+ g2.draw(_pathArrow);
+ break;
+
+ case ARROW_RIGHT:
+ default: {
+ _pathArrow.moveTo(0, h13);
+ _pathArrow.lineTo(w23, h13);
+ _pathArrow.lineTo(w23, 0);
+ _pathArrow.lineTo(w - 1, h12);
+ _pathArrow.lineTo(w23, h - 1);
+ _pathArrow.lineTo(w23, h23);
+ _pathArrow.lineTo(0, h23);
+ _pathArrow.closePath();
+ g2.setPaint(new GradientPaint(0, 0, Color.white, // SystemColor.
+ // controlLtHighlight
+ // ,
+ 0, h, SystemColor.controlShadow));
+ g2.fill(_pathArrow);
+
+ _pathArrow.reset();
+ _pathArrow.moveTo(0, h23);
+ _pathArrow.lineTo(w23, h23);
+ _pathArrow.moveTo(w23, h - 1);
+ _pathArrow.lineTo(w - 1, h12);
+ g2.setColor(SystemColor.controlDkShadow);
+ g2.draw(_pathArrow);
+
+ g2.setColor(SystemColor.controlShadow);
+ g2.draw(new Line2D.Float(w - 1, h12, w23, 0));
+
+ _pathArrow.reset();
+ _pathArrow.moveTo(w23, 0);
+ _pathArrow.lineTo(w23, h13);
+ _pathArrow.lineTo(0, h13);
+ _pathArrow.lineTo(0, h23);
+ _pathArrow.moveTo(w23, h23);
+ _pathArrow.lineTo(w23, h - 1);
+ g2.setColor(SystemColor.controlLtHighlight);
+ g2.draw(_pathArrow);
+ break;
+ }
+ }
+
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/CTransferableTreePath.java
----------------------------------------------------------------------
diff --git a/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/CTransferableTreePath.java b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/CTransferableTreePath.java
new file mode 100644
index 0000000..2d85203
--- /dev/null
+++ b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/CTransferableTreePath.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.lang.ui;
+
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.Transferable;
+import java.awt.datatransfer.UnsupportedFlavorException;
+
+import javax.swing.tree.TreePath;
+
+/**
+ * This represents a TreePath (a node in a JTree) that can be transferred
+ * between a drag source and a drop target.
+ */
+public class CTransferableTreePath implements Transferable {
+ // The type of DnD object being dragged...
+ public static final DataFlavor TREEPATH_FLAVOR = new DataFlavor(
+ DataFlavor.javaJVMLocalObjectMimeType, "TreePath");
+
+ private TreePath _path;
+
+ private DataFlavor[] _flavors = { TREEPATH_FLAVOR };
+
+ /**
+ * Constructs a transferrable tree path object for the specified path.
+ */
+ public CTransferableTreePath(TreePath path) {
+ _path = path;
+ }
+
+ // Transferable interface methods...
+ public DataFlavor[] getTransferDataFlavors() {
+ return _flavors;
+ }
+
+ public boolean isDataFlavorSupported(DataFlavor flavor) {
+ return java.util.Arrays.asList(_flavors).contains(flavor);
+ }
+
+ public synchronized Object getTransferData(DataFlavor flavor)
+ throws UnsupportedFlavorException {
+ if (flavor.isMimeTypeEqual(TREEPATH_FLAVOR.getMimeType())) // DataFlavor.javaJVMLocalObjectMimeType))
+ return _path;
+ else
+ throw new UnsupportedFlavorException(flavor);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/DeselectingButton.java
----------------------------------------------------------------------
diff --git a/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/DeselectingButton.java b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/DeselectingButton.java
new file mode 100644
index 0000000..ea29adb
--- /dev/null
+++ b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/DeselectingButton.java
@@ -0,0 +1,45 @@
+/**
+ *
+ */
+package net.sf.taverna.t2.lang.ui;
+
+import java.awt.Component;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.AbstractAction;
+import javax.swing.Action;
+import javax.swing.JButton;
+
+/**
+ * @author alanrw
+ *
+ */
+public class DeselectingButton extends JButton {
+
+ public DeselectingButton(String name, final ActionListener action, String toolTip) {
+ super();
+ this.setAction(new AbstractAction() {
+
+ public void actionPerformed(ActionEvent e) {
+ Component parent = DeselectingButton.this.getParent();
+ action.actionPerformed(e);
+ parent.requestFocusInWindow();
+ }
+ });
+ this.setText(name);
+ this.setToolTipText(toolTip);
+ }
+
+ public DeselectingButton(String name, final ActionListener action) {
+ this(name, action, null);
+ }
+
+ public DeselectingButton(final Action action, String toolTip) {
+ this((String) action.getValue(Action.NAME), action, toolTip);
+ }
+
+ public DeselectingButton(final Action action) {
+ this(action, null);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/DialogTextArea.java
----------------------------------------------------------------------
diff --git a/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/DialogTextArea.java b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/DialogTextArea.java
new file mode 100644
index 0000000..faf2643
--- /dev/null
+++ b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/DialogTextArea.java
@@ -0,0 +1,83 @@
+/**
+ *
+ */
+package net.sf.taverna.t2.lang.ui;
+
+import java.awt.Font;
+
+import javax.swing.JTextArea;
+import javax.swing.text.Document;
+
+/**
+ * @author alanrw
+ *
+ */
+public class DialogTextArea extends JTextArea {
+
+ private static Font newFont = Font.decode("Dialog");
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 2329063139827993252L;
+
+ /**
+ *
+ */
+ public DialogTextArea() {
+ updateFont();
+ }
+
+ /**
+ * @param text
+ */
+ public DialogTextArea(String text) {
+ super(text);
+ updateFont();
+ }
+
+ /**
+ * @param doc
+ */
+ public DialogTextArea(Document doc) {
+ super(doc);
+ updateFont();
+ }
+
+ /**
+ * @param rows
+ * @param columns
+ */
+ public DialogTextArea(int rows, int columns) {
+ super(rows, columns);
+ updateFont();
+ }
+
+ /**
+ * @param text
+ * @param rows
+ * @param columns
+ */
+ public DialogTextArea(String text, int rows, int columns) {
+ super(text, rows, columns);
+ updateFont();
+ }
+
+ /**
+ * @param doc
+ * @param text
+ * @param rows
+ * @param columns
+ */
+ public DialogTextArea(Document doc, String text, int rows, int columns) {
+ super(doc, text, rows, columns);
+ updateFont();
+ }
+
+ private void updateFont() {
+ if (newFont != null) {
+ this.setFont(newFont);
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/EdgeLineBorder.java
----------------------------------------------------------------------
diff --git a/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/EdgeLineBorder.java b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/EdgeLineBorder.java
new file mode 100644
index 0000000..f49faa1
--- /dev/null
+++ b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/EdgeLineBorder.java
@@ -0,0 +1,91 @@
+/*******************************************************************************
+ * Copyright (C) 2013 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.lang.ui;
+
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Graphics;
+import java.awt.Insets;
+
+import javax.swing.JFrame;
+import javax.swing.JPanel;
+import javax.swing.border.Border;
+import javax.swing.border.LineBorder;
+
+/**
+ *
+ *
+ * @author David Withers
+ */
+public class EdgeLineBorder implements Border {
+
+ public static final int TOP = 1;
+ public static final int BOTTOM = 2;
+ public static final int LEFT = 3;
+ public static final int RIGHT = 4;
+ private final int edge;
+ private final Color color;
+
+ public EdgeLineBorder(int edge, Color color) {
+ this.edge = edge;
+ this.color = color;
+ }
+
+ @Override
+ public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
+ Color oldColor = g.getColor();
+ g.setColor(color);
+ switch (edge) {
+ case TOP:
+ g.drawLine(x, y, x+width, y);
+ break;
+ case BOTTOM:
+ g.drawLine(x, y+height-2, x+width, y+height-2);
+ break;
+ case LEFT:
+ g.drawLine(x, y, x+width, y+height);
+ break;
+ case RIGHT:
+ g.drawLine(x+width, y, x+width, y+height);
+ break;
+ }
+ g.setColor(oldColor);
+ }
+
+ @Override
+ public Insets getBorderInsets(Component c) {
+ return new Insets(0, 0, 0, 0);
+ }
+
+ @Override
+ public boolean isBorderOpaque() {
+ return false;
+ }
+
+ public static void main(String[] args) {
+ JFrame frame = new JFrame();
+ frame.setSize(500, 500);
+ JPanel panel = new JPanel();
+ panel.setBorder(new EdgeLineBorder(TOP, Color.GRAY));
+ frame.add(panel);
+ frame.setVisible(true);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/EditorKeySetUtil.java
----------------------------------------------------------------------
diff --git a/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/EditorKeySetUtil.java b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/EditorKeySetUtil.java
new file mode 100644
index 0000000..0e8d908
--- /dev/null
+++ b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/EditorKeySetUtil.java
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * Copyright (C) 2009 Ingo Wassink of University of Twente, Netherlands and
+ * The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+
+/**
+ * @author Ingo Wassink
+ * @author Ian Dunlop
+ * @author Alan R Williams
+ */
+package net.sf.taverna.t2.lang.ui;
+
+import java.io.BufferedReader;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.TreeSet;
+
+import org.apache.log4j.Logger;
+
+/**
+ * Manager for reading key set file
+ *
+ * @author WassinkI
+ * @author alanrw
+ *
+ */
+public class EditorKeySetUtil {
+
+ private static Logger logger = Logger.getLogger(EditorKeySetUtil.class);
+
+
+ public static Set<String> loadKeySet(InputStream stream) {
+ Set<String> result = new TreeSet<String>();
+ try {
+ BufferedReader reader = new BufferedReader(
+ new InputStreamReader(stream));
+
+ String line;
+ while ((line = reader.readLine()) != null) {
+ result.add(line.trim());
+ }
+ reader.close();
+ } catch (Exception e) {
+ logger.error(e);
+ }
+ return result;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/ExtensionFileFilter.java
----------------------------------------------------------------------
diff --git a/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/ExtensionFileFilter.java b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/ExtensionFileFilter.java
new file mode 100644
index 0000000..35e2417
--- /dev/null
+++ b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/ExtensionFileFilter.java
@@ -0,0 +1,105 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+/**
+ * This file is a component of the Taverna project,
+ * and is licensed under the GNU LGPL.
+ * Copyright Tom Oinn, EMBL-EBI
+ */
+package net.sf.taverna.t2.lang.ui;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.swing.filechooser.FileFilter;
+
+/**
+ * A FileFilter implementation that can be configured to show only specific file
+ * suffixes.
+ *
+ * @author Tom Oinn
+ * @author Stian Soiland-Reyes
+ */
+public class ExtensionFileFilter extends FileFilter {
+ List<String> allowedExtensions;
+
+ public ExtensionFileFilter(List<String> extensions) {
+ setAllowedExtensions(extensions);
+ }
+
+ public ExtensionFileFilter(String[] allowedExtensions) {
+ setAllowedExtensions(Arrays.asList(allowedExtensions));
+ }
+
+ private void setAllowedExtensions(List<String> extensions) {
+ this.allowedExtensions = new ArrayList<String>();
+ for (String e : extensions) {
+ if (e.startsWith(".")) {
+ if (e.length() > 1) {
+ allowedExtensions.add(e.substring(1));
+ }
+ }
+ else {
+ allowedExtensions.add(e);
+ }
+ }
+ }
+
+ @Override
+ public boolean accept(File f) {
+ if (f.isDirectory()) {
+ return true;
+ }
+ String extension = getExtension(f);
+ if (extension != null) {
+ for (String allowedExtension : allowedExtensions) {
+ if (extension.equalsIgnoreCase(allowedExtension)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ String getExtension(File f) {
+ String ext = null;
+ String s = f.getName();
+ int i = s.lastIndexOf('.');
+ if (i > 0 && i < s.length() - 1) {
+ ext = s.substring(i + 1).toLowerCase();
+ }
+ return ext;
+ }
+
+ @Override
+ public String getDescription() {
+ StringBuffer sb = new StringBuffer();
+ sb.append("Filter for extensions : " );
+ for (int i = 0; i < allowedExtensions.size(); i++) {
+ sb.append(allowedExtensions.get(i));
+ if (i < allowedExtensions.size() - 1) {
+ sb.append(", ");
+ }
+ }
+ return sb.toString();
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/FileTools.java
----------------------------------------------------------------------
diff --git a/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/FileTools.java b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/FileTools.java
new file mode 100644
index 0000000..4aa5bb2
--- /dev/null
+++ b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/FileTools.java
@@ -0,0 +1,117 @@
+/**
+ *
+ */
+package net.sf.taverna.t2.lang.ui;
+
+import java.awt.Component;
+import java.io.File;
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import java.util.prefs.Preferences;
+
+import javax.swing.JFileChooser;
+import javax.swing.JOptionPane;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.log4j.Logger;
+
+/**
+ * @author alanrw
+ *
+ */
+public class FileTools {
+
+ private static Logger logger = Logger.getLogger(FileTools.class);
+
+
+
+ public static boolean saveStringToFile(Component parent, String dialogTitle, String extension, String content) {
+ JFileChooser fileChooser = new JFileChooser();
+ fileChooser.setDialogTitle(dialogTitle);
+
+ fileChooser.resetChoosableFileFilters();
+ fileChooser.setAcceptAllFileFilterUsed(true);
+
+ fileChooser.setFileFilter(new ExtensionFileFilter(new String[] { extension }));
+
+ Preferences prefs = Preferences.userNodeForPackage(FileTools.class);
+ String curDir = prefs
+ .get("currentDir", System.getProperty("user.home"));
+ fileChooser.setCurrentDirectory(new File(curDir));
+
+ boolean tryAgain = true;
+ while (tryAgain) {
+ tryAgain = false;
+ int returnVal = fileChooser.showSaveDialog(parent);
+ if (returnVal == JFileChooser.APPROVE_OPTION) {
+ prefs.put("currentDir", fileChooser.getCurrentDirectory()
+ .toString());
+ File file = fileChooser.getSelectedFile();
+ if (!file.getName().contains(".")) {
+ String newName = file.getName() + extension;
+ file = new File(file.getParentFile(), newName);
+ }
+
+ // TODO: Open in separate thread to avoid hanging UI
+ try {
+ if (file.exists()) {
+ logger.info("File already exists: " + file);
+ String msg = "Are you sure you want to overwrite existing file "
+ + file + "?";
+ int ret = JOptionPane.showConfirmDialog(
+ parent, msg, "File already exists",
+ JOptionPane.YES_NO_CANCEL_OPTION);
+ if (ret == JOptionPane.YES_OPTION) {
+
+ } else if (ret == JOptionPane.NO_OPTION) {
+ tryAgain = true;
+ continue;
+ } else {
+ logger.info("Aborted overwrite of " + file);
+ return false;
+ }
+ }
+ FileUtils.writeStringToFile(file, content, StandardCharsets.UTF_8.name());
+ logger.info("Saved content by overwriting " + file);
+ return true;
+ } catch (IOException ex) {
+ logger.warn("Could not save content to " + file, ex);
+ JOptionPane.showMessageDialog(parent,
+ "Could not save to " + file + ": \n\n"
+ + ex.getMessage(), "Warning",
+ JOptionPane.WARNING_MESSAGE);
+ return false;
+ }
+ }
+ }
+ return false;
+ }
+
+ public static String readStringFromFile(Component parent, String dialogTitle, String extension) {
+ JFileChooser fileChooser = new JFileChooser();
+ fileChooser.setDialogTitle(dialogTitle);
+ fileChooser.resetChoosableFileFilters();
+ fileChooser.setAcceptAllFileFilterUsed(true);
+
+ fileChooser.setFileFilter(new ExtensionFileFilter(new String[] { extension }));
+
+ Preferences prefs = Preferences.userNodeForPackage(FileTools.class);
+ String curDir = prefs
+ .get("currentDir", System.getProperty("user.home"));
+ fileChooser.setCurrentDirectory(new File(curDir));
+
+ if (fileChooser.showOpenDialog(parent) == JFileChooser.APPROVE_OPTION) {
+ File selectedFile = fileChooser.getSelectedFile();
+
+ try {
+ return FileUtils.readFileToString(selectedFile, StandardCharsets.UTF_8.name());
+ } catch (IOException ioe) {
+ JOptionPane.showMessageDialog(parent, "Can not read file '"
+ + selectedFile.getName() + "'", "Can not read file",
+ JOptionPane.ERROR_MESSAGE);
+ }
+
+ }
+ return null;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/HtmlUtils.java
----------------------------------------------------------------------
diff --git a/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/HtmlUtils.java b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/HtmlUtils.java
new file mode 100644
index 0000000..a30d36f
--- /dev/null
+++ b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/HtmlUtils.java
@@ -0,0 +1,87 @@
+/**
+ *
+ */
+package net.sf.taverna.t2.lang.ui;
+
+import static org.apache.log4j.Logger.getLogger;
+
+import java.awt.BorderLayout;
+import java.awt.Desktop;
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.swing.JEditorPane;
+import javax.swing.JPanel;
+import javax.swing.event.HyperlinkEvent;
+import javax.swing.event.HyperlinkListener;
+
+import org.apache.log4j.Logger;
+
+/**
+ * @author alanrw
+ *
+ */
+public class HtmlUtils {
+
+ private static Logger logger = getLogger(HtmlUtils.class);
+
+
+
+ public static JEditorPane createEditorPane(String html) {
+ JEditorPane result = new JEditorPane("text/html", html);
+ result.addHyperlinkListener(new HyperlinkListener() {
+
+ @Override
+ public void hyperlinkUpdate(HyperlinkEvent arg0) {
+ if (HyperlinkEvent.EventType.ACTIVATED == arg0.getEventType()) {
+ try {
+ Desktop.getDesktop().browse(arg0.getURL().toURI());
+ } catch (IOException | URISyntaxException e1) {
+ logger.error(e1);
+ }
+ }
+ }});
+ result.setEditable(false);
+ return result;
+ }
+
+ public static JPanel panelForHtml(JEditorPane editorPane) {
+ JPanel result = new JPanel();
+
+ result.setLayout(new BorderLayout());
+
+ result.add(editorPane, BorderLayout.CENTER);
+ return result;
+ }
+
+ public static String getStyle(String backgroundColour) {
+ String style = "<style type='text/css'>";
+ style += "table {align:center; border:solid black 1px; background-color:"
+ + backgroundColour
+ + ";width:100%; height:100%; overflow:auto;}";
+ style += "</style>";
+ return style;
+ }
+
+ public static String buildTableOpeningTag() {
+ String result = "<table ";
+ Map<String, String> props = getTableProperties();
+ for (String key : props.keySet()) {
+ result += key + "=\"" + props.get(key) + "\" ";
+ }
+ result += ">";
+ return result;
+ }
+
+ public static Map<String, String> getTableProperties() {
+ Map<String, String> result = new HashMap<String, String>();
+ result.put("border", "1");
+ return result;
+ }
+
+ public static String getHtmlHead(String backgroundColour) {
+ return "<html><head>" + getStyle(backgroundColour) + "</head><body>";
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/JSplitPaneExt.java
----------------------------------------------------------------------
diff --git a/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/JSplitPaneExt.java b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/JSplitPaneExt.java
new file mode 100644
index 0000000..e656c36
--- /dev/null
+++ b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/JSplitPaneExt.java
@@ -0,0 +1,56 @@
+/**
+ *
+ */
+package net.sf.taverna.t2.lang.ui;
+
+import java.awt.Graphics;
+
+import javax.swing.JSplitPane;
+
+/**
+ * Copied from code found on http://www.jguru.com
+ *
+ */
+public class JSplitPaneExt extends JSplitPane {
+
+ protected boolean m_fIsPainted = false;
+ protected double m_dProportionalLocation = -1;
+
+ public JSplitPaneExt() {
+ super();
+ }
+
+ public JSplitPaneExt(int iOrientation) {
+ super(iOrientation);
+ }
+
+ protected boolean hasProportionalLocation() {
+ return (m_dProportionalLocation != -1);
+ }
+
+ public void cancelDividerProportionalLocation() {
+ m_dProportionalLocation = -1;
+ }
+
+ public void setDividerLocation(double dProportionalLocation) {
+ if (dProportionalLocation < 0 || dProportionalLocation > 1) {
+ throw new IllegalArgumentException(
+ "Illegal value for divider location: "
+ + dProportionalLocation);
+ }
+ m_dProportionalLocation = dProportionalLocation;
+ if (m_fIsPainted) {
+ super.setDividerLocation(m_dProportionalLocation);
+ }
+ }
+
+ public void paint(Graphics g) {
+ super.paint(g);
+ if (hasProportionalLocation()) {
+ super.setDividerLocation(m_dProportionalLocation);
+ }
+ m_fIsPainted=true;
+
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/KeywordDocument.java
----------------------------------------------------------------------
diff --git a/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/KeywordDocument.java b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/KeywordDocument.java
new file mode 100644
index 0000000..e8fae14
--- /dev/null
+++ b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/KeywordDocument.java
@@ -0,0 +1,568 @@
+/*******************************************************************************
+ * Copyright (C) 2009 Ingo Wassink of University of Twente, Netherlands and
+ * The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+
+/**
+ * @author Ingo Wassink
+ * @author Ian Dunlop
+ * @author Alan R Williams
+ */
+package net.sf.taverna.t2.lang.ui;
+
+import java.awt.Color;
+import java.util.Set;
+
+import javax.swing.text.AttributeSet;
+import javax.swing.text.BadLocationException;
+import javax.swing.text.DefaultEditorKit;
+import javax.swing.text.DefaultStyledDocument;
+import javax.swing.text.Element;
+import javax.swing.text.MutableAttributeSet;
+import javax.swing.text.SimpleAttributeSet;
+import javax.swing.text.StyleConstants;
+
+import org.apache.log4j.Logger;
+
+public class KeywordDocument extends DefaultStyledDocument {
+
+ private static Logger logger = Logger
+ .getLogger(KeywordDocument.class);
+
+ private DefaultStyledDocument doc;
+ private Element rootElement;
+
+ private boolean multiLineComment;
+ private MutableAttributeSet normal;
+ private MutableAttributeSet keyword;
+ private MutableAttributeSet comment;
+ private MutableAttributeSet quote;
+ private MutableAttributeSet port;
+
+ private Set<String> keywords;
+
+ private Set<String> ports;
+
+
+
+ public KeywordDocument(Set<String> keywords, Set<String> ports) {
+ doc = this;
+ rootElement = doc.getDefaultRootElement();
+ putProperty(DefaultEditorKit.EndOfLineStringProperty, "\n");
+
+ normal = new SimpleAttributeSet();
+ StyleConstants.setForeground(normal, Color.black);
+
+ comment = new SimpleAttributeSet();
+ StyleConstants.setForeground(comment, new Color(0, 139, 69, 255));
+ StyleConstants.setItalic(comment, true);
+
+ keyword = new SimpleAttributeSet();
+ StyleConstants.setForeground(keyword, Color.blue);
+ StyleConstants.setBold(keyword, true);
+
+
+ port = new SimpleAttributeSet();
+ StyleConstants.setForeground(port, Color.magenta);
+
+ quote = new SimpleAttributeSet();
+ StyleConstants.setForeground(quote, Color.red);
+
+ this.keywords = keywords;
+ this.ports = ports;
+ }
+
+ /**
+ * Method for adding an port
+ * @param name the name of the port
+ */
+ public void addPort(String name){
+ ports.add(name);
+ updateText();
+ }
+
+ /**
+ * Method for removing an port
+ * @param name the name of the port
+ */
+ public void removePort(String name){
+ ports.remove(name);
+ updateText();
+ }
+
+ /**
+ * Method for checking whether the name represents an input port
+ * @param name the name of the port
+ * @return true if true
+ */
+ private boolean isPort(String name){
+ return ports.contains(name);
+ }
+
+
+ /**
+ * Method for updating the whole text
+ */
+ private void updateText(){
+ try{
+ processChangedLines(0, getLength() );
+ } catch(Exception e){
+ logger.error("Unable to update text", e);
+ }
+ }
+
+ /*
+ * Override to apply syntax highlighting after the document has been updated
+ */
+ public void insertString(int offset, String str, AttributeSet a)
+ throws BadLocationException {
+ if (str.equals("{"))
+ str = addMatchingBrace(offset);
+
+ super.insertString(offset, str, a);
+ processChangedLines(offset, str.length());
+ }
+
+ /*
+ * Override to apply syntax highlighting after the document has been updated
+ */
+ public void remove(int offset, int length) throws BadLocationException {
+ super.remove(offset, length);
+ processChangedLines(offset, 0);
+ }
+
+ /*
+ * Determine how many lines have been changed, then apply highlighting to
+ * each line
+ */
+ public void processChangedLines(int offset, int length)
+ throws BadLocationException {
+ String content = doc.getText(0, doc.getLength());
+
+ // The lines affected by the latest document update
+
+ int startLine = rootElement.getElementIndex(offset);
+ int endLine = rootElement.getElementIndex(offset + length);
+
+ // Make sure all comment lines prior to the start line are commented
+ // and determine if the start line is still in a multi line comment
+
+ setMultiLineComment(commentLinesBefore(content, startLine));
+
+ // Do the actual highlighting
+
+ for (int i = startLine; i <= endLine; i++) {
+ applyHighlighting(content, i);
+ }
+
+ // Resolve highlighting to the next end multi line delimiter
+
+ if (isMultiLineComment())
+ commentLinesAfter(content, endLine);
+ else
+ highlightLinesAfter(content, endLine);
+ }
+
+ /*
+ * Highlight lines when a multi line comment is still 'open' (ie. matching
+ * end delimiter has not yet been encountered)
+ */
+ private boolean commentLinesBefore(String content, int line) {
+ int offset = rootElement.getElement(line).getStartOffset();
+
+ // Start of comment not found, nothing to do
+
+ int startDelimiter = lastIndexOf(content, getStartDelimiter(),
+ offset - 2);
+
+ if (startDelimiter < 0)
+ return false;
+
+ // Matching start/end of comment found, nothing to do
+
+ int endDelimiter = indexOf(content, getEndDelimiter(), startDelimiter);
+
+ if (endDelimiter < offset & endDelimiter != -1)
+ return false;
+
+ // End of comment not found, highlight the lines
+
+ doc.setCharacterAttributes(startDelimiter, offset - startDelimiter + 1,
+ comment, false);
+ return true;
+ }
+
+ /*
+ * Highlight comment lines to matching end delimiter
+ */
+ private void commentLinesAfter(String content, int line) {
+ int offset = rootElement.getElement(line).getEndOffset();
+
+ // End of comment not found, nothing to do
+
+ int endDelimiter = indexOf(content, getEndDelimiter(), offset);
+
+ if (endDelimiter < 0)
+ return;
+
+ // Matching start/end of comment found, comment the lines
+
+ int startDelimiter = lastIndexOf(content, getStartDelimiter(),
+ endDelimiter);
+
+ if (startDelimiter < 0 || startDelimiter <= offset) {
+ doc.setCharacterAttributes(offset, endDelimiter - offset + 1,
+ comment, false);
+ }
+ }
+
+ /*
+ * Highlight lines to start or end delimiter
+ */
+ private void highlightLinesAfter(String content, int line)
+ throws BadLocationException {
+ int offset = rootElement.getElement(line).getEndOffset();
+
+ // Start/End delimiter not found, nothing to do
+
+ int startDelimiter = indexOf(content, getStartDelimiter(), offset);
+ int endDelimiter = indexOf(content, getEndDelimiter(), offset);
+
+ if (startDelimiter < 0)
+ startDelimiter = content.length();
+
+ if (endDelimiter < 0)
+ endDelimiter = content.length();
+
+ int delimiter = Math.min(startDelimiter, endDelimiter);
+
+ if (delimiter < offset)
+ return;
+
+ // Start/End delimiter found, reapply highlighting
+
+ int endLine = rootElement.getElementIndex(delimiter);
+
+ for (int i = line + 1; i < endLine; i++) {
+ Element branch = rootElement.getElement(i);
+ Element leaf = doc.getCharacterElement(branch.getStartOffset());
+ AttributeSet as = leaf.getAttributes();
+
+ if (as.isEqual(comment))
+ applyHighlighting(content, i);
+ }
+ }
+
+ /*
+ * Parse the line to determine the appropriate highlighting
+ */
+ private void applyHighlighting(String content, int line)
+ throws BadLocationException {
+ int startOffset = rootElement.getElement(line).getStartOffset();
+ int endOffset = rootElement.getElement(line).getEndOffset() - 1;
+
+ int lineLength = endOffset - startOffset;
+ int contentLength = content.length();
+
+ if (endOffset >= contentLength)
+ endOffset = contentLength - 1;
+
+ // check for multi line comments
+ // (always set the comment attribute for the entire line)
+
+ if (endingMultiLineComment(content, startOffset, endOffset)
+ || isMultiLineComment()
+ || startingMultiLineComment(content, startOffset, endOffset)) {
+ doc.setCharacterAttributes(startOffset,
+ endOffset - startOffset + 1, comment, false);
+ return;
+ }
+
+ // set normal attributes for the line
+
+ doc.setCharacterAttributes(startOffset, lineLength, normal, true);
+
+ // check for single line comment
+
+ int index = content.indexOf(getSingleLineDelimiter(), startOffset);
+
+ if ((index > -1) && (index < endOffset)) {
+ doc.setCharacterAttributes(index, endOffset - index + 1, comment,
+ false);
+ endOffset = index - 1;
+ }
+
+ // check for tokens
+
+ checkForTokens(content, startOffset, endOffset);
+ }
+
+ /*
+ * Does this line contain the start delimiter
+ */
+ private boolean startingMultiLineComment(String content, int startOffset,
+ int endOffset) throws BadLocationException {
+ int index = indexOf(content, getStartDelimiter(), startOffset);
+
+ if ((index < 0) || (index > endOffset))
+ return false;
+ else {
+ setMultiLineComment(true);
+ return true;
+ }
+ }
+
+ /*
+ * Does this line contain the end delimiter
+ */
+ private boolean endingMultiLineComment(String content, int startOffset,
+ int endOffset) throws BadLocationException {
+ int index = indexOf(content, getEndDelimiter(), startOffset);
+
+ if ((index < 0) || (index > endOffset))
+ return false;
+ else {
+ setMultiLineComment(false);
+ return true;
+ }
+ }
+
+ /*
+ * We have found a start delimiter and are still searching for the end
+ * delimiter
+ */
+ private boolean isMultiLineComment() {
+ return false;//multiLineComment;
+ }
+
+ private void setMultiLineComment(boolean value) {
+ multiLineComment = value;
+ }
+
+ /*
+ * Parse the line for tokens to highlight
+ */
+ private void checkForTokens(String content, int startOffset, int endOffset) {
+ while (startOffset <= endOffset) {
+ // skip the delimiters to find the start of a new token
+
+ while (isDelimiter(content.substring(startOffset, startOffset + 1))) {
+ if (startOffset < endOffset)
+ startOffset++;
+ else
+ return;
+ }
+
+ // Extract and process the entire token
+
+ if (isQuoteDelimiter(content
+ .substring(startOffset, startOffset + 1)))
+ startOffset = getQuoteToken(content, startOffset, endOffset);
+ else
+ startOffset = getOtherToken(content, startOffset, endOffset);
+ }
+ }
+
+ /*
+ *
+ */
+ private int getQuoteToken(String content, int startOffset, int endOffset) {
+ String quoteDelimiter = content.substring(startOffset, startOffset + 1);
+ String escapeString = getEscapeString(quoteDelimiter);
+
+ int index;
+ int endOfQuote = startOffset;
+
+ // skip over the escape quotes in this quote
+
+ index = content.indexOf(escapeString, endOfQuote + 1);
+
+ while ((index > -1) && (index < endOffset)) {
+ endOfQuote = index + 1;
+ index = content.indexOf(escapeString, endOfQuote);
+ }
+
+ // now find the matching delimiter
+
+ index = content.indexOf(quoteDelimiter, endOfQuote + 1);
+
+ if ((index < 0) || (index > endOffset))
+ endOfQuote = endOffset;
+ else
+ endOfQuote = index;
+
+ doc.setCharacterAttributes(startOffset, endOfQuote - startOffset + 1,
+ quote, false);
+
+ return endOfQuote + 1;
+ }
+
+ /*
+ *
+ */
+ private int getOtherToken(String content, int startOffset, int endOffset) {
+ int endOfToken = startOffset + 1;
+
+ while (endOfToken <= endOffset) {
+ if (isDelimiter(content.substring(endOfToken, endOfToken + 1)))
+ break;
+
+ endOfToken++;
+ }
+
+ String token = content.substring(startOffset, endOfToken);
+
+ if (isKeyword(token)) {
+ doc.setCharacterAttributes(startOffset, endOfToken - startOffset,
+ keyword, false);
+ } else if(isPort(token)){
+ doc.setCharacterAttributes(startOffset, endOfToken - startOffset,
+ port, false);
+ }
+
+ return endOfToken + 1;
+ }
+
+ /*
+ * Assume the needle will the found at the start/end of the line
+ */
+ private int indexOf(String content, String needle, int offset) {
+ int index;
+
+ while ((index = content.indexOf(needle, offset)) != -1) {
+ String text = getLine(content, index).trim();
+
+ if (text.startsWith(needle) || text.endsWith(needle))
+ break;
+ else
+ offset = index + 1;
+ }
+
+ return index;
+ }
+
+ /*
+ * Assume the needle will the found at the start/end of the line
+ */
+ private int lastIndexOf(String content, String needle, int offset) {
+ int index;
+
+ while ((index = content.lastIndexOf(needle, offset)) != -1) {
+ String text = getLine(content, index).trim();
+
+ if (text.startsWith(needle) || text.endsWith(needle))
+ break;
+ else
+ offset = index - 1;
+ }
+
+ return index;
+ }
+
+ private String getLine(String content, int offset) {
+ int line = rootElement.getElementIndex(offset);
+ Element lineElement = rootElement.getElement(line);
+ int start = lineElement.getStartOffset();
+ int end = lineElement.getEndOffset();
+ return content.substring(start, end - 1);
+ }
+
+ /*
+ * Override for other languages
+ */
+ protected boolean isDelimiter(String character) {
+ String operands = ";:{}()[]+-/%<=>!&|^~*,.";
+
+ if (Character.isWhitespace(character.charAt(0))
+ || operands.indexOf(character) != -1)
+ return true;
+ else
+ return false;
+ }
+
+ /*
+ * Override for other languages
+ */
+ protected boolean isQuoteDelimiter(String character) {
+ String quoteDelimiters = "\"'";
+
+ if (quoteDelimiters.indexOf(character) < 0)
+ return false;
+ else
+ return true;
+ }
+
+ /*
+ * Override for other languages
+ */
+ protected boolean isKeyword(String token) {
+ return keywords.contains(token);
+ }
+
+ /*
+ * Override for other languages
+ */
+ protected String getStartDelimiter() {
+ return "/*";
+ }
+
+ /*
+ * Override for other languages
+ */
+ protected String getEndDelimiter() {
+ return "*/";
+ }
+
+ /*
+ * Override for other languages
+ */
+ protected String getSingleLineDelimiter() {
+ return "#";
+ }
+
+ /*
+ * Override for other languages
+ */
+ protected String getEscapeString(String quoteDelimiter) {
+ return "\\" + quoteDelimiter;
+ }
+
+ /*
+ *
+ */
+ protected String addMatchingBrace(int offset) throws BadLocationException {
+ StringBuffer whiteSpace = new StringBuffer();
+ int line = rootElement.getElementIndex(offset);
+ int i = rootElement.getElement(line).getStartOffset();
+
+ while (true) {
+ String temp = doc.getText(i, 1);
+
+ if (temp.equals(" ") || temp.equals("\t")) {
+ whiteSpace.append(temp);
+ i++;
+ } else
+ break;
+ }
+
+ return "{\n" + whiteSpace.toString() + "\t\n" + whiteSpace.toString()
+ + "}";
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/LineEnabledTextPanel.java
----------------------------------------------------------------------
diff --git a/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/LineEnabledTextPanel.java b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/LineEnabledTextPanel.java
new file mode 100644
index 0000000..389b9b3
--- /dev/null
+++ b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/LineEnabledTextPanel.java
@@ -0,0 +1,106 @@
+/**
+ *
+ */
+package net.sf.taverna.t2.lang.ui;
+
+import java.awt.BorderLayout;
+import java.awt.Event;
+import java.awt.event.ActionEvent;
+import java.awt.event.KeyEvent;
+
+import javax.swing.AbstractAction;
+import javax.swing.JLabel;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.KeyStroke;
+import javax.swing.event.CaretEvent;
+import javax.swing.event.CaretListener;
+import javax.swing.text.Document;
+import javax.swing.text.Element;
+import javax.swing.text.JTextComponent;
+
+
+/**
+ * @author alanrw
+ *
+ */
+public class LineEnabledTextPanel extends JPanel {
+
+ private JTextComponent textComponent = null;
+ private Document document;
+ private GotoLineAction gotoLineAction = null;
+
+ public LineEnabledTextPanel(final JTextComponent component) {
+
+ this.setLayout(new BorderLayout());
+ textComponent = component;
+ updateDocument();
+
+ JScrollPane scrollPane = new JScrollPane(textComponent );
+ scrollPane.setPreferredSize(textComponent.getPreferredSize() );
+
+ this.add(scrollPane, BorderLayout.CENTER);;
+
+ final JLabel caretLabel = new JLabel("Line: 1 Column: 0");
+
+ setCaretListener(new CaretListener() {
+
+ public void caretUpdate(CaretEvent e) {
+ int caretPosition = getCaretPosition();
+ Element root = document.getRootElements()[0];
+ int elementIndex = root.getElementIndex(caretPosition);
+ int relativeOffset = caretPosition - root.getElement(elementIndex).getStartOffset();
+ caretLabel.setText("Line: " + (elementIndex + 1) + " Column: " + relativeOffset);
+
+ }});
+ this.add(caretLabel, BorderLayout.SOUTH);
+
+ KeyStroke gotoLineKeystroke = KeyStroke.getKeyStroke(KeyEvent.VK_L, Event.META_MASK);
+
+ gotoLineAction = new GotoLineAction();
+ textComponent.getInputMap().put(gotoLineKeystroke, "gotoLineKeystroke");
+ textComponent.getActionMap().put("gotoLineKeystroke", gotoLineAction);
+
+ }
+
+ private void updateDocument() {
+ document = ((JTextComponent) textComponent).getDocument();
+ }
+
+ private void setCaretListener(CaretListener listener) {
+ ((JTextComponent) textComponent).addCaretListener(listener);
+ }
+
+ private int getCaretPosition() {
+ return ((JTextComponent) textComponent).getCaretPosition();
+ }
+
+ private void setCaretPosition(int position) {
+ ((JTextComponent) textComponent).setCaretPosition(position);
+ textComponent.requestFocus();
+ }
+
+ class GotoLineAction extends AbstractAction
+ {
+
+ public GotoLineAction() {
+ }
+
+ public void actionPerformed(ActionEvent e) {
+ String inputString = JOptionPane.showInputDialog(null, "Enter line number", "Line number", JOptionPane.QUESTION_MESSAGE);
+ if (inputString != null) {
+ try {
+ int lineNumber = Integer.parseInt(inputString);
+ Element root = document.getDefaultRootElement();
+ lineNumber = Math.max(lineNumber, 1);
+ lineNumber = Math.min(lineNumber, root.getElementCount());
+ setCaretPosition( root.getElement( lineNumber - 1 ).getStartOffset() );
+
+ } catch (NumberFormatException e1){
+ // do nothing
+ }
+ }
+ }
+ }
+}
[31/50] [abbrv] incubator-taverna-workbench git commit:
org.apache.taverna.workbench parent
Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/taverna-workbench-plugins-gui/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-plugins-gui/pom.xml b/taverna-workbench-plugins-gui/pom.xml
index 0468c67..c8d6634 100644
--- a/taverna-workbench-plugins-gui/pom.xml
+++ b/taverna-workbench-plugins-gui/pom.xml
@@ -1,12 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
-<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">
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<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>net.sf.taverna.t2</groupId>
- <artifactId>ui-impl</artifactId>
- <version>2.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.ui-impl</groupId>
<artifactId>plugins-gui</artifactId>
<name>Raven plugin manager GUI</name>
<dependencies>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/taverna-workbench-reference-ui/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-reference-ui/pom.xml b/taverna-workbench-reference-ui/pom.xml
index 3755c20..5335306 100644
--- a/taverna-workbench-reference-ui/pom.xml
+++ b/taverna-workbench-reference-ui/pom.xml
@@ -1,13 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
<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>net.sf.taverna.t2</groupId>
- <artifactId>ui-components</artifactId>
- <version>2.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.ui-components</groupId>
<artifactId>reference-ui</artifactId>
<packaging>bundle</packaging>
<name>T2 reference manager user interface</name>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/taverna-workbench-renderers-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-renderers-api/pom.xml b/taverna-workbench-renderers-api/pom.xml
index 63100d7..7dbdb62 100644
--- a/taverna-workbench-renderers-api/pom.xml
+++ b/taverna-workbench-renderers-api/pom.xml
@@ -1,13 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
<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>net.sf.taverna.t2</groupId>
- <artifactId>ui-api</artifactId>
- <version>2.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>renderers-api</artifactId>
<packaging>bundle</packaging>
<name>Renderers API</name>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/taverna-workbench-renderers-exts/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-renderers-exts/pom.xml b/taverna-workbench-renderers-exts/pom.xml
index 2060886..b10233a 100644
--- a/taverna-workbench-renderers-exts/pom.xml
+++ b/taverna-workbench-renderers-exts/pom.xml
@@ -1,13 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
<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>net.sf.taverna.t2</groupId>
- <artifactId>ui-exts</artifactId>
- <version>2.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.ui-exts</groupId>
<artifactId>renderers-exts</artifactId>
<name>Renderers extensions</name>
<dependencies>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/taverna-workbench-renderers-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-renderers-impl/pom.xml b/taverna-workbench-renderers-impl/pom.xml
index 24e06c0..4e91d87 100644
--- a/taverna-workbench-renderers-impl/pom.xml
+++ b/taverna-workbench-renderers-impl/pom.xml
@@ -1,13 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
<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>net.sf.taverna.t2</groupId>
- <artifactId>ui-impl</artifactId>
- <version>2.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.ui-impl</groupId>
<artifactId>renderers-impl</artifactId>
<packaging>bundle</packaging>
<name>Renderers Implementation</name>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/taverna-workbench-report-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-report-api/pom.xml b/taverna-workbench-report-api/pom.xml
index 706fd17..bc5f75e 100644
--- a/taverna-workbench-report-api/pom.xml
+++ b/taverna-workbench-report-api/pom.xml
@@ -1,13 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
<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>net.sf.taverna.t2</groupId>
- <artifactId>ui-api</artifactId>
- <version>2.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>report-api</artifactId>
<packaging>bundle</packaging>
<name>Reporting API</name>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/taverna-workbench-report-explainer/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-report-explainer/pom.xml b/taverna-workbench-report-explainer/pom.xml
index 4be9bd9..87d5a74 100644
--- a/taverna-workbench-report-explainer/pom.xml
+++ b/taverna-workbench-report-explainer/pom.xml
@@ -1,12 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
-<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">
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<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>net.sf.taverna.t2</groupId>
- <artifactId>ui-exts</artifactId>
- <version>2.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.ui-exts</groupId>
<artifactId>report-explainer</artifactId>
<packaging>bundle</packaging>
<name>Report explainer</name>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/taverna-workbench-report-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-report-impl/pom.xml b/taverna-workbench-report-impl/pom.xml
index c0e72bb..8a88a89 100644
--- a/taverna-workbench-report-impl/pom.xml
+++ b/taverna-workbench-report-impl/pom.xml
@@ -1,12 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
<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/xsd/maven-4.0.0.xsd">
+ 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>
- <artifactId>ui-impl</artifactId>
- <groupId>net.sf.taverna.t2</groupId>
- <version>2.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.ui-impl</groupId>
<artifactId>report-impl</artifactId>
<packaging>bundle</packaging>
<name>Reporting Implementation</name>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/taverna-workbench-report-view/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-report-view/pom.xml b/taverna-workbench-report-view/pom.xml
index 9bc61d3..a357b70 100644
--- a/taverna-workbench-report-view/pom.xml
+++ b/taverna-workbench-report-view/pom.xml
@@ -1,12 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
-<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">
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<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>net.sf.taverna.t2</groupId>
- <artifactId>ui-components</artifactId>
- <version>2.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.ui-components</groupId>
<artifactId>report-view</artifactId>
<packaging>bundle</packaging>
<name>Reporting view</name>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/taverna-workbench-results-view/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-results-view/pom.xml b/taverna-workbench-results-view/pom.xml
index 063e6cc..c66099c 100644
--- a/taverna-workbench-results-view/pom.xml
+++ b/taverna-workbench-results-view/pom.xml
@@ -1,13 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
<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>net.sf.taverna.t2</groupId>
- <artifactId>ui-components</artifactId>
- <version>2.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.ui-components</groupId>
<artifactId>results-view</artifactId>
<packaging>bundle</packaging>
<name>Results and outputs from a workflow run</name>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/taverna-workbench-retry-ui/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-retry-ui/pom.xml b/taverna-workbench-retry-ui/pom.xml
index 7c22ea6..3ef6ef8 100644
--- a/taverna-workbench-retry-ui/pom.xml
+++ b/taverna-workbench-retry-ui/pom.xml
@@ -1,13 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
<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>net.sf.taverna.t2</groupId>
- <artifactId>ui-exts</artifactId>
- <version>2.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.ui-exts</groupId>
<artifactId>retry-ui</artifactId>
<packaging>bundle</packaging>
<name>Retry layer contextual view</name>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/taverna-workbench-run-ui/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-run-ui/pom.xml b/taverna-workbench-run-ui/pom.xml
index bcda0d6..eb73392 100644
--- a/taverna-workbench-run-ui/pom.xml
+++ b/taverna-workbench-run-ui/pom.xml
@@ -1,12 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
-<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">
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<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>net.sf.taverna.t2</groupId>
- <artifactId>ui-components</artifactId>
- <version>2.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.ui-components</groupId>
<artifactId>run-ui</artifactId>
<packaging>bundle</packaging>
<name>Results UI</name>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/taverna-workbench-selection-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-selection-api/pom.xml b/taverna-workbench-selection-api/pom.xml
index 3925201..33bf821 100644
--- a/taverna-workbench-selection-api/pom.xml
+++ b/taverna-workbench-selection-api/pom.xml
@@ -1,12 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
<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/xsd/maven-4.0.0.xsd">
+ 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>net.sf.taverna.t2</groupId>
- <artifactId>ui-api</artifactId>
- <version>2.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
<artifactId>selection-api</artifactId>
<packaging>bundle</packaging>
<name>Selection API</name>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/taverna-workbench-selection-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-selection-impl/pom.xml b/taverna-workbench-selection-impl/pom.xml
index cb6cbcb..ea997f2 100644
--- a/taverna-workbench-selection-impl/pom.xml
+++ b/taverna-workbench-selection-impl/pom.xml
@@ -1,12 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
<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/xsd/maven-4.0.0.xsd">
+ 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>net.sf.taverna.t2</groupId>
- <artifactId>ui-impl</artifactId>
- <version>2.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.ui-impl</groupId>
<artifactId>selection-impl</artifactId>
<packaging>bundle</packaging>
<name>Selection Implementation</name>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/taverna-workbench-update-manager/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-update-manager/pom.xml b/taverna-workbench-update-manager/pom.xml
index c2f2003..60b6086 100644
--- a/taverna-workbench-update-manager/pom.xml
+++ b/taverna-workbench-update-manager/pom.xml
@@ -1,12 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
-<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">
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<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>net.sf.taverna.t2</groupId>
- <artifactId>ui-impl</artifactId>
- <version>2.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.ui-impl</groupId>
<artifactId>update-manager</artifactId>
<version>2.0.1-SNAPSHOT</version>
<packaging>bundle</packaging>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/taverna-workbench-workbench-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-workbench-api/pom.xml b/taverna-workbench-workbench-api/pom.xml
index fc7b444..44bca05 100644
--- a/taverna-workbench-workbench-api/pom.xml
+++ b/taverna-workbench-workbench-api/pom.xml
@@ -1,4 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
<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>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/taverna-workbench-workbench-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-workbench-impl/pom.xml b/taverna-workbench-workbench-impl/pom.xml
index 5b52d3a..092da29 100644
--- a/taverna-workbench-workbench-impl/pom.xml
+++ b/taverna-workbench-workbench-impl/pom.xml
@@ -1,13 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
<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>net.sf.taverna.t2</groupId>
- <artifactId>ui-impl</artifactId>
- <version>2.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.ui-impl</groupId>
<artifactId>workbench-impl</artifactId>
<packaging>bundle</packaging>
<name>Workbench UI implementation</name>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/taverna-workbench-workflow-explorer/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-workflow-explorer/pom.xml b/taverna-workbench-workflow-explorer/pom.xml
index 8076b99..2fc0ba3 100644
--- a/taverna-workbench-workflow-explorer/pom.xml
+++ b/taverna-workbench-workflow-explorer/pom.xml
@@ -1,12 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
-<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">
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<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>net.sf.taverna.t2</groupId>
- <artifactId>ui-components</artifactId>
- <version>2.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.ui-components</groupId>
<artifactId>workflow-explorer</artifactId>
<packaging>bundle</packaging>
<name>Workflow Explorer</name>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/e103aa7e/taverna-workbench-workflow-view/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-workflow-view/pom.xml b/taverna-workbench-workflow-view/pom.xml
index b2bd0ef..1755c6b 100644
--- a/taverna-workbench-workflow-view/pom.xml
+++ b/taverna-workbench-workflow-view/pom.xml
@@ -1,13 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
<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>net.sf.taverna.t2</groupId>
- <artifactId>ui-components</artifactId>
- <version>2.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.ui-components</groupId>
<artifactId>workflow-view</artifactId>
<packaging>bundle</packaging>
<name>Workflow View</name>
[19/50] [abbrv] incubator-taverna-workbench git commit: extended
gitignore
Posted by st...@apache.org.
extended gitignore
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/commit/68c55c91
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/tree/68c55c91
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/diff/68c55c91
Branch: refs/heads/master
Commit: 68c55c914d2cf9b0b06715c89818de8f508321d4
Parents: 7981942
Author: Christian-B <br...@cs.man.ac.uk>
Authored: Fri May 9 09:11:10 2014 +0100
Committer: Christian-B <br...@cs.man.ac.uk>
Committed: Fri May 9 09:11:10 2014 +0100
----------------------------------------------------------------------
.gitignore | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/68c55c91/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index e8df2d5..ebe0e5b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,24 @@
+# ignore project files #
.classpath
.project
.settings/
+catalog-v001.xml
+
+# ignore target files #
target/
+bin/
+build/
+dist/
+apidoc/
+*.swp
+
+# ignore svn files if there
.svn
+
+# ignore log files #
+*.log
+/logs/*
+*/logs/*
+
+
+
[40/50] [abbrv] incubator-taverna-workbench git commit: taverna-*
Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/treetable/JTreeTable.java
----------------------------------------------------------------------
diff --git a/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/treetable/JTreeTable.java b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/treetable/JTreeTable.java
new file mode 100644
index 0000000..85d3577
--- /dev/null
+++ b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/treetable/JTreeTable.java
@@ -0,0 +1,657 @@
+/*
+ * @(#)JTreeTable.java 1.2 98/10/27
+ *
+ * Copyright 1997, 1998 by Sun Microsystems, Inc.,
+ * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
+ * All rights reserved.
+ *
+ * This software is the confidential and proprietary information
+ * of Sun Microsystems, Inc. ("Confidential Information"). You
+ * shall not disclose such Confidential Information and shall use
+ * it only in accordance with the terms of the license agreement
+ * you entered into with Sun.
+ */
+package net.sf.taverna.t2.lang.ui.treetable;
+
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.Graphics;
+import java.awt.Insets;
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.EventObject;
+
+import javax.swing.DefaultCellEditor;
+import javax.swing.Icon;
+import javax.swing.JLabel;
+import javax.swing.JTable;
+import javax.swing.JTextField;
+import javax.swing.JTree;
+import javax.swing.ListSelectionModel;
+import javax.swing.LookAndFeel;
+import javax.swing.UIManager;
+import javax.swing.border.Border;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
+import javax.swing.table.DefaultTableCellRenderer;
+import javax.swing.table.TableCellRenderer;
+import javax.swing.tree.DefaultTreeCellRenderer;
+import javax.swing.tree.DefaultTreeSelectionModel;
+import javax.swing.tree.TreeCellRenderer;
+import javax.swing.tree.TreeModel;
+import javax.swing.tree.TreePath;
+import javax.swing.tree.TreeSelectionModel;
+
+/**
+ * This example shows how to create a simple JTreeTable component, by using a
+ * JTree as a renderer (and editor) for the cells in a particular column in the
+ * JTable.
+ *
+ * @version 1.2 10/27/98
+ *
+ * @author Philip Milne
+ * @author Scott Violet
+ * @author Tom Oinn
+ */
+@SuppressWarnings("serial")
+public class JTreeTable extends JTable {
+ /** A subclass of JTree. */
+ protected TreeTableCellRenderer tree;
+
+
+ private static SimpleDateFormat ISO_8601_FORMAT = new SimpleDateFormat(
+ "yyyy-MM-dd HH:mm:ss");
+ private static SimpleDateFormat TIME_FORMAT = new SimpleDateFormat(
+ "HH:mm:ss");
+
+
+ public JTreeTable() {
+ super();
+ }
+
+ public JTreeTable(TreeTableModel treeTableModel) {
+ super();
+ setModel(treeTableModel);
+ }
+
+ public void setModel(TreeTableModel model) {
+ tree = new TreeTableCellRenderer(model);
+ super.setModel(new TreeTableModelAdapter(model, tree));
+
+ ListToTreeSelectionModelWrapper selectionWrapper = new ListToTreeSelectionModelWrapper();
+ tree.setSelectionModel(selectionWrapper);
+ setSelectionModel(selectionWrapper.getListSelectionModel());
+
+ // Install the tree editor renderer and editor.
+ setDefaultRenderer(TreeTableModel.class, tree);
+ setDefaultRenderer(Date.class, new DateCellRenderer());
+ setDefaultEditor(TreeTableModel.class, new TreeTableCellEditor());
+
+ // Show grid but only if Look and Feel is not Java 6's Nimbus
+ if (!UIManager.getLookAndFeel().getName().equals("Nimbus")){
+ setShowGrid(true);
+ setGridColor(Color.LIGHT_GRAY);
+ }
+ else{
+ setShowGrid(false);
+ }
+
+ // No intercell spacing
+ setIntercellSpacing(new Dimension(0, 0));
+
+ // Add a mouse listener to forward events on to the tree.
+ // We need this as on MAC only double clicks seem to expand the tree.
+ addMouseListener(new MouseAdapter() {
+ public void mousePressed(MouseEvent e) {
+
+ for (int counter = getColumnCount() - 1; counter >= 0; counter--) {
+ if (getColumnClass(counter) == TreeTableModel.class) {
+ MouseEvent me = (MouseEvent) e;
+ MouseEvent newME = new MouseEvent(tree, me.getID(), me
+ .getWhen(), me.getModifiers(), me.getX()
+ - getCellRect(0, counter, true).x, me.getY(),
+ me.getClickCount(), me.isPopupTrigger());
+ if (me.getClickCount() == 1) {
+ tree.dispatchEvent(newME);
+ }
+ }
+ else{
+
+ }
+ }
+ }
+ });
+
+ // And update the height of the trees row to match that of
+ // the table.
+
+ if (tree.getRowHeight() < 1) {
+ // Metal looks better like this.
+ setRowHeight(18);
+ }
+
+ }
+
+ /**
+ * Overridden to message super and forward the method to the tree. Since the
+ * tree is not actually in the component hierarchy it will never receive this
+ * unless we forward it in this manner.
+ */
+ public void updateUI() {
+ super.updateUI();
+ if (tree != null) {
+ tree.updateUI();
+ }
+ // Use the tree's default foreground and background colors in the
+ // table.
+ LookAndFeel.installColorsAndFont(this, "Tree.background",
+ "Tree.foreground", "Tree.font");
+ }
+
+ /*
+ * Workaround for BasicTableUI anomaly. Make sure the UI never tries to
+ * paint the editor. The UI currently uses different techniques to paint the
+ * renderers and editors and overriding setBounds() below is not the right
+ * thing to do for an editor. Returning -1 for the editing row in this case,
+ * ensures the editor is never painted.
+ */
+ public int getEditingRow() {
+ return (getColumnClass(editingColumn) == TreeTableModel.class) ? -1
+ : editingRow;
+ }
+
+ /**
+ * Returns the actual row that is editing as <code>getEditingRow</code> will
+ * always return -1.
+ */
+ private int realEditingRow() {
+ return editingRow;
+ }
+
+ /**
+ * This is overridden to invoke super's implementation, and then, if the
+ * receiver is editing a Tree column, the editor's bounds is reset. The
+ * reason we have to do this is because JTable doesn't think the table is
+ * being edited, as <code>getEditingRow</code> returns -1, and therefore
+ * doesn't automatically resize the editor for us.
+ */
+ public void sizeColumnsToFit(int resizingColumn) {
+ super.sizeColumnsToFit(resizingColumn);
+ if (getEditingColumn() != -1
+ && getColumnClass(editingColumn) == TreeTableModel.class) {
+ Rectangle cellRect = getCellRect(realEditingRow(),
+ getEditingColumn(), false);
+ Component component = getEditorComponent();
+ component.setBounds(cellRect);
+ component.validate();
+ }
+ }
+
+ /**
+ * Overridden to pass the new rowHeight to the tree.
+ */
+ public void setRowHeight(int rowHeight) {
+ super.setRowHeight(rowHeight);
+ if (tree != null && tree.getRowHeight() != rowHeight) {
+ tree.setRowHeight(getRowHeight());
+ }
+ }
+
+ /**
+ * Returns the tree that is being shared between the model.
+ */
+ public JTree getTree() {
+ return tree;
+ }
+
+ /**
+ * Overridden to invoke repaint for the particular location if the column
+ * contains the tree. This is done as the tree editor does not fill the
+ * bounds of the cell, we need the renderer to paint the tree in the
+ * background, and then draw the editor over it.
+ */
+ public boolean editCellAt(int row, int column, EventObject e) {
+ boolean retValue = super.editCellAt(row, column, e);
+ if (retValue && getColumnClass(column) == TreeTableModel.class) {
+ repaint(getCellRect(row, column, false));
+ }
+ return retValue;
+ }
+
+ /**
+ * A TreeCellRenderer that displays a JTree.
+ */
+ public class TreeTableCellRenderer extends JTree implements
+ TableCellRenderer {
+ /** Last table/tree row asked to renderer. */
+ protected int visibleRow;
+ protected Border highlightBorder;
+
+ public TreeTableCellRenderer(TreeModel model) {
+ super(model);
+ }
+
+ /**
+ * updateUI is overridden to set the colors of the Tree's renderer to
+ * match that of the table.
+ */
+ public void updateUI() {
+ super.updateUI();
+ // Make the tree's cell renderer use the table's cell selection
+ // colors.
+ TreeCellRenderer tcr = getCellRenderer();
+ if (tcr instanceof DefaultTreeCellRenderer) {
+ //DefaultTreeCellRenderer dtcr = ((DefaultTreeCellRenderer) tcr);
+ // For 1.1 uncomment this, 1.2 has a bug that will cause an
+ // exception to be thrown if the border selection color is
+ // null.
+ // dtcr.setBorderSelectionColor(null);
+ // dtcr.setTextSelectionColor(UIManager.getColor
+ // ("Table.selectionForeground"));
+ // dtcr.setBackgroundSelectionColor(UIManager.getColor
+ // ("Table.selectionBackground"));
+ }
+ }
+
+ /**
+ * Sets the row height of the tree, and forwards the row height to the
+ * table.
+ */
+ public void setRowHeight(int rowHeight) {
+ if (rowHeight > 0) {
+ super.setRowHeight(rowHeight);
+ if (JTreeTable.this != null
+ && JTreeTable.this.getRowHeight() != rowHeight) {
+ JTreeTable.this.setRowHeight(getRowHeight());
+ }
+ }
+ }
+
+ /**
+ * This is overridden to set the height to match that of the JTable.
+ */
+ public void setBounds(int x, int y, int w, int h) {
+ super.setBounds(x, 0, w, JTreeTable.this.getHeight());
+ }
+
+ /**
+ * Subclassed to translate the graphics such that the last visible row
+ * will be drawn at 0,0.
+ */
+ public void paint(Graphics g) {
+ g.translate(0, -visibleRow * getRowHeight());
+ super.paint(g);
+ // Draw the Table border if we have focus.
+ if (highlightBorder != null) {
+ highlightBorder.paintBorder(this, g, 0, visibleRow
+ * getRowHeight(), getWidth(), getRowHeight());
+ }
+ else{
+ // Tree cell renderer get rid of the grid lines for some
+ // reason so we draw them here but only if Look and Feel
+ // is different from Java 6's Nimbus LaF
+ // as it completely ignores the grid lines
+ if (!UIManager.getLookAndFeel().getName().equals("Nimbus")){
+ LinesBorder linesBorder = new LinesBorder(getGridColor(),
+ new Insets(0, 0, 1, 1));
+ linesBorder
+ .paintBorder(this, g, 0, visibleRow * getRowHeight(),
+ getWidth(), getRowHeight());
+ }
+ }
+ }
+
+ /**
+ * TreeCellRenderer method. Overridden to update the visible row.
+ */
+ public Component getTableCellRendererComponent(JTable table,
+ Object value, boolean isSelected, boolean hasFocus, int row,
+ int column) {
+ Color background;
+ Color foreground;
+
+ if (isSelected) {
+ background = table.getSelectionBackground();
+ foreground = table.getSelectionForeground();
+ } else {
+ background = table.getBackground();
+ foreground = table.getForeground();
+ }
+ highlightBorder = null;
+ if (realEditingRow() == row && getEditingColumn() == column) {
+ // background = UIManager.getColor("Table.focusCellBackground");
+ // foreground = UIManager.getColor("Table.focusCellForeground");
+ } else if (hasFocus) {
+ if (isSelected) {
+ highlightBorder = UIManager.getBorder("Table.focusSelectedCellHighlightBorder");
+ }
+ else{
+ highlightBorder = UIManager.getBorder("Table.focusCellHighlightBorder");
+ }
+ if (isCellEditable(row, column)) {
+ // background = UIManager.getColor
+ // ("Table.focusCellBackground");
+ background = table.getSelectionBackground();
+ foreground = table.getSelectionForeground();
+ }
+ }
+
+ visibleRow = row;
+ setBackground(background);
+
+ TreeCellRenderer tcr = getCellRenderer();
+ if (tcr instanceof DefaultTreeCellRenderer) {
+ DefaultTreeCellRenderer dtcr = ((DefaultTreeCellRenderer) tcr);
+ if (isSelected) {
+ dtcr.setTextSelectionColor(foreground);
+ dtcr.setBackgroundSelectionColor(background);
+ } else {
+ dtcr.setTextNonSelectionColor(foreground);
+ dtcr.setBackgroundNonSelectionColor(background);
+ }
+ }
+ return this;
+ }
+
+ }
+
+ public static String formatDate(Date date) {
+ final Date midnight = new Date();
+ midnight.setHours(0);
+ midnight.setMinutes(0);
+ midnight.setSeconds(0);
+ SimpleDateFormat format;
+ if (date.before(midnight)) {
+ // FULL DATE
+ format = ISO_8601_FORMAT;
+ } else {
+ format = TIME_FORMAT;
+ }
+ final String formatted = format.format(date);
+ return formatted;
+ }
+
+ /**
+ * A TreeCellRenderer that displays a date in a "yyyy-MM-dd HH:mm:ss"
+ * format.
+ */
+ public class DateCellRenderer extends DefaultTableCellRenderer {
+ /** Last table/tree row asked to renderer. */
+ protected int visibleRow;
+ protected Border highlightBorder;
+
+ public DateCellRenderer() {
+ setOpaque(true);
+ }
+
+ public Component getTableCellRendererComponent(JTable table,
+ Object value, boolean isSelected, boolean hasFocus, int row,
+ int column) {
+ super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
+
+ if (isSelected) {
+// this.setBackground(table.getSelectionBackground());
+// this.setForeground(table.getSelectionForeground());
+ } else {
+ /*this.setBackground(table.getBackground());
+ this.setForeground(table.getForeground());*/
+ }
+
+
+ //dtcr.setBorderSelectionColor(null);
+ // dtcr.setTextSelectionColor(UIManager.getColor
+ // ("Table.selectionForeground"));
+ // dtcr.setBackgroundSelectionColor(UIManager.getColor
+ // ("Table.selectionBackground"));
+
+
+
+ Date date = (Date) ((TreeTableModelAdapter) getModel()).getValueAt(
+ row, column);
+ if (date != null) {
+ setText(formatDate(date));
+ } else {
+ setText(null);
+ }
+ return this;
+ }
+
+ }
+
+ /**
+ * TreeTableCellEditor implementation. Component returned is the JTree.
+ */
+ public class TreeTableCellEditor extends DefaultCellEditor {
+ public TreeTableCellEditor() {
+ super(new TreeTableTextField());
+ }
+
+ public Component getTableCellEditorComponent(JTable table,
+ Object value, boolean isSelected, int r, int c) {
+ Component component = super.getTableCellEditorComponent(table,
+ value, isSelected, r, c);
+ JTree t = getTree();
+ boolean rv = t.isRootVisible();
+ int offsetRow = rv ? r : r - 1;
+ Rectangle bounds = t.getRowBounds(offsetRow);
+ int offset = bounds.x;
+ TreeCellRenderer tcr = t.getCellRenderer();
+ if (tcr instanceof DefaultTreeCellRenderer) {
+ Object node = t.getPathForRow(offsetRow).getLastPathComponent();
+ boolean isExpanded = t.isExpanded(t.getPathForRow(offsetRow));
+ boolean isLeaf = t.getModel().isLeaf(node);
+ Component renderer = tcr.getTreeCellRendererComponent(t, node,
+ true, isExpanded, isLeaf, offsetRow, true);
+ Icon icon = ((JLabel) renderer).getIcon();
+ // if (t.getModel().isLeaf(node))
+ // icon = ((DefaultTreeCellRenderer)tcr).getLeafIcon();
+ // else if (tree.isExpanded(offsetRow))
+ // icon = ((DefaultTreeCellRenderer)tcr).getOpenIcon();
+ // else
+ // icon = ((DefaultTreeCellRenderer)tcr).getClosedIcon();
+ if (icon != null) {
+ offset += ((DefaultTreeCellRenderer) tcr).getIconTextGap()
+ + icon.getIconWidth();
+ }
+ }
+ ((TreeTableTextField) getComponent()).offset = offset;
+ return component;
+ }
+
+ // /**
+ // * This is overridden to forward the event to the tree. This will
+ // return
+ // * true if the click count >= 3, or the event is null.
+ // */
+ // public boolean isCellEditable(EventObject e) {
+ // /**
+ // * if (e instanceof MouseEvent) { for (int counter =
+ // * getColumnCount() - 1; counter >= 0; counter--) { if
+ // * (getColumnClass(counter) == TreeTableModel.class) { MouseEvent me
+ // * = (MouseEvent)e; MouseEvent newME = new MouseEvent(tree,
+ // * me.getID(), me.getWhen(), me.getModifiers(), me.getX() -
+ // * getCellRect(0, counter, true).x, me.getY(), me.getClickCount(),
+ // * me.isPopupTrigger()); System.out.println(newME);
+ // * tree.dispatchEvent(newME); break; } } }
+ // */
+ // if (e instanceof MouseEvent) {
+ // MouseEvent me = (MouseEvent) e;
+ // if (me.getClickCount() >= 3) {
+ // return true;
+ // }
+ // }
+ // if (e == null) {
+ // return true;
+ // }
+ // return false;
+ // }
+
+ /**
+ * This is overridden to forward the event to the tree. This will return
+ * true if the click count >= 3, or the event is null.
+ */
+ public boolean isCellEditable(EventObject e) {
+ // Edit on double click rather than the default triple
+ if (e instanceof MouseEvent) {
+
+ MouseEvent me = (MouseEvent) e;
+ if (me.getClickCount() == 1
+ && System.getProperty("os.name").equals("Mac OS X")) {
+ // Workaround for buggy tree table on OS X. Open/close the
+ // path
+ // on any click on the column (not just on the > icon)
+ for (int counter = getColumnCount() - 1; counter >= 0; counter--) {
+ if (getColumnClass(counter) == TreeTableModel.class) {
+ MouseEvent newME = new MouseEvent(tree, me.getID(),
+ me.getWhen(), me.getModifiers(), me.getX()
+ - getCellRect(0, counter, true).x,
+ me.getY(), me.getClickCount(), me
+ .isPopupTrigger());
+ tree.dispatchEvent(newME);
+
+ Point p = new Point(me.getX(), me.getY());
+ int row = rowAtPoint(p);
+ int column = columnAtPoint(p);
+ if (column == 0) {
+ boolean isExpanded = tree.isExpanded(tree
+ .getPathForRow(row));
+ if (isExpanded == false) {
+ tree.expandPath(tree.getPathForRow(row));
+ } else {
+ tree.collapsePath(tree.getPathForRow(row));
+ }
+ }
+
+ break;
+ }
+ }
+
+ }
+ /*
+ * if (me.getClickCount() >= 3) { return true; }
+ */// tree is no editable
+ }
+ if (e == null) {
+ return true;
+ }
+ return false;
+ }
+
+ }
+
+ /**
+ * Component used by TreeTableCellEditor. The only thing this does is to
+ * override the <code>reshape</code> method, and to ALWAYS make the x
+ * location be <code>offset</code>.
+ */
+ public static class TreeTableTextField extends JTextField {
+ public int offset;
+
+ public void setBounds(int x, int y, int w, int h) {
+ int newX = Math.max(x, offset);
+ super.setBounds(newX, y, w - (newX - x), h);
+ }
+ }
+
+ /**
+ * ListToTreeSelectionModelWrapper extends DefaultTreeSelectionModel to
+ * listen for changes in the ListSelectionModel it maintains. Once a change
+ * in the ListSelectionModel happens, the paths are updated in the
+ * DefaultTreeSelectionModel.
+ */
+ class ListToTreeSelectionModelWrapper extends DefaultTreeSelectionModel {
+ /** Set to true when we are updating the ListSelectionModel. */
+ protected boolean updatingListSelectionModel;
+
+ public ListToTreeSelectionModelWrapper() {
+ super();
+ setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
+ getListSelectionModel().addListSelectionListener(
+ createListSelectionListener());
+ }
+
+ /**
+ * Returns the list selection model. ListToTreeSelectionModelWrapper
+ * listens for changes to this model and updates the selected paths
+ * accordingly.
+ */
+ ListSelectionModel getListSelectionModel() {
+ return listSelectionModel;
+ }
+
+ /**
+ * This is overridden to set <code>updatingListSelectionModel</code> and
+ * message super. This is the only place DefaultTreeSelectionModel
+ * alters the ListSelectionModel.
+ */
+ public void resetRowSelection() {
+ if (!updatingListSelectionModel) {
+ updatingListSelectionModel = true;
+ try {
+ super.resetRowSelection();
+ } finally {
+ updatingListSelectionModel = false;
+ }
+ }
+ // Notice how we don't message super if
+ // updatingListSelectionModel is true. If
+ // updatingListSelectionModel is true, it implies the
+ // ListSelectionModel has already been updated and the
+ // paths are the only thing that needs to be updated.
+ }
+
+ /**
+ * Creates and returns an instance of ListSelectionHandler.
+ */
+ protected ListSelectionListener createListSelectionListener() {
+ return new ListSelectionHandler();
+ }
+
+ /**
+ * If <code>updatingListSelectionModel</code> is false, this will reset
+ * the selected paths from the selected rows in the list selection
+ * model.
+ */
+ protected void updateSelectedPathsFromSelectedRows() {
+ if (!updatingListSelectionModel) {
+ updatingListSelectionModel = true;
+ try {
+ // This is way expensive, ListSelectionModel needs an
+ // enumerator for iterating.
+ int min = listSelectionModel.getMinSelectionIndex();
+ int max = listSelectionModel.getMaxSelectionIndex();
+
+ clearSelection();
+ if (min != -1 && max != -1) {
+ for (int counter = min; counter <= max; counter++) {
+ if (listSelectionModel.isSelectedIndex(counter)) {
+ TreePath selPath = tree.getPathForRow(counter);
+
+ if (selPath != null) {
+ addSelectionPath(selPath);
+ }
+ }
+ }
+ }
+ } finally {
+ updatingListSelectionModel = false;
+ }
+ }
+ }
+
+ /**
+ * Class responsible for calling updateSelectedPathsFromSelectedRows
+ * when the selection of the list change.
+ */
+ class ListSelectionHandler implements ListSelectionListener {
+ public void valueChanged(ListSelectionEvent e) {
+ updateSelectedPathsFromSelectedRows();
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/treetable/LinesBorder.java
----------------------------------------------------------------------
diff --git a/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/treetable/LinesBorder.java b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/treetable/LinesBorder.java
new file mode 100644
index 0000000..45ac3bb
--- /dev/null
+++ b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/treetable/LinesBorder.java
@@ -0,0 +1,178 @@
+/**
+ * Example from http://www.java2s.com/Code/Java/Swing-Components/CellBorderTableExample.htm
+ */
+package net.sf.taverna.t2.lang.ui.treetable;
+
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Graphics;
+import java.awt.Insets;
+
+import javax.swing.SwingConstants;
+import javax.swing.border.AbstractBorder;
+
+/**
+ *
+ * Line border that lets you control the colour and thickness of all four edges. Needed to fix the tree cell
+ * renderer in the JTreeTable that looked a bit 'naff' on Windows (i.e. Windows draws lines around table
+ * cells when default Look and Feel is in use and the tree cell renderer was not drawing lines.)
+ *
+ */
+@SuppressWarnings("serial")
+public class LinesBorder extends AbstractBorder implements SwingConstants {
+ protected int northThickness;
+
+ protected int southThickness;
+
+ protected int eastThickness;
+
+ protected int westThickness;
+
+ protected Color northColor;
+
+ protected Color southColor;
+
+ protected Color eastColor;
+
+ protected Color westColor;
+
+ public LinesBorder(Color color) {
+ this(color, 1);
+ }
+
+ public LinesBorder(Color color, int thickness) {
+ setColor(color);
+ setThickness(thickness);
+ }
+
+ public LinesBorder(Color color, Insets insets) {
+ setColor(color);
+ setThickness(insets);
+ }
+
+ public void paintBorder(Component c, Graphics g, int x, int y, int width,
+ int height) {
+ Color oldColor = g.getColor();
+
+ g.setColor(northColor);
+ for (int i = 0; i < northThickness; i++) {
+ g.drawLine(x, y + i, x + width - 1, y + i);
+ }
+ g.setColor(southColor);
+ for (int i = 0; i < southThickness; i++) {
+ g
+ .drawLine(x, y + height - i - 1, x + width - 1, y + height
+ - i - 1);
+ }
+ g.setColor(eastColor);
+ for (int i = 0; i < westThickness; i++) {
+ g.drawLine(x + i, y, x + i, y + height - 1);
+ }
+ g.setColor(westColor);
+ for (int i = 0; i < eastThickness; i++) {
+ g.drawLine(x + width - i - 1, y, x + width - i - 1, y + height - 1);
+ }
+
+ g.setColor(oldColor);
+ }
+
+ public Insets getBorderInsets(Component c) {
+ return new Insets(northThickness, westThickness, southThickness,
+ eastThickness);
+ }
+
+ public Insets getBorderInsets(Component c, Insets insets) {
+ return new Insets(northThickness, westThickness, southThickness,
+ eastThickness);
+ }
+
+ public boolean isBorderOpaque() {
+ return true;
+ }
+
+ public void setColor(Color c) {
+ northColor = c;
+ southColor = c;
+ eastColor = c;
+ westColor = c;
+ }
+
+ public void setColor(Color c, int direction) {
+ switch (direction) {
+ case NORTH:
+ northColor = c;
+ break;
+ case SOUTH:
+ southColor = c;
+ break;
+ case EAST:
+ eastColor = c;
+ break;
+ case WEST:
+ westColor = c;
+ break;
+ default:
+ }
+ }
+
+ public void setThickness(int n) {
+ northThickness = n;
+ southThickness = n;
+ eastThickness = n;
+ westThickness = n;
+ }
+
+ public void setThickness(Insets insets) {
+ northThickness = insets.top;
+ southThickness = insets.bottom;
+ eastThickness = insets.right;
+ westThickness = insets.left;
+ }
+
+ public void setThickness(int n, int direction) {
+ switch (direction) {
+ case NORTH:
+ northThickness = n;
+ break;
+ case SOUTH:
+ southThickness = n;
+ break;
+ case EAST:
+ eastThickness = n;
+ break;
+ case WEST:
+ westThickness = n;
+ break;
+ default:
+ }
+ }
+
+ public void append(LinesBorder b, boolean isReplace) {
+ if (isReplace) {
+ northThickness = b.northThickness;
+ southThickness = b.southThickness;
+ eastThickness = b.eastThickness;
+ westThickness = b.westThickness;
+ } else {
+ northThickness = Math.max(northThickness, b.northThickness);
+ southThickness = Math.max(southThickness, b.southThickness);
+ eastThickness = Math.max(eastThickness, b.eastThickness);
+ westThickness = Math.max(westThickness, b.westThickness);
+ }
+ }
+
+ public void append(Insets insets, boolean isReplace) {
+ if (isReplace) {
+ northThickness = insets.top;
+ southThickness = insets.bottom;
+ eastThickness = insets.right;
+ westThickness = insets.left;
+ } else {
+ northThickness = Math.max(northThickness, insets.top);
+ southThickness = Math.max(southThickness, insets.bottom);
+ eastThickness = Math.max(eastThickness, insets.right);
+ westThickness = Math.max(westThickness, insets.left);
+ }
+ }
+
+ }
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/treetable/TreeTableModel.java
----------------------------------------------------------------------
diff --git a/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/treetable/TreeTableModel.java b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/treetable/TreeTableModel.java
new file mode 100644
index 0000000..36fa4fe
--- /dev/null
+++ b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/treetable/TreeTableModel.java
@@ -0,0 +1,69 @@
+/*
+ * TreeTableModel.java
+ *
+ * Copyright (c) 1998 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * This software is the confidential and proprietary information of Sun
+ * Microsystems, Inc. ("Confidential Information"). You shall not
+ * disclose such Confidential Information and shall use it only in
+ * accordance with the terms of the license agreement you entered into
+ * with Sun.
+ *
+ * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
+ * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
+ * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
+ * THIS SOFTWARE OR ITS DERIVATIVES.
+ *
+ */
+package net.sf.taverna.t2.lang.ui.treetable;
+
+import javax.swing.tree.TreeModel;
+
+/**
+ * TreeTableModel is the model used by a JTreeTable. It extends TreeModel
+ * to add methods for getting inforamtion about the set of columns each
+ * node in the TreeTableModel may have. Each column, like a column in
+ * a TableModel, has a name and a type associated with it. Each node in
+ * the TreeTableModel can return a value for each of the columns and
+ * set that value if isCellEditable() returns true.
+ *
+ * @author Philip Milne
+ * @author Scott Violet
+ */
+public interface TreeTableModel extends TreeModel
+{
+ /**
+ * Returns the number ofs availible column.
+ */
+ public int getColumnCount();
+
+ /**
+ * Returns the name for column number <code>column</code>.
+ */
+ public String getColumnName(int column);
+
+ /**
+ * Returns the type for column number <code>column</code>.
+ */
+ public Class getColumnClass(int column);
+
+ /**
+ * Returns the value to be displayed for node <code>node</code>,
+ * at column number <code>column</code>.
+ */
+ public Object getValueAt(Object node, int column);
+
+ /**
+ * Indicates whether the the value for node <code>node</code>,
+ * at column number <code>column</code> is editable.
+ */
+ public boolean isCellEditable(Object node, int column);
+
+ /**
+ * Sets the value for node <code>node</code>,
+ * at column number <code>column</code>.
+ */
+ public void setValueAt(Object aValue, Object node, int column);
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/treetable/TreeTableModelAdapter.java
----------------------------------------------------------------------
diff --git a/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/treetable/TreeTableModelAdapter.java b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/treetable/TreeTableModelAdapter.java
new file mode 100644
index 0000000..a6cdd24
--- /dev/null
+++ b/taverna-ui/src/main/java/net/sf/taverna/t2/lang/ui/treetable/TreeTableModelAdapter.java
@@ -0,0 +1,132 @@
+/*
+ * @(#)TreeTableModelAdapter.java 1.2 98/10/27
+ *
+ * Copyright 1997, 1998 by Sun Microsystems, Inc.,
+ * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
+ * All rights reserved.
+ *
+ * This software is the confidential and proprietary information
+ * of Sun Microsystems, Inc. ("Confidential Information"). You
+ * shall not disclose such Confidential Information and shall use
+ * it only in accordance with the terms of the license agreement
+ * you entered into with Sun.
+ */
+package net.sf.taverna.t2.lang.ui.treetable;
+
+import javax.swing.JTree;
+import javax.swing.SwingUtilities;
+import javax.swing.event.TreeExpansionEvent;
+import javax.swing.event.TreeExpansionListener;
+import javax.swing.event.TreeModelEvent;
+import javax.swing.event.TreeModelListener;
+import javax.swing.table.AbstractTableModel;
+import javax.swing.tree.TreePath;
+
+/**
+ * This is a wrapper class takes a TreeTableModel and implements
+ * the table model interface. The implementation is trivial, with
+ * all of the event dispatching support provided by the superclass:
+ * the AbstractTableModel.
+ *
+ * @version 1.2 10/27/98
+ *
+ * @author Philip Milne
+ * @author Scott Violet
+ */
+@SuppressWarnings("serial")
+public class TreeTableModelAdapter extends AbstractTableModel
+{
+ JTree tree;
+ TreeTableModel treeTableModel;
+
+ public TreeTableModelAdapter(TreeTableModel treeTableModel, JTree tree) {
+ this.tree = tree;
+ this.treeTableModel = treeTableModel;
+
+ tree.addTreeExpansionListener(new TreeExpansionListener() {
+ // Don't use fireTableRowsInserted() here; the selection model
+ // would get updated twice.
+ public void treeExpanded(TreeExpansionEvent event) {
+ fireTableDataChanged();
+ }
+ public void treeCollapsed(TreeExpansionEvent event) {
+ fireTableDataChanged();
+ }
+ });
+
+ // Install a TreeModelListener that can update the table when
+ // tree changes. We use delayedFireTableDataChanged as we can
+ // not be guaranteed the tree will have finished processing
+ // the event before us.
+ treeTableModel.addTreeModelListener(new TreeModelListener() {
+ public void treeNodesChanged(TreeModelEvent e) {
+ delayedFireTableDataChanged();
+ }
+
+ public void treeNodesInserted(TreeModelEvent e) {
+ delayedFireTableDataChanged();
+ }
+
+ public void treeNodesRemoved(TreeModelEvent e) {
+ delayedFireTableDataChanged();
+ }
+
+ public void treeStructureChanged(TreeModelEvent e) {
+ delayedFireTableDataChanged();
+ }
+ });
+ }
+
+ // Wrappers, implementing TableModel interface.
+
+ public int getColumnCount() {
+ return treeTableModel.getColumnCount();
+ }
+
+ public String getColumnName(int column) {
+ return treeTableModel.getColumnName(column);
+ }
+
+ public Class getColumnClass(int column) {
+ return treeTableModel.getColumnClass(column);
+ }
+
+ public int getRowCount() {
+ return tree.getRowCount();
+ }
+
+ protected Object nodeForRow(int row) {
+ TreePath treePath = tree.getPathForRow(row);
+ if (treePath == null) {
+ return null;
+ }
+ return treePath.getLastPathComponent();
+ }
+
+ public Object getValueAt(int row, int column) {
+ return treeTableModel.getValueAt(nodeForRow(row), column);
+ }
+
+ public boolean isCellEditable(int row, int column) {
+ return treeTableModel.isCellEditable(nodeForRow(row), column);
+ }
+
+ public void setValueAt(Object value, int row, int column) {
+ treeTableModel.setValueAt(value, nodeForRow(row), column);
+ }
+
+ /**
+ * Invokes fireTableDataChanged after all the pending events have been
+ * processed. SwingUtilities.invokeLater is used to handle this.
+ */
+ protected void delayedFireTableDataChanged() {
+ SwingUtilities.invokeLater(new Runnable() {
+ public void run() {
+ TreePath[] selected = tree.getSelectionPaths();
+ fireTableDataChanged();
+ tree.setSelectionPaths(selected);
+ }
+ });
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-ui/src/main/resources/net/sf/taverna/t2/lang/ui/icons/ok.png
----------------------------------------------------------------------
diff --git a/taverna-ui/src/main/resources/net/sf/taverna/t2/lang/ui/icons/ok.png b/taverna-ui/src/main/resources/net/sf/taverna/t2/lang/ui/icons/ok.png
new file mode 100644
index 0000000..ac479f2
Binary files /dev/null and b/taverna-ui/src/main/resources/net/sf/taverna/t2/lang/ui/icons/ok.png differ
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-ui/src/main/resources/net/sf/taverna/t2/lang/ui/icons/severe.png
----------------------------------------------------------------------
diff --git a/taverna-ui/src/main/resources/net/sf/taverna/t2/lang/ui/icons/severe.png b/taverna-ui/src/main/resources/net/sf/taverna/t2/lang/ui/icons/severe.png
new file mode 100644
index 0000000..a69364d
Binary files /dev/null and b/taverna-ui/src/main/resources/net/sf/taverna/t2/lang/ui/icons/severe.png differ
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-ui/src/main/resources/net/sf/taverna/t2/lang/ui/icons/warning.png
----------------------------------------------------------------------
diff --git a/taverna-ui/src/main/resources/net/sf/taverna/t2/lang/ui/icons/warning.png b/taverna-ui/src/main/resources/net/sf/taverna/t2/lang/ui/icons/warning.png
new file mode 100644
index 0000000..f09e60f
Binary files /dev/null and b/taverna-ui/src/main/resources/net/sf/taverna/t2/lang/ui/icons/warning.png differ
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/ui/pom.xml
----------------------------------------------------------------------
diff --git a/ui/pom.xml b/ui/pom.xml
deleted file mode 100644
index 6d42dc3..0000000
--- a/ui/pom.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<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>net.sf.taverna.t2</groupId>
- <artifactId>lang</artifactId>
- <version>2.0.1-SNAPSHOT</version>
- </parent>
- <groupId>net.sf.taverna.t2.lang</groupId>
- <artifactId>ui</artifactId>
- <packaging>bundle</packaging>
- <name>User interface (Swing) utility classes</name>
- <dependencies>
- <dependency>
- <groupId>net.sf.taverna.t2.lang</groupId>
- <artifactId>observer</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>net.sf.taverna.jedit</groupId>
- <artifactId>jedit-syntax</artifactId>
- <version>${jedit.syntax.version}</version>
- </dependency>
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- <version>${commons.io.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.log4j</groupId>
- <artifactId>com.springsource.org.apache.log4j</artifactId>
- <version>${log4j.version}</version>
- </dependency>
- </dependencies>
-</project>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/ui/src/main/java/net/sf/taverna/t2/lang/ui/CArrowImage.java
----------------------------------------------------------------------
diff --git a/ui/src/main/java/net/sf/taverna/t2/lang/ui/CArrowImage.java b/ui/src/main/java/net/sf/taverna/t2/lang/ui/CArrowImage.java
deleted file mode 100644
index 6a258de..0000000
--- a/ui/src/main/java/net/sf/taverna/t2/lang/ui/CArrowImage.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.lang.ui;
-
-import java.awt.Color;
-import java.awt.GradientPaint;
-import java.awt.Graphics2D;
-import java.awt.RenderingHints;
-import java.awt.SystemColor;
-import java.awt.RenderingHints.Key;
-import java.awt.geom.GeneralPath;
-import java.awt.geom.Line2D;
-import java.awt.image.BufferedImage;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * A BufferedImage of one of four types of arrow (up, down, left or right) drawn
- * to the size specified on the constructor.
- */
-public class CArrowImage extends BufferedImage {
- // Constants...
- public static final int ARROW_UP = 0;
-
- public static final int ARROW_DOWN = 1;
-
- public static final int ARROW_LEFT = 2;
-
- public static final int ARROW_RIGHT = 3;
-
- // Member variables...
- private GeneralPath _pathArrow = new GeneralPath();
-
- // Constructor...
- public CArrowImage(int nArrowDirection) {
- this(15, 9, nArrowDirection);
- }
-
- public CArrowImage(int nWidth, int nHeight, int nArrowDirection) {
- super(nWidth, nHeight, TYPE_INT_ARGB_PRE); // Set the width, height and
- // image type
-
- Map<Key, Object> map = new HashMap<Key, Object>();
- map.put(RenderingHints.KEY_ANTIALIASING,
- RenderingHints.VALUE_ANTIALIAS_ON);
- map.put(RenderingHints.KEY_RENDERING,
- RenderingHints.VALUE_RENDER_QUALITY);
- RenderingHints hints = new RenderingHints(map);
-
- Graphics2D g2 = this.createGraphics(); // Create a graphics context for
- // this buffered image
- g2.setRenderingHints(hints);
-
- float h = getHeight();
- float w = getWidth();
- float w13 = w / 3;
- float w12 = w / 2;
- float w23 = w * 2 / 3;
- float h13 = h / 3;
- float h12 = h / 2;
- float h23 = h * 2 / 3;
-
- switch (nArrowDirection) {
- case ARROW_UP:
- _pathArrow.moveTo(w12, h12);
- _pathArrow.lineTo(w12, 0);
- _pathArrow.lineTo(w, h - 1);
- _pathArrow.lineTo(0, h - 1);
- _pathArrow.closePath();
- g2.setPaint(new GradientPaint(w13, h13,
- SystemColor.controlLtHighlight, w, h - 1,
- SystemColor.controlShadow));
-
- g2.fill(_pathArrow);
-
- g2.setColor(SystemColor.controlDkShadow);
- g2.draw(new Line2D.Float(0, h - 1, w, h - 1));
- g2.setColor(SystemColor.controlShadow);
- g2.draw(new Line2D.Float(w12, 0, w, h - 1));
- g2.setColor(SystemColor.controlLtHighlight);
- g2.draw(new Line2D.Float(0, h - 1, w12, 0));
- break;
-
- case ARROW_DOWN:
- _pathArrow.moveTo(w12, h12);
- _pathArrow.lineTo(w, 0);
- _pathArrow.lineTo(w12, h - 1);
- _pathArrow.closePath();
- g2.setPaint(new GradientPaint(0, 0, SystemColor.controlLtHighlight,
- w23, h23, SystemColor.controlShadow));
- g2.fill(_pathArrow);
-
- g2.setColor(SystemColor.controlDkShadow);
- g2.draw(new Line2D.Float(w, 0, w12, h - 1));
- g2.setColor(SystemColor.controlShadow);
- g2.draw(new Line2D.Float(w12, h - 1, 0, 0));
- g2.setColor(SystemColor.controlLtHighlight);
- g2.draw(new Line2D.Float(0, 0, w, 0));
- break;
-
- case ARROW_LEFT:
- _pathArrow.moveTo(w - 1, h13);
- _pathArrow.lineTo(w13, h13);
- _pathArrow.lineTo(w13, 0);
- _pathArrow.lineTo(0, h12);
- _pathArrow.lineTo(w13, h - 1);
- _pathArrow.lineTo(w13, h23);
- _pathArrow.lineTo(w - 1, h23);
- _pathArrow.closePath();
- g2.setPaint(new GradientPaint(0, 0, Color.white, // SystemColor.
- // controlLtHighlight
- // ,
- 0, h, SystemColor.controlShadow));
- g2.fill(_pathArrow);
-
- _pathArrow.reset();
- _pathArrow.moveTo(w13, 0);
- _pathArrow.lineTo(w13, h13);
- _pathArrow.moveTo(w - 1, h13);
- _pathArrow.lineTo(w - 1, h23);
- _pathArrow.lineTo(w13, h23);
- _pathArrow.lineTo(w13, h - 1);
- g2.setColor(SystemColor.controlDkShadow);
- g2.draw(_pathArrow);
-
- g2.setColor(SystemColor.controlShadow);
- g2.draw(new Line2D.Float(0, h12, w13, h - 1));
-
- _pathArrow.reset();
- _pathArrow.moveTo(0, h12);
- _pathArrow.lineTo(w13, 0);
- _pathArrow.moveTo(w13, h13);
- _pathArrow.lineTo(w - 1, h13);
- g2.setColor(SystemColor.controlLtHighlight);
- g2.draw(_pathArrow);
- break;
-
- case ARROW_RIGHT:
- default: {
- _pathArrow.moveTo(0, h13);
- _pathArrow.lineTo(w23, h13);
- _pathArrow.lineTo(w23, 0);
- _pathArrow.lineTo(w - 1, h12);
- _pathArrow.lineTo(w23, h - 1);
- _pathArrow.lineTo(w23, h23);
- _pathArrow.lineTo(0, h23);
- _pathArrow.closePath();
- g2.setPaint(new GradientPaint(0, 0, Color.white, // SystemColor.
- // controlLtHighlight
- // ,
- 0, h, SystemColor.controlShadow));
- g2.fill(_pathArrow);
-
- _pathArrow.reset();
- _pathArrow.moveTo(0, h23);
- _pathArrow.lineTo(w23, h23);
- _pathArrow.moveTo(w23, h - 1);
- _pathArrow.lineTo(w - 1, h12);
- g2.setColor(SystemColor.controlDkShadow);
- g2.draw(_pathArrow);
-
- g2.setColor(SystemColor.controlShadow);
- g2.draw(new Line2D.Float(w - 1, h12, w23, 0));
-
- _pathArrow.reset();
- _pathArrow.moveTo(w23, 0);
- _pathArrow.lineTo(w23, h13);
- _pathArrow.lineTo(0, h13);
- _pathArrow.lineTo(0, h23);
- _pathArrow.moveTo(w23, h23);
- _pathArrow.lineTo(w23, h - 1);
- g2.setColor(SystemColor.controlLtHighlight);
- g2.draw(_pathArrow);
- break;
- }
- }
-
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/ui/src/main/java/net/sf/taverna/t2/lang/ui/CTransferableTreePath.java
----------------------------------------------------------------------
diff --git a/ui/src/main/java/net/sf/taverna/t2/lang/ui/CTransferableTreePath.java b/ui/src/main/java/net/sf/taverna/t2/lang/ui/CTransferableTreePath.java
deleted file mode 100644
index 2d85203..0000000
--- a/ui/src/main/java/net/sf/taverna/t2/lang/ui/CTransferableTreePath.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.lang.ui;
-
-import java.awt.datatransfer.DataFlavor;
-import java.awt.datatransfer.Transferable;
-import java.awt.datatransfer.UnsupportedFlavorException;
-
-import javax.swing.tree.TreePath;
-
-/**
- * This represents a TreePath (a node in a JTree) that can be transferred
- * between a drag source and a drop target.
- */
-public class CTransferableTreePath implements Transferable {
- // The type of DnD object being dragged...
- public static final DataFlavor TREEPATH_FLAVOR = new DataFlavor(
- DataFlavor.javaJVMLocalObjectMimeType, "TreePath");
-
- private TreePath _path;
-
- private DataFlavor[] _flavors = { TREEPATH_FLAVOR };
-
- /**
- * Constructs a transferrable tree path object for the specified path.
- */
- public CTransferableTreePath(TreePath path) {
- _path = path;
- }
-
- // Transferable interface methods...
- public DataFlavor[] getTransferDataFlavors() {
- return _flavors;
- }
-
- public boolean isDataFlavorSupported(DataFlavor flavor) {
- return java.util.Arrays.asList(_flavors).contains(flavor);
- }
-
- public synchronized Object getTransferData(DataFlavor flavor)
- throws UnsupportedFlavorException {
- if (flavor.isMimeTypeEqual(TREEPATH_FLAVOR.getMimeType())) // DataFlavor.javaJVMLocalObjectMimeType))
- return _path;
- else
- throw new UnsupportedFlavorException(flavor);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/ui/src/main/java/net/sf/taverna/t2/lang/ui/DeselectingButton.java
----------------------------------------------------------------------
diff --git a/ui/src/main/java/net/sf/taverna/t2/lang/ui/DeselectingButton.java b/ui/src/main/java/net/sf/taverna/t2/lang/ui/DeselectingButton.java
deleted file mode 100644
index ea29adb..0000000
--- a/ui/src/main/java/net/sf/taverna/t2/lang/ui/DeselectingButton.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- *
- */
-package net.sf.taverna.t2.lang.ui;
-
-import java.awt.Component;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-import javax.swing.AbstractAction;
-import javax.swing.Action;
-import javax.swing.JButton;
-
-/**
- * @author alanrw
- *
- */
-public class DeselectingButton extends JButton {
-
- public DeselectingButton(String name, final ActionListener action, String toolTip) {
- super();
- this.setAction(new AbstractAction() {
-
- public void actionPerformed(ActionEvent e) {
- Component parent = DeselectingButton.this.getParent();
- action.actionPerformed(e);
- parent.requestFocusInWindow();
- }
- });
- this.setText(name);
- this.setToolTipText(toolTip);
- }
-
- public DeselectingButton(String name, final ActionListener action) {
- this(name, action, null);
- }
-
- public DeselectingButton(final Action action, String toolTip) {
- this((String) action.getValue(Action.NAME), action, toolTip);
- }
-
- public DeselectingButton(final Action action) {
- this(action, null);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/ui/src/main/java/net/sf/taverna/t2/lang/ui/DialogTextArea.java
----------------------------------------------------------------------
diff --git a/ui/src/main/java/net/sf/taverna/t2/lang/ui/DialogTextArea.java b/ui/src/main/java/net/sf/taverna/t2/lang/ui/DialogTextArea.java
deleted file mode 100644
index faf2643..0000000
--- a/ui/src/main/java/net/sf/taverna/t2/lang/ui/DialogTextArea.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/**
- *
- */
-package net.sf.taverna.t2.lang.ui;
-
-import java.awt.Font;
-
-import javax.swing.JTextArea;
-import javax.swing.text.Document;
-
-/**
- * @author alanrw
- *
- */
-public class DialogTextArea extends JTextArea {
-
- private static Font newFont = Font.decode("Dialog");
-
- /**
- *
- */
- private static final long serialVersionUID = 2329063139827993252L;
-
- /**
- *
- */
- public DialogTextArea() {
- updateFont();
- }
-
- /**
- * @param text
- */
- public DialogTextArea(String text) {
- super(text);
- updateFont();
- }
-
- /**
- * @param doc
- */
- public DialogTextArea(Document doc) {
- super(doc);
- updateFont();
- }
-
- /**
- * @param rows
- * @param columns
- */
- public DialogTextArea(int rows, int columns) {
- super(rows, columns);
- updateFont();
- }
-
- /**
- * @param text
- * @param rows
- * @param columns
- */
- public DialogTextArea(String text, int rows, int columns) {
- super(text, rows, columns);
- updateFont();
- }
-
- /**
- * @param doc
- * @param text
- * @param rows
- * @param columns
- */
- public DialogTextArea(Document doc, String text, int rows, int columns) {
- super(doc, text, rows, columns);
- updateFont();
- }
-
- private void updateFont() {
- if (newFont != null) {
- this.setFont(newFont);
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/ui/src/main/java/net/sf/taverna/t2/lang/ui/EdgeLineBorder.java
----------------------------------------------------------------------
diff --git a/ui/src/main/java/net/sf/taverna/t2/lang/ui/EdgeLineBorder.java b/ui/src/main/java/net/sf/taverna/t2/lang/ui/EdgeLineBorder.java
deleted file mode 100644
index f49faa1..0000000
--- a/ui/src/main/java/net/sf/taverna/t2/lang/ui/EdgeLineBorder.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2013 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.lang.ui;
-
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Graphics;
-import java.awt.Insets;
-
-import javax.swing.JFrame;
-import javax.swing.JPanel;
-import javax.swing.border.Border;
-import javax.swing.border.LineBorder;
-
-/**
- *
- *
- * @author David Withers
- */
-public class EdgeLineBorder implements Border {
-
- public static final int TOP = 1;
- public static final int BOTTOM = 2;
- public static final int LEFT = 3;
- public static final int RIGHT = 4;
- private final int edge;
- private final Color color;
-
- public EdgeLineBorder(int edge, Color color) {
- this.edge = edge;
- this.color = color;
- }
-
- @Override
- public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
- Color oldColor = g.getColor();
- g.setColor(color);
- switch (edge) {
- case TOP:
- g.drawLine(x, y, x+width, y);
- break;
- case BOTTOM:
- g.drawLine(x, y+height-2, x+width, y+height-2);
- break;
- case LEFT:
- g.drawLine(x, y, x+width, y+height);
- break;
- case RIGHT:
- g.drawLine(x+width, y, x+width, y+height);
- break;
- }
- g.setColor(oldColor);
- }
-
- @Override
- public Insets getBorderInsets(Component c) {
- return new Insets(0, 0, 0, 0);
- }
-
- @Override
- public boolean isBorderOpaque() {
- return false;
- }
-
- public static void main(String[] args) {
- JFrame frame = new JFrame();
- frame.setSize(500, 500);
- JPanel panel = new JPanel();
- panel.setBorder(new EdgeLineBorder(TOP, Color.GRAY));
- frame.add(panel);
- frame.setVisible(true);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/ui/src/main/java/net/sf/taverna/t2/lang/ui/EditorKeySetUtil.java
----------------------------------------------------------------------
diff --git a/ui/src/main/java/net/sf/taverna/t2/lang/ui/EditorKeySetUtil.java b/ui/src/main/java/net/sf/taverna/t2/lang/ui/EditorKeySetUtil.java
deleted file mode 100644
index 0e8d908..0000000
--- a/ui/src/main/java/net/sf/taverna/t2/lang/ui/EditorKeySetUtil.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2009 Ingo Wassink of University of Twente, Netherlands and
- * The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-
-/**
- * @author Ingo Wassink
- * @author Ian Dunlop
- * @author Alan R Williams
- */
-package net.sf.taverna.t2.lang.ui;
-
-import java.io.BufferedReader;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.TreeSet;
-
-import org.apache.log4j.Logger;
-
-/**
- * Manager for reading key set file
- *
- * @author WassinkI
- * @author alanrw
- *
- */
-public class EditorKeySetUtil {
-
- private static Logger logger = Logger.getLogger(EditorKeySetUtil.class);
-
-
- public static Set<String> loadKeySet(InputStream stream) {
- Set<String> result = new TreeSet<String>();
- try {
- BufferedReader reader = new BufferedReader(
- new InputStreamReader(stream));
-
- String line;
- while ((line = reader.readLine()) != null) {
- result.add(line.trim());
- }
- reader.close();
- } catch (Exception e) {
- logger.error(e);
- }
- return result;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/ui/src/main/java/net/sf/taverna/t2/lang/ui/ExtensionFileFilter.java
----------------------------------------------------------------------
diff --git a/ui/src/main/java/net/sf/taverna/t2/lang/ui/ExtensionFileFilter.java b/ui/src/main/java/net/sf/taverna/t2/lang/ui/ExtensionFileFilter.java
deleted file mode 100644
index 35e2417..0000000
--- a/ui/src/main/java/net/sf/taverna/t2/lang/ui/ExtensionFileFilter.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-/**
- * This file is a component of the Taverna project,
- * and is licensed under the GNU LGPL.
- * Copyright Tom Oinn, EMBL-EBI
- */
-package net.sf.taverna.t2.lang.ui;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import javax.swing.filechooser.FileFilter;
-
-/**
- * A FileFilter implementation that can be configured to show only specific file
- * suffixes.
- *
- * @author Tom Oinn
- * @author Stian Soiland-Reyes
- */
-public class ExtensionFileFilter extends FileFilter {
- List<String> allowedExtensions;
-
- public ExtensionFileFilter(List<String> extensions) {
- setAllowedExtensions(extensions);
- }
-
- public ExtensionFileFilter(String[] allowedExtensions) {
- setAllowedExtensions(Arrays.asList(allowedExtensions));
- }
-
- private void setAllowedExtensions(List<String> extensions) {
- this.allowedExtensions = new ArrayList<String>();
- for (String e : extensions) {
- if (e.startsWith(".")) {
- if (e.length() > 1) {
- allowedExtensions.add(e.substring(1));
- }
- }
- else {
- allowedExtensions.add(e);
- }
- }
- }
-
- @Override
- public boolean accept(File f) {
- if (f.isDirectory()) {
- return true;
- }
- String extension = getExtension(f);
- if (extension != null) {
- for (String allowedExtension : allowedExtensions) {
- if (extension.equalsIgnoreCase(allowedExtension)) {
- return true;
- }
- }
- }
- return false;
- }
-
- String getExtension(File f) {
- String ext = null;
- String s = f.getName();
- int i = s.lastIndexOf('.');
- if (i > 0 && i < s.length() - 1) {
- ext = s.substring(i + 1).toLowerCase();
- }
- return ext;
- }
-
- @Override
- public String getDescription() {
- StringBuffer sb = new StringBuffer();
- sb.append("Filter for extensions : " );
- for (int i = 0; i < allowedExtensions.size(); i++) {
- sb.append(allowedExtensions.get(i));
- if (i < allowedExtensions.size() - 1) {
- sb.append(", ");
- }
- }
- return sb.toString();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/ui/src/main/java/net/sf/taverna/t2/lang/ui/FileTools.java
----------------------------------------------------------------------
diff --git a/ui/src/main/java/net/sf/taverna/t2/lang/ui/FileTools.java b/ui/src/main/java/net/sf/taverna/t2/lang/ui/FileTools.java
deleted file mode 100644
index 4aa5bb2..0000000
--- a/ui/src/main/java/net/sf/taverna/t2/lang/ui/FileTools.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/**
- *
- */
-package net.sf.taverna.t2.lang.ui;
-
-import java.awt.Component;
-import java.io.File;
-import java.io.IOException;
-import java.nio.charset.StandardCharsets;
-import java.util.prefs.Preferences;
-
-import javax.swing.JFileChooser;
-import javax.swing.JOptionPane;
-
-import org.apache.commons.io.FileUtils;
-import org.apache.log4j.Logger;
-
-/**
- * @author alanrw
- *
- */
-public class FileTools {
-
- private static Logger logger = Logger.getLogger(FileTools.class);
-
-
-
- public static boolean saveStringToFile(Component parent, String dialogTitle, String extension, String content) {
- JFileChooser fileChooser = new JFileChooser();
- fileChooser.setDialogTitle(dialogTitle);
-
- fileChooser.resetChoosableFileFilters();
- fileChooser.setAcceptAllFileFilterUsed(true);
-
- fileChooser.setFileFilter(new ExtensionFileFilter(new String[] { extension }));
-
- Preferences prefs = Preferences.userNodeForPackage(FileTools.class);
- String curDir = prefs
- .get("currentDir", System.getProperty("user.home"));
- fileChooser.setCurrentDirectory(new File(curDir));
-
- boolean tryAgain = true;
- while (tryAgain) {
- tryAgain = false;
- int returnVal = fileChooser.showSaveDialog(parent);
- if (returnVal == JFileChooser.APPROVE_OPTION) {
- prefs.put("currentDir", fileChooser.getCurrentDirectory()
- .toString());
- File file = fileChooser.getSelectedFile();
- if (!file.getName().contains(".")) {
- String newName = file.getName() + extension;
- file = new File(file.getParentFile(), newName);
- }
-
- // TODO: Open in separate thread to avoid hanging UI
- try {
- if (file.exists()) {
- logger.info("File already exists: " + file);
- String msg = "Are you sure you want to overwrite existing file "
- + file + "?";
- int ret = JOptionPane.showConfirmDialog(
- parent, msg, "File already exists",
- JOptionPane.YES_NO_CANCEL_OPTION);
- if (ret == JOptionPane.YES_OPTION) {
-
- } else if (ret == JOptionPane.NO_OPTION) {
- tryAgain = true;
- continue;
- } else {
- logger.info("Aborted overwrite of " + file);
- return false;
- }
- }
- FileUtils.writeStringToFile(file, content, StandardCharsets.UTF_8.name());
- logger.info("Saved content by overwriting " + file);
- return true;
- } catch (IOException ex) {
- logger.warn("Could not save content to " + file, ex);
- JOptionPane.showMessageDialog(parent,
- "Could not save to " + file + ": \n\n"
- + ex.getMessage(), "Warning",
- JOptionPane.WARNING_MESSAGE);
- return false;
- }
- }
- }
- return false;
- }
-
- public static String readStringFromFile(Component parent, String dialogTitle, String extension) {
- JFileChooser fileChooser = new JFileChooser();
- fileChooser.setDialogTitle(dialogTitle);
- fileChooser.resetChoosableFileFilters();
- fileChooser.setAcceptAllFileFilterUsed(true);
-
- fileChooser.setFileFilter(new ExtensionFileFilter(new String[] { extension }));
-
- Preferences prefs = Preferences.userNodeForPackage(FileTools.class);
- String curDir = prefs
- .get("currentDir", System.getProperty("user.home"));
- fileChooser.setCurrentDirectory(new File(curDir));
-
- if (fileChooser.showOpenDialog(parent) == JFileChooser.APPROVE_OPTION) {
- File selectedFile = fileChooser.getSelectedFile();
-
- try {
- return FileUtils.readFileToString(selectedFile, StandardCharsets.UTF_8.name());
- } catch (IOException ioe) {
- JOptionPane.showMessageDialog(parent, "Can not read file '"
- + selectedFile.getName() + "'", "Can not read file",
- JOptionPane.ERROR_MESSAGE);
- }
-
- }
- return null;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/ui/src/main/java/net/sf/taverna/t2/lang/ui/HtmlUtils.java
----------------------------------------------------------------------
diff --git a/ui/src/main/java/net/sf/taverna/t2/lang/ui/HtmlUtils.java b/ui/src/main/java/net/sf/taverna/t2/lang/ui/HtmlUtils.java
deleted file mode 100644
index a30d36f..0000000
--- a/ui/src/main/java/net/sf/taverna/t2/lang/ui/HtmlUtils.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/**
- *
- */
-package net.sf.taverna.t2.lang.ui;
-
-import static org.apache.log4j.Logger.getLogger;
-
-import java.awt.BorderLayout;
-import java.awt.Desktop;
-import java.io.IOException;
-import java.net.URISyntaxException;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.swing.JEditorPane;
-import javax.swing.JPanel;
-import javax.swing.event.HyperlinkEvent;
-import javax.swing.event.HyperlinkListener;
-
-import org.apache.log4j.Logger;
-
-/**
- * @author alanrw
- *
- */
-public class HtmlUtils {
-
- private static Logger logger = getLogger(HtmlUtils.class);
-
-
-
- public static JEditorPane createEditorPane(String html) {
- JEditorPane result = new JEditorPane("text/html", html);
- result.addHyperlinkListener(new HyperlinkListener() {
-
- @Override
- public void hyperlinkUpdate(HyperlinkEvent arg0) {
- if (HyperlinkEvent.EventType.ACTIVATED == arg0.getEventType()) {
- try {
- Desktop.getDesktop().browse(arg0.getURL().toURI());
- } catch (IOException | URISyntaxException e1) {
- logger.error(e1);
- }
- }
- }});
- result.setEditable(false);
- return result;
- }
-
- public static JPanel panelForHtml(JEditorPane editorPane) {
- JPanel result = new JPanel();
-
- result.setLayout(new BorderLayout());
-
- result.add(editorPane, BorderLayout.CENTER);
- return result;
- }
-
- public static String getStyle(String backgroundColour) {
- String style = "<style type='text/css'>";
- style += "table {align:center; border:solid black 1px; background-color:"
- + backgroundColour
- + ";width:100%; height:100%; overflow:auto;}";
- style += "</style>";
- return style;
- }
-
- public static String buildTableOpeningTag() {
- String result = "<table ";
- Map<String, String> props = getTableProperties();
- for (String key : props.keySet()) {
- result += key + "=\"" + props.get(key) + "\" ";
- }
- result += ">";
- return result;
- }
-
- public static Map<String, String> getTableProperties() {
- Map<String, String> result = new HashMap<String, String>();
- result.put("border", "1");
- return result;
- }
-
- public static String getHtmlHead(String backgroundColour) {
- return "<html><head>" + getStyle(backgroundColour) + "</head><body>";
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/ui/src/main/java/net/sf/taverna/t2/lang/ui/JSplitPaneExt.java
----------------------------------------------------------------------
diff --git a/ui/src/main/java/net/sf/taverna/t2/lang/ui/JSplitPaneExt.java b/ui/src/main/java/net/sf/taverna/t2/lang/ui/JSplitPaneExt.java
deleted file mode 100644
index e656c36..0000000
--- a/ui/src/main/java/net/sf/taverna/t2/lang/ui/JSplitPaneExt.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- *
- */
-package net.sf.taverna.t2.lang.ui;
-
-import java.awt.Graphics;
-
-import javax.swing.JSplitPane;
-
-/**
- * Copied from code found on http://www.jguru.com
- *
- */
-public class JSplitPaneExt extends JSplitPane {
-
- protected boolean m_fIsPainted = false;
- protected double m_dProportionalLocation = -1;
-
- public JSplitPaneExt() {
- super();
- }
-
- public JSplitPaneExt(int iOrientation) {
- super(iOrientation);
- }
-
- protected boolean hasProportionalLocation() {
- return (m_dProportionalLocation != -1);
- }
-
- public void cancelDividerProportionalLocation() {
- m_dProportionalLocation = -1;
- }
-
- public void setDividerLocation(double dProportionalLocation) {
- if (dProportionalLocation < 0 || dProportionalLocation > 1) {
- throw new IllegalArgumentException(
- "Illegal value for divider location: "
- + dProportionalLocation);
- }
- m_dProportionalLocation = dProportionalLocation;
- if (m_fIsPainted) {
- super.setDividerLocation(m_dProportionalLocation);
- }
- }
-
- public void paint(Graphics g) {
- super.paint(g);
- if (hasProportionalLocation()) {
- super.setDividerLocation(m_dProportionalLocation);
- }
- m_fIsPainted=true;
-
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/ui/src/main/java/net/sf/taverna/t2/lang/ui/KeywordDocument.java
----------------------------------------------------------------------
diff --git a/ui/src/main/java/net/sf/taverna/t2/lang/ui/KeywordDocument.java b/ui/src/main/java/net/sf/taverna/t2/lang/ui/KeywordDocument.java
deleted file mode 100644
index e8fae14..0000000
--- a/ui/src/main/java/net/sf/taverna/t2/lang/ui/KeywordDocument.java
+++ /dev/null
@@ -1,568 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2009 Ingo Wassink of University of Twente, Netherlands and
- * The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-
-/**
- * @author Ingo Wassink
- * @author Ian Dunlop
- * @author Alan R Williams
- */
-package net.sf.taverna.t2.lang.ui;
-
-import java.awt.Color;
-import java.util.Set;
-
-import javax.swing.text.AttributeSet;
-import javax.swing.text.BadLocationException;
-import javax.swing.text.DefaultEditorKit;
-import javax.swing.text.DefaultStyledDocument;
-import javax.swing.text.Element;
-import javax.swing.text.MutableAttributeSet;
-import javax.swing.text.SimpleAttributeSet;
-import javax.swing.text.StyleConstants;
-
-import org.apache.log4j.Logger;
-
-public class KeywordDocument extends DefaultStyledDocument {
-
- private static Logger logger = Logger
- .getLogger(KeywordDocument.class);
-
- private DefaultStyledDocument doc;
- private Element rootElement;
-
- private boolean multiLineComment;
- private MutableAttributeSet normal;
- private MutableAttributeSet keyword;
- private MutableAttributeSet comment;
- private MutableAttributeSet quote;
- private MutableAttributeSet port;
-
- private Set<String> keywords;
-
- private Set<String> ports;
-
-
-
- public KeywordDocument(Set<String> keywords, Set<String> ports) {
- doc = this;
- rootElement = doc.getDefaultRootElement();
- putProperty(DefaultEditorKit.EndOfLineStringProperty, "\n");
-
- normal = new SimpleAttributeSet();
- StyleConstants.setForeground(normal, Color.black);
-
- comment = new SimpleAttributeSet();
- StyleConstants.setForeground(comment, new Color(0, 139, 69, 255));
- StyleConstants.setItalic(comment, true);
-
- keyword = new SimpleAttributeSet();
- StyleConstants.setForeground(keyword, Color.blue);
- StyleConstants.setBold(keyword, true);
-
-
- port = new SimpleAttributeSet();
- StyleConstants.setForeground(port, Color.magenta);
-
- quote = new SimpleAttributeSet();
- StyleConstants.setForeground(quote, Color.red);
-
- this.keywords = keywords;
- this.ports = ports;
- }
-
- /**
- * Method for adding an port
- * @param name the name of the port
- */
- public void addPort(String name){
- ports.add(name);
- updateText();
- }
-
- /**
- * Method for removing an port
- * @param name the name of the port
- */
- public void removePort(String name){
- ports.remove(name);
- updateText();
- }
-
- /**
- * Method for checking whether the name represents an input port
- * @param name the name of the port
- * @return true if true
- */
- private boolean isPort(String name){
- return ports.contains(name);
- }
-
-
- /**
- * Method for updating the whole text
- */
- private void updateText(){
- try{
- processChangedLines(0, getLength() );
- } catch(Exception e){
- logger.error("Unable to update text", e);
- }
- }
-
- /*
- * Override to apply syntax highlighting after the document has been updated
- */
- public void insertString(int offset, String str, AttributeSet a)
- throws BadLocationException {
- if (str.equals("{"))
- str = addMatchingBrace(offset);
-
- super.insertString(offset, str, a);
- processChangedLines(offset, str.length());
- }
-
- /*
- * Override to apply syntax highlighting after the document has been updated
- */
- public void remove(int offset, int length) throws BadLocationException {
- super.remove(offset, length);
- processChangedLines(offset, 0);
- }
-
- /*
- * Determine how many lines have been changed, then apply highlighting to
- * each line
- */
- public void processChangedLines(int offset, int length)
- throws BadLocationException {
- String content = doc.getText(0, doc.getLength());
-
- // The lines affected by the latest document update
-
- int startLine = rootElement.getElementIndex(offset);
- int endLine = rootElement.getElementIndex(offset + length);
-
- // Make sure all comment lines prior to the start line are commented
- // and determine if the start line is still in a multi line comment
-
- setMultiLineComment(commentLinesBefore(content, startLine));
-
- // Do the actual highlighting
-
- for (int i = startLine; i <= endLine; i++) {
- applyHighlighting(content, i);
- }
-
- // Resolve highlighting to the next end multi line delimiter
-
- if (isMultiLineComment())
- commentLinesAfter(content, endLine);
- else
- highlightLinesAfter(content, endLine);
- }
-
- /*
- * Highlight lines when a multi line comment is still 'open' (ie. matching
- * end delimiter has not yet been encountered)
- */
- private boolean commentLinesBefore(String content, int line) {
- int offset = rootElement.getElement(line).getStartOffset();
-
- // Start of comment not found, nothing to do
-
- int startDelimiter = lastIndexOf(content, getStartDelimiter(),
- offset - 2);
-
- if (startDelimiter < 0)
- return false;
-
- // Matching start/end of comment found, nothing to do
-
- int endDelimiter = indexOf(content, getEndDelimiter(), startDelimiter);
-
- if (endDelimiter < offset & endDelimiter != -1)
- return false;
-
- // End of comment not found, highlight the lines
-
- doc.setCharacterAttributes(startDelimiter, offset - startDelimiter + 1,
- comment, false);
- return true;
- }
-
- /*
- * Highlight comment lines to matching end delimiter
- */
- private void commentLinesAfter(String content, int line) {
- int offset = rootElement.getElement(line).getEndOffset();
-
- // End of comment not found, nothing to do
-
- int endDelimiter = indexOf(content, getEndDelimiter(), offset);
-
- if (endDelimiter < 0)
- return;
-
- // Matching start/end of comment found, comment the lines
-
- int startDelimiter = lastIndexOf(content, getStartDelimiter(),
- endDelimiter);
-
- if (startDelimiter < 0 || startDelimiter <= offset) {
- doc.setCharacterAttributes(offset, endDelimiter - offset + 1,
- comment, false);
- }
- }
-
- /*
- * Highlight lines to start or end delimiter
- */
- private void highlightLinesAfter(String content, int line)
- throws BadLocationException {
- int offset = rootElement.getElement(line).getEndOffset();
-
- // Start/End delimiter not found, nothing to do
-
- int startDelimiter = indexOf(content, getStartDelimiter(), offset);
- int endDelimiter = indexOf(content, getEndDelimiter(), offset);
-
- if (startDelimiter < 0)
- startDelimiter = content.length();
-
- if (endDelimiter < 0)
- endDelimiter = content.length();
-
- int delimiter = Math.min(startDelimiter, endDelimiter);
-
- if (delimiter < offset)
- return;
-
- // Start/End delimiter found, reapply highlighting
-
- int endLine = rootElement.getElementIndex(delimiter);
-
- for (int i = line + 1; i < endLine; i++) {
- Element branch = rootElement.getElement(i);
- Element leaf = doc.getCharacterElement(branch.getStartOffset());
- AttributeSet as = leaf.getAttributes();
-
- if (as.isEqual(comment))
- applyHighlighting(content, i);
- }
- }
-
- /*
- * Parse the line to determine the appropriate highlighting
- */
- private void applyHighlighting(String content, int line)
- throws BadLocationException {
- int startOffset = rootElement.getElement(line).getStartOffset();
- int endOffset = rootElement.getElement(line).getEndOffset() - 1;
-
- int lineLength = endOffset - startOffset;
- int contentLength = content.length();
-
- if (endOffset >= contentLength)
- endOffset = contentLength - 1;
-
- // check for multi line comments
- // (always set the comment attribute for the entire line)
-
- if (endingMultiLineComment(content, startOffset, endOffset)
- || isMultiLineComment()
- || startingMultiLineComment(content, startOffset, endOffset)) {
- doc.setCharacterAttributes(startOffset,
- endOffset - startOffset + 1, comment, false);
- return;
- }
-
- // set normal attributes for the line
-
- doc.setCharacterAttributes(startOffset, lineLength, normal, true);
-
- // check for single line comment
-
- int index = content.indexOf(getSingleLineDelimiter(), startOffset);
-
- if ((index > -1) && (index < endOffset)) {
- doc.setCharacterAttributes(index, endOffset - index + 1, comment,
- false);
- endOffset = index - 1;
- }
-
- // check for tokens
-
- checkForTokens(content, startOffset, endOffset);
- }
-
- /*
- * Does this line contain the start delimiter
- */
- private boolean startingMultiLineComment(String content, int startOffset,
- int endOffset) throws BadLocationException {
- int index = indexOf(content, getStartDelimiter(), startOffset);
-
- if ((index < 0) || (index > endOffset))
- return false;
- else {
- setMultiLineComment(true);
- return true;
- }
- }
-
- /*
- * Does this line contain the end delimiter
- */
- private boolean endingMultiLineComment(String content, int startOffset,
- int endOffset) throws BadLocationException {
- int index = indexOf(content, getEndDelimiter(), startOffset);
-
- if ((index < 0) || (index > endOffset))
- return false;
- else {
- setMultiLineComment(false);
- return true;
- }
- }
-
- /*
- * We have found a start delimiter and are still searching for the end
- * delimiter
- */
- private boolean isMultiLineComment() {
- return false;//multiLineComment;
- }
-
- private void setMultiLineComment(boolean value) {
- multiLineComment = value;
- }
-
- /*
- * Parse the line for tokens to highlight
- */
- private void checkForTokens(String content, int startOffset, int endOffset) {
- while (startOffset <= endOffset) {
- // skip the delimiters to find the start of a new token
-
- while (isDelimiter(content.substring(startOffset, startOffset + 1))) {
- if (startOffset < endOffset)
- startOffset++;
- else
- return;
- }
-
- // Extract and process the entire token
-
- if (isQuoteDelimiter(content
- .substring(startOffset, startOffset + 1)))
- startOffset = getQuoteToken(content, startOffset, endOffset);
- else
- startOffset = getOtherToken(content, startOffset, endOffset);
- }
- }
-
- /*
- *
- */
- private int getQuoteToken(String content, int startOffset, int endOffset) {
- String quoteDelimiter = content.substring(startOffset, startOffset + 1);
- String escapeString = getEscapeString(quoteDelimiter);
-
- int index;
- int endOfQuote = startOffset;
-
- // skip over the escape quotes in this quote
-
- index = content.indexOf(escapeString, endOfQuote + 1);
-
- while ((index > -1) && (index < endOffset)) {
- endOfQuote = index + 1;
- index = content.indexOf(escapeString, endOfQuote);
- }
-
- // now find the matching delimiter
-
- index = content.indexOf(quoteDelimiter, endOfQuote + 1);
-
- if ((index < 0) || (index > endOffset))
- endOfQuote = endOffset;
- else
- endOfQuote = index;
-
- doc.setCharacterAttributes(startOffset, endOfQuote - startOffset + 1,
- quote, false);
-
- return endOfQuote + 1;
- }
-
- /*
- *
- */
- private int getOtherToken(String content, int startOffset, int endOffset) {
- int endOfToken = startOffset + 1;
-
- while (endOfToken <= endOffset) {
- if (isDelimiter(content.substring(endOfToken, endOfToken + 1)))
- break;
-
- endOfToken++;
- }
-
- String token = content.substring(startOffset, endOfToken);
-
- if (isKeyword(token)) {
- doc.setCharacterAttributes(startOffset, endOfToken - startOffset,
- keyword, false);
- } else if(isPort(token)){
- doc.setCharacterAttributes(startOffset, endOfToken - startOffset,
- port, false);
- }
-
- return endOfToken + 1;
- }
-
- /*
- * Assume the needle will the found at the start/end of the line
- */
- private int indexOf(String content, String needle, int offset) {
- int index;
-
- while ((index = content.indexOf(needle, offset)) != -1) {
- String text = getLine(content, index).trim();
-
- if (text.startsWith(needle) || text.endsWith(needle))
- break;
- else
- offset = index + 1;
- }
-
- return index;
- }
-
- /*
- * Assume the needle will the found at the start/end of the line
- */
- private int lastIndexOf(String content, String needle, int offset) {
- int index;
-
- while ((index = content.lastIndexOf(needle, offset)) != -1) {
- String text = getLine(content, index).trim();
-
- if (text.startsWith(needle) || text.endsWith(needle))
- break;
- else
- offset = index - 1;
- }
-
- return index;
- }
-
- private String getLine(String content, int offset) {
- int line = rootElement.getElementIndex(offset);
- Element lineElement = rootElement.getElement(line);
- int start = lineElement.getStartOffset();
- int end = lineElement.getEndOffset();
- return content.substring(start, end - 1);
- }
-
- /*
- * Override for other languages
- */
- protected boolean isDelimiter(String character) {
- String operands = ";:{}()[]+-/%<=>!&|^~*,.";
-
- if (Character.isWhitespace(character.charAt(0))
- || operands.indexOf(character) != -1)
- return true;
- else
- return false;
- }
-
- /*
- * Override for other languages
- */
- protected boolean isQuoteDelimiter(String character) {
- String quoteDelimiters = "\"'";
-
- if (quoteDelimiters.indexOf(character) < 0)
- return false;
- else
- return true;
- }
-
- /*
- * Override for other languages
- */
- protected boolean isKeyword(String token) {
- return keywords.contains(token);
- }
-
- /*
- * Override for other languages
- */
- protected String getStartDelimiter() {
- return "/*";
- }
-
- /*
- * Override for other languages
- */
- protected String getEndDelimiter() {
- return "*/";
- }
-
- /*
- * Override for other languages
- */
- protected String getSingleLineDelimiter() {
- return "#";
- }
-
- /*
- * Override for other languages
- */
- protected String getEscapeString(String quoteDelimiter) {
- return "\\" + quoteDelimiter;
- }
-
- /*
- *
- */
- protected String addMatchingBrace(int offset) throws BadLocationException {
- StringBuffer whiteSpace = new StringBuffer();
- int line = rootElement.getElementIndex(offset);
- int i = rootElement.getElement(line).getStartOffset();
-
- while (true) {
- String temp = doc.getText(i, 1);
-
- if (temp.equals(" ") || temp.equals("\t")) {
- whiteSpace.append(temp);
- i++;
- } else
- break;
- }
-
- return "{\n" + whiteSpace.toString() + "\t\n" + whiteSpace.toString()
- + "}";
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/ui/src/main/java/net/sf/taverna/t2/lang/ui/LineEnabledTextPanel.java
----------------------------------------------------------------------
diff --git a/ui/src/main/java/net/sf/taverna/t2/lang/ui/LineEnabledTextPanel.java b/ui/src/main/java/net/sf/taverna/t2/lang/ui/LineEnabledTextPanel.java
deleted file mode 100644
index 389b9b3..0000000
--- a/ui/src/main/java/net/sf/taverna/t2/lang/ui/LineEnabledTextPanel.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/**
- *
- */
-package net.sf.taverna.t2.lang.ui;
-
-import java.awt.BorderLayout;
-import java.awt.Event;
-import java.awt.event.ActionEvent;
-import java.awt.event.KeyEvent;
-
-import javax.swing.AbstractAction;
-import javax.swing.JLabel;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.KeyStroke;
-import javax.swing.event.CaretEvent;
-import javax.swing.event.CaretListener;
-import javax.swing.text.Document;
-import javax.swing.text.Element;
-import javax.swing.text.JTextComponent;
-
-
-/**
- * @author alanrw
- *
- */
-public class LineEnabledTextPanel extends JPanel {
-
- private JTextComponent textComponent = null;
- private Document document;
- private GotoLineAction gotoLineAction = null;
-
- public LineEnabledTextPanel(final JTextComponent component) {
-
- this.setLayout(new BorderLayout());
- textComponent = component;
- updateDocument();
-
- JScrollPane scrollPane = new JScrollPane(textComponent );
- scrollPane.setPreferredSize(textComponent.getPreferredSize() );
-
- this.add(scrollPane, BorderLayout.CENTER);;
-
- final JLabel caretLabel = new JLabel("Line: 1 Column: 0");
-
- setCaretListener(new CaretListener() {
-
- public void caretUpdate(CaretEvent e) {
- int caretPosition = getCaretPosition();
- Element root = document.getRootElements()[0];
- int elementIndex = root.getElementIndex(caretPosition);
- int relativeOffset = caretPosition - root.getElement(elementIndex).getStartOffset();
- caretLabel.setText("Line: " + (elementIndex + 1) + " Column: " + relativeOffset);
-
- }});
- this.add(caretLabel, BorderLayout.SOUTH);
-
- KeyStroke gotoLineKeystroke = KeyStroke.getKeyStroke(KeyEvent.VK_L, Event.META_MASK);
-
- gotoLineAction = new GotoLineAction();
- textComponent.getInputMap().put(gotoLineKeystroke, "gotoLineKeystroke");
- textComponent.getActionMap().put("gotoLineKeystroke", gotoLineAction);
-
- }
-
- private void updateDocument() {
- document = ((JTextComponent) textComponent).getDocument();
- }
-
- private void setCaretListener(CaretListener listener) {
- ((JTextComponent) textComponent).addCaretListener(listener);
- }
-
- private int getCaretPosition() {
- return ((JTextComponent) textComponent).getCaretPosition();
- }
-
- private void setCaretPosition(int position) {
- ((JTextComponent) textComponent).setCaretPosition(position);
- textComponent.requestFocus();
- }
-
- class GotoLineAction extends AbstractAction
- {
-
- public GotoLineAction() {
- }
-
- public void actionPerformed(ActionEvent e) {
- String inputString = JOptionPane.showInputDialog(null, "Enter line number", "Line number", JOptionPane.QUESTION_MESSAGE);
- if (inputString != null) {
- try {
- int lineNumber = Integer.parseInt(inputString);
- Element root = document.getDefaultRootElement();
- lineNumber = Math.max(lineNumber, 1);
- lineNumber = Math.min(lineNumber, root.getElementCount());
- setCaretPosition( root.getElement( lineNumber - 1 ).getStartOffset() );
-
- } catch (NumberFormatException e1){
- // do nothing
- }
- }
- }
- }
-}
[06/50] [abbrv] incubator-taverna-workbench git commit: Increased
version numbers
Posted by st...@apache.org.
Increased version numbers
git-svn-id: https://taverna.googlecode.com/svn/taverna/utils/net.sf.taverna.t2.lang/branches/maintenance@16048 bf327186-88b3-11dd-a302-d386e5130c1c
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/commit/ddfae3fb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/tree/ddfae3fb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/diff/ddfae3fb
Branch: refs/heads/master
Commit: ddfae3fbb2afb62c5e4ed3619742bd6ce78a7761
Parents: 73450bc
Author: alan@mygrid.org.uk <al...@bf327186-88b3-11dd-a302-d386e5130c1c>
Authored: Fri Sep 13 17:01:57 2013 +0000
Committer: alan@mygrid.org.uk <al...@bf327186-88b3-11dd-a302-d386e5130c1c>
Committed: Fri Sep 13 17:01:57 2013 +0000
----------------------------------------------------------------------
beans/pom.xml | 2 +-
io/pom.xml | 2 +-
observer/pom.xml | 2 +-
partition/pom.xml | 2 +-
pom.xml | 4 ++--
results/pom.xml | 2 +-
ui/pom.xml | 2 +-
uibuilder/pom.xml | 2 +-
8 files changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/ddfae3fb/beans/pom.xml
----------------------------------------------------------------------
diff --git a/beans/pom.xml b/beans/pom.xml
index 2d5380c..3d19823 100644
--- a/beans/pom.xml
+++ b/beans/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>net.sf.taverna.t2</groupId>
<artifactId>lang</artifactId>
- <version>1.4-SNAPSHOT</version>
+ <version>1.5-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/ddfae3fb/io/pom.xml
----------------------------------------------------------------------
diff --git a/io/pom.xml b/io/pom.xml
index 7344fb1..7e58ce5 100644
--- a/io/pom.xml
+++ b/io/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>net.sf.taverna.t2</groupId>
<artifactId>lang</artifactId>
- <version>1.4-SNAPSHOT</version>
+ <version>1.5-SNAPSHOT</version>
</parent>
<groupId>net.sf.taverna.t2.lang</groupId>
<artifactId>io</artifactId>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/ddfae3fb/observer/pom.xml
----------------------------------------------------------------------
diff --git a/observer/pom.xml b/observer/pom.xml
index eb9cc2c..2724a36 100644
--- a/observer/pom.xml
+++ b/observer/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>net.sf.taverna.t2</groupId>
<artifactId>lang</artifactId>
- <version>1.4-SNAPSHOT</version>
+ <version>1.5-SNAPSHOT</version>
</parent>
<description>Implementation of the Observer pattern.</description>
<dependencies>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/ddfae3fb/partition/pom.xml
----------------------------------------------------------------------
diff --git a/partition/pom.xml b/partition/pom.xml
index 3346cae..318b0c8 100644
--- a/partition/pom.xml
+++ b/partition/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>net.sf.taverna.t2</groupId>
<artifactId>lang</artifactId>
- <version>1.4-SNAPSHOT</version>
+ <version>1.5-SNAPSHOT</version>
</parent>
<description>API for recursive subset partitioning</description>
<dependencies>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/ddfae3fb/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index ad1cb6f..e540cc8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,14 +4,14 @@
<parent>
<groupId>net.sf.taverna</groupId>
<artifactId>taverna-parent</artifactId>
- <version>2.4-SNAPSHOT</version>
+ <version>2.5-SNAPSHOT</version>
<relativePath>../../taverna-parent/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<name>Taverna 2 language extensions</name>
<groupId>net.sf.taverna.t2</groupId>
- <version>1.4-SNAPSHOT</version>
+ <version>1.5-SNAPSHOT</version>
<artifactId>lang</artifactId>
<packaging>pom</packaging>
<dependencyManagement>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/ddfae3fb/results/pom.xml
----------------------------------------------------------------------
diff --git a/results/pom.xml b/results/pom.xml
index 6de3586..61a6e05 100644
--- a/results/pom.xml
+++ b/results/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>net.sf.taverna.t2</groupId>
<artifactId>lang</artifactId>
- <version>1.4-SNAPSHOT</version>
+ <version>1.5-SNAPSHOT</version>
</parent>
<name>Common Results handling utilities</name>
<description>Common utilities for handling results, in particular Baclava document handling and de-referencing T2References</description>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/ddfae3fb/ui/pom.xml
----------------------------------------------------------------------
diff --git a/ui/pom.xml b/ui/pom.xml
index 8a04d34..de2b422 100644
--- a/ui/pom.xml
+++ b/ui/pom.xml
@@ -8,7 +8,7 @@
<parent>
<groupId>net.sf.taverna.t2</groupId>
<artifactId>lang</artifactId>
- <version>1.4-SNAPSHOT</version>
+ <version>1.5-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/ddfae3fb/uibuilder/pom.xml
----------------------------------------------------------------------
diff --git a/uibuilder/pom.xml b/uibuilder/pom.xml
index 19204ab..b102fad 100644
--- a/uibuilder/pom.xml
+++ b/uibuilder/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>net.sf.taverna.t2</groupId>
<artifactId>lang</artifactId>
- <version>1.4-SNAPSHOT</version>
+ <version>1.5-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
[44/50] [abbrv] incubator-taverna-workbench git commit: taverna-*
Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/partition/src/main/java/net/sf/taverna/t2/partition/RootPartition.java
----------------------------------------------------------------------
diff --git a/partition/src/main/java/net/sf/taverna/t2/partition/RootPartition.java b/partition/src/main/java/net/sf/taverna/t2/partition/RootPartition.java
deleted file mode 100644
index 64edfd8..0000000
--- a/partition/src/main/java/net/sf/taverna/t2/partition/RootPartition.java
+++ /dev/null
@@ -1,394 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.partition;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.swing.SwingUtilities;
-import javax.swing.event.TreeModelEvent;
-import javax.swing.event.TreeModelListener;
-import javax.swing.tree.TreeModel;
-import javax.swing.tree.TreePath;
-
-/**
- * Subclass of Partition acting as the public access point for the partition
- * structure. Exposes a TreeModel for use with a UI.
- *
- * @author Tom Oinn
- *
- * @param <ItemType>
- * all items added to this partition must cast to this type
- */
-public class RootPartition<ItemType extends Comparable> extends
- Partition<ItemType, Object, Object> implements TreeModel {
-
- // Used to track where we ended up putting items with the addOrUpdateItem
- // method, this makes checking for duplicate items, reclassification and
- // removal of partitions much faster at the expense of a few bytes of memory
- private Map<ItemType, Partition<ItemType, ?, ?>> itemToLeafPartition;
-
- private PropertyExtractorRegistry propertyExtractorRegistry;
-
- private final SetModelChangeListener<ItemType> setChangeListener = new SetModelChangeListener<ItemType>() {
-
- private List<Query<?>> queryList = new ArrayList<Query<?>>();
-
- public void itemsWereAdded(Set<ItemType> newItems) {
- for (ItemType item : newItems) {
- addOrUpdateItem(item);
- }
- }
-
- @SuppressWarnings("unchecked")
- public void itemsWereRemoved(Set<Object> itemsRemoved) {
- for (Object item : itemsRemoved) {
- try {
- removeItem((ItemType) item);
- } catch (ClassCastException cce) {
- // Obviously wasn't the right type of item but that means it
- // couldn't have been added in the first place so we can
- // safely ignore this.
- }
- }
- }
-
- public void addQuery(Query<?> query) {
- queryList.add(query);
- }
-
- public List<Query<?>> getQueries() {
- return queryList;
- }
-
- };
-
- /**
- * Build a new empty root partition with the specified list of partition
- * algorithm implementations used to recursively allocate new data items to
- * the sub-partitions below this one on addition
- *
- * @param pa
- */
- public RootPartition(List<PartitionAlgorithm<?>> pa,
- PropertyExtractorRegistry per) {
- super(null, pa, null, null);
- this.root = this;
- this.propertyExtractorRegistry = per;
- this.itemToLeafPartition = new HashMap<ItemType, Partition<ItemType, ?, ?>>();
- }
-
- /**
- * The root partition comes with a convenience implementation of
- * SetModelChangeListener which can be used to attach it to a compliant
- * instance of SetModel (assuming the item types match). This allows the
- * SetModel to act as the backing data store for the partition - as Query
- * and the various subset / set union operators also implement this it
- * provides a relatively simple mechanism to link multiple sets of data to
- * this partition.
- */
- public SetModelChangeListener<ItemType> getSetModelChangeListener() {
- return this.setChangeListener;
- }
-
- /**
- * Alter the list of partition algorithms which drive the construction of
- * the partitions. Calling this effectively forces a complete rebuild of the
- * tree structure which is an expensive operation so be careful when you use
- * it.
- *
- * @param pa
- * a new list of PartitionAlgorithmSPI instances to use as the
- * basis for the partition structure.
- */
- public synchronized void setPartitionAlgorithmList(
- List<PartitionAlgorithm<?>> pa) {
- if (pa.equals(this.partitionAlgorithms)) {
- // At the least this checks for reference equality, although I'm not
- // sure it does much more than that. TODO - replace this with a
- // smarter check to see whether the list has really changed, doing a
- // full re-build is expensive.
- return;
- }
- // First create a copy of the keyset containing all the items we've
- // added to this point.
- Set<ItemType> itemsToAdd = new HashSet<ItemType>(itemToLeafPartition
- .keySet());
- this.partitionAlgorithms = pa;
- this.children.clear();
- this.itemToLeafPartition.clear();
- treeStructureChanged(new TreeModelEvent(this, getTreePath()));
- for (ItemType item : itemsToAdd) {
- addOrUpdateItem(item);
- }
- sortChildPartitions();
- }
-
- /**
- * Add a new item to the partition structure. If the item already exists
- * this is interpreted as a request to reclassify according to properties
- * which may have changed. This is not the same as a reclassification due to
- * modification of the partition algorithm list, and just refers to the
- * specified item. If the item exists already and its classification is
- * changed the model will be notified with a removal event from the previous
- * location and the item will be added as usual immediately afterwards.
- */
- public synchronized void addOrUpdateItem(ItemType item) {
- // First check whether the item is already stored
- if (itemToLeafPartition.containsKey(item)) {
- // request to reclassify item.
- List<Partition<ItemType, ?, ?>> partitions = itemToLeafPartition
- .get(item).getPartitionPath();
- // partitions[i].getPartitionValue is the result of running
- // getPartitionAlgorithms[i-1] on the item, we run through the array
- // until either we hit the end (no reclassification) or the item
- // classifies differently in which case we remove and re-add it.
- for (int i = 1; i < partitions.size(); i++) {
- PartitionAlgorithm<?> pa = getPartitionAlgorithms().get(
- i - 1);
- Object existingValue = partitions.get(i).getPartitionValue();
- Object reclassifiedValue = pa.allocate(item,
- getPropertyExtractorRegistry());
- if (existingValue.equals(reclassifiedValue) == false) {
- // Items classify differently, remove it
- removeItem(item);
- // ...and add it back again, forcing reclassification
- super.addItem(item);
- return;
- }
- }
- // return as the item wasn't changed.
- return;
- } else {
- // Value wasn't already in the map so we just add it as usual
- super.addItem(item);
- }
-
- }
-
- /**
- * Remove an item from the partition structure, if this leaves any
- * partitions with zero item count they are removed as well to keep things
- * tidy.
- *
- * @param item
- * the item to remove from the partition structure. If this isn't
- * present in the structure this method does nothing along the
- * lines of the collections API.
- */
- public synchronized void removeItem(ItemType item) {
- Partition<ItemType, ?, ?> partition = itemToLeafPartition.get(item);
- if (partition != null) {
- // Remove the item from the leaf partition
- int previousIndex = partition.getMembers().indexOf(item);
- TreePath pathToPartition = partition.getTreePath();
- //partition.removeMember(item);
- for (Partition<ItemType, ?, ?> parentPathElement : partition
- .getPartitionPath()) {
- // Notify path to root that the number of members
- // has changed and it should update the renderers of
- // any attached trees
- treeNodesChanged(new TreeModelEvent(this, parentPathElement
- .getTreePath()));
- }
- partition.removeMember(item);
- treeNodesRemoved(new TreeModelEvent(this, pathToPartition,
- new int[] { previousIndex }, new Object[] { item }));
- // Traverse up the partition path and decrement the item count. If
- // any item count becomes zero we mark this as a partition to
- // remove, then at the end we remove the highest level one (so we
- // only have to send a single delete event to the tree view)
- for (Partition<ItemType, ?, ?> p : partition.getPartitionPath()) {
- synchronized (p) {
- p.itemCount--;
- if (p.getItemCount() == 0 && p != this) {
- // Can remove this node, all nodes after this will by
- // definition have item count of zero. The exception is
- // if this is the root node, in which case we just
- // ignore it and move on to the next child. This avoids
- // deleting the root, which is generally not a smart
- // thing to do to a tree.
- Partition<ItemType, ?, ?> parent = p.getParent();
- int indexInParent = getIndexOfChild(parent, p);
- parent.children.remove(indexInParent);
- treeNodesRemoved(new TreeModelEvent(this, parent
- .getTreePath(), new int[] { indexInParent },
- new Object[] { p }));
-
- break;
- }
- }
- }
- itemToLeafPartition.remove(item);
- }
- treeStructureChanged(new TreeModelEvent(this,getTreePath()));
- }
-
- /**
- * Called by a leaf Partition when it has stored an item in its member set,
- * used to keep track of where items have been stored to make removal more
- * efficient.
- */
- void itemStoredAt(ItemType item, Partition<ItemType, ?, ?> partition) {
- itemToLeafPartition.put(item, partition);
- }
-
- // ---------------------//
- // TreeModel interfaces //
- // ---------------------//
- private List<TreeModelListener> treeListeners = new ArrayList<TreeModelListener>();
-
- @SuppressWarnings("unchecked")
- public synchronized Object getChild(Object parent, int index) {
- if (parent instanceof Partition) {
- Partition<ItemType, ?, ?> p = (Partition<ItemType, ?, ?>) parent;
- if (p.getMembers().isEmpty() == false) {
- if (index < 0 || index >= p.getMembers().size()) {
- return null;
- } else {
- return p.getMembers().get(index);
- }
- } else {
- if (index < 0 || index >= p.getChildren().size()) {
- return null;
- } else {
- return p.getChildren().get(index);
- }
- }
- }
- return null;
- }
-
- @SuppressWarnings("unchecked")
- public synchronized int getChildCount(Object parent) {
- if (parent instanceof Partition) {
- Partition<ItemType, ?, ?> p = (Partition<ItemType, ?, ?>) parent;
- if (p.getMembers().isEmpty() == false) {
- return p.getMembers().size();
- }
- return p.getChildren().size();
- }
- return 0;
- }
-
- @SuppressWarnings("unchecked")
- public synchronized int getIndexOfChild(Object parent, Object child) {
- if (parent != null && child != null && parent instanceof Partition
- && child instanceof Partition) {
- Partition<ItemType, ?, ?> p = (Partition<ItemType, ?, ?>) parent;
- Partition<ItemType, ?, ?> c = (Partition<ItemType, ?, ?>) child;
- if (p.root == c.root && p.root == this) {
- // Parent and child must both be members of this tree structure
- return p.getChildren().indexOf(child);
- }
- } else if (parent != null && child != null
- && parent instanceof Partition) {
- Partition<ItemType, ?, ?> p = (Partition<ItemType, ?, ?>) parent;
- return p.getMembers().indexOf(child);
- }
- return -1;
-
- }
-
- public Object getRoot() {
- // The root partition is also the root of the tree model
- return this;
- }
-
- public boolean isLeaf(Object node) {
- // No leaves at the moment as we're only considering partitions which
- // are by definition not leaves (the items within the last partition are
- // but at the moment we're not including them in the tree model)
- return (!(node instanceof Partition));
- }
-
- public void removeTreeModelListener(TreeModelListener l) {
- treeListeners.remove(l);
- }
-
- public void addTreeModelListener(TreeModelListener l) {
- if (treeListeners.contains(l) == false) {
- treeListeners.add(l);
- }
- }
-
- public void valueForPathChanged(TreePath path, Object newValue) {
- // Ignore this, the tree values are never changed by the user in this
- // implementation so we don't have to do anything
- }
-
- // -------------------------------------------------------//
- // Tree event forwarding helper methods used by Partition //
- // -------------------------------------------------------//
-
- void treeNodesChanged(final TreeModelEvent e) {
- SwingUtilities.invokeLater(new Runnable() {
- public void run() {
- for (TreeModelListener listener : new ArrayList<TreeModelListener>(
- treeListeners)) {
- listener.treeNodesChanged(e);
- }
- }
- });
- }
-
- void treeNodesInserted(final TreeModelEvent e) {
- SwingUtilities.invokeLater(new Runnable() {
- public void run() {
- for (TreeModelListener listener : new ArrayList<TreeModelListener>(
- treeListeners)) {
- listener.treeNodesInserted(e);
- }
- }
- });
- }
-
- void treeNodesRemoved(final TreeModelEvent e) {
- SwingUtilities.invokeLater(new Runnable() {
- public void run() {
- for (TreeModelListener listener : new ArrayList<TreeModelListener>(
- treeListeners)) {
- listener.treeNodesRemoved(e);
- }
- }
- });
- }
-
- void treeStructureChanged(final TreeModelEvent e) {
- SwingUtilities.invokeLater(new Runnable() {
- public void run() {
- for (TreeModelListener listener : new ArrayList<TreeModelListener>(
- treeListeners)) {
- listener.treeStructureChanged(e);
- }
- }
- });
- }
-
- public PropertyExtractorRegistry getPropertyExtractorRegistry() {
- return this.propertyExtractorRegistry;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/partition/src/main/java/net/sf/taverna/t2/partition/SetModel.java
----------------------------------------------------------------------
diff --git a/partition/src/main/java/net/sf/taverna/t2/partition/SetModel.java b/partition/src/main/java/net/sf/taverna/t2/partition/SetModel.java
deleted file mode 100644
index 393d697..0000000
--- a/partition/src/main/java/net/sf/taverna/t2/partition/SetModel.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.partition;
-
-import java.util.Set;
-
-/**
- * Extension of the java Set interface with the addition of change listener
- * support. Intended to be plugged into the RootPartition class so the partition
- * is synchronized with the set membership.
- *
- * @author Tom Oinn
- *
- * @param <ItemType>
- * the parameterised type of the set
- */
-public interface SetModel<ItemType> extends Set<ItemType> {
-
- /**
- * Add a listener to be notified of change events on the set's membership
- *
- * @param listener
- */
- public void addSetModelChangeListener(
- SetModelChangeListener<ItemType> listener);
-
- /**
- * Remove a previously registered change listener
- *
- * @param listener
- */
- public void removeSetModelChangeListener(
- SetModelChangeListener<ItemType> listener);
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/partition/src/main/java/net/sf/taverna/t2/partition/SetModelChangeListener.java
----------------------------------------------------------------------
diff --git a/partition/src/main/java/net/sf/taverna/t2/partition/SetModelChangeListener.java b/partition/src/main/java/net/sf/taverna/t2/partition/SetModelChangeListener.java
deleted file mode 100644
index 176eb7c..0000000
--- a/partition/src/main/java/net/sf/taverna/t2/partition/SetModelChangeListener.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.partition;
-
-import java.util.List;
-import java.util.Set;
-
-/**
- * Handler for change events on a SetModel instance
- *
- * @author Tom Oinn
- *
- */
-public interface SetModelChangeListener<ItemType> {
-
- public void itemsWereAdded(Set<ItemType> newItems);
-
- public void itemsWereRemoved(Set<Object> itemsRemoved);
-
- public List<Query<?>> getQueries();
-
- public void addQuery(Query<?> query);
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/partition/src/main/java/net/sf/taverna/t2/partition/algorithms/CustomPartitionAlgorithm.java
----------------------------------------------------------------------
diff --git a/partition/src/main/java/net/sf/taverna/t2/partition/algorithms/CustomPartitionAlgorithm.java b/partition/src/main/java/net/sf/taverna/t2/partition/algorithms/CustomPartitionAlgorithm.java
deleted file mode 100644
index b6a3eea..0000000
--- a/partition/src/main/java/net/sf/taverna/t2/partition/algorithms/CustomPartitionAlgorithm.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.partition.algorithms;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import net.sf.taverna.t2.partition.PartitionAlgorithm;
-import net.sf.taverna.t2.partition.PropertyExtractorRegistry;
-
-/**
- * Takes a custom search term and checks against the properties eg
- * "operation" of each of the available items. Adds the item to the activity
- * palette if it matches
- *
- * @author Ian Dunlop
- *
- */
-public class CustomPartitionAlgorithm implements PartitionAlgorithm<Object> {
-
- private String searchValue;
- private List<String> properties;
- private static String NO_SEARCH = "No match";
- private static String MATCHING_ITEMS = "Activities with a matching property";
-
- public String getSearchValue() {
- return searchValue;
- }
-
- public void setSearchValue(String searchValue) {
- this.searchValue = searchValue;
- }
-
- public CustomPartitionAlgorithm() {
- properties = new ArrayList<String>();
- }
-
- public CustomPartitionAlgorithm(String searchValue) {
- super();
- this.searchValue = searchValue;
- // this.propertyName = propertyName;
- properties = new ArrayList<String>();
- }
-
- public void addProperty(String propertyValue) {
- properties.add(propertyValue);
- }
-
- /**
- * Checks against the items property to see if it contains the search term.
- * Search each of the properties in {@link #properties} in turn
- */
- public Object allocate(Object newItem, PropertyExtractorRegistry reg) {
- for (String property : properties) {
- Object propertyValue = reg.getAllPropertiesFor(newItem).get(
- property);
- String itemString = newItem.toString();
- //search all the properties first
- if (propertyValue != null) {
- if (((String) propertyValue).contains(getSearchValue()
- .toLowerCase())) {
- return MATCHING_ITEMS;
- }
- }
- //then the name of the item
- if (itemString.toLowerCase().contains(
- getSearchValue().toLowerCase())) {
- return MATCHING_ITEMS;
- }
- }
- return NO_SEARCH;
-
- }
-
- @Override
- public String toString() {
- return "search term=" + this.searchValue;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/partition/src/main/java/net/sf/taverna/t2/partition/algorithms/LiteralValuePartitionAlgorithm.java
----------------------------------------------------------------------
diff --git a/partition/src/main/java/net/sf/taverna/t2/partition/algorithms/LiteralValuePartitionAlgorithm.java b/partition/src/main/java/net/sf/taverna/t2/partition/algorithms/LiteralValuePartitionAlgorithm.java
deleted file mode 100644
index b703d40..0000000
--- a/partition/src/main/java/net/sf/taverna/t2/partition/algorithms/LiteralValuePartitionAlgorithm.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.partition.algorithms;
-
-import net.sf.taverna.t2.partition.PartitionAlgorithm;
-import net.sf.taverna.t2.partition.PropertyExtractorRegistry;
-
-/**
- * A naive partition algorithm that simply returns the property value it's been
- * configured to use from the property getter.
- *
- * @author Tom
- *
- */
-public class LiteralValuePartitionAlgorithm implements
- PartitionAlgorithm<Object> {
-
- private String propertyName = null;
-
- private static String NO_PROPERTY = "No value";
-
- /**
- * Default constructor. The property name defaults to null, and needs setting using getPropertyName
- */
- public LiteralValuePartitionAlgorithm() {
-
- }
-
- /**
- * Constructor that initialised the LiteralValuePartitionAlgorithm with a property name
- *
- * @param propertyName
- */
- public LiteralValuePartitionAlgorithm(String propertyName) {
- super();
- this.propertyName = propertyName;
- }
-
- public Object allocate(Object newItem, PropertyExtractorRegistry reg) {
- if (propertyName == null) {
- return NO_PROPERTY;
- }
- else {
- Object propertyValue = reg.getAllPropertiesFor(newItem).get(propertyName);
- if (propertyValue == null) {
- return NO_PROPERTY;
- }
- else {
- return propertyValue;
- }
- }
- }
-
- public String getPropertyName() {
- return propertyName;
- }
-
- public void setPropertyName(String propertyName) {
- this.propertyName = propertyName;
- }
-
-
-
- /**
- * @return true if obj is a LiteralValuePartionAlgorithm and the property names match
- */
- @Override
- public boolean equals(Object obj) {
- if (obj instanceof LiteralValuePartitionAlgorithm) {
- LiteralValuePartitionAlgorithm alg = (LiteralValuePartitionAlgorithm)obj;
- return getPropertyName().equals(alg.getPropertyName());
- }
- else {
- return false;
- }
- }
-
- @Override
- public int hashCode() {
- return getPropertyName().hashCode();
- }
-
- @Override
- public String toString() {
- return this.propertyName;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/partition/src/main/java/net/sf/taverna/t2/partition/ui/PartitionAlgorithmListEditor.java
----------------------------------------------------------------------
diff --git a/partition/src/main/java/net/sf/taverna/t2/partition/ui/PartitionAlgorithmListEditor.java b/partition/src/main/java/net/sf/taverna/t2/partition/ui/PartitionAlgorithmListEditor.java
deleted file mode 100644
index 9c05c44..0000000
--- a/partition/src/main/java/net/sf/taverna/t2/partition/ui/PartitionAlgorithmListEditor.java
+++ /dev/null
@@ -1,224 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.partition.ui;
-
-import javax.swing.JComponent;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-
-import net.sf.taverna.t2.partition.PartitionAlgorithm;
-
-import java.awt.BasicStroke;
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.Graphics;
-import java.awt.Graphics2D;
-import java.awt.RenderingHints;
-import java.awt.geom.GeneralPath;
-import java.util.List;
-
-public class PartitionAlgorithmListEditor extends JPanel {
-
- // Serial version ID
- private static final long serialVersionUID = 8206805090698009524L;
-
- // Index of currently selected 'tab' or -1 if none selected
- private int selectedIndex = 1;
-
- // List of partition algorithm instances acting as the model for this
- // component
- private List<PartitionAlgorithm<?>> paList;
-
- private int cornerSep = 8;
- private int labelHorizontalPad = 10;
- private int labelBottomPad = 2;
- private int labelTopPad = 4;
- private float selectedStrokeWidth = 3f;
-
- public List<PartitionAlgorithm<?>> getPartitionAlgorithmList() {
- return null;
- }
-
- @Override
- public Dimension getPreferredSize() {
- if (paList.isEmpty()) {
- return new Dimension(0, 16 + labelBottomPad + labelTopPad);
- } else {
- return new Dimension(0, (int) new Tab(getLabelForPA(paList.get(0)))
- .getPreferredSize().getHeight());
- }
- }
-
- public PartitionAlgorithmListEditor(
- List<PartitionAlgorithm<?>> currentState) {
- super();
- this.paList = currentState;
- }
-
- protected JLabel getLabelForPA(PartitionAlgorithm<?> pa) {
- return new JLabel("Test...");
- }
-
- protected Color getBorderColorForPA(PartitionAlgorithm<?> pa) {
- return Color.black;
- }
-
- @Override
- protected void paintComponent(Graphics g) {
- Graphics2D g2d = (Graphics2D) g.create();
- // Enable anti-aliasing for the curved lines
- g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
- RenderingHints.VALUE_ANTIALIAS_ON);
-
- int selectedStartsAt = 0;
- int selectedEndsAt = 0;
- Color frameColor = null;
- int cumulativeTranslation = 0;
-
- super.paintComponent(g2d);
-
- for (int i = 0; i < paList.size(); i++) {
-
- Tab t = new Tab(getLabelForPA(paList.get(i)));
- t.setBackground(new Color(150, 150, 255));
- t.setSelected(i == selectedIndex);
- int width = (int) (t.getPreferredSize()).getWidth();
- t.setSize(new Dimension(width, getHeight()));
- t.paint(g2d);
-
- if (i < selectedIndex) {
- selectedStartsAt += width;
- } else if (i == selectedIndex) {
- selectedEndsAt = selectedStartsAt + width;
- frameColor = t.getBackground();
- }
- cumulativeTranslation += width;
- g2d.translate(width, 0);
- }
-
-
- // Reset the transform
- g2d.translate(-cumulativeTranslation, 0);
- if (selectedIndex > 0) {
- g2d.setStroke(new BasicStroke(selectedStrokeWidth, BasicStroke.CAP_BUTT,
- BasicStroke.JOIN_MITER));
- int height = (int)(getHeight() - selectedStrokeWidth/2);
- // Render the selected index line...
- if (frameColor != null) {
- g2d.setPaint(frameColor.darker());
- }
- GeneralPath path = new GeneralPath();
- path.moveTo(0, height);
- path.lineTo(selectedStartsAt, height);
- path.lineTo(selectedStartsAt, cornerSep);
- path.curveTo(selectedStartsAt, cornerSep / 2, selectedStartsAt
- + cornerSep / 2, 0, selectedStartsAt + cornerSep, 0);
- path.lineTo(selectedEndsAt - cornerSep, 0);
- path.curveTo(selectedEndsAt - cornerSep / 2, 0, selectedEndsAt,
- cornerSep / 2, selectedEndsAt, cornerSep);
- path.lineTo(selectedEndsAt, height);
- path.lineTo(getWidth(), height);
-
- g2d.draw(path);
- }
- g2d.dispose();
- }
-
- @SuppressWarnings("serial")
- // Renderer for a single tab in the partition algorithm list, used as a
- // rubber stamp for a single tab in the tab list.
- class Tab extends JComponent {
-
- // Label to use to render tab contents
- private JLabel label;
-
- // If this is selected then we don't draw the stroke as it'll be drawn
- // on later.
- private boolean selected = false;
-
- @Override
- // Always false as we don't render the corners
- public boolean isOpaque() {
- return false;
- }
-
- public void setSelected(boolean b) {
- this.selected = b;
-
- }
-
- @Override
- public Dimension getPreferredSize() {
- Dimension d = label.getPreferredSize();
- return new Dimension((int) (d.getWidth()) + labelHorizontalPad * 2,
- ((int) d.getHeight()) + labelBottomPad + labelTopPad);
- }
-
- protected Tab(JLabel label) {
- super();
- this.label = label;
- }
-
- @Override
- public void setBackground(Color colour) {
- label.setBackground(colour);
- }
-
- @Override
- public Color getBackground() {
- return label.getBackground();
- }
-
- @Override
- protected void paintComponent(Graphics g) {
- Graphics2D g2d = (Graphics2D) g.create();
-
- int width = getWidth();
- int height = getHeight();
-
- // Create a general path to draw the tab shape
- g2d.setPaint(label.getBackground());
- GeneralPath path = new GeneralPath();
- path.moveTo(0, height);
- path.lineTo(0, cornerSep);
- path.curveTo(0, cornerSep / 2, cornerSep / 2, 0, cornerSep, 0);
- path.lineTo(width - cornerSep, 0);
- path.curveTo(width - cornerSep / 2, 0, width, cornerSep / 2, width,
- cornerSep);
- path.lineTo(width, height);
- path.closePath();
- g2d.fill(path);
- if (!selected) {
- g2d.setPaint(label.getBackground().darker());
- g2d.draw(path);
- }
-
- label.setSize(width - labelHorizontalPad * 2, height
- - (labelBottomPad + labelTopPad));
- g2d.translate(labelHorizontalPad, labelTopPad);
- label.paint(g2d);
- g2d.translate(-labelHorizontalPad, -labelTopPad);
-
- g2d.dispose();
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/partition/src/main/java/net/sf/taverna/t2/partition/ui/TableTreeNodeColumn.java
----------------------------------------------------------------------
diff --git a/partition/src/main/java/net/sf/taverna/t2/partition/ui/TableTreeNodeColumn.java b/partition/src/main/java/net/sf/taverna/t2/partition/ui/TableTreeNodeColumn.java
deleted file mode 100644
index c6b4b36..0000000
--- a/partition/src/main/java/net/sf/taverna/t2/partition/ui/TableTreeNodeColumn.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.partition.ui;
-
-import java.awt.Color;
-import java.awt.Component;
-
-/**
- * A column used in the tree part of the table tree node renderer
- *
- * @author Tom Oinn
- *
- */
-public interface TableTreeNodeColumn {
-
- /**
- * Get a string to use as the header text
- *
- * @return
- */
- public String getShortName();
-
- /**
- * Get a descriptive string for tooltips etc.
- *
- * @return
- */
- public String getDescription();
-
- /**
- * Given a node value render the appropriate property for this column
- *
- * @param value
- * @return
- */
- public Component getCellRenderer(Object value);
-
- /**
- * Return the width in pixels for this column
- *
- * @return
- */
- public int getColumnWidth();
-
- /**
- * Get a header colour - the actual column colour will be a stripe of the
- * result of applying the lighter operator twice and once to this colour.
- */
- public Color getColour();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/partition/src/main/java/net/sf/taverna/t2/partition/ui/TableTreeNodeRenderer.java
----------------------------------------------------------------------
diff --git a/partition/src/main/java/net/sf/taverna/t2/partition/ui/TableTreeNodeRenderer.java b/partition/src/main/java/net/sf/taverna/t2/partition/ui/TableTreeNodeRenderer.java
deleted file mode 100644
index 12fd2a4..0000000
--- a/partition/src/main/java/net/sf/taverna/t2/partition/ui/TableTreeNodeRenderer.java
+++ /dev/null
@@ -1,554 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.partition.ui;
-
-import java.awt.BasicStroke;
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Dimension;
-import java.awt.Graphics;
-import java.awt.Graphics2D;
-import java.awt.Paint;
-import java.awt.Rectangle;
-import java.awt.RenderingHints;
-import java.awt.Stroke;
-import java.awt.geom.AffineTransform;
-import java.awt.geom.GeneralPath;
-
-import javax.swing.JComponent;
-import javax.swing.JLabel;
-import javax.swing.JTree;
-import javax.swing.UIManager;
-import javax.swing.plaf.TreeUI;
-import javax.swing.tree.TreeCellRenderer;
-import javax.swing.tree.TreeModel;
-import javax.swing.tree.TreePath;
-
-public abstract class TableTreeNodeRenderer implements TreeCellRenderer {
-
- private static final long serialVersionUID = -7291631337751330696L;
-
- // The difference in indentation between a node and its child nodes, there
- // isn't an easy way to get this other than constructing a JTree and
- // measuring it - you'd think it would be a property of TreeUI but
- // apparently not.
- private static int perNodeOffset = -1;
-
- // Use this to rubber stamp the original node renderer in before rendering
- // the table
- private TreeCellRenderer nodeRenderer;
-
- // Determines the space allocated to leaf nodes and their parents when
- // applying the stamp defined by the nodeRenderer
- private int nodeWidth;
-
- // Number of pixels of space to leave between the node label and the table
- // header or rows
- private int labelToTablePad = 3;
-
- // Number of pixels to leave around the label rendered into the table cells
- private int cellPadding = 4;
-
- // Drawing borders?
- private boolean drawingBorders = true;
-
- // The number of pixels by which the height of the header is reduced
- // compared to the row height, this leaves a small border above the header
- // and separates it from the last row of the table above, if any.
- private int headerTopPad = 4;
-
- // The proportion of colour : black or colour : white used to create the
- // darker or lighter shades is blendFactor : 1
- private int blendFactor = 2;
-
- // Colour to use to draw the table borders when they're enabled
- private Color borderColour = Color.black;
-
- /**
- * Set the colour to be used to draw the borders if they are displayed at
- * all. Defaults to black.
- */
- public void setBorderColour(Color borderColour) {
- this.borderColour = borderColour;
- }
-
- /**
- * The blend factor determines how strong the colour component is in the
- * shadow and highlight colours used in the bevelled boxes, the ratio of
- * black / white to colour is 1 : blendFactor
- *
- * @param blendFactor
- */
- public void setBlendFactor(int blendFactor) {
- this.blendFactor = blendFactor;
- }
-
- /**
- * Set whether the renderer will draw borders around the table cells - if
- * this is false the table still has the bevelled edges of the cell painters
- * so will still look semi-bordered. Defaults to true if not otherwise set.
- *
- * @param drawingBorders
- */
- public void setDrawBorders(boolean drawingBorders) {
- this.drawingBorders = drawingBorders;
- }
-
- /**
- * Override and implement to get the list of columns for a given partition
- * node - currently assumes all partitions use the same column structure
- * which I need to fix so it doesn't take a partition as argument (yet).
- *
- * @return an array of column specifications used to drive the renderer
- */
- public abstract TableTreeNodeColumn[] getColumns();
-
- /**
- * Construct a new TableTreeNodeRenderer
- *
- * @param nodeRenderer
- * The inner renderer used to render the node labels
- * @param nodeWidth
- * Width of the cell space into which the node label is rendered
- * in the table header and row nodes
- */
- public TableTreeNodeRenderer(TreeCellRenderer nodeRenderer, int nodeWidth) {
- super();
- this.nodeRenderer = nodeRenderer;
- this.nodeWidth = nodeWidth;
- }
-
- /**
- * Do the magic!
- */
- public Component getTreeCellRendererComponent(final JTree tree,
- final Object value, final boolean selected, final boolean expanded,
- final boolean leaf, final int row, final boolean hasFocus) {
- final Component nodeLabel = nodeRenderer.getTreeCellRendererComponent(
- tree, value, false, expanded, leaf, row, false);
- final int nodeLabelHeight = (int) nodeLabel.getPreferredSize()
- .getHeight();
- if (leaf) {
- // Rendering the leaf nodes, therefore use the table rendering
- // strategy
- getPerNodeIndentation(tree, row);
- return new JComponent() {
- private static final long serialVersionUID = 4993815558563895266L;
-
- @Override
- public Dimension getPreferredSize() {
- int width = nodeWidth + labelToTablePad;
- for (TableTreeNodeColumn column : getColumns()) {
- width += column.getColumnWidth();
- }
- return new Dimension(width, nodeLabelHeight);
- }
-
- @Override
- protected void paintComponent(Graphics g) {
-
- Graphics2D g2d = (Graphics2D) g.create();
- AffineTransform originalTransform = g2d.getTransform();
- // Enable anti-aliasing for the curved lines
- g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
- RenderingHints.VALUE_ANTIALIAS_ON);
-
- // This method should paint a bevelled container for the
- // original label but it doesn't really work terribly well
- // as we can't ensure that the original label is actually
- // honouring any opaque flags.
- if (drawingBorders) {
- paintRectangleWithBevel(g2d, nodeWidth
- + labelToTablePad, getHeight(), Color.white);
- }
-
- // Paint original node label
- nodeLabel.setSize(new Dimension(
- nodeWidth - cellPadding * 2, getHeight()
- - (drawingBorders ? 2 : 1)));
- g2d.translate(cellPadding, 0);
- nodeLabel.paint(g2d);
- g2d.translate(-cellPadding, 0);
-
- if (drawingBorders) {
- paintRectangleBorder(g2d, nodeWidth + labelToTablePad,
- getHeight(), 0, 0, 1, 1, borderColour);
- }
-
- g2d.translate(nodeWidth + labelToTablePad, 0);
- boolean first = true;
- for (TableTreeNodeColumn column : getColumns()) {
-
- Color fillColour = column.getColour().brighter();
- Object parentNode = tree.getPathForRow(row)
- .getParentPath().getLastPathComponent();
- int indexInParent = tree.getModel().getIndexOfChild(
- parentNode, value);
- if ((indexInParent & 1) == 1) {
- fillColour = new Color(
- (fillColour.getRed() + column.getColour()
- .getRed()) / 2, (fillColour
- .getGreen() + column.getColour()
- .getGreen()) / 2, (fillColour
- .getBlue() + column.getColour()
- .getBlue()) / 2);
- }
-
- // Paint background and bevel
- paintRectangleWithBevel(g2d, column.getColumnWidth(),
- getHeight(), fillColour);
-
- // Paint cell component
- Component cellComponent = column.getCellRenderer(value);
- cellComponent.setSize(new Dimension(column
- .getColumnWidth()
- - cellPadding * 2, getHeight()));
- g2d.translate(cellPadding, 0);
- cellComponent.paint(g2d);
- g2d.translate(-cellPadding, 0);
-
- // Draw border
- if (drawingBorders) {
- paintRectangleBorder(g2d, column.getColumnWidth(),
- getHeight(), 0, 1, 1, first ? 1 : 0,
- borderColour);
- }
- first = false;
-
- g2d.translate(column.getColumnWidth(), 0);
-
- }
- if (selected) {
- g2d.setTransform(originalTransform);
- g2d.translate(2, 0);
- paintRectangleWithHighlightColour(g2d, getWidth()
- - (drawingBorders ? 4 : 2), getHeight()
- - (drawingBorders ? 2 : 0));
- }
- }
- };
- } else {
- // If there are no child nodes, or there are child nodes but they
- // aren't leaves then we render the cell as normal. If there are
- // child nodes and the first one is a leaf (we assume this means
- // they all are!) then we render the table header after the label.
- if (!expanded) {
- return getLabelWithHighlight(nodeLabel, selected);
- }
- // Expanded so do the model check...
- TreeModel model = tree.getModel();
- int childCount = model.getChildCount(value);
- if (childCount == 0) {
- return getLabelWithHighlight(nodeLabel, selected);
- }
- Object childNode = model.getChild(value, 0);
- if (!model.isLeaf(childNode)) {
- return getLabelWithHighlight(nodeLabel, selected);
- }
- getPerNodeIndentation(tree, row);
- // Got to here so we need to render a table header.
- return new JComponent() {
- private static final long serialVersionUID = -4923965850510357216L;
-
- @Override
- public Dimension getPreferredSize() {
- int width = nodeWidth + labelToTablePad + perNodeOffset;
- for (TableTreeNodeColumn column : getColumns()) {
- width += column.getColumnWidth();
- }
- return new Dimension(width, nodeLabelHeight);
- }
-
- @Override
- protected void paintComponent(Graphics g) {
-
- Graphics2D g2d = (Graphics2D) g.create();
- AffineTransform originalTransform = g2d.getTransform();
- // Enable anti-aliasing for the curved lines
- g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
- RenderingHints.VALUE_ANTIALIAS_ON);
-
- // Paint original node label
- nodeLabel.setSize(new Dimension(nodeWidth + perNodeOffset,
- getHeight()));
- nodeLabel.paint(g2d);
-
- // Draw line under label to act as line above table row
- // below
- if (drawingBorders) {
- GeneralPath path = new GeneralPath();
- path.moveTo(perNodeOffset, getHeight() - 1);
- path.lineTo(
- perNodeOffset + nodeWidth + labelToTablePad,
- getHeight() - 1);
- g2d.setStroke(new BasicStroke(1, BasicStroke.CAP_BUTT,
- BasicStroke.JOIN_MITER));
- g2d.setPaint(borderColour);
- g2d.draw(path);
- }
-
- // Move painting origin to the start of the header row
- g2d.translate(nodeWidth + perNodeOffset + labelToTablePad,
- 0);
-
- // Paint columns
- boolean first = true;
- for (TableTreeNodeColumn column : getColumns()) {
-
- // Paint header cell background with bevel
- g2d.translate(0, headerTopPad);
- paintRectangleWithBevel(g2d, column.getColumnWidth(),
- getHeight() - headerTopPad, column.getColour());
-
- // Paint header label
- JLabel columnLabel = new JLabel(column.getShortName());
- columnLabel.setSize(new Dimension(column
- .getColumnWidth()
- - cellPadding * 2, getHeight() - headerTopPad));
- g2d.translate(cellPadding, 0);
- columnLabel.paint(g2d);
- g2d.translate(-cellPadding, 0);
-
- // Paint header borders
- if (drawingBorders) {
- paintRectangleBorder(g2d, column.getColumnWidth(),
- getHeight() - headerTopPad, 1, 1, 1,
- first ? 1 : 0, borderColour);
- }
- g2d.translate(0, -headerTopPad);
- first = false;
- g2d.translate(column.getColumnWidth(), 0);
-
- }
- if (selected) {
- g2d.setTransform(originalTransform);
- g2d.translate(1, headerTopPad);
- paintRectangleWithHighlightColour(g2d, perNodeOffset
- + nodeWidth + labelToTablePad
- - (drawingBorders ? 2 : 0), getHeight()
- - (headerTopPad + 2));
- }
- }
- };
-
- }
-
- }
-
- private static Component getLabelWithHighlight(final Component c,
- boolean selected) {
- if (!selected) {
- return c;
- } else {
- return new JComponent() {
- private static final long serialVersionUID = -9175635475959046704L;
-
- @Override
- public Dimension getPreferredSize() {
- return c.getPreferredSize();
- }
-
- @Override
- protected void paintComponent(Graphics g) {
- Graphics2D g2d = (Graphics2D) g.create();
- c.setSize(new Dimension(getWidth(), getHeight()));
- c.paint(g2d);
- g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
- RenderingHints.VALUE_ANTIALIAS_ON);
- g2d.translate(1, 1);
- paintRectangleWithHighlightColour(g2d, getWidth() - 2,
- getHeight() - 2);
- }
- };
- }
- }
-
- private static void paintRectangleBorder(Graphics2D g2d, int width,
- int height, int north, int east, int south, int west, Color c) {
- Paint oldPaint = g2d.getPaint();
- Stroke oldStroke = g2d.getStroke();
-
- g2d.setPaint(c);
-
- GeneralPath path;
-
- if (north > 0) {
- g2d.setStroke(new BasicStroke(north, BasicStroke.CAP_BUTT,
- BasicStroke.JOIN_MITER));
- path = new GeneralPath();
- path.moveTo(0, north - 1);
- path.lineTo(width - 1, north - 1);
- g2d.draw(path);
- }
- if (east > 0) {
- g2d.setStroke(new BasicStroke(east, BasicStroke.CAP_BUTT,
- BasicStroke.JOIN_MITER));
- path = new GeneralPath();
- path.moveTo(width - east, 0);
- path.lineTo(width - east, height - 1);
- g2d.draw(path);
- }
- if (south > 0) {
- g2d.setStroke(new BasicStroke(south, BasicStroke.CAP_BUTT,
- BasicStroke.JOIN_MITER));
- path = new GeneralPath();
- path.moveTo(0, height - south);
- path.lineTo(width - 1, height - south);
- g2d.draw(path);
- }
- if (west > 0) {
- g2d.setStroke(new BasicStroke(west, BasicStroke.CAP_BUTT,
- BasicStroke.JOIN_MITER));
- path = new GeneralPath();
- path.moveTo(west - 1, 0);
- path.lineTo(west - 1, height - 1);
- g2d.draw(path);
- }
-
- g2d.setPaint(oldPaint);
- g2d.setStroke(oldStroke);
- }
-
- /**
- * Paint a rectangle with the border colour set from the UIManager
- * 'textHighlight' property and filled with the same colour at alpha 50/255.
- * Paints from 0,0 to width-1,height-1 into the specified Graphics2D,
- * preserving the existing paint and stroke properties on exit.
- */
- private static void paintRectangleWithHighlightColour(Graphics2D g2d,
- int width, int height) {
- GeneralPath path = new GeneralPath();
- path.moveTo(0, 0);
- path.lineTo(width - 1, 0);
- path.lineTo(width - 1, height - 1);
- path.lineTo(0, height - 1);
- path.closePath();
-
- Paint oldPaint = g2d.getPaint();
- Stroke oldStroke = g2d.getStroke();
-
- Color c = UIManager.getColor("textHighlight");
-
- g2d.setStroke(new BasicStroke(2, BasicStroke.CAP_BUTT,
- BasicStroke.JOIN_MITER));
- g2d.setPaint(c);
- g2d.draw(path);
-
- Color alpha = new Color(c.getRed(), c.getGreen(), c.getBlue(), 50);
- g2d.setPaint(alpha);
- g2d.fill(path);
-
- g2d.setPaint(oldPaint);
- g2d.setStroke(oldStroke);
-
- }
-
- /**
- * Paint a bevelled rectangle into the specified Graphics2D with shape from
- * 0,0 to width-1,height-1 using the specified colour as a base and
- * preserving colour and stroke in the Graphics2D
- */
- private void paintRectangleWithBevel(Graphics2D g2d, int width, int height,
- Color c) {
- if (drawingBorders) {
- width = width - 1;
- height = height - 1;
- }
-
- GeneralPath path = new GeneralPath();
- path.moveTo(0, 0);
- path.lineTo(width - 1, 0);
- path.lineTo(width - 1, height - 1);
- path.lineTo(0, height - 1);
- path.closePath();
-
- Paint oldPaint = g2d.getPaint();
- Stroke oldStroke = g2d.getStroke();
-
- g2d.setPaint(c);
- g2d.fill(path);
-
- g2d.setStroke(new BasicStroke(1, BasicStroke.CAP_BUTT,
- BasicStroke.JOIN_MITER));
-
- // Draw highlight (Northeast)
- path = new GeneralPath();
- path.moveTo(0, 0);
- path.lineTo(width - 1, 0);
- path.lineTo(width - 1, height - 1);
- Color highlightColour = new Color((c.getRed() * blendFactor + 255)
- / (blendFactor + 1), (c.getGreen() * blendFactor + 255)
- / (blendFactor + 1), (c.getBlue() * blendFactor + 255)
- / (blendFactor + 1));
- g2d.setPaint(highlightColour);
- g2d.draw(path);
-
- // Draw shadow (Southwest)
- path = new GeneralPath();
- path.moveTo(0, 0);
- path.lineTo(0, height - 1);
- path.lineTo(width - 1, height - 1);
- Color shadowColour = new Color((c.getRed() * blendFactor)
- / (blendFactor + 1), (c.getGreen() * blendFactor)
- / (blendFactor + 1), (c.getBlue() * blendFactor)
- / (blendFactor + 1));
- g2d.setPaint(shadowColour);
- g2d.draw(path);
-
- g2d.setPaint(oldPaint);
- g2d.setStroke(oldStroke);
-
- }
-
- /**
- * The TreeUI which was used to determine the per node indentation in the
- * JTree for which this is a renderer. If this hasn't been set yet then this
- * is null.
- */
- private static TreeUI cachedTreeUI = null;
-
- /**
- * Use the current TreeUI to determine the indentation per-node in the tree,
- * this only works when the treeRow passed in is not the root as it has to
- * traverse up to the parent to do anything sensible. Cached and associated
- * with the TreeUI so in theory if the look and feel changes the UI changes
- * and this is re-generated within the renderer code.
- *
- * @param tree
- * @param treeRow
- * @return
- */
- private static int getPerNodeIndentation(JTree tree, int treeRow) {
- if (perNodeOffset > 0 && tree.getUI() == cachedTreeUI) {
- return perNodeOffset;
- }
- TreeUI uiModel = tree.getUI();
- cachedTreeUI = uiModel;
- TreePath path = tree.getPathForRow(treeRow);
- Rectangle nodeBounds = uiModel.getPathBounds(tree, path);
- Rectangle parentNodeBounds = uiModel.getPathBounds(tree, path
- .getParentPath());
- perNodeOffset = (int) nodeBounds.getMinX()
- - (int) parentNodeBounds.getMinX();
- return perNodeOffset;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/partition/src/main/java/net/sf/taverna/t2/partition/ui/UITest.java
----------------------------------------------------------------------
diff --git a/partition/src/main/java/net/sf/taverna/t2/partition/ui/UITest.java b/partition/src/main/java/net/sf/taverna/t2/partition/ui/UITest.java
deleted file mode 100644
index 05a6112..0000000
--- a/partition/src/main/java/net/sf/taverna/t2/partition/ui/UITest.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.partition.ui;
-
-import java.awt.BorderLayout;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.swing.JFrame;
-import javax.swing.JLabel;
-
-import net.sf.taverna.t2.partition.PartitionAlgorithm;
-import net.sf.taverna.t2.partition.algorithms.LiteralValuePartitionAlgorithm;
-
-public class UITest extends JFrame {
-
- private static final long serialVersionUID = -734851883737477053L;
-
- public UITest() {
- super();
- getContentPane().setLayout(new BorderLayout());
- List<PartitionAlgorithm<?>> paList = new ArrayList<PartitionAlgorithm<?>>();
- paList.add(new LiteralValuePartitionAlgorithm());
- paList.add(new LiteralValuePartitionAlgorithm());
- paList.add(new LiteralValuePartitionAlgorithm());
- PartitionAlgorithmListEditor pale = new PartitionAlgorithmListEditor(paList);
- getContentPane().add(pale, BorderLayout.NORTH);
- setVisible(true);
-
- }
-
- public static void main(String[] args) {
- JLabel l = new JLabel("Foo");
- System.out.println(l.getPreferredSize());
- System.out.println(l.getWidth());
-
- new UITest();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/partition/src/test/java/net/sf/taverna/t2/partition/PartitionTestApplication.java
----------------------------------------------------------------------
diff --git a/partition/src/test/java/net/sf/taverna/t2/partition/PartitionTestApplication.java b/partition/src/test/java/net/sf/taverna/t2/partition/PartitionTestApplication.java
deleted file mode 100644
index 07364f1..0000000
--- a/partition/src/test/java/net/sf/taverna/t2/partition/PartitionTestApplication.java
+++ /dev/null
@@ -1,280 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.partition;
-
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.FlowLayout;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.swing.BoxLayout;
-import javax.swing.JFrame;
-import javax.swing.JLabel;
-import javax.swing.JScrollPane;
-import javax.swing.JTree;
-import javax.swing.SwingUtilities;
-import javax.swing.UIManager;
-import javax.swing.event.TreeModelEvent;
-import javax.swing.tree.TreeCellRenderer;
-import javax.swing.tree.TreeModel;
-import javax.swing.tree.TreePath;
-
-import net.sf.taverna.t2.partition.algorithms.LiteralValuePartitionAlgorithm;
-import net.sf.taverna.t2.partition.ui.TableTreeNodeColumn;
-import net.sf.taverna.t2.partition.ui.TableTreeNodeRenderer;
-
-/**
- * Exercise the partition algorithm codes
- *
- * @author Tom Oinn
- *
- */
-public class PartitionTestApplication {
-
- final static PropertyExtractorRegistry reg = new ExampleExtractorRegistry();
-
- public static void main(String[] args) throws InterruptedException {
- try {
- // Set System L&F
- UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
- } catch (Exception e) {
- //
- }
-
- JFrame frame = new JFrame("Partition test");
- frame.addWindowListener(new WindowAdapter() {
- @Override
- public void windowClosing(WindowEvent e) {
- System.exit(0);
- }
-
- });
-
- RootPartition<ExampleItem> partition = new RootPartition<ExampleItem>(
- getAlgorithms(), reg);
- JTree partitionTree = new AlwaysOpenJTree(partition);
- partitionTree.setRowHeight(24);
- TreeCellRenderer oldRenderer = partitionTree.getCellRenderer();
- TableTreeNodeRenderer ttnr = new TableTreeNodeRenderer(oldRenderer, 50) {
- @Override
- public TableTreeNodeColumn[] getColumns() {
- return new TableTreeNodeColumn[] {
- new TableTreeNodeColumnImpl("int", new Color(150, 150,
- 210), 60,reg),
- new TableTreeNodeColumnImpl("float", new Color(150,
- 210, 150), 60,reg),
- new TableTreeNodeColumnImpl("name", new Color(210, 150,
- 150), 60,reg) ,
- new TableTreeNodeColumnImpl("Fish", new Color(210, 150,
- 150), 60,reg) };
- }
- };
-
- ttnr.setBorderColour(new Color(150, 150, 150));
-
- partitionTree.setCellRenderer(ttnr);
-
- frame.getContentPane().setLayout(new BoxLayout(frame.getContentPane(),BoxLayout.Y_AXIS));
- frame.getContentPane().add(new JScrollPane(partitionTree));
- frame.getContentPane().add(new JScrollPane(partitionTree));
- frame.setSize(400, 200);
- frame.setVisible(true);
- boolean showFrames = false;
- //while (true) {
- ttnr.setDrawBorders(showFrames);
- showFrames = !showFrames;
- for (ExampleItem item : exampleItems) {
- Thread.sleep(200);
- partition.addOrUpdateItem(item);
- }
-// Thread.sleep(1000);
-// for (ExampleItem item : exampleItems) {
-// Thread.sleep(400);
-// partition.removeItem(item);
-// }
- //}
- }
-
- static ExampleItem[] exampleItems = new ExampleItem[] {
- new ExampleItem("foo", 1, 2.0f), new ExampleItem("bar", 1, 2.0f),
- new ExampleItem("foo", 4, 3.7f), new ExampleItem("foo", 3, 2.0f),
- new ExampleItem("bar", 1, 3.5f), new ExampleItem("bar", 1, 7.5f),
- new ExampleItem("foo", 1, 2.1f), new ExampleItem("bar", 1, 2.3f),
- new ExampleItem("foo", 4, 3.8f), new ExampleItem("foo", 3, 2.4f) };
-
- static class TableTreeNodeColumnImpl implements TableTreeNodeColumn {
-
- private String propertyName;
- private Color colour;
- private int columnWidth;
- private PropertyExtractorRegistry reg;
-
- public TableTreeNodeColumnImpl(String propertyName, Color colour,
- int width,PropertyExtractorRegistry reg) {
- this.propertyName = propertyName;
- this.colour = colour;
- this.columnWidth = width;
- this.reg=reg;
- }
-
- public Component getCellRenderer(Object value) {
- Object propertyValue = reg.getAllPropertiesFor(value).get(
- propertyName);
- if (propertyValue == null) {
- propertyValue = "Not defined";
- }
- return new JLabel(propertyValue.toString());
- }
-
- public Color getColour() {
- return this.colour;
- }
-
- public int getColumnWidth() {
- return columnWidth;
- }
-
- public String getDescription() {
- return "A description...";
- }
-
- public String getShortName() {
- return propertyName;
- }
-
- }
-
- static List<PartitionAlgorithm<?>> getAlgorithms() {
- List<PartitionAlgorithm<?>> paList = new ArrayList<PartitionAlgorithm<?>>();
- LiteralValuePartitionAlgorithm lvpa = new LiteralValuePartitionAlgorithm();
- lvpa.setPropertyName("float");
-
- LiteralValuePartitionAlgorithm lvpa2 = new LiteralValuePartitionAlgorithm();
- lvpa2.setPropertyName("int");
- LiteralValuePartitionAlgorithm lvpa3 = new LiteralValuePartitionAlgorithm();
- lvpa3.setPropertyName("name");
-
- paList.add(lvpa2);
- paList.add(lvpa);
- paList.add(lvpa3);
-
- return paList;
- }
-
- static class ExampleItem implements Comparable<Object>{
- private String name;
- private int intValue;
- private float floatValue;
-
- public String getName() {
- return this.name;
- }
-
- public int getIntValue() {
- return this.intValue;
- }
-
- public float getFloatValue() {
- return this.floatValue;
- }
-
- public ExampleItem(String name, int intValue, float floatValue) {
- this.name = name;
- this.intValue = intValue;
- this.floatValue = floatValue;
- }
-
- @Override
- public String toString() {
- return this.name;
- }
-
- public int compareTo(Object o) {
- // TODO Auto-generated method stub
- return 0;
- }
- }
-
- static class ExampleExtractorRegistry implements PropertyExtractorRegistry {
- public Map<String, Object> getAllPropertiesFor(Object target) {
- Map<String, Object> properties = new HashMap<String, Object>();
- if (target instanceof ExampleItem) {
- ExampleItem item = (ExampleItem) target;
- properties.put("name", item.getName());
- properties.put("int", item.getIntValue());
- properties.put("float", item.getFloatValue());
- properties.put("Fish", "Soup");
- }
-
- return properties;
- }
- }
-
- static class AlwaysOpenJTree extends JTree {
-
- private static final long serialVersionUID = -3769998854485605447L;
-
- public AlwaysOpenJTree(TreeModel newModel) {
- super(newModel);
- setEditable(false);
- setExpandsSelectedPaths(false);
- setDragEnabled(false);
- setScrollsOnExpand(false);
- // setSelectionModel(SingleSelectionModel.sharedInstance());
- }
-
- @Override
- public void setModel(TreeModel model) {
- if (treeModel == model)
- return;
- if (treeModelListener == null)
- treeModelListener = new TreeModelHandler() {
- @Override
- public void treeNodesInserted(final TreeModelEvent ev) {
- if (ev.getChildren()[0] instanceof Partition == false) {
- SwingUtilities.invokeLater(new Runnable() {
- public void run() {
- TreePath path = ev.getTreePath();
- setExpandedState(path, true);
- fireTreeExpanded(path);
- }
- });
- }
-
- }
-
- };
- if (model != null) {
- model.addTreeModelListener(treeModelListener);
- }
- TreeModel oldValue = treeModel;
- treeModel = model;
- firePropertyChange(TREE_MODEL_PROPERTY, oldValue, model);
- }
-
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/partition/src/test/java/net/sf/taverna/t2/partition/algorithms/LiteralValuePartitionAlgorithmTest.java
----------------------------------------------------------------------
diff --git a/partition/src/test/java/net/sf/taverna/t2/partition/algorithms/LiteralValuePartitionAlgorithmTest.java b/partition/src/test/java/net/sf/taverna/t2/partition/algorithms/LiteralValuePartitionAlgorithmTest.java
deleted file mode 100644
index 4e8f93c..0000000
--- a/partition/src/test/java/net/sf/taverna/t2/partition/algorithms/LiteralValuePartitionAlgorithmTest.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.partition.algorithms;
-
-import static org.junit.Assert.*;
-import net.sf.taverna.t2.partition.algorithms.LiteralValuePartitionAlgorithm;
-
-import org.junit.Test;
-
-public class LiteralValuePartitionAlgorithmTest {
-
- @Test
- public void testEquals() {
- LiteralValuePartitionAlgorithm a = new LiteralValuePartitionAlgorithm();
- LiteralValuePartitionAlgorithm b = new LiteralValuePartitionAlgorithm();
- LiteralValuePartitionAlgorithm c = new LiteralValuePartitionAlgorithm();
-
- a.setPropertyName("cheese");
- b.setPropertyName("cheese");
- c.setPropertyName("butter");
-
- assertEquals("They should be equal",a,a);
- assertEquals("They should be equal",a,b);
- assertFalse("They should not be equal",a.equals(c));
- assertFalse("They should not be equal",a.equals("cheese"));
- }
-
- @Test
- public void testHashcode() {
- LiteralValuePartitionAlgorithm a = new LiteralValuePartitionAlgorithm();
- LiteralValuePartitionAlgorithm b = new LiteralValuePartitionAlgorithm();
- LiteralValuePartitionAlgorithm c = new LiteralValuePartitionAlgorithm();
-
- a.setPropertyName("cheese");
- b.setPropertyName("cheese");
- c.setPropertyName("Z");
-
- assertEquals("They should have the same hashcode",a.hashCode(),b.hashCode());
- }
-
- @Test
- public void testConstructor() {
- LiteralValuePartitionAlgorithm p = new LiteralValuePartitionAlgorithm();
- assertNull("The property shoudl default to null",p.getPropertyName());
-
- p=new LiteralValuePartitionAlgorithm("pea");
- assertEquals("The property name should default to 'pea'","pea",p.getPropertyName());
- }
-}
-
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-beaninfo/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-beaninfo/pom.xml b/taverna-beaninfo/pom.xml
new file mode 100644
index 0000000..ea51b1a
--- /dev/null
+++ b/taverna-beaninfo/pom.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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>net.sf.taverna.t2</groupId>
+ <artifactId>lang</artifactId>
+ <version>2.0.1-SNAPSHOT</version>
+ </parent>
+ <groupId>net.sf.taverna.t2.lang</groupId>
+ <artifactId>beans</artifactId>
+ <packaging>bundle</packaging>
+ <name>BeanInfo extensions</name>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.log4j</groupId>
+ <artifactId>com.springsource.org.apache.log4j</artifactId>
+ <version>${log4j.version}</version>
+ </dependency>
+ </dependencies>
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-beaninfo/src/main/java/net/sf/taverna/t2/lang/beans/PropertyAnnotated.java
----------------------------------------------------------------------
diff --git a/taverna-beaninfo/src/main/java/net/sf/taverna/t2/lang/beans/PropertyAnnotated.java b/taverna-beaninfo/src/main/java/net/sf/taverna/t2/lang/beans/PropertyAnnotated.java
new file mode 100644
index 0000000..aa59e68
--- /dev/null
+++ b/taverna-beaninfo/src/main/java/net/sf/taverna/t2/lang/beans/PropertyAnnotated.java
@@ -0,0 +1,74 @@
+/**********************************************************************
+ * Copyright (C) 2009 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ **********************************************************************/
+package net.sf.taverna.t2.lang.beans;
+
+import java.beans.BeanInfo;
+import java.beans.Introspector;
+import java.beans.PropertyDescriptor;
+import java.beans.SimpleBeanInfo;
+
+/**
+ * A {@link BeanInfo} that includes {@link PropertyDescriptor}s from methods
+ * annotated using {@link PropertyAnnotation}.
+ * <p>
+ * The bean info from the PropertyAnnotation will then be available through
+ * Java's {@link Introspector}, and allows you to specify details such as
+ * {@link PropertyAnnotation#displayName()} and
+ * {@link PropertyAnnotation#hidden()} for the properties of a Java Bean.
+ * <p>
+ * This class can either be used as a superclass for the classes containing
+ * property annotated methods, or put in a neighbouring BeanInfo class.
+ * <p>
+ * For instance, if your class is called DescribedClass and has methods
+ * annotated using {@link PropertyAnnotation}, either let DescribedClass
+ * subclass {@link PropertyAnnotated}, or make a neighbouring {@link BeanInfo}
+ * class called DescribedClassBeanInfo, which should subclass
+ * {@link PropertyAnnotated}.
+ *
+ *
+ * @author Stian Soiland-Reyes
+ *
+ */
+public class PropertyAnnotated extends SimpleBeanInfo {
+
+ private static PropertyAnnotationExtractor extractor = new PropertyAnnotationExtractor();
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public PropertyDescriptor[] getPropertyDescriptors() {
+ return extractor.getPropertyDescriptors(getDescribedClass());
+ }
+
+ /**
+ * The class that is being described. By default this returns
+ * {@link #getClass()} so that {@link PropertyAnnotated} can be used as a
+ * superclass, but if instead the DescribedClassBeanInfo pattern is used,
+ * subclass PropertyAnnotated in each BeanInfo class, and override this
+ * method to return the described class. (DescribedClass in this example)
+ *
+ */
+ public Class<?> getDescribedClass() {
+ return getClass();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-beaninfo/src/main/java/net/sf/taverna/t2/lang/beans/PropertyAnnotation.java
----------------------------------------------------------------------
diff --git a/taverna-beaninfo/src/main/java/net/sf/taverna/t2/lang/beans/PropertyAnnotation.java b/taverna-beaninfo/src/main/java/net/sf/taverna/t2/lang/beans/PropertyAnnotation.java
new file mode 100644
index 0000000..5923a21
--- /dev/null
+++ b/taverna-beaninfo/src/main/java/net/sf/taverna/t2/lang/beans/PropertyAnnotation.java
@@ -0,0 +1,109 @@
+/**********************************************************************
+ * Copyright (C) 2009 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ **********************************************************************/
+package net.sf.taverna.t2.lang.beans;
+
+import java.beans.Introspector;
+import java.beans.PropertyDescriptor;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * An annotation of a Java bean style property method, ie. a getXX() or setXX()
+ * method.
+ * <p>
+ * The annotations allow the method to better describe properties such as
+ * {@link #displayName()}, {@link #shortDescription()} and {@link #hidden()}.
+ * <p>
+ * The annotations can be retrieved as {@link PropertyDescriptor} using
+ * {@link PropertyAnnotationExtractor}, or if {@link PropertyAnnotated} has been
+ * used (recommended), through Java's BeanInfo support, such as using
+ * {@link Introspector}.
+ * <p>
+ * Annotations can be applied to interfaces or classes, abstract and normal
+ * methods, as long as they confirm with the Java bean conventions. Annotations
+ * will be inherited, so overriding methods don't need to reapply the annotations,
+ * although they can if they want to override.
+ * <p>
+ * It is recommended that classes using these annotations either subclass
+ * {@link PropertyAnnotated} or have a neighbouring BeanInfo class that
+ * subclasses PropertyAnnotated.
+ * <p>
+ * Example usage:
+ *
+ * <pre>
+ * public interface MyBean {
+ * // Annotation for the property called "name". displayName: Title
+ * // of the property shown in UI instead of "name".
+ * @PropertyAnnotation(displayName = "Full name")
+ * public String getName();
+ *
+ * // Second annotation for the write-method of the same property called
+ * // "name". Both displayName and shortDescription will be set on the
+ * // property descriptor.
+ * @PropertyAnnotation(shortDescription = "The name of the person")
+ * public void setName(String name);
+ *
+ * // Boolean read method for the property "married", two annotations.
+ * // expert: Only shown in UI under "advanced" views.
+ * @PropertyAnnotation(expert = true, shortDescription = "Marital status")
+ * public boolean isMarried();
+ *
+ * // Write-method for the "married" property, no new annotations, but will
+ * // get the ones from {@link #isMarried()}.
+ * public void setMarried(boolean married);
+ *
+ * // Write-only method, hidden (not shown in UIs).
+ * @PropertyAnnotation(hidden = true)
+ * public void setID(String id);
+ *
+ * // Read-only method, no annotations, defaults will be used.
+ * public void getTelephoneNumber(String number);
+ * }
+ * </pre>
+ *
+ * @see PropertyAnnotated
+ * @author Stian Soiland-Reyes
+ *
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target( { ElementType.METHOD })
+public @interface PropertyAnnotation {
+
+ /**
+ * A unique string that means the default should be used
+ */
+ public static String DEFAULT = "Default_8930B86A-50C0-4859-9B6F-DD034B3C5C1E";
+
+ String displayName() default DEFAULT;
+
+ String name() default DEFAULT;
+
+ String shortDescription() default DEFAULT;
+
+ boolean expert() default false;
+
+ boolean hidden() default false;
+
+ boolean preferred() default false;
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-beaninfo/src/main/java/net/sf/taverna/t2/lang/beans/PropertyAnnotationExtractor.java
----------------------------------------------------------------------
diff --git a/taverna-beaninfo/src/main/java/net/sf/taverna/t2/lang/beans/PropertyAnnotationExtractor.java b/taverna-beaninfo/src/main/java/net/sf/taverna/t2/lang/beans/PropertyAnnotationExtractor.java
new file mode 100644
index 0000000..4524822
--- /dev/null
+++ b/taverna-beaninfo/src/main/java/net/sf/taverna/t2/lang/beans/PropertyAnnotationExtractor.java
@@ -0,0 +1,202 @@
+/**********************************************************************
+ * Copyright (C) 2009 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ **********************************************************************/
+package net.sf.taverna.t2.lang.beans;
+
+import java.beans.IntrospectionException;
+import java.beans.PropertyDescriptor;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.WeakHashMap;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * A utility class for extracting {@link PropertyDescriptor}s from a class which
+ * methods have been described using {@link PropertyAnnotation}.
+ *
+ * @author Stian Soiland-Reyes
+ *
+ */
+public class PropertyAnnotationExtractor {
+
+ protected static Pattern methodPattern = Pattern
+ .compile("(get|is|set)(.+)");
+
+ protected WeakHashMap<Class<?>, List<Method>> allMethodsCache = new WeakHashMap<Class<?>, List<Method>>();
+
+ protected WeakHashMap<Class<?>, PropertyDescriptor[]> propertyDescriptorsCache = new WeakHashMap<Class<?>, PropertyDescriptor[]>();
+
+ @SuppressWarnings("unchecked")
+ protected List<Class> ignoreClasses = Arrays.<Class>asList(Class.class, Object.class, PropertyAnnotated.class);
+
+ /**
+ * Find PropertyDescriptors for the given bean class based on descriptions
+ * using {@link PropertyAnnotation}s.
+ * <p>
+ * Annotations will be inherited from interfaces and superclasses.
+ *
+ * @param beanClass
+ * @return Array of {@link PropertyDescriptor}
+ */
+ public PropertyDescriptor[] getPropertyDescriptors(Class<?> beanClass) {
+ PropertyDescriptor[] cached = propertyDescriptorsCache.get(beanClass);
+ if (cached != null) {
+ return cached;
+ }
+
+ Map<String, PropertyDescriptor> descriptors = new HashMap<String, PropertyDescriptor>();
+
+ for (Method method : allMethods(beanClass)) {
+ PropertyAnnotation annotation = method
+ .getAnnotation(PropertyAnnotation.class);
+ Matcher methodMatcher = methodPattern.matcher(method.getName());
+ if (!methodMatcher.matches() && annotation == null) {
+ continue;
+ }
+
+ String name = PropertyAnnotation.DEFAULT;
+ if (annotation != null) {
+ annotation.name();
+ }
+ if (name.equals(PropertyAnnotation.DEFAULT)) {
+ name = methodMatcher.group(2);
+ if (name.length() < 1) {
+ continue;
+ }
+ // decapitalize first letter
+ name = name.substring(0, 1).toLowerCase() + name.substring(1);
+ }
+ Method writeMethod = null;
+ Method readMethod = null;
+ if (methodMatcher.group(1).equals("set")) {
+ writeMethod = method;
+ if (writeMethod.getParameterTypes().length != 1) {
+ continue;
+ }
+ } else {
+ readMethod = method;
+ if (readMethod.getParameterTypes().length != 0) {
+ continue;
+ }
+ }
+
+ PropertyDescriptor descriptor = descriptors.get(name);
+ try {
+ if (descriptor == null) {
+ descriptor = new PropertyDescriptor(name, readMethod,
+ writeMethod);
+ descriptors.put(name, descriptor);
+ }
+ // Set the one we just found
+ if (readMethod != null) {
+ descriptor.setReadMethod(readMethod);
+ }
+ if (writeMethod != null) {
+ descriptor.setWriteMethod(writeMethod);
+ }
+ } catch (IntrospectionException ex) {
+ throw new RuntimeException("Can't inspect property " + name
+ + " using method " + method, ex);
+ }
+ if (annotation != null) {
+ descriptor.setExpert(annotation.expert());
+ descriptor.setHidden(annotation.hidden());
+ descriptor.setPreferred(annotation.preferred());
+ if (!annotation.displayName()
+ .equals(PropertyAnnotation.DEFAULT)) {
+ descriptor.setDisplayName(annotation.displayName());
+ }
+ if (!annotation.shortDescription().equals(
+ PropertyAnnotation.DEFAULT)) {
+ descriptor.setShortDescription(annotation
+ .shortDescription());
+ }
+ }
+ }
+ cached = descriptors.values().toArray(
+ new PropertyDescriptor[descriptors.size()]);
+ propertyDescriptorsCache.put(beanClass, cached);
+ return cached;
+ }
+
+ /**
+ * Find all {@link Method}s defined in the class, all its superclasses and
+ * interfaces. This might include methods that override each other.
+ * <p>
+ * The list contains first the methods from each of the class's interfaces
+ * (and the methods they inherit from their interfaces), then recurses for
+ * the subclass of this class (including any additional interfaces used in
+ * the superclasses), before finally adding methods declared in the given
+ * class.
+ * <p>
+ * This can be useful to find annotations given to methods that have been
+ * overridden in subclasses.
+ *
+ * @param theClass
+ * @return
+ */
+ @SuppressWarnings("unchecked")
+ protected List<Method> allMethods(Class<?> theClass) {
+ List<Method> methods = allMethodsCache.get(theClass);
+ if (methods == null) {
+ methods = new ArrayList<Method>();
+ allMethods(theClass, new HashSet<Class>(ignoreClasses), methods);
+ allMethodsCache.put(theClass, methods);
+ }
+ return methods;
+ }
+
+ @SuppressWarnings("unchecked")
+ protected void allMethods(Class<?> theClass, Set<Class> visitedClasses,
+ List<Method> foundMethods) {
+ if (theClass == null || theClass == Object.class
+ || theClass == Class.class || !visitedClasses.add(theClass)) {
+ // Top class or already visted
+ return;
+ }
+ // Let's first dig down into our interfaces
+ for (Class anInterface : theClass.getInterfaces()) {
+ allMethods(anInterface, visitedClasses, foundMethods);
+ }
+ // And our superclasses
+ allMethods(theClass.getSuperclass(), visitedClasses, foundMethods);
+ // Before we find any methods only declared in this class
+ // (parent methods are already earlier in the list -
+ // note that the new methods might override earlier methods)
+ for (Method method : theClass.getDeclaredMethods()) {
+ int methodModifiers = method.getModifiers();
+ if (!Modifier.isPublic(methodModifiers)
+ || Modifier.isStatic(methodModifiers)) {
+ continue;
+ }
+ assert !foundMethods.contains(method) : "Method discovered twice: "
+ + method;
+ foundMethods.add(method);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/f676ef35/taverna-io/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-io/pom.xml b/taverna-io/pom.xml
new file mode 100644
index 0000000..1512fd7
--- /dev/null
+++ b/taverna-io/pom.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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>net.sf.taverna.t2</groupId>
+ <artifactId>lang</artifactId>
+ <version>2.0.1-SNAPSHOT</version>
+ </parent>
+ <groupId>net.sf.taverna.t2.lang</groupId>
+ <artifactId>io</artifactId>
+ <packaging>bundle</packaging>
+ <name>IO utility classes</name>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.log4j</groupId>
+ <artifactId>com.springsource.org.apache.log4j</artifactId>
+ <version>${log4j.version}</version>
+ </dependency>
+ </dependencies>
+</project>
[16/50] [abbrv] incubator-taverna-workbench git commit: results moved
to
http://taverna.googlecode.com/svn/taverna/engine/net.sf.taverna.t2.results/branches/maintenance/
Posted by st...@apache.org.
results moved to http://taverna.googlecode.com/svn/taverna/engine/net.sf.taverna.t2.results/branches/maintenance/
git-svn-id: https://taverna.googlecode.com/svn/taverna/utils/net.sf.taverna.t2.lang/branches/maintenance@16889 bf327186-88b3-11dd-a302-d386e5130c1c
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/commit/a479d549
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/tree/a479d549
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/diff/a479d549
Branch: refs/heads/master
Commit: a479d5490bd098536f2044ed7d612e53486aa56a
Parents: c7cfb2e
Author: stian@mygrid.org.uk <st...@bf327186-88b3-11dd-a302-d386e5130c1c>
Authored: Wed Mar 19 16:51:58 2014 +0000
Committer: stian@mygrid.org.uk <st...@bf327186-88b3-11dd-a302-d386e5130c1c>
Committed: Wed Mar 19 16:51:58 2014 +0000
----------------------------------------------------------------------
pom.xml | 1 -
1 file changed, 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/a479d549/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 4d525c7..7d4387d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -65,7 +65,6 @@
<module>partition</module>
<module>ui</module>
<module>uibuilder</module>
- <module>results</module>
</modules>
<scm>
<connection>scm:svn:http://taverna.googlecode.com/svn/taverna/utils/net.sf.taverna.t2.lang/trunk/</connection>
[30/50] [abbrv] incubator-taverna-workbench git commit:
org.apache.taverna.workbench
Posted by st...@apache.org.
org.apache.taverna.workbench
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/commit/3f67f4f8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/tree/3f67f4f8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/diff/3f67f4f8
Branch: refs/heads/master
Commit: 3f67f4f86219699b6db1732d35175b1e6bda4ef2
Parents: 6c3dca2
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Fri Mar 6 17:35:50 2015 +0000
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Fri Mar 6 17:35:50 2015 +0000
----------------------------------------------------------------------
taverna-dataflow-activity-ui/pom.xml | 49 ++++++++++++++--------------
taverna-workbench-workbench-api/pom.xml | 11 +++----
2 files changed, 29 insertions(+), 31 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/3f67f4f8/taverna-dataflow-activity-ui/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-dataflow-activity-ui/pom.xml b/taverna-dataflow-activity-ui/pom.xml
index d93cf07..00812ff 100644
--- a/taverna-dataflow-activity-ui/pom.xml
+++ b/taverna-dataflow-activity-ui/pom.xml
@@ -1,56 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
-<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">
+<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>net.sf.taverna</groupId>
- <artifactId>taverna-parent</artifactId>
- <version>3.0.1-SNAPSHOT</version>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.ui-activities</groupId>
- <artifactId>dataflow-activity-ui</artifactId>
- <version>2.0-SNAPSHOT</version>
+ <artifactId>taverna-dataflow-activity-ui</artifactId>
<packaging>bundle</packaging>
- <name>Taverna 2 Dataflow Activity UI</name>
+ <name>Apache Taverna Dataflow Activity UI</name>
<dependencies>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${parent.project.groupId}</groupId>
<artifactId>activity-icons-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${parent.project.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${parent.project.groupId}</groupId>
<artifactId>activity-palette-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${parent.project.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${parent.project.groupId}</groupId>
<artifactId>contextual-views-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${parent.project.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${parent.project.groupId}</groupId>
<artifactId>file-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${parent.project.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <groupId>${parent.project.groupId}</groupId>
<artifactId>edits-api</artifactId>
- <version>${t2.ui.api.version}</version>
+ <version>${parent.project.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-components</groupId>
+ <groupId>${parent.project.groupId}</groupId>
<artifactId>workflow-view</artifactId>
- <version>${t2.ui.components.version}</version>
+ <version>${parent.project.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.taverna.t2.ui-components</groupId>
+ <groupId>${parent.project.groupId}</groupId>
<artifactId>graph-view</artifactId>
- <version>${t2.ui.components.version}</version>
+ <version>${parent.project.version}</version>
</dependency>
<dependency>
- <groupId>uk.org.taverna.scufl2</groupId>
- <artifactId>scufl2-api</artifactId>
- <version>${scufl2.version}</version>
+ <groupId>org.apache.taverna.language</groupId>
+ <artifactId>taverna-scufl2-api</artifactId>
+ <version>${taverna.language.version}</version>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/3f67f4f8/taverna-workbench-workbench-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-workbench-workbench-api/pom.xml b/taverna-workbench-workbench-api/pom.xml
index 4d9a9ad..fc7b444 100644
--- a/taverna-workbench-workbench-api/pom.xml
+++ b/taverna-workbench-workbench-api/pom.xml
@@ -3,13 +3,12 @@
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>net.sf.taverna.t2</groupId>
- <artifactId>ui-api</artifactId>
- <version>2.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.workbench</groupId>
+ <artifactId>taverna-workbench</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
- <artifactId>workbench-api</artifactId>
+ <artifactId>taverna-workbench-api</artifactId>
<packaging>bundle</packaging>
- <name>Workbench API</name>
+ <name>Apache Taverna Workbench API</name>
<description>The main workbench ui</description>
</project>
[11/50] [abbrv] incubator-taverna-workbench git commit: Attempt to
fix saving and reading of files as per T3-783
Posted by st...@apache.org.
Attempt to fix saving and reading of files as per T3-783
git-svn-id: https://taverna.googlecode.com/svn/taverna/utils/net.sf.taverna.t2.lang/branches/maintenance@16825 bf327186-88b3-11dd-a302-d386e5130c1c
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/commit/d5d915d0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/tree/d5d915d0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/diff/d5d915d0
Branch: refs/heads/master
Commit: d5d915d02fdd936555e0b947879fbfe6c4e189b0
Parents: 7f23d78
Author: alan@mygrid.org.uk <al...@bf327186-88b3-11dd-a302-d386e5130c1c>
Authored: Thu Mar 6 12:51:06 2014 +0000
Committer: alan@mygrid.org.uk <al...@bf327186-88b3-11dd-a302-d386e5130c1c>
Committed: Thu Mar 6 12:51:06 2014 +0000
----------------------------------------------------------------------
ui/pom.xml | 5 +++
.../net/sf/taverna/t2/lang/ui/FileTools.java | 33 +++++---------------
2 files changed, 12 insertions(+), 26 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/d5d915d0/ui/pom.xml
----------------------------------------------------------------------
diff --git a/ui/pom.xml b/ui/pom.xml
index de2b422..d2839fd 100644
--- a/ui/pom.xml
+++ b/ui/pom.xml
@@ -17,6 +17,11 @@
<version>${project.version}</version>
</dependency>
<dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>${commons.io.version}</version>
+ </dependency>
+ <dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/d5d915d0/ui/src/main/java/net/sf/taverna/t2/lang/ui/FileTools.java
----------------------------------------------------------------------
diff --git a/ui/src/main/java/net/sf/taverna/t2/lang/ui/FileTools.java b/ui/src/main/java/net/sf/taverna/t2/lang/ui/FileTools.java
index 8fae745..4aa5bb2 100644
--- a/ui/src/main/java/net/sf/taverna/t2/lang/ui/FileTools.java
+++ b/ui/src/main/java/net/sf/taverna/t2/lang/ui/FileTools.java
@@ -4,18 +4,15 @@
package net.sf.taverna.t2.lang.ui;
import java.awt.Component;
-import java.io.BufferedReader;
-import java.io.BufferedWriter;
import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileReader;
-import java.io.FileWriter;
import java.io.IOException;
+import java.nio.charset.StandardCharsets;
import java.util.prefs.Preferences;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
+import org.apache.commons.io.FileUtils;
import org.apache.log4j.Logger;
/**
@@ -25,6 +22,8 @@ import org.apache.log4j.Logger;
public class FileTools {
private static Logger logger = Logger.getLogger(FileTools.class);
+
+
public static boolean saveStringToFile(Component parent, String dialogTitle, String extension, String content) {
JFileChooser fileChooser = new JFileChooser();
@@ -72,9 +71,7 @@ public class FileTools {
return false;
}
}
- BufferedWriter out = new BufferedWriter(new FileWriter(file));
- out.write(content);
- out.close();
+ FileUtils.writeStringToFile(file, content, StandardCharsets.UTF_8.name());
logger.info("Saved content by overwriting " + file);
return true;
} catch (IOException ex) {
@@ -105,25 +102,9 @@ public class FileTools {
if (fileChooser.showOpenDialog(parent) == JFileChooser.APPROVE_OPTION) {
File selectedFile = fileChooser.getSelectedFile();
-
+
try {
- BufferedReader reader = new BufferedReader(new FileReader(
- selectedFile));
-
- String line;
- StringBuffer buffer = new StringBuffer();
- while ((line = reader.readLine()) != null) {
- buffer.append(line);
- buffer.append("\n");
- }
- reader.close();
-
- return buffer.toString();
-
- } catch (FileNotFoundException ffe) {
- JOptionPane.showMessageDialog(parent, "File '"
- + selectedFile.getName() + "' not found",
- "File not found", JOptionPane.ERROR_MESSAGE);
+ return FileUtils.readFileToString(selectedFile, StandardCharsets.UTF_8.name());
} catch (IOException ioe) {
JOptionPane.showMessageDialog(parent, "Can not read file '"
+ selectedFile.getName() + "'", "Can not read file",