fenfire-commits
[Top][All Lists]
Advanced

[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: Fri, 15 Aug 2003 04:04:58 -0400

CVSROOT:        /cvsroot/fenfire
Module name:    fenfire
Branch:         
Changes by:     Asko Soukka <address@hidden>    03/08/15 04:04:58

Modified files:
        .              : README.MMDEMO 
        org/fenfire/demo: mm.py 
        org/fenfire/util: PUIClipboard.java 

Log message:
        clipboard

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/fenfire/fenfire/README.MMDEMO.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/fenfire/fenfire/org/fenfire/demo/mm.py.diff?tr1=1.11&tr2=1.12&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/fenfire/fenfire/org/fenfire/util/PUIClipboard.java.diff?tr1=1.2&tr2=1.3&r1=text&r2=text

Patches:
Index: fenfire/README.MMDEMO
diff -u fenfire/README.MMDEMO:1.4 fenfire/README.MMDEMO:1.5
--- fenfire/README.MMDEMO:1.4   Thu Aug 14 12:15:44 2003
+++ fenfire/README.MMDEMO       Fri Aug 15 04:04:57 2003
@@ -11,11 +11,9 @@
 of mindmap technique.
 
 NOTE
-       unlinking nodes may create unreachable subnetworks
-
-       that is hard to avoid, but it's possible to create a 
-        special action (with special keybinding), which collects
-        and shows such subnetwork
+       Be careful! Currently, unlinking nodes may create unreachable
+        disconnected components. We are working for way to bring those
+        components reachable.
 
 ------------------
 Used abbreviations
@@ -89,19 +87,25 @@
        Enters text.
 
 Backspace
-       Removes a character before text cursor.
+       Removes a character before the text cursor.
 
 Arrows
-       Moves text cursor.
+       Moves the text cursor.
 
 Home or Ctrl-A
-       Moves text cursor into the beginning of the line. 
+       Moves the text cursor into the beginning of the line. 
 
 End or Ctrl-E
-       Moves text cursor to the end of the line. 
+       Moves the text cursor to the end of the line. 
 
 Ctrl-Home
-       Moves text cursor into the beginning of the text.
+       Moves the text cursor into the beginning of the text.
 
 Ctrl-End
-       Moves text cursor to the end of the text.
+       Moves the text cursor to the end of the text.
+
+Ctrl-C
+       Copy the content of the node into the clipboard.
+
+Ctrl-V or Ctrl-Y
+       Paste the content of the clipbard (just after the cursor).
Index: fenfire/org/fenfire/demo/mm.py
diff -u fenfire/org/fenfire/demo/mm.py:1.11 fenfire/org/fenfire/demo/mm.py:1.12
--- fenfire/org/fenfire/demo/mm.py:1.11 Thu Aug 14 16:46:01 2003
+++ fenfire/org/fenfire/demo/mm.py      Fri Aug 15 04:04:58 2003
@@ -11,6 +11,7 @@
 from org.fenfire.vocab import *
 from org.fenfire.vocab.lava import *
 from org.fenfire.swamp import Nodes
+from org.fenfire.util import PUIClipboard
 import org.nongnu.alph as alph
 import org.nongnu.storm as storm
 
@@ -71,7 +72,6 @@
 nodeview.setHasNoContext()
 mindView = ff.view.lava.mindMapView2D.MindMapView2D(fen, nodeview)
 
-
 class Context(ff.view.buoy.AbstractMainNode2D.Context):
     def __init__(self):
         self.rmb_switch = [ 'go', 'link', 'unlink' ]
@@ -282,31 +282,38 @@
         vob.AbstractUpdateManager.chg()
         
     def key(self, key):
-        if (dbg): p("key: ", key)
+        p("key: ", key)
         if key == 'Escape' or key == 'Tab':
+            """Removes the focus from the current accursed node and sets no 
new accursed node."""
             context.setAccursed(None)
         elif key == 'Backspace':
+            """Removes a character before the cursor."""
             if context.getAccursed() != None \
                    and context.offset > 0:
                 context.deleteText()
         elif key == 'Delete':
+            """Removes a character next to the cursor."""
             if context.getAccursed() != None:
                 text = alphContent.getText(fen.graph, context.getAccursed())
                 if context.offset < len(text):
                     context.offset += 1
                     context.deleteText()
         elif key == "Ctrl-S":
+            """Save the structure."""
             p("going to save");
             m = ff.swamp.Graphs.toModel(fen.graph);
             m.write(java.io.FileWriter(FILE));
         elif key == "Ctrl-Q":
+            """Save the structure and quit."""
             p("going to save");
             m = ff.swamp.Graphs.toModel(fen.graph);
             m.write(java.io.FileWriter(FILE));
             java.lang.System.exit(43)
         elif key == "Ctrl-R":
+            """Reload scene."""
             vob.putil.demo.loadScenes()
         elif key == "Return":
+            """Add a linebreak."""
             context.insertText("\n")
             text = alphContent.getText(fen.graph, context.getAccursed())
             # small hack to show the new line on NodeView, without content it 
would be shrank
@@ -314,35 +321,51 @@
                 context.insertText(" ")
                 context.offset -= 1
         elif key == 'Up':
+            """Move the cursor to the previous line."""
             xy = jarray.zeros(2, 'f')
             nodeview.getXY(fen.graph, context.getAccursed(),
                                context.offset, xy)
             xy[1] -= textstyle.getHeight(1)
             context.offset = nodeview.getPos(fen.graph, context.getAccursed(), 
xy[0], xy[1])
        elif key == 'Down':
+            """Move the cursor to the next line."""
             xy = jarray.zeros(2, 'f')
             nodeview.getXY(fen.graph, context.getAccursed(),
                                context.offset, xy)
             xy[1] += textstyle.getHeight(1)
             context.offset = nodeview.getPos(fen.graph, context.getAccursed(), 
xy[0], xy[1])
        elif key == 'Left':
+            """Move the cursor a character to the left."""
             if context.offset > 0: context.offset -= 1
         elif key == 'Right':
+            """Move the cursor a character to the right."""
             text = alphContent.getText(fen.graph, context.getAccursed())
             if context.offset < len(text):
                 context.offset += 1
         if key == "Ctrl-HomE":
+            """Move the cursor into the beginning of the text."""
             context.offset = 0
         if key == "Ctrl-EnD":
+            """Move the cursor to the end of the text."""
             text = alphContent.getText(fen.graph, context.getAccursed())
             context.offset = len(text)
+        if key == "Ctrl-C":
+            """Copy the content of the node into the clipboard."""
+            text = alphContent.getText(fen.graph, context.getAccursed())
+            PUIClipboard.puiCopy(text)
+        if key == "Ctrl-V" or key=="Ctrl-Y":
+            """Paste the content the clipboard just after the cursor."""
+            context.insertText(PUIClipboard.getText())
+            print 'PUI', PUIClipboard.getText()
         if key == "Home" or key == "Ctrl-A":
+            """Move the cursor into the beginning of the line."""
             xy = jarray.zeros(2, 'f')
             nodeview.getXY(fen.graph, context.getAccursed(),
                                context.offset, xy)
             xy[0] = 0
             context.offset = nodeview.getPos(fen.graph, context.getAccursed(), 
xy[0], xy[1])            
         if key == "End" or key == "Ctrl-E":
+            """Move the cursor to the end of the line."""
             # the end of line is reached by going to home of the line below
             # and returning a single character back if not the end of text was 
reached
             xy = jarray.zeros(2, 'f')
@@ -354,6 +377,7 @@
             text = alphContent.getText(fen.graph, context.getAccursed())
             if context.offset < len(text): context.offset -= 1
         elif len(key) == 1:
+            """Enter a character into the cursor position."""
             context.insertText(key)
 
         if dbg:
Index: fenfire/org/fenfire/util/PUIClipboard.java
diff -u fenfire/org/fenfire/util/PUIClipboard.java:1.2 
fenfire/org/fenfire/util/PUIClipboard.java:1.3
--- fenfire/org/fenfire/util/PUIClipboard.java:1.2      Fri Apr 25 07:19:39 2003
+++ fenfire/org/fenfire/util/PUIClipboard.java  Fri Aug 15 04:04:58 2003
@@ -35,7 +35,7 @@
 /** Handle copy and paste of PUI clipboard
  */
 public class PUIClipboard {
-public static final String rcsid = "$Id: PUIClipboard.java,v 1.2 2003/04/25 
11:19:39 tjl Exp $";
+public static final String rcsid = "$Id: PUIClipboard.java,v 1.3 2003/08/15 
08:04:58 humppake Exp $";
     public static boolean dbg = false;
     private static void pa(String s) { System.err.println(s); }
 
@@ -64,6 +64,9 @@
         return s;
     }
 
+    /** Copy the string into the PUI clipboard (overwrites the
+     * existing content).
+     */
     static public void puiCopy(String str) {
         if(dbg) pa("PuiCOPY '"+str+"'");
         Clipboard clipboard = getClipboard();




reply via email to

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