fenfire-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ff-cvs] fenfire/org/fenfire fenpdf/fenpdf.py fenpdf/fen...


From: Tuomas J. Lukka
Subject: [ff-cvs] fenfire/org/fenfire fenpdf/fenpdf.py fenpdf/fen...
Date: Tue, 14 Oct 2003 10:21:43 -0400

CVSROOT:        /cvsroot/fenfire
Module name:    fenfire
Branch:         
Changes by:     Tuomas J. Lukka <address@hidden>        03/10/14 10:21:43

Modified files:
        org/fenfire/fenpdf: fenpdf.py fenpdfcontext.py 
        org/fenfire/fenpdf/actions: menu.py mouse.py 
        org/fenfire/fenpdf/events: mousemenu.py 
        org/fenfire/view: CanvasView2D.java 
        org/fenfire/view/buoy: AbstractMainNode2D.java PPConnector.java 
Added files:
        org/fenfire    : animation.test 

Log message:
        Arch sync

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/fenfire/fenfire/org/fenfire/animation.test?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/fenfire/fenfire/org/fenfire/fenpdf/fenpdf.py.diff?tr1=1.14&tr2=1.15&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/fenfire/fenfire/org/fenfire/fenpdf/fenpdfcontext.py.diff?tr1=1.33&tr2=1.34&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/fenfire/fenfire/org/fenfire/fenpdf/actions/menu.py.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/fenfire/fenfire/org/fenfire/fenpdf/actions/mouse.py.diff?tr1=1.9&tr2=1.10&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/fenfire/fenfire/org/fenfire/fenpdf/events/mousemenu.py.diff?tr1=1.10&tr2=1.11&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/fenfire/fenfire/org/fenfire/view/CanvasView2D.java.diff?tr1=1.31&tr2=1.32&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/fenfire/fenfire/org/fenfire/view/buoy/AbstractMainNode2D.java.diff?tr1=1.49&tr2=1.50&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/fenfire/fenfire/org/fenfire/view/buoy/PPConnector.java.diff?tr1=1.24&tr2=1.25&r1=text&r2=text

Patches:
Index: fenfire/org/fenfire/fenpdf/actions/menu.py
diff -u fenfire/org/fenfire/fenpdf/actions/menu.py:1.3 
fenfire/org/fenfire/fenpdf/actions/menu.py:1.4
--- fenfire/org/fenfire/fenpdf/actions/menu.py:1.3      Wed Sep 10 16:07:16 2003
+++ fenfire/org/fenfire/fenpdf/actions/menu.py  Tue Oct 14 10:21:40 2003
@@ -9,7 +9,7 @@
 dbg = 0
 
 def p(*s):
-    print 'ff.fenpdf.events.key::', s
+    print 'ff.fenpdf.actions.menu::', s
 
 # Menu actions will always cause a vobscene regeneration.
 
@@ -115,3 +115,21 @@
        self.fenPDF.structure.ff.setContent(node, obj)
                
 
+    def beginTextScissor(self):
+       """Begin to use scissor for text.
+       """
+       node = self.fenPDF.uistate.menu.originatingNode
+       if node == None: return
+       self.fenPDF.uistate.textScissor.setBegin(node, 
self.fenPDF.uistate.menu.originatingTextOffset)
+        if self.fenPDF.uistate.textScissor.end.node != node:
+            self.fenPDF.uistate.textScissor.setEnd(None, None)
+        p(self.fenPDF.uistate.textScissor.begin.node, 
self.fenPDF.uistate.textScissor.begin.offset)
+
+    def endTextScissor(self):
+       """End to use scissor for text.
+       """
+       node = self.fenPDF.uistate.menu.originatingNode
+       if node == None: return
+       self.fenPDF.uistate.textScissor.setEnd(node, 
self.fenPDF.uistate.menu.originatingTextOffset)
+        if self.fenPDF.uistate.textScissor.begin.node != node:
+            self.fenPDF.uistate.textScissor.setBegin(None, None)
Index: fenfire/org/fenfire/fenpdf/actions/mouse.py
diff -u fenfire/org/fenfire/fenpdf/actions/mouse.py:1.9 
fenfire/org/fenfire/fenpdf/actions/mouse.py:1.10
--- fenfire/org/fenfire/fenpdf/actions/mouse.py:1.9     Fri Sep 12 15:05:53 2003
+++ fenfire/org/fenfire/fenpdf/actions/mouse.py Tue Oct 14 10:21:40 2003
@@ -29,6 +29,7 @@
 from org import fenfire as ff
 from org.fenfire.vocab import CANVAS2D, RDF
 import org.nongnu.libvob as vob
+import jarray
 
 dbg = 0
 
@@ -43,6 +44,7 @@
     def getOldVS():
        return fenPDF.animation.lastVs
 
+
 # Inside the action, we have the following symbols usable:
 #  fenPDF - the main FenPDF object
 #  context - the context object
@@ -109,6 +111,17 @@
            obj = getMainNode().getNodeOnPlane(getOldVS(), x,y)
            context.states.cursor.setAccursed(obj)
            getMainNode().moveToPoint(int(x),int(y), getOldVS())
+
+            viewFunction = fenPDF.views.getMultiplexerNodeContentFunction()
+            placeable = viewFunction.f(fenPDF.fen.graph, obj)
+            if dbg: p(placeable)
+            if obj != None and isinstance(placeable, 
vob.lava.placeable.TextPlaceable):
+                cs = getMainNode().getNodeCS(getOldVS(), x,y)
+                ptsIn = jarray.array([x,y,0], 'f')
+                ptsOut = jarray.zeros(3, 'f')
+                getOldVS().coords.inverseTransformPoints3(cs, ptsIn, ptsOut)
+                offs = placeable.getCursorPos(ptsOut[0], ptsOut[1])
+                fenPDF.uistate.cursor.setCursorOffset(offs)
            fenPDF.animation.regenerateVS()
 
 
@@ -131,12 +144,24 @@
     class MouseMenu(vob.mouse.MouseClickListener):
        def clicked(self, x, y):
            obj = getMainNode().getNodeOnPlane(getOldVS(), x,y)
-           if obj != None:
-               context.states.objectOnPlane = obj
-               context.mousemenu.link = 1
-           else: context.mousemenu.link = 0
+           #if obj != None:
+            #    context.states.objectOnPlane = obj
+               #context.mousemenu.link = 1
+           #else: context.mousemenu.link = 0
+
+            viewFunction = fenPDF.views.getMultiplexerNodeContentFunction()
+            placeable = viewFunction.f(fenPDF.fen.graph, obj)
+            if dbg: p(placeable)
+            offs = None
+            if obj != None and isinstance(placeable, 
vob.lava.placeable.TextPlaceable):
+                cs = getMainNode().getNodeCS(getOldVS(), x,y)
+                ptsIn = jarray.array([x,y,0], 'f')
+                ptsOut = jarray.zeros(3, 'f')
+                getOldVS().coords.inverseTransformPoints3(cs, ptsIn, ptsOut)
+                offs = placeable.getCursorPos(ptsOut[0], ptsOut[1])
+                p(offs)
 
-           fenPDF.uistate.menu.originateFromMainNode(getMainNode(), obj)
+           fenPDF.uistate.menu.originateFromMainNode(getMainNode(), obj, offs)
 
            context.mousemenu.showList(x,y,'mainmenu')
            fenPDF.animation.regenerateVS()
@@ -147,21 +172,90 @@
     class NodeMover(vob.mouse.RelativeAdapter,
                    vob.mouse.MousePressListener):
        def pressed(self, x,y):
-           self.set(getMainNode().getNodeOnPlane(getOldVS(), x,y))
+           self.set(getMainNode().getNodeOnPlane(getOldVS(), x,y),x,y)
            return self
-       def set(self, node):
+       def set(self, node, x,y):
+            self.evX, self.evY = x, y
            s = context.states
            self.node, self.pp, self.graph = node, s.ppActions, s.fen.graph
        def changedRelative(self, x,y):
            f = getMainNode().getFocus()
            fX, fY = f.getPanX(), f.getPanY()
-           f.setPan(fX+x/f.zoom,
-                    fY+y/f.zoom)
+
+            if self.node == None: raise 'No node!!!'
+
            g = self.graph
-           ox = ff.util.RDFUtil.getFloat(g, self.node, CANVAS2D.x)
-           oy = ff.util.RDFUtil.getFloat(g, self.node, CANVAS2D.y)
-           self.pp.moveNote(self.node, ox+x/f.zoom, oy+y/f.zoom )
-           getMainNode().chgFast(getOldVS(), -1)
+           self.startPointX = ff.util.RDFUtil.getFloat(g, self.node, 
CANVAS2D.x)
+           self.startPointY = ff.util.RDFUtil.getFloat(g, self.node, 
CANVAS2D.y)
+            self.canvas =  fenPDF.structure.canvas2d.getCanvas(self.node)
+
+            fenPDF.events.eventHandler.eventGrabber = 
self.theUltimateEventGrabberUtilToMoveNodesWhereEver
+
+            # find out offset
+            viewFunction = fenPDF.views.getMultiplexerNodeContentFunction()
+            placeable = viewFunction.f(fenPDF.fen.graph, self.node)
+            if isinstance(placeable, vob.lava.placeable.TextPlaceable):
+                p('text!')
+                cs = getMainNode().getNodeCS(getOldVS(), self.evX,self.evY)
+                p('cs', cs)
+                ptsIn = jarray.array([self.evX,self.evY,0], 'f')
+                ptsOut = jarray.zeros(3, 'f')
+                getOldVS().coords.inverseTransformPoints3(cs, ptsIn, ptsOut)
+                offs = placeable.getCursorPos(ptsOut[0], ptsOut[1])
+                p('offs', offs, ptsOut)
+                if fenPDF.uistate.textScissor.isScissored(self.node, offs):
+                    p('shoul scissor now...')
+                    p('implement the scissoring here ;)')
+                    
+            fenPDF.structure.canvas2d.removeNode(self.node)
+            self.nodeCS = None
+           fenPDF.animation.noAnimation()
+            fenPDF.animation.regenerateVS()
+
+
+        def theUltimateEventGrabberUtilToMoveNodesWhereEver(self, ev, oldVS):
+            if self.nodeCS == None:
+                self.createFlyingNode(oldVS)
+                vob.AbstractUpdateManager.chg()
+                return
+
+            # There seems to be posibilities to lost the right vs
+            # Now be sure that no nodes get ever lost even there are bugs
+            #
+            try:
+                oldVS.matcher.getKey(self.transCS) != 'NODE_CS'
+            except:
+                p('wrongVS!!!!')
+                self.createFlyingNode(oldVS)
+                vob.AbstractUpdateManager.chg()
+                return
+
+            if ev.getType() == ev.MOUSE_DRAGGED:
+                if dbg: p('drag')
+                oldVS.coords.setTranslateParams(self.transCS, ev.getX(), 
ev.getY())
+            else:
+                buoymanager = fenPDF.views.getBuoyManager()
+                mainNode = buoymanager.findTopmostMainNode(oldVS, ev.getX(), 
ev.getY())
+                if mainNode == None or not 
fenPDF.structure.canvas2d.isCanvas(mainNode.getPlane()):
+                    fenPDF.structure.canvas2d.placeOnCanvas(self.canvas, 
self.node, self.startPointX, self.startPointY)
+                else:
+                    xy = mainNode.getXYHit(getOldVS(), ev.getX(), ev.getY())
+                    
fenPDF.structure.canvas2d.placeOnCanvas(mainNode.getPlane(), self.node, xy[0], 
xy[1])
+                # temporarily solution, flush drags away...
+                fenPDF.events.mouse.mainMouse.flush()
+                fenPDF.events.eventHandler.eventGrabber = None
+                fenPDF.animation.regenerateVS()
+            vob.AbstractUpdateManager.chg()
+
+        def createFlyingNode(self,oldVS):
+            self.transCS = oldVS.translateCS(0,'NODE_CS', self.evX,self.evY)
+            viewFunction = fenPDF.views.getMultiplexerNodeContentFunction()
+            placeable = viewFunction.f(fenPDF.fen.graph, self.node)
+            self.nodeCS = oldVS.orthoBoxCS(self.transCS,
+                                           self.node, -1000,0,0, 1,1,
+                                           placeable.getWidth(),
+                                           placeable.getHeight())
+            placeable.place(oldVS, self.nodeCS)
 
 
 
@@ -204,7 +298,7 @@
            
            if obj != None and obj == context.states.cursor.getAccursed():
                if dbg: p('accursed!')
-               self.nodeMover.set(obj)
+               self.nodeMover.set(obj, x,y)
                return self.nodeMover
            return self.panMover
 
Index: fenfire/org/fenfire/fenpdf/events/mousemenu.py
diff -u fenfire/org/fenfire/fenpdf/events/mousemenu.py:1.10 
fenfire/org/fenfire/fenpdf/events/mousemenu.py:1.11
--- fenfire/org/fenfire/fenpdf/events/mousemenu.py:1.10 Thu Sep 11 10:50:20 2003
+++ fenfire/org/fenfire/fenpdf/events/mousemenu.py      Tue Oct 14 10:21:40 2003
@@ -26,6 +26,11 @@
        if self.states.selection.hasSelection():
            list.append(Item('Transclude selection (PDF to canvas only)',
                    lambda: self.fenPDF.actions.menu.transclude()))
+        if self.fenPDF.uistate.menu.hasTextOffset():
+            list.append(Item('Begin text scissor', 
+                   lambda: self.fenPDF.actions.menu.beginTextScissor()))
+            list.append(Item('End text scissor', 
+                   lambda: self.fenPDF.actions.menu.endTextScissor()))
         if self.fenPDF.uistate.menu.originatingNode:
             list.append(Item('<-----  Link node to left', 
                    lambda: self.fenPDF.actions.menu.structLinkNodes(-1)))
Index: fenfire/org/fenfire/fenpdf/fenpdf.py
diff -u fenfire/org/fenfire/fenpdf/fenpdf.py:1.14 
fenfire/org/fenfire/fenpdf/fenpdf.py:1.15
--- fenfire/org/fenfire/fenpdf/fenpdf.py:1.14   Thu Sep 11 13:26:08 2003
+++ fenfire/org/fenfire/fenpdf/fenpdf.py        Tue Oct 14 10:21:39 2003
@@ -62,6 +62,9 @@
                               on which the context menu 
                               was clicked open
 
+            originatingTextOffset -- the cursor offset of text
+                                     if there are any text othervise None
+
            originatingMainNode -- the main view on which
                                    the context menu was clicked
                                    open. If originatingNode is
@@ -76,21 +79,64 @@
     def __init__(self):
        self.shown = 0
        self.originatingMainNode = None
+        self.originatingTextOffset = None
        self.originatingNode = None
        self.originatingBuoy = None
     def originateFromBuoy(self, buoy):
        self.originatingBuoy = buoy
        self.originatingNode = None
        self.originatingMainNode = None
+        self.originatingTextOffset = None
        self.shown = 1
-    def originateFromMainNode(self, mainNode, node):
+    def originateFromMainNode(self, mainNode, node, offs):
        self.originatingBuoy = None
        self.originatingNode = node
        self.originatingMainNode = mainNode
+        self.originatingTextOffset = offs
        self.shown = 1
+    def hasTextOffset(self):
+        if self.originatingTextOffset == None: return 0
+        else: return 1
     def clear(self):
        self.__init__()
-       
+
+
+class UIState_Scissor:
+    """ XXX
+    States for text scissor
+        begin
+            node
+            offset
+        end
+            node
+            offset
+
+    Read acces to all.
+    Write only trough methods setBegin and setEnd.
+    """
+
+    class ScissorPoint:
+        def __init__(self):
+            self.node = None
+            self.offset = None
+
+    def __init__(self):
+        self.begin = self.ScissorPoint()
+        self.end = self.ScissorPoint()
+    def setBegin(self, node, offset):
+        self.begin.node = node
+        self.begin.offset = offset
+    def setEnd(self, node, offset):
+        self.end.node = node
+        self.end.offset = offset
+    def isScissored(self, node, offset):
+        if node == None: return 0
+        if self.begin.node == node and \
+           self.end.node == node and \
+           self.begin.offset <= offset and \
+           self.end.offset >= offset:
+            return 1
+        return 0
 
 class FenPDF:
     """This class represents a complete fenpdf "application".
@@ -139,6 +185,9 @@
     
        cursor -- the accursed node or plane
 
+        textscissor -- begin and end scissor offsets and nodes to
+                       support text cloud operations 
+
        menu -- State of the ui context menu.
     
 
@@ -155,6 +204,7 @@
        self.animation = AnimationState()
        self.uistate = _Empty()
        self.uistate.menu = UIState_Menu()
+       self.uistate.textScissor = UIState_Scissor()
 
 
        self.structure.ff = structure_ff
Index: fenfire/org/fenfire/fenpdf/fenpdfcontext.py
diff -u fenfire/org/fenfire/fenpdf/fenpdfcontext.py:1.33 
fenfire/org/fenfire/fenpdf/fenpdfcontext.py:1.34
--- fenfire/org/fenfire/fenpdf/fenpdfcontext.py:1.33    Wed Sep 10 09:00:46 2003
+++ fenfire/org/fenfire/fenpdf/fenpdfcontext.py Tue Oct 14 10:21:40 2003
@@ -123,12 +123,49 @@
         buoymanager = self.states.fenPDF.views.getBuoyManager()
         if mainNode != buoymanager.getLastMain(): return
 
-        # draw cursor
         mainNode = buoymanager.getLastMain()
         canvas = ff.util.lava.view.getView(mainNode, ff.view.CanvasView2D)
         if not isinstance(canvas, ff.view.CanvasView2D): return
-            
+
         xy = jarray.zeros(2, 'f')
+        # XXX ugly 
+        height = 23
+
+
+        # draw scissor points
+        node = self.states.fenPDF.uistate.textScissor.begin.node
+        if node != None:
+            containerCS = canvas.getContainerCS(vs, into)
+            cs = vs.matcher.getCS(containerCS, node)
+            if cs < 2: return
+
+            viewFunction = 
self.states.fenPDF.views.getMultiplexerNodeContentFunction()
+            placeable = viewFunction.f(self.states.fen.graph, node)
+            p('offset:',self.states.fenPDF.uistate.textScissor.begin.offset)
+            if isinstance(placeable, vob.lava.placeable.TextPlaceable):
+                
placeable.getCursorXY(self.states.fenPDF.uistate.textScissor.begin.offset, xy)
+
+                cs = vs.coords.ortho(cs, 0,xy[0],xy[1], height, -height)
+                vs.put(vob.vobs.ContinuousLineVob(5, [.3,-.3,0 , 0,0,0 , 0,1,0 
, .3,1.3,0], 0, 100, java.awt.Color.blue), cs)
+
+        node = self.states.fenPDF.uistate.textScissor.end.node
+        if node != None:
+            containerCS = canvas.getContainerCS(vs, into)
+            cs = vs.matcher.getCS(containerCS, node)
+            if cs < 2: return
+
+            viewFunction = 
self.states.fenPDF.views.getMultiplexerNodeContentFunction()
+            placeable = viewFunction.f(self.states.fen.graph, node)
+            if isinstance(placeable, vob.lava.placeable.TextPlaceable):
+                
placeable.getCursorXY(self.states.fenPDF.uistate.textScissor.end.offset, xy)
+
+                cs = vs.coords.ortho(cs, 0,xy[0],xy[1], height, -height)
+                vs.put(vob.vobs.ContinuousLineVob(5, [-.3,-.3,0 , 0,0,0 , 
0,1,0 , -.3,1.3,0], 0, 100, java.awt.Color.blue), cs)
+
+
+
+            
+        # draw cursor
         if not self.states.cursor.hasAccursed():
             focus = mainNode.getFocus()
             cs = vs.matcher.getCS(into, 'canvasview_conc')
@@ -140,13 +177,11 @@
             if cs < 0: return
 
             viewFunction = 
self.states.fenPDF.views.getMultiplexerNodeContentFunction()
-            p = viewFunction.f(self.states.fen.graph, 
self.states.cursor.getAccursed())
-            if isinstance(p, vob.lava.placeable.TextPlaceable):
-                p.getCursorXY(self.states.cursor.getCursorOffset(), xy)
+            pl = viewFunction.f(self.states.fen.graph, 
self.states.cursor.getAccursed())
+            if isinstance(pl, vob.lava.placeable.TextPlaceable):
+                pl.getCursorXY(self.states.cursor.getCursorOffset(), xy)
             else: return 
                 
-        # XXX ugly 
-        height = 24
         cs = vs.coords.ortho(cs, 0,xy[0],xy[1], 1, -height)
         vs.put(vob.vobs.ContinuousLineVob(5, [0,0,0 , 0,1,0]), cs)
         
Index: fenfire/org/fenfire/view/CanvasView2D.java
diff -u fenfire/org/fenfire/view/CanvasView2D.java:1.31 
fenfire/org/fenfire/view/CanvasView2D.java:1.32
--- fenfire/org/fenfire/view/CanvasView2D.java:1.31     Wed Sep 10 09:28:24 2003
+++ fenfire/org/fenfire/view/CanvasView2D.java  Tue Oct 14 10:21:41 2003
@@ -45,7 +45,7 @@
 
 /** A View2D of a CANVAS2D, with a given node function.
  */
-public class CanvasView2D extends View2D implements NodedView2D, 
org.fenfire.view.lava.FastView {
+public class CanvasView2D extends View2D implements 
org.fenfire.view.lava.FastView {// NodedView2D,{
     public static boolean dbg = false;
     private static void p(String s) { System.out.println("CanvasView2D:: "+s); 
}
     
@@ -63,7 +63,7 @@
            "Disable TEXTURE_2D\n"+
            "LineWidth 5\n" +
            "Enable BLEND\n" +
-           "Color 0 0 0 0.6\n"
+           "Color 0 0 0 0.3\n"
        );
        lineconn.glteardown = GLCache.getCallList("PopAttrib");
     }
@@ -196,13 +196,15 @@
        }
     }
 
-    public Object getNode(VobScene oldvs, 
+    public int getNodeCS(VobScene oldvs, 
                    int x, int y,
                    Object plane, int matchingParent, 
                    int box2screen, int box2plane,
                    float[] xyout) {
-       int cs = oldvs.getCSAt(box2screen, x, y, xyout);
-       if(cs <= 1) return null;
-       return oldvs.matcher.getKey(cs);
+       return oldvs.getCSAt(box2screen, x, y, xyout);
+    }
+
+    static public boolean hasCanvas(ConstGraph g, Object node) {
+       return g.find1_X11(CANVAS2D.contains, node) != null;
     }
 }
Index: fenfire/org/fenfire/view/buoy/AbstractMainNode2D.java
diff -u fenfire/org/fenfire/view/buoy/AbstractMainNode2D.java:1.49 
fenfire/org/fenfire/view/buoy/AbstractMainNode2D.java:1.50
--- fenfire/org/fenfire/view/buoy/AbstractMainNode2D.java:1.49  Fri Sep 12 
15:05:53 2003
+++ fenfire/org/fenfire/view/buoy/AbstractMainNode2D.java       Tue Oct 14 
10:21:41 2003
@@ -252,22 +252,30 @@
        }
     }
 
-    public Object getNodeOnPlane(VobScene oldVobScene, float x, float y) {
+    public int getNodeCS(VobScene oldVobScene, float x, float y) {
        View2D view = getView2D();
        while (view.getChildView2D() != null) 
            view = view.getChildView2D();
            
-       // currently only for canvas2d canvases
-       // XXX Refactor: should be in View2D
+       // XXX should this be in View2D?
        if (view instanceof CanvasView2D) {
                
-           Object obj = ((CanvasView2D)view)
-               .getNode(oldVobScene, (int)x, (int)y, 
+           int cs = ((CanvasView2D)view)
+               .getNodeCS(oldVobScene, (int)x, (int)y, 
                         plane, box2screen, box2screen,
                         box2paper, null);
-           if (dbg) p("Object is: "+ (obj != null ? obj.toString() : obj));
-           return obj;
+
+           if(dbg) p("CS is: "+cs);
+           return cs;
        } 
-       return null;
+       return -1;
+    }
+
+    public Object getNodeOnPlane(VobScene oldVobScene, float x, float y) {
+       int cs = getNodeCS(oldVobScene, x, y);
+       if(cs <= 1) return null;
+       Object obj = oldVobScene.matcher.getKey(cs);
+       if (dbg) p("Object is: "+ (obj != null ? obj.toString() : obj));
+       return obj;
     }
 }
Index: fenfire/org/fenfire/view/buoy/PPConnector.java
diff -u fenfire/org/fenfire/view/buoy/PPConnector.java:1.24 
fenfire/org/fenfire/view/buoy/PPConnector.java:1.25
--- fenfire/org/fenfire/view/buoy/PPConnector.java:1.24 Thu Sep 11 13:26:09 2003
+++ fenfire/org/fenfire/view/buoy/PPConnector.java      Tue Oct 14 10:21:42 2003
@@ -103,7 +103,8 @@
            while (iter.hasNext()) {
                Object obj = iter.next();
                Object plane = fen.constgraph.find1_X11(CANVAS2D.contains, obj);
-               if (container == plane) continue;
+               if (container == plane || 
+                   !(CanvasView2D.hasCanvas(fen.graph, obj))) continue;
                Object anchor = getAnchor(plane, obj);
                if(anchor == null) continue;
                if (dbg) p("anchor:"+anchor);
@@ -117,7 +118,8 @@
            while (iter.hasNext()) {
                Object obj = iter.next();
                Object plane = fen.constgraph.find1_X11(CANVAS2D.contains, obj);
-               if (container == plane) continue;
+               if (container == plane || 
+                   !(CanvasView2D.hasCanvas(fen.graph, obj))) continue;
                Object anchor = getAnchor(plane, obj);
                if(anchor == null) continue;
                if (dbg) p("anchor:"+anchor);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]