gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] gzz/gzz/view DefaultBinder.java LastOpDecorator...


From: Benja Fallenstein
Subject: [Gzz-commits] gzz/gzz/view DefaultBinder.java LastOpDecorator...
Date: Thu, 10 Oct 2002 11:57:43 -0400

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Benja Fallenstein <address@hidden>      02/10/10 11:57:42

Modified files:
        gzz/view       : DefaultBinder.java LastOpDecorator.java 

Log message:
        A more formal way to do 'error messages', together with
        a bit of javadoc explaining policy: these
        are *apologies to the user* (because if
        they're not explicitly apologies, they
        sound like accusations)

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/DefaultBinder.java.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/LastOpDecorator.java.diff?tr1=1.16&tr2=1.17&r1=text&r2=text

Patches:
Index: gzz/gzz/view/DefaultBinder.java
diff -c gzz/gzz/view/DefaultBinder.java:1.5 gzz/gzz/view/DefaultBinder.java:1.6
*** gzz/gzz/view/DefaultBinder.java:1.5 Wed Oct  9 05:10:08 2002
--- gzz/gzz/view/DefaultBinder.java     Thu Oct 10 11:57:42 2002
***************
*** 42,48 ****
  /** Keybindings for the Fallback client.
   */
  public class DefaultBinder implements FallbackBinder {
! public static final String rcsid = "$Id: DefaultBinder.java,v 1.5 2002/10/09 
09:10:08 benja Exp $";
      public static boolean dbg = false;
      private static void pa(String s) { System.err.println(s); }
  
--- 42,48 ----
  /** Keybindings for the Fallback client.
   */
  public class DefaultBinder implements FallbackBinder {
! public static final String rcsid = "$Id: DefaultBinder.java,v 1.6 2002/10/10 
15:57:42 benja Exp $";
      public static boolean dbg = false;
      private static void pa(String s) { System.err.println(s); }
  
***************
*** 92,107 ****
       */
      public Set markedCells = new HashSet();
      
!     /** A string describing the last error that occurred, if any.
       */
!     public String errstring = null;
  
      public DefaultBinder(Fallback fallback) {
          this.fallback = fallback;
      }
  
  
!     void dir(int win, int dim, int dir) {
          Fallback.Win w = fallback.windows[win];
        Fallback.Win other = fallback.windows[1-win];
          Dim[] dims = w.dims;
--- 92,107 ----
       */
      public Set markedCells = new HashSet();
      
!     /** The last client exception that occurred, if any.
       */
!     public ClientException lastClientException;
  
      public DefaultBinder(Fallback fallback) {
          this.fallback = fallback;
      }
  
  
!     void dir(int win, int dim, int dir) throws ClientException {
          Fallback.Win w = fallback.windows[win];
        Fallback.Win other = fallback.windows[1-win];
          Dim[] dims = w.dims;
***************
*** 198,204 ****
        }
  
        wasInWindow = (Fallback.Win)win;
!         errstring = null;
  
        try {
            if(fallback.mode == NORMAL)
--- 198,204 ----
        }
  
        wasInWindow = (Fallback.Win)win;
!         lastClientException = null;
  
        try {
            if(fallback.mode == NORMAL)
***************
*** 220,231 ****
            directOp = NONE; throw e;
        } catch(RuntimeException e) {
            directOp = NONE; throw e;
        } finally {
            AbstractUpdateManager.chg();
        }
      }
  
!     public void normalModeKeystroke(String k) {
        if(k.equals("Tab")) {
            if(dbg) pa("Switching to text edit mode.");
            fallback.mode = TEXT_1;
--- 220,234 ----
            directOp = NONE; throw e;
        } catch(RuntimeException e) {
            directOp = NONE; throw e;
+         } catch(ClientException e) {
+             lastClientException = e;
+             directOp = NONE;
        } finally {
            AbstractUpdateManager.chg();
        }
      }
  
!     public void normalModeKeystroke(String k) throws ClientException {
        if(k.equals("Tab")) {
            if(dbg) pa("Switching to text edit mode.");
            fallback.mode = TEXT_1;
***************
*** 267,273 ****
                  cell.delete();
                  fallback.windows[1].cursor = home;
              } else {
!                 errstring = "Sorry, I can't delete the home cell.";
              }
        } else if(k.length() == 1) {
            switch(k.charAt(0)) {
--- 270,277 ----
                  cell.delete();
                  fallback.windows[1].cursor = home;
              } else {
!                 throw new ClientException(
!                     "Sorry, I can't delete the home cell.");
              }
        } else if(k.length() == 1) {
            switch(k.charAt(0)) {
Index: gzz/gzz/view/LastOpDecorator.java
diff -c gzz/gzz/view/LastOpDecorator.java:1.16 
gzz/gzz/view/LastOpDecorator.java:1.17
*** gzz/gzz/view/LastOpDecorator.java:1.16      Wed Oct  9 05:10:08 2002
--- gzz/gzz/view/LastOpDecorator.java   Thu Oct 10 11:57:42 2002
***************
*** 32,38 ****
   *  directional op entered.
   */
  public class LastOpDecorator implements FallbackSceneDecorator {
! String rcsid = "$Id: LastOpDecorator.java,v 1.16 2002/10/09 09:10:08 benja 
Exp $";
      public static boolean dbg = false;
      private static void pa(String s) { System.err.println(s); }
  
--- 32,38 ----
   *  directional op entered.
   */
  public class LastOpDecorator implements FallbackSceneDecorator {
! String rcsid = "$Id: LastOpDecorator.java,v 1.17 2002/10/10 15:57:42 benja 
Exp $";
      public static boolean dbg = false;
      private static void pa(String s) { System.err.println(s); }
  
***************
*** 63,70 ****
  
          if(dbg) pa("fallback.binder.directOp: "+fallback.binder.directOp);
  
!         if(fallback.binder.errstring != null) {
!             ch.addBox(text(fallback.binder.errstring));
          } else if(fallback.mode == fallback.NORMAL) {
              switch(fallback.binder.directOp) {
                  case DefaultBinder.NONE: return;
--- 63,70 ----
  
          if(dbg) pa("fallback.binder.directOp: "+fallback.binder.directOp);
  
!         if(fallback.binder.lastClientException != null) {
!             fallback.binder.lastClientException.renderApology(ch, style);
          } else if(fallback.mode == fallback.NORMAL) {
              switch(fallback.binder.directOp) {
                  case DefaultBinder.NONE: return;




reply via email to

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