/[fenfire]/fenfire/org/fenfire/fenmm/MMTextCursor.java
ViewVC logotype

Diff of /fenfire/org/fenfire/fenmm/MMTextCursor.java

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

revision 1.1 by humppake, Wed Aug 20 06:11:37 2003 UTC revision 1.2 by humppake, Sun Aug 24 09:19:57 2003 UTC
# Line 10  package org.fenfire.fenmm; Line 10  package org.fenfire.fenmm;
10  import org.nongnu.libvob.VobScene;  import org.nongnu.libvob.VobScene;
11  import org.nongnu.libvob.TextStyle;  import org.nongnu.libvob.TextStyle;
12  import org.nongnu.libvob.vobs.LineVob;  import org.nongnu.libvob.vobs.LineVob;
13    import org.fenfire.swamp.MultiplexerNodeFunction;
14    
15  import org.nongnu.libvob.lava.placeable.TextPlaceable;  import org.nongnu.libvob.lava.placeable.TextPlaceable;
16    
17  import java.awt.Color;  import java.awt.Color;
18    import java.util.HashSet;
19    
20  public class MMTextCursor {  public class MMTextCursor {
21      public static final String rcsid = "";      public static final String rcsid = "";
# Line 43  public class MMTextCursor { Line 45  public class MMTextCursor {
45      }      }
46    
47      public void setAccursed(Object node) { accursed = node; offset = 0; }      public void setAccursed(Object node) { accursed = node; offset = 0; }
48    
49        /** unnecessary
50        public HashSet setAccursed(Object node, MultiplexerNodeFunction multiplexer) {
51            HashSet set = new HashSet();
52            set.add(node);
53            setAccursed(node);
54            if (multiplexer != null) multiplexer.setMultiplexerNodes(set);
55            return set;
56        }
57        */
58    
59      public Object getAccursed() { return accursed; }      public Object getAccursed() { return accursed; }
60      public int setOffset(int offset) { this.offset = offset; return this.offset; }      public int setOffset(int offset) { this.offset = offset; return this.offset; }
61      public int setOffset(float x, float y) throws NotYetRenderedException {      public int setOffset(float x, float y) throws NotYetRenderedException {
# Line 124  public class MMTextCursor { Line 137  public class MMTextCursor {
137          this.length = 0;          this.length = 0;
138      }      }
139    
140      public void render(VobScene vs, int rootCS, TextPlaceable p) {      public void render(VobScene vs, int into, TextPlaceable p) {
141            render(vs, into, 0, p);
142        }
143        public void render(VobScene vs, int matchCS, int zoomPanCS, TextPlaceable p) {
144          setTextPlaceable(p);          setTextPlaceable(p);
145    
         int nodeCS = vs.matcher.getCS(accursed);  
         float nodeXY[] = {0f, 0f, 0f};  
         vs.coords.transformPoints3(nodeCS, nodeXY, nodeXY);  
           
146          float cursorXY[] = new float[2];          float cursorXY[] = new float[2];
147          this.p.getCursorXY(offset, cursorXY);          this.p.getCursorXY(offset, cursorXY);
148    
149          int cursorCS = vs.orthoCS(rootCS, "CURSOR", -1000,          int nodeCS;
150                                    nodeXY[0] + cursorXY[0],          int cursorCS;
151                                    nodeXY[1] + cursorXY[1],          if (zoomPanCS > 0) {
152                                    1, -style.getHeight(scale));              cursorCS = vs.coords.ortho(zoomPanCS, -1000,
153                                               -p.getWidth()/2 + cursorXY[0],
154                                               -p.getHeight()/2 + cursorXY[1],
155                                               1, -style.getHeight(scale));
156                vs.matcher.add(matchCS, cursorCS, "CURSOR");
157            } else {
158                nodeCS = vs.matcher.getCS(accursed);
159                float nodeXY[] = {0f, 0f, 0f};
160                vs.coords.transformPoints3(nodeCS, nodeXY, nodeXY);
161            
162                cursorCS = vs.orthoCS(matchCS, "CURSOR", -1000,
163                                          nodeXY[0] + cursorXY[0],
164                                          nodeXY[1] + cursorXY[1],
165                                          1, -style.getHeight(scale));
166            }
167          vs.put(new LineVob(0,0,0,1, color), cursorCS);          vs.put(new LineVob(0,0,0,1, color), cursorCS);
168      }      }
169    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

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