/[fenfire]/fenfire/org/fenfire/demo/mm.py
ViewVC logotype

Diff of /fenfire/org/fenfire/demo/mm.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.34 by humppake, Sun Aug 24 10:52:11 2003 UTC revision 1.35 by humppake, Mon Aug 25 07:27:51 2003 UTC
# Line 29  import org.fenfire as ff Line 29  import org.fenfire as ff
29  from org.fenfire.vocab import *  from org.fenfire.vocab import *
30  from org.fenfire.vocab.lava import *  from org.fenfire.vocab.lava import *
31  from org.fenfire.swamp import Nodes  from org.fenfire.swamp import Nodes
32    from org.fenfire.fenmm import MMGeometry
33  from org.nongnu.libvob.util import PUIClipboard  from org.nongnu.libvob.util import PUIClipboard
34  import org.nongnu.alph as alph  import org.nongnu.alph as alph
35  import org.nongnu.storm as storm  import org.nongnu.storm as storm
# Line 208  class Context(ff.view.buoy.AbstractMainN Line 209  class Context(ff.view.buoy.AbstractMainN
209      def setSlowAnimation(self):      def setSlowAnimation(self):
210          self.fastMouseChg = 0          self.fastMouseChg = 0
211          self.replaceVS = None          self.replaceVS = None
     def getScale(self, depth):  
         return 1-(Math.log(depth+1)/Math.E)  
     def getTextScale(self, depth):  
         return 1-(Math.log(depth+1)/Math.E)/2  
212    
213  class Action:  class Action:
214      def __init__(self, fen, context):      def __init__(self, fen, context):
# Line 250  class LMB(Action, vob.mouse.MouseClickLi Line 247  class LMB(Action, vob.mouse.MouseClickLi
247              scale = 1./main.getFocus().getZoom()              scale = 1./main.getFocus().getZoom()
248    
249              # scaling              # scaling
250              nodeScale = self.context.getTextScale(100+into[2])              nodeScale = ff.fenmm.MMGeometry.getTextScale(int(100+into[2]))
251    
252              if node == self.context.main.getPlane(): # from border to linked              if node == self.context.main.getPlane(): # from border to linked
253                  cursor.setOffset((x-into[0])/scale/nodeScale, (y-into[1])/scale/nodeScale)                  cursor.setOffset((x-into[0])/scale/nodeScale, (y-into[1])/scale/nodeScale)
# Line 325  class MMScene: Line 322  class MMScene:
322          self.mindMouse.setListener(1, 0,'Moving the pan around or the node if accursed.', \          self.mindMouse.setListener(1, 0,'Moving the pan around or the node if accursed.', \
323                            PanMover(fen, self.context))                            PanMover(fen, self.context))
324    
325          self.view = ff.view.lava.mindMapView2D.MindMapView2D(fen, self.context, 5)          self.view = ff.view.lava.mindMapView2D.MindMapView2D(fen, self.context)
326          self.main = ff.view.lava.mindMapView2D.MindMapMainNode2D(fen, self.context, self.view, self.mindMouse)          self.main = ff.view.lava.mindMapView2D.MindMapMainNode2D(fen, self.context, self.view, self.mindMouse)
327          self.context.main = self.main          self.context.main = self.main
328            dimensions = w.getSize()
329            self.view.filletLength = dimensions.width * 1./4.
330            self.view.filletWidth = dimensions.height * 1./15.
331            self.view.depth = 5
332    
333          # flag for cursor('wait')          # flag for cursor('wait')
334          self.startup = 1          self.startup = 1
# Line 346  class MMScene: Line 347  class MMScene:
347              self.axes = [None, None, None]              self.axes = [None, None, None]
348    
349              if self.naxes >= 1:              if self.naxes >= 1:
350                  self.axes[0] = vob.input.impl.StandardBoundedFloatModel(0.001, self.view.filletWidth*2,                  self.axes[0] = vob.input.impl.StandardBoundedFloatModel(1, self.view.filletWidth*2,
351                      actionPerformed = lambda x: vob.AbstractUpdateManager.chg())                      actionPerformed = lambda x: vob.AbstractUpdateManager.chg())
352              if self.naxes >= 2:              if self.naxes >= 2:
353                  self.axes[1] = vob.input.impl.StandardBoundedFloatModel(0.001, self.view.filletLength*2,                  self.axes[1] = vob.input.impl.StandardBoundedFloatModel(1, self.view.filletLength*2,
354                      actionPerformed = lambda x: vob.AbstractUpdateManager.chg())                      actionPerformed = lambda x: vob.AbstractUpdateManager.chg())
355              if self.naxes >= 3:              if self.naxes >= 3:
356                  self.axes[2] = vob.input.impl.WrappingBoundedFloatModel(0, Math.PI*2,                  self.axes[2] = vob.input.impl.WrappingBoundedFloatModel(0, Math.PI*2,
# Line 370  class MMScene: Line 371  class MMScene:
371          # custom controller support          # custom controller support
372          if self.naxes >= 1: self.view.filletWidth = self.axes[0].getValue()          if self.naxes >= 1: self.view.filletWidth = self.axes[0].getValue()
373          if self.naxes >= 2: self.view.filletLength = self.axes[1].getValue()          if self.naxes >= 2: self.view.filletLength = self.axes[1].getValue()
374          if self.naxes >= 3: self.view.rotation = -self.axes[2].getValue()          if self.naxes >= 3: self.view.initRotation = -self.axes[2].getValue()
375    
376          accursed = self.context.c.getAccursed()          accursed = self.context.c.getAccursed()
377          # adding accursed to multiplexer          # adding accursed to multiplexer

Legend:
Removed from v.1.34  
changed lines
  Added in v.1.35

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26