Index: TODO
===================================================================
RCS file: /cvsroot/cashew-s-editor/cashews/TODO,v
retrieving revision 1.4
diff -u -3 -p -u -r1.4 TODO
--- TODO 5 May 2005 23:47:58 -0000 1.4
+++ TODO 16 May 2005 13:47:38 -0000
@@ -1,9 +1,3 @@
-Top priority:
-* CASheW-s model
-* Instantiate, serialize and send model
-* Parse WSDL
-* Interface
-
Nearly completed:
* RDF
* Parse RDF in XML form
@@ -14,3 +8,8 @@ Postponed:
* Eclipse diagram editor
* Extend with all elements for OWL-S
+Completed:
+* CASheW-s model
+* Instantiate, serialize and send model
+* Parse WSDL
+* Interface
Index: src/nongnu/cashews/eclipse/composer/commands/CreateNodeCommand.java
===================================================================
RCS file: /cvsroot/cashew-s-editor/cashews/src/nongnu/cashews/eclipse/composer/commands/CreateNodeCommand.java,v
retrieving revision 1.2
diff -u -3 -p -u -r1.2 CreateNodeCommand.java
--- src/nongnu/cashews/eclipse/composer/commands/CreateNodeCommand.java 5 May 2005 23:47:58 -0000 1.2
+++ src/nongnu/cashews/eclipse/composer/commands/CreateNodeCommand.java 16 May 2005 13:47:38 -0000
@@ -37,20 +37,14 @@ to any source code in the Content.
package nongnu.cashews.eclipse.composer.commands;
-import java.util.Iterator;
import java.util.Vector;
import nongnu.cashews.eclipse.composer.model.Diagram;
import nongnu.cashews.eclipse.composer.model.Node;
-import nongnu.cashews.eclipse.composer.wizards.ProcessData;
import nongnu.cashews.eclipse.composer.wizards.ProcessDefine;
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.gef.commands.Command;
-import org.eclipse.jface.window.ApplicationWindow;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.ui.dialogs.FileSelectionDialog;
-import org.eclipse.ui.dialogs.FileSystemElement;
public class CreateNodeCommand
extends Command
Index: src/nongnu/cashews/eclipse/composer/commands/RenameNodeCommand.java
===================================================================
RCS file: /cvsroot/cashew-s-editor/cashews/src/nongnu/cashews/eclipse/composer/commands/RenameNodeCommand.java,v
retrieving revision 1.2
diff -u -3 -p -u -r1.2 RenameNodeCommand.java
--- src/nongnu/cashews/eclipse/composer/commands/RenameNodeCommand.java 5 May 2005 23:47:58 -0000 1.2
+++ src/nongnu/cashews/eclipse/composer/commands/RenameNodeCommand.java 16 May 2005 13:47:38 -0000
@@ -39,9 +39,6 @@ package nongnu.cashews.eclipse.composer.
import nongnu.cashews.eclipse.composer.model.Diagram;
import nongnu.cashews.eclipse.composer.model.Node;
-import nongnu.cashews.eclipse.composer.model.NodeRegistrar;
-import nongnu.cashews.eclipse.composer.util.Dialogs;
-
import org.eclipse.gef.commands.Command;
public class RenameNodeCommand
Index: src/nongnu/cashews/eclipse/composer/figures/EllipseNodeFigure.java
===================================================================
RCS file: src/nongnu/cashews/eclipse/composer/figures/EllipseNodeFigure.java
diff -N src/nongnu/cashews/eclipse/composer/figures/EllipseNodeFigure.java
--- src/nongnu/cashews/eclipse/composer/figures/EllipseNodeFigure.java 31 Mar 2005 17:35:21 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,89 +0,0 @@
-/* EllipseNodeFigure.java -- Figure for the elliptical node.
- Copyright (C) 2005 The University of Sheffield.
-
-This file is part of the CASheW-s editor Eclipse plug-in.
-
-The CASheW-s editor Eclipse plug-in is free software; you may copy, modify,
-and redistribute it under the terms of the GNU General Public License
-version 2 (or, at your option, any later version), and/or the Eclipse
-Public License version 1.0.
-
-The CASheW-s editor 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
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with The CASheW-s editor; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
-
-The University of Sheffield makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to
-you under the terms and conditions of the Eclipse Public License Version
-1.0 ("EPL"). A copy of the EPL is available at
-http://www.eclipse.org/legal/epl-v10.html. For purposes of the EPL,
-"Program" will mean the Content.
-
-If you did not receive this Content directly from the University of Sheffield,
-the Content is being redistributed by another party ("Redistributor") and
-different terms and conditions may apply to your use of any object code in
-the Content. Check the Redistributor's license that was provided with the
-Content. If no such license exists, contact the Redistributor. Unless
-otherwise indicated below, the terms and conditions of the EPL still apply
-to any source code in the Content.
-
-*/
-
-package nongnu.cashews.eclipse.composer.figures;
-
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.Ellipse;
-import org.eclipse.draw2d.geometry.Rectangle;
-
-public class EllipseNodeFigure
- extends Figure
-{
-
- private String name;
-
- private Ellipse ellipseFigure;
-
- private Label label;
-
- public EllipseNodeFigure()
- {
- this.ellipseFigure = new Ellipse();
- this.label = new Label();
- this.add(ellipseFigure);
- this.add(label);
- }
-
- public String getText()
- {
- return this.label.getText();
- }
-
- public Rectangle getTextBounds()
- {
- return this.label.getTextBounds();
- }
-
- public void setName(String name)
- {
- this.name = name;
- this.label.setText(name);
- this.repaint();
- }
-
- // ------------------------------------------------------------------------
- // Overridden methods from Figure
-
- public void setBounds(Rectangle rect)
- {
- super.setBounds(rect);
- this.ellipseFigure.setBounds(rect);
- this.label.setBounds(rect);
- }
-}
Index: src/nongnu/cashews/eclipse/composer/model/Connection.java
===================================================================
RCS file: src/nongnu/cashews/eclipse/composer/model/Connection.java
diff -N src/nongnu/cashews/eclipse/composer/model/Connection.java
--- src/nongnu/cashews/eclipse/composer/model/Connection.java 31 Mar 2005 17:35:21 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,71 +0,0 @@
-/* Connection.java -- A connection between two nodes.
- Copyright (C) 2005 The University of Sheffield.
-
-This file is part of the CASheW-s editor Eclipse plug-in.
-
-The CASheW-s editor Eclipse plug-in is free software; you may copy, modify,
-and redistribute it under the terms of the GNU General Public License
-version 2 (or, at your option, any later version), and/or the Eclipse
-Public License version 1.0.
-
-The CASheW-s editor 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
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with The CASheW-s editor; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
-
-The University of Sheffield makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to
-you under the terms and conditions of the Eclipse Public License Version
-1.0 ("EPL"). A copy of the EPL is available at
-http://www.eclipse.org/legal/epl-v10.html. For purposes of the EPL,
-"Program" will mean the Content.
-
-If you did not receive this Content directly from the University of Sheffield,
-the Content is being redistributed by another party ("Redistributor") and
-different terms and conditions may apply to your use of any object code in
-the Content. Check the Redistributor's license that was provided with the
-Content. If no such license exists, contact the Redistributor. Unless
-otherwise indicated below, the terms and conditions of the EPL still apply
-to any source code in the Content.
-
-*/
-
-package nongnu.cashews.eclipse.composer.model;
-
-public class Connection
- extends Element
-{
-
- /**
- * Comment for serialVersionUID
- */
- private static final long serialVersionUID = 1L;
-
- private Node target;
-
- private Node source;
-
- public Connection(Node source, Node target)
- {
- this.source = source;
- this.target = target;
-
- source.addOutput(this);
- target.addInput(this);
- }
-
- public Node getTarget()
- {
- return this.target;
- }
-
- public Node getSource()
- {
- return this.source;
- }
-}
Index: src/nongnu/cashews/eclipse/composer/model/EllipseNode.java
===================================================================
RCS file: src/nongnu/cashews/eclipse/composer/model/EllipseNode.java
diff -N src/nongnu/cashews/eclipse/composer/model/EllipseNode.java
--- src/nongnu/cashews/eclipse/composer/model/EllipseNode.java 31 Mar 2005 17:35:21 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,205 +0,0 @@
-/* EllipseNode.java -- Representation of an ellipsical node.
- Copyright (C) 2005 The University of Sheffield.
-
-This file is part of the CASheW-s editor Eclipse plug-in.
-
-The CASheW-s editor Eclipse plug-in is free software; you may copy, modify,
-and redistribute it under the terms of the GNU General Public License
-version 2 (or, at your option, any later version), and/or the Eclipse
-Public License version 1.0.
-
-The CASheW-s editor 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
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with The CASheW-s editor; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
-
-The University of Sheffield makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to
-you under the terms and conditions of the Eclipse Public License Version
-1.0 ("EPL"). A copy of the EPL is available at
-http://www.eclipse.org/legal/epl-v10.html. For purposes of the EPL,
-"Program" will mean the Content.
-
-If you did not receive this Content directly from the University of Sheffield,
-the Content is being redistributed by another party ("Redistributor") and
-different terms and conditions may apply to your use of any object code in
-the Content. Check the Redistributor's license that was provided with the
-Content. If no such license exists, contact the Redistributor. Unless
-otherwise indicated below, the terms and conditions of the EPL still apply
-to any source code in the Content.
-
-*/
-
-package nongnu.cashews.eclipse.composer.model;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.ui.views.properties.TextPropertyDescriptor;
-
-public class EllipseNode
- extends Node
- implements IPropertySource, XMLizable
-{
-
- // serialization version
- static final long serialVersionUID = 4;
-
- // properties
-
- // descriptors for property sheet
- static final IPropertyDescriptor[] descriptors;
- static
- {
- descriptors = new IPropertyDescriptor[] { new TextPropertyDescriptor(
- NAME,
- "Name") };
- }
-
- // actual fields
-
- public EllipseNode(String name)
- {
- setName(name);
- }
-
- public void setLocation(Point p)
- {
- if (location.equals(p))
- {
- return;
- }
- location = p;
- firePropertyChange(LOCATION, null, p);
- }
-
- public Point getLocation()
- {
- return location;
- }
-
- public String getName()
- {
- return name;
- }
-
- public void addInput(Connection connection)
- {
- inputs.add(connection);
- fireStructureChange(INPUTS, connection);
- }
-
- public void addOutput(Connection connection)
- {
- outputs.add(connection);
- fireStructureChange(OUTPUTS, connection);
- }
-
- public List getIncomingConnections()
- {
- return inputs;
- }
-
- public List getOutgoingConnections()
- {
- return outputs;
- }
-
- public void removeInput(Connection connection)
- {
- inputs.remove(connection);
- fireStructureChange(INPUTS, connection);
- }
-
- public void removeOutput(Connection connection)
- {
- outputs.remove(connection);
- fireStructureChange(OUTPUTS, connection);
- }
-
- // ------------------------------------------------------------------------
- // Abstract methods from IPropertySource
-
- public Object getEditableValue()
- {
- return this;
- }
-
- public Object getPropertyValue(Object id)
- {
- if (NAME.equals(id))
- {
- return getName();
- }
- else
- {
- return null;
- }
- }
-
- public boolean isPropertySet(Object id)
- {
- return true;
- }
-
- public void resetPropertyValue(Object id)
- {
- // do nothing
- }
-
- public void setPropertyValue(Object id, Object value)
- {
- if (id == NAME)
- {
- setName((String) value);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see nongnu.cashews.eclipse.composer.model.XMLizable#toXML()
- */
- public String toXML()
- {
- StringBuffer str = new StringBuffer();
- str.append("");
- Iterator i = outputs.iterator();
- Node tempNode = null;
- Connection tempConnection = null;
- while (i.hasNext())
- {
- tempConnection = (Connection) i.next();
- tempNode = (Node) tempConnection.getTarget();
- str.append("");
- }
- str.append("");
- return str.toString();
- }
-}
Index: src/nongnu/cashews/eclipse/composer/model/EllipseNodeFactory.java
===================================================================
RCS file: src/nongnu/cashews/eclipse/composer/model/EllipseNodeFactory.java
diff -N src/nongnu/cashews/eclipse/composer/model/EllipseNodeFactory.java
--- src/nongnu/cashews/eclipse/composer/model/EllipseNodeFactory.java 31 Mar 2005 17:35:21 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,53 +0,0 @@
-/* EllipseNodeFactory.java -- Factory for creating ellipse nodes.
- Copyright (C) 2005 The University of Sheffield.
-
-This file is part of the CASheW-s editor Eclipse plug-in.
-
-The CASheW-s editor Eclipse plug-in is free software; you may copy, modify,
-and redistribute it under the terms of the GNU General Public License
-version 2 (or, at your option, any later version), and/or the Eclipse
-Public License version 1.0.
-
-The CASheW-s editor 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
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with The CASheW-s editor; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
-
-The University of Sheffield makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to
-you under the terms and conditions of the Eclipse Public License Version
-1.0 ("EPL"). A copy of the EPL is available at
-http://www.eclipse.org/legal/epl-v10.html. For purposes of the EPL,
-"Program" will mean the Content.
-
-If you did not receive this Content directly from the University of Sheffield,
-the Content is being redistributed by another party ("Redistributor") and
-different terms and conditions may apply to your use of any object code in
-the Content. Check the Redistributor's license that was provided with the
-Content. If no such license exists, contact the Redistributor. Unless
-otherwise indicated below, the terms and conditions of the EPL still apply
-to any source code in the Content.
-
-*/
-
-package nongnu.cashews.eclipse.composer.model;
-
-public class EllipseNodeFactory extends NodeFactory
-{
-
- public EllipseNodeFactory(Class aClass)
- {
- super(aClass);
- }
-
- public Node createNode(String name)
- {
- return new EllipseNode(name);
- }
-
-}
Index: src/nongnu/cashews/eclipse/composer/model/NodeFactory.java
===================================================================
RCS file: /cvsroot/cashew-s-editor/cashews/src/nongnu/cashews/eclipse/composer/model/NodeFactory.java,v
retrieving revision 1.2
diff -u -3 -p -u -r1.2 NodeFactory.java
--- src/nongnu/cashews/eclipse/composer/model/NodeFactory.java 5 May 2005 23:47:58 -0000 1.2
+++ src/nongnu/cashews/eclipse/composer/model/NodeFactory.java 16 May 2005 13:47:38 -0000
@@ -42,9 +42,6 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import nongnu.cashews.eclipse.composer.commands.DiagramSingleton;
-import nongnu.cashews.eclipse.composer.wizards.ProcessData;
-import nongnu.cashews.eclipse.composer.wizards.ProcessDefine;
-
import org.eclipse.gef.requests.SimpleFactory;
public abstract class NodeFactory extends SimpleFactory
Index: src/nongnu/cashews/eclipse/composer/model/PerformanceElement.java
===================================================================
RCS file: /cvsroot/cashew-s-editor/cashews/src/nongnu/cashews/eclipse/composer/model/PerformanceElement.java,v
retrieving revision 1.1
diff -u -3 -p -u -r1.1 PerformanceElement.java
--- src/nongnu/cashews/eclipse/composer/model/PerformanceElement.java 5 May 2005 23:47:58 -0000 1.1
+++ src/nongnu/cashews/eclipse/composer/model/PerformanceElement.java 16 May 2005 13:47:38 -0000
@@ -216,7 +216,7 @@ public class PerformanceElement
str.append("/>");
}
}
- str.append("");
+ str.append("");
return str.toString();
}
Index: src/nongnu/cashews/eclipse/composer/parts/ConnectionPart.java
===================================================================
RCS file: /cvsroot/cashew-s-editor/cashews/src/nongnu/cashews/eclipse/composer/parts/ConnectionPart.java,v
retrieving revision 1.2
diff -u -3 -p -u -r1.2 ConnectionPart.java
--- src/nongnu/cashews/eclipse/composer/parts/ConnectionPart.java 5 May 2005 23:47:58 -0000 1.2
+++ src/nongnu/cashews/eclipse/composer/parts/ConnectionPart.java 16 May 2005 13:47:38 -0000
@@ -96,17 +96,21 @@ public class ConnectionPart
if (figure.getChildren().size() > 1)
{
figure.remove(ellipseFigure);
+ figure.remove(label);
}
ellipseFigure = new Ellipse();
+ ellipseFigure.setSize(60,40);
+
Dimension d = new Dimension(40, 40);
label = new Label();
-
+ label.setText("a\nb\nc");
ellipseFigure.setLocation(midPoint(connx.getSource().getLocation(), connx.getTarget().getLocation()));
+ label.setLocation(midPoint(connx.getSource().getLocation(), connx.getTarget().getLocation()));
figure.add(ellipseFigure);
-
+ figure.add(label);
figure.addFigureListener
(
new FigureListener()
@@ -116,6 +120,7 @@ public class ConnectionPart
{
ConnectionElement connx = (ConnectionElement) getModel();
ellipseFigure.setLocation(midPoint(connx.getSource().getLocation(), connx.getTarget().getLocation()));
+ label.setLocation(midPoint(connx.getSource().getLocation(), connx.getTarget().getLocation()));
}
}
Index: src/nongnu/cashews/eclipse/composer/parts/EllipseNodePart.java
===================================================================
RCS file: src/nongnu/cashews/eclipse/composer/parts/EllipseNodePart.java
diff -N src/nongnu/cashews/eclipse/composer/parts/EllipseNodePart.java
--- src/nongnu/cashews/eclipse/composer/parts/EllipseNodePart.java 31 Mar 2005 17:35:21 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,149 +0,0 @@
-/* EllipseNodePart.java -- Displayable part of the elliptical node.
- Copyright (C) 2005 The University of Sheffield.
-
-This file is part of the CASheW-s editor Eclipse plug-in.
-
-The CASheW-s editor Eclipse plug-in is free software; you may copy, modify,
-and redistribute it under the terms of the GNU General Public License
-version 2 (or, at your option, any later version), and/or the Eclipse
-Public License version 1.0.
-
-The CASheW-s editor 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
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with The CASheW-s editor; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
-
-The University of Sheffield makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to
-you under the terms and conditions of the Eclipse Public License Version
-1.0 ("EPL"). A copy of the EPL is available at
-http://www.eclipse.org/legal/epl-v10.html. For purposes of the EPL,
-"Program" will mean the Content.
-
-If you did not receive this Content directly from the University of Sheffield,
-the Content is being redistributed by another party ("Redistributor") and
-different terms and conditions may apply to your use of any object code in
-the Content. Check the Redistributor's license that was provided with the
-Content. If no such license exists, contact the Redistributor. Unless
-otherwise indicated below, the terms and conditions of the EPL still apply
-to any source code in the Content.
-
-*/
-
-package nongnu.cashews.eclipse.composer.parts;
-
-import java.beans.PropertyChangeListener;
-import java.util.List;
-
-import nongnu.cashews.eclipse.composer.figures.EllipseNodeFigure;
-import nongnu.cashews.eclipse.composer.model.EllipseNode;
-import nongnu.cashews.eclipse.composer.model.Node;
-import nongnu.cashews.eclipse.composer.tools.EllipseNodeCellEditorLocator;
-import nongnu.cashews.eclipse.composer.tools.EllipseNodeDirectEditManager;
-
-import org.eclipse.draw2d.IFigure;
-
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.NodeEditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.RequestConstants;
-
-import org.eclipse.jface.viewers.TextCellEditor;
-
-public class EllipseNodePart
- extends NodePart
- implements PropertyChangeListener, NodeEditPart
-{
-
- // ------------------------------------------------------------------------
- // Overridden from AbstractGraphicalEditPart
-
- // override activate to register with the model for property changes
- public void activate()
- {
- if (isActive())
- {
- return;
- }
- super.activate();
- ((EllipseNode) getModel()).addPropertyChangeListener(this);
- }
-
- // override deactivate to deregister with the model
- public void deactivate()
- {
- if (!isActive())
- {
- return;
- }
- super.deactivate();
- ((EllipseNode) getModel()).removePropertyChangeListener(this);
- }
-
- protected List getModelSourceConnections()
- {
- return ((EllipseNode) this.getModel()).getOutgoingConnections();
- }
-
- protected List getModelTargetConnections()
- {
- return ((EllipseNode) this.getModel()).getIncomingConnections();
- }
-
- // ------------------------------------------------------------------------
- // Overridden from AbstractEditPart
-
- protected void refreshVisuals()
- {
- EllipseNode node = (EllipseNode) this.getModel();
- Point loc = node.getLocation();
- Dimension size = new Dimension(60, 60);
- Rectangle rectangle = new Rectangle(loc, size);
-
- ((EllipseNodeFigure) this.getFigure()).setName(((Node) this.getModel()).getName());
-
- // tells the parent part (in this case DiagramPart) that this part
- // and its figure are to be constrained to the given rectangle
- ((GraphicalEditPart) getParent()).setLayoutConstraint(this, getFigure(),
- rectangle);
- // //////============================================================
-
- }
-
- public void performRequest(Request request)
- {
- if (request.getType() == RequestConstants.REQ_DIRECT_EDIT)
- {
- if (manager == null)
- {
- EllipseNodeFigure nodeFigure = (EllipseNodeFigure) getFigure();
- manager = new EllipseNodeDirectEditManager(
- this,
- TextCellEditor.class,
- new EllipseNodeCellEditorLocator(
- nodeFigure),
- nodeFigure);
- }
- manager.show();
- }
- }
-
- // ------------------------------------------------------------------------
- // Abstract methods from AbstractGraphicalEditPart
-
- protected IFigure createFigure()
- {
- // return new NodeFigure();
- return new EllipseNodeFigure();
- }
-
-
-}
Index: src/nongnu/cashews/eclipse/composer/tools/EllipseNodeCellEditorLocator.java
===================================================================
RCS file: src/nongnu/cashews/eclipse/composer/tools/EllipseNodeCellEditorLocator.java
diff -N src/nongnu/cashews/eclipse/composer/tools/EllipseNodeCellEditorLocator.java
--- src/nongnu/cashews/eclipse/composer/tools/EllipseNodeCellEditorLocator.java 31 Mar 2005 17:35:21 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,70 +0,0 @@
-/* EllipseNodeCellEditorLocator.java -- Locator for elliptical nodes.
- Copyright (C) 2005 The University of Sheffield.
-
-This file is part of the CASheW-s editor Eclipse plug-in.
-
-The CASheW-s editor Eclipse plug-in is free software; you may copy, modify,
-and redistribute it under the terms of the GNU General Public License
-version 2 (or, at your option, any later version), and/or the Eclipse
-Public License version 1.0.
-
-The CASheW-s editor 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
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with The CASheW-s editor; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
-
-The University of Sheffield makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to
-you under the terms and conditions of the Eclipse Public License Version
-1.0 ("EPL"). A copy of the EPL is available at
-http://www.eclipse.org/legal/epl-v10.html. For purposes of the EPL,
-"Program" will mean the Content.
-
-If you did not receive this Content directly from the University of Sheffield,
-the Content is being redistributed by another party ("Redistributor") and
-different terms and conditions may apply to your use of any object code in
-the Content. Check the Redistributor's license that was provided with the
-Content. If no such license exists, contact the Redistributor. Unless
-otherwise indicated below, the terms and conditions of the EPL still apply
-to any source code in the Content.
-
-*/
-
-package nongnu.cashews.eclipse.composer.tools;
-
-import nongnu.cashews.eclipse.composer.figures.EllipseNodeFigure;
-
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.tools.CellEditorLocator;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Text;
-
-public class EllipseNodeCellEditorLocator
- implements CellEditorLocator
-{
-
- private EllipseNodeFigure nodeFigure;
-
- public EllipseNodeCellEditorLocator(EllipseNodeFigure nodeFigure)
- {
- this.nodeFigure = nodeFigure;
- }
-
- // ------------------------------------------------------------------------
- // Abstract methods from CellEditorLocator
-
- public void relocate(CellEditor celleditor)
- {
- Text text = (Text) celleditor.getControl();
- Point pref = text.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- Rectangle rect = this.nodeFigure.getTextBounds();
- text.setBounds(rect.x - 1, rect.y - 1, pref.x + 1, pref.y + 1);
- }
-}
Index: src/nongnu/cashews/eclipse/composer/tools/EllipseNodeDirectEditManager.java
===================================================================
RCS file: src/nongnu/cashews/eclipse/composer/tools/EllipseNodeDirectEditManager.java
diff -N src/nongnu/cashews/eclipse/composer/tools/EllipseNodeDirectEditManager.java
--- src/nongnu/cashews/eclipse/composer/tools/EllipseNodeDirectEditManager.java 31 Mar 2005 17:35:21 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,138 +0,0 @@
-/* EllipseNodeDirectEditManager.java -- Manager for direct edits.
- Copyright (C) 2005 The University of Sheffield.
-
-This file is part of the CASheW-s editor Eclipse plug-in.
-
-The CASheW-s editor Eclipse plug-in is free software; you may copy, modify,
-and redistribute it under the terms of the GNU General Public License
-version 2 (or, at your option, any later version), and/or the Eclipse
-Public License version 1.0.
-
-The CASheW-s editor 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
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with The CASheW-s editor; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
-
-The University of Sheffield makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to
-you under the terms and conditions of the Eclipse Public License Version
-1.0 ("EPL"). A copy of the EPL is available at
-http://www.eclipse.org/legal/epl-v10.html. For purposes of the EPL,
-"Program" will mean the Content.
-
-If you did not receive this Content directly from the University of Sheffield,
-the Content is being redistributed by another party ("Redistributor") and
-different terms and conditions may apply to your use of any object code in
-the Content. Check the Redistributor's license that was provided with the
-Content. If no such license exists, contact the Redistributor. Unless
-otherwise indicated below, the terms and conditions of the EPL still apply
-to any source code in the Content.
-
-*/
-
-package nongnu.cashews.eclipse.composer.tools;
-
-import nongnu.cashews.eclipse.composer.figures.EllipseNodeFigure;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.VerifyEvent;
-import org.eclipse.swt.events.VerifyListener;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Text;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.tools.CellEditorLocator;
-import org.eclipse.gef.tools.DirectEditManager;
-
-public class EllipseNodeDirectEditManager
- extends DirectEditManager
-{
-
- Font scaledFont;
-
- protected VerifyListener verifyListener;
-
- protected EllipseNodeFigure ellipseNodeFigure;
-
- public EllipseNodeDirectEditManager(GraphicalEditPart source,
- Class editorType,
- CellEditorLocator locator,
- EllipseNodeFigure ellipseNodeFigure)
- {
- super(source, editorType, locator);
- this.ellipseNodeFigure = ellipseNodeFigure;
- }
-
- // ------------------------------------------------------------------------
- // Overridden methods from DirectEditManager
-
- protected void bringDown()
- {
- Font disposeFont = this.scaledFont;
- this.scaledFont = null;
- super.bringDown();
- if (disposeFont != null)
- {
- disposeFont.dispose();
- }
- }
-
- protected void unhookListeners()
- {
- super.unhookListeners();
- Text text = (Text) getCellEditor().getControl();
- text.removeVerifyListener(verifyListener);
- verifyListener = null;
- }
-
- // ------------------------------------------------------------------------
- // Abstract methods from DirectEditManager
-
- protected void initCellEditor()
- {
-
- verifyListener = new VerifyListener()
- {
- public void verifyText(VerifyEvent event)
- {
- Text text = (Text) getCellEditor().getControl();
- String oldText = text.getText();
- String leftText = oldText.substring(0, event.start);
- String rightText = oldText.substring(event.end, oldText.length());
- GC gc = new GC(text);
- Point size = gc.textExtent(leftText + event.text + rightText);
- gc.dispose();
- if (size.x != 0)
- {
- size = text.computeSize(size.x, SWT.DEFAULT);
- }
- getCellEditor().getControl().setSize(size.x, size.y);
- }
- };
-
- Text text = (Text) getCellEditor().getControl();
- text.addVerifyListener(verifyListener);
-
- getCellEditor().setValue(this.ellipseNodeFigure.getText());
- IFigure figure = ((GraphicalEditPart) getEditPart()).getFigure();
- scaledFont = figure.getFont();
- FontData data = scaledFont.getFontData()[0];
- Dimension fontSize = new Dimension(0, data.getHeight());
- data.setHeight(fontSize.height);
- scaledFont = new Font(null, data);
-
- text.setFont(scaledFont);
- text.selectAll();
- }
-}
Index: src/nongnu/cashews/eclipse/composer/tools/EndPointNodeDirectEditManager.java
===================================================================
RCS file: /cvsroot/cashew-s-editor/cashews/src/nongnu/cashews/eclipse/composer/tools/EndPointNodeDirectEditManager.java,v
retrieving revision 1.1
diff -u -3 -p -u -r1.1 EndPointNodeDirectEditManager.java
--- src/nongnu/cashews/eclipse/composer/tools/EndPointNodeDirectEditManager.java 5 May 2005 23:47:59 -0000 1.1
+++ src/nongnu/cashews/eclipse/composer/tools/EndPointNodeDirectEditManager.java 16 May 2005 13:47:38 -0000
@@ -36,13 +36,7 @@ to any source code in the Content.
*/
package nongnu.cashews.eclipse.composer.tools;
-/**
- * @author Xianfeng Liu