Login | Register
My pages Projects Community openCollabNet

Discussions > commits > svn commit: r1332 - trunk/src/org/tigris/gef/presentation

gef
Discussion topic

Back to topic list

svn commit: r1332 - trunk/src/org/tigris/gef/presentation

Author bobtarling
Full name Bob Tarling
Date 2011-05-22 03:26:16 PDT
Message Author: bobtarling
Date: 2011-05-22 03:26:16-0700
New Revision: 1332

Added:
   trunk/src/org/tigris​/gef/presentation/Co​nnector.java
Modified:
   trunk/src/org/tigris​/gef/presentation/Fi​gNode.java

Log:
Introduce a Connector interface to allow a node to connect to another with no edge

Added: trunk/src/org/tigris​/gef/presentation/Co​nnector.java
Url: http://gef.tigris.or​g/source/browse/gef/​trunk/src/org/tigris​/gef/presentation/Co​nnector.java?view=ma​rkup&pathrev=133​2
====================​====================​====================​==================
--- (empty file)
+++ trunk/src/org/tigris​/gef/presentation/Co​nnector.java 2011-05-22 03:26:16-0700
@@ -0,0 +1,46 @@
+// $Id: $
+// Copyright (c) 1996-2009 The Regents of the University of California. All
+// Rights Reserved. Permission to use, copy, modify, and distribute this
+// software and its documentation without fee, and without a written
+// agreement is hereby granted, provided that the above copyright notice
+// and this paragraph appear in all copies. This software program and
+// documentation are copyrighted by The Regents of the University of
+// California. The software program and documentation are supplied "AS
+// IS", without any accompanying services from The Regents. The Regents
+// does not warrant that the operation of the program will be
+// uninterrupted or error-free. The end-user understands that the program
+// was developed for research purposes and is advised not to rely
+// exclusively on the program for any reason. IN NO EVENT SHALL THE
+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+package org.tigris.gef.presentation;
+
+import org.tigris.gef.di.GraphNode;
+
+/**
+ * An interface for any diagram element that connects the bounds of some node.
+ * @author Bob Tarling
+ */
+public interface Connector {
+
+ /**
+ * Get theGraphNode this connector is connected to.
+ * @return
+ */
+ GraphNode getGraphNode();
+
+ /**
+ * Assign a GraphNode to this connector
+ * @param node the GraphNode to assign
+ */
+ void setGraphNode(GraphNode node);
+}

Modified: trunk/src/org/tigris​/gef/presentation/Fi​gNode.java
Url: http://gef.tigris.or​g/source/browse/gef/​trunk/src/org/tigris​/gef/presentation/Fi​gNode.java?view=diff​&pathrev=1332​&r1=1331&r2=133​2
====================​====================​====================​==================
--- trunk/src/org/tigris​/gef/presentation/Fi​gNode.java (original)
+++ trunk/src/org/tigris​/gef/presentation/Fi​gNode.java 2011-05-22 03:26:16-0700
@@ -72,6 +72,8 @@
     private BufferedImage shadowImage;
     private int cachedWidth = -1;
     private int cachedHeight = -1;
+
+ private List<Connector> connectors = new ArrayList<Connector>();
 
     /**
      * Set this to force a repaint of the shadow. Normally repainting only
@@ -700,11 +702,22 @@
      *
      * @return List of figs
      */
- public List getDragDependencies() {
+ public List<? extends Fig> getDragDependencies() {
         return null;
     }
 
     /**
+ * Return a list of other Figs that must be forced to be dragged at the same
+ * time as this Fig or null if no dependent. By default this returns null,
+ * override in concrete class as required.
+ *
+ * @return List of figs
+ */
+ public List<Connector> getConnectors() {
+ return connectors;
+ }
+
+ /**
      * @param size
      * the new shadow size TODO: Move the shadow stuff into GEF
      */

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

svn commit: r1332 - trunk/src/org/tigris/gef/presentation bobtarling Bob Tarling 2011-05-22 03:26:16 PDT
Messages per page: