[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] gzz/gzz client/Fallback.java view/FallbackBinde...
From: |
Benja Fallenstein |
Subject: |
[Gzz-commits] gzz/gzz client/Fallback.java view/FallbackBinde... |
Date: |
Tue, 24 Sep 2002 14:15:35 -0400 |
CVSROOT: /cvsroot/gzz
Module name: gzz
Changes by: Benja Fallenstein <address@hidden> 02/09/24 14:15:35
Modified files:
gzz/client : Fallback.java
gzz/view : FallbackBinder.java LastOpDecorator.java
Log message:
Start work on implementing Ted's cursorspec
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/client/Fallback.java.diff?tr1=1.32&tr2=1.33&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/FallbackBinder.java.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/LastOpDecorator.java.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
Patches:
Index: gzz/gzz/client/Fallback.java
diff -c gzz/gzz/client/Fallback.java:1.32 gzz/gzz/client/Fallback.java:1.33
*** gzz/gzz/client/Fallback.java:1.32 Wed Sep 4 18:15:39 2002
--- gzz/gzz/client/Fallback.java Tue Sep 24 14:15:34 2002
***************
*** 72,78 ****
* It implements a subset of the 0.6.0 bindings.
*/
public class Fallback {
! public static final String rcsid = "$Id: Fallback.java,v 1.32 2002/09/04
22:15:39 benja Exp $";
public static boolean dbg = false;
private static void pa(String s) { System.err.println(s); }
--- 72,78 ----
* It implements a subset of the 0.6.0 bindings.
*/
public class Fallback {
! public static final String rcsid = "$Id: Fallback.java,v 1.33 2002/09/24
18:15:34 benja Exp $";
public static boolean dbg = false;
private static void pa(String s) { System.err.println(s); }
***************
*** 86,93 ****
--- 86,103 ----
/** The current mode.
*/
public int mode = NORMAL;
+
+ // Arrowsets
+ public static final int LEFT = 0;
+ public static final int RIGHT = 1;
+ /** Windows, by arrowset (LEFT or RIGHT)
+ */
public Win[] windows = new Win[2];
+
+ /** The list of *all* windows, regardless of arrowset
+ */
+ public List windowList = new ArrayList();
/** The group of filers we use for saving.
*/
***************
*** 125,131 ****
public void updateDims() {
for(int i=0; i<dimsIndices.length; i++) dims[i] =
dimList[dimsIndices[i]].d;
}
! public Win other;
public Cell getAccursed() { return cursor; }
public List getCursorColors(Cell c) {
--- 135,165 ----
public void updateDims() {
for(int i=0; i<dimsIndices.length; i++) dims[i] =
dimList[dimsIndices[i]].d;
}
!
! public Win getNext() {
! int i = windowList.indexOf(this) + 1;
! if(i >= windowList.size()) i = 0;
! return (Win)windowList.get(i);
! }
!
! public Win getPrev() {
! int i = windowList.indexOf(this) - 1;
! if(i < 0) i = windowList.size() - 1;
! return (Win)windowList.get(i);
! }
!
! public void close() {
! Win next = getNext();
! if(next == this) {
! // this is last window... XXX
! return;
! }
! if(windows[LEFT] == this) windows[LEFT] = next;
! if(windows[RIGHT] == this) windows[RIGHT] = next;
! windowList.remove(this);
!
! throw new UnsupportedOperationException("Closing not implemented in
GraphicsAPI.Window");
! }
public Cell getAccursed() { return cursor; }
public List getCursorColors(Cell c) {
***************
*** 246,253 ****
*/
windows[0] = new Win(new LightColorScheme(0.233f));
windows[1] = new Win(new LightColorScheme(0.555f));
! windows[0].other = windows[1];
! windows[1].other = windows[0];
windows[0].cursor = start;
windows[1].cursor = start;
--- 280,287 ----
*/
windows[0] = new Win(new LightColorScheme(0.233f));
windows[1] = new Win(new LightColorScheme(0.555f));
! windowList.add(windows[0]);
! windowList.add(windows[1]);
windows[0].cursor = start;
windows[1].cursor = start;
Index: gzz/gzz/view/FallbackBinder.java
diff -c gzz/gzz/view/FallbackBinder.java:1.7
gzz/gzz/view/FallbackBinder.java:1.8
*** gzz/gzz/view/FallbackBinder.java:1.7 Fri Sep 13 07:19:34 2002
--- gzz/gzz/view/FallbackBinder.java Tue Sep 24 14:15:35 2002
***************
*** 40,46 ****
/** Keybindings for the Fallback client.
*/
public class FallbackBinder extends AbstractBinder {
! public static final String rcsid = "$Id: FallbackBinder.java,v 1.7 2002/09/13
11:19:34 benja Exp $";
public static boolean dbg = false;
private static void pa(String s) { System.err.println(s); }
--- 40,46 ----
/** Keybindings for the Fallback client.
*/
public class FallbackBinder extends AbstractBinder {
! public static final String rcsid = "$Id: FallbackBinder.java,v 1.8 2002/09/24
18:15:35 benja Exp $";
public static boolean dbg = false;
private static void pa(String s) { System.err.println(s); }
***************
*** 77,82 ****
--- 77,83 ----
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;
Cell n = dims[dim].s(w.cursor, dir);
***************
*** 84,90 ****
if(dbg) pa("Dir: "+dim+" "+dir+" '"+n+"'");
switch(directOp) {
case NONE: if(n != null) w.cursor = n; break;
! case CONNECT: dims[dim].connect(w.cursor, dir, w.other.cursor); break;
case DISCONNECT: dims[dim].disconnect(w.cursor, dir); break;
case HOP: dims[dim].hop(w.cursor, dir); break;
case NEW: w.cursor = w.cursor.N(dims[dim], dir); break;
--- 85,91 ----
if(dbg) pa("Dir: "+dim+" "+dir+" '"+n+"'");
switch(directOp) {
case NONE: if(n != null) w.cursor = n; break;
! case CONNECT: dims[dim].connect(w.cursor, dir, other.cursor); break;
case DISCONNECT: dims[dim].disconnect(w.cursor, dir); break;
case HOP: dims[dim].hop(w.cursor, dir); break;
case NEW: w.cursor = w.cursor.N(dims[dim], dir); break;
***************
*** 276,289 ****
}
void searchModeKeystroke(String k) {
! if(k.equals("Enter")) { fallback.mode = NORMAL; return; }
if(k.equals("Shift-Enter")) {
fallback.windows[0].cursor = fallback.windows[1].cursor;
fallback.windows[1].cursor = searchStart;
fallback.mode = NORMAL;
return;
}
! if(k.equals("ESC")) {
fallback.windows[1].cursor = searchStart;
fallback.mode = NORMAL;
return;
--- 277,292 ----
}
void searchModeKeystroke(String k) {
! if(k.equals("Enter") || k.equals("Return")) {
! fallback.mode = NORMAL; return;
! }
if(k.equals("Shift-Enter")) {
fallback.windows[0].cursor = fallback.windows[1].cursor;
fallback.windows[1].cursor = searchStart;
fallback.mode = NORMAL;
return;
}
! if(k.equals("Escape")) {
fallback.windows[1].cursor = searchStart;
fallback.mode = NORMAL;
return;
Index: gzz/gzz/view/LastOpDecorator.java
diff -c gzz/gzz/view/LastOpDecorator.java:1.6
gzz/gzz/view/LastOpDecorator.java:1.7
*** gzz/gzz/view/LastOpDecorator.java:1.6 Sun Sep 22 14:46:32 2002
--- gzz/gzz/view/LastOpDecorator.java Tue Sep 24 14:15:35 2002
***************
*** 32,38 ****
* directional op entered.
*/
public class LastOpDecorator implements FallbackSceneDecorator {
! String rcsid = "$Id: LastOpDecorator.java,v 1.6 2002/09/22 18:46:32 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.7 2002/09/24 18:15:35 benja Exp
$";
public static boolean dbg = false;
private static void pa(String s) { System.err.println(s); }
***************
*** 45,50 ****
--- 45,59 ----
int padding = 15;
public void render(VobScene sc, int into, Fallback fallback, Fallback.Win
win) {
+ Fallback.Win other;
+ if(win == fallback.windows[fallback.LEFT])
+ other = fallback.windows[fallback.RIGHT];
+ else if(win == fallback.windows[fallback.RIGHT])
+ other = fallback.windows[fallback.LEFT];
+ else
+ return; // command doesn't apply to this window...
+ // hmm... should we still show something?
+
Dimension size = sc.getSize();
HChain ch = new LinebreakableChain();
***************
*** 57,63 ****
case FallbackBinder.NONE: return;
case FallbackBinder.CONNECT:
ch.addBox(text("Connect [where?] to "));
! ch.addBox(cell(win.other.cursor, win));
break;
case FallbackBinder.DISCONNECT:
ch.addBox(text("Break [which connection?]")); break;
--- 66,72 ----
case FallbackBinder.NONE: return;
case FallbackBinder.CONNECT:
ch.addBox(text("Connect [where?] to "));
! ch.addBox(cell(other.cursor, win));
break;
case FallbackBinder.DISCONNECT:
ch.addBox(text("Break [which connection?]")); break;
- [Gzz-commits] gzz/gzz client/Fallback.java view/FallbackBinde...,
Benja Fallenstein <=