[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ff-cvs] fenfire ./README.MMDEMO org/fenfire/demo/mm.py
From: |
Asko Soukka |
Subject: |
[ff-cvs] fenfire ./README.MMDEMO org/fenfire/demo/mm.py |
Date: |
Tue, 19 Aug 2003 14:58:11 -0400 |
CVSROOT: /cvsroot/fenfire
Module name: fenfire
Branch:
Changes by: Asko Soukka <address@hidden> 03/08/19 14:58:11
Modified files:
. : README.MMDEMO
org/fenfire/demo: mm.py
Log message:
dropped a state
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/fenfire/fenfire/README.MMDEMO.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/fenfire/fenfire/org/fenfire/demo/mm.py.diff?tr1=1.30&tr2=1.31&r1=text&r2=text
Patches:
Index: fenfire/README.MMDEMO
diff -u fenfire/README.MMDEMO:1.7 fenfire/README.MMDEMO:1.8
--- fenfire/README.MMDEMO:1.7 Tue Aug 19 05:34:24 2003
+++ fenfire/README.MMDEMO Tue Aug 19 14:58:10 2003
@@ -34,7 +34,6 @@
- selecting state; blue background; arrow cursor
- linking state; green background; pointing hand cursor
- - unlinking state; grey background; crosshair cursor
LMB click
Selecting state
@@ -44,9 +43,9 @@
editable at once and text cursor should be automaticly
transferred below the clicking point.
Linking state
- Links the center node the clicked node.
- Unlinking state
- Unlinks the center node from the clicked node.
+ Links the center node and the clicked node or
+ removes the existing link between the center
+ node and the clicked node.
LMB drag
Moves the linked structure on the screen.
Index: fenfire/org/fenfire/demo/mm.py
diff -u fenfire/org/fenfire/demo/mm.py:1.30 fenfire/org/fenfire/demo/mm.py:1.31
--- fenfire/org/fenfire/demo/mm.py:1.30 Tue Aug 19 05:34:24 2003
+++ fenfire/org/fenfire/demo/mm.py Tue Aug 19 14:58:11 2003
@@ -134,7 +134,7 @@
class Context(ff.view.buoy.AbstractMainNode2D.Context):
def __init__(self):
- self.rmb_switch = [ 'go', 'link', 'unlink' ]
+ self.rmb_switch = [ 'go', 'link' ]
self.oldVS = None
self.replaceVS = None
self.main = None # MainNode2D
@@ -151,7 +151,6 @@
rmb = rmb[0]
if rmb == 'go': self.bgcolor = (.4, .7, 1.0); w.setCursor('default')
elif rmb == 'link': self.bgcolor = (.4, .8, .4); w.setCursor('hand')
- elif rmb == 'unlink': self.bgcolor = (.7, .7, .7);
w.setCursor('crosshair')
else: raise 'no good cursor!?'
def drawCursor(self, vs, node, cs):
@@ -202,16 +201,20 @@
def rmLinkTo(self, obj, with):
+ rm = 0
iter = fen.graph.findN_11X_Iter(obj, STRUCTLINK.linkedTo)
try:
while (iter.hasNext()):
if with == iter.next():
fen.graph.rm_111(obj, STRUCTLINK.linkedTo, with)
+ rm += 1
iter = fen.graph.findN_11X_Iter(with, STRUCTLINK.linkedTo)
while (iter.hasNext()):
if obj == iter.next():
fen.graph.rm_111(with, STRUCTLINK.linkedTo, obj)
+ rm += 1
except: pass
+ return rm
def mainNodeToBeRender(self, vs,into, main): pass
def changeFastAfterMouseEvent(self):
@@ -287,18 +290,9 @@
(x-into[0])/self.context.scale/nodeScale,
(y-into[1])/self.context.scale/nodeScale)
elif rmb == 'link':
- if node == self.context.main.getPlane():
- pass
- elif ff.util.RDFUtil.isLinkedWith(fen.graph, node,
self.context.main.getPlane()):
- pass
- else:
+ if node == self.context.main.getPlane(): pass
+ elif self.context.rmLinkTo(node, self.context.main.getPlane()) ==
0:
fen.graph.add(self.context.main.getPlane(),
STRUCTLINK.linkedTo, node)
- elif rmb == 'unlink':
- if node == self.context.main.getPlane(): pass
- else:
-# if ff.util.RDFUtil.isLinkedWith(fen.graph, node,
self.context.main.getPlane()) \
-# or ff.util.RDFUtil.isLinkedWith(fen.graph,
self.context.main.getPlane(), node):
- self.context.rmLinkTo(node, self.context.main.getPlane())
class ZoomPan(vob.input.RelativeAxisListener, Action,
vob.mouse.MousePressListener):
- [ff-cvs] fenfire ./README.MMDEMO org/fenfire/demo/mm.py,
Asko Soukka <=