/[gzz]/gzz/gzz/modules/pp/PPMouseEvents.java
ViewVC logotype

Diff of /gzz/gzz/modules/pp/PPMouseEvents.java

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

revision 1.12 by mudyc, Fri Jan 3 08:59:18 2003 UTC revision 1.13 by mudyc, Fri Jan 3 09:55:55 2003 UTC
# Line 24  import java.awt.event.*; Line 24  import java.awt.event.*;
24    
25    
26    
27  /** Event handling, event objects..  /** Executes something for PP when in specified coordsystem a mouse event turns up.
28   */   */
29    
30  public class PPMouseEvents {  public class PPMouseEvents {
# Line 96  public static final String rcsid = "$Id$ Line 96  public static final String rcsid = "$Id$
96              m_ev.hit = null;              m_ev.hit = null;
97    
98    
99                pa("king: " +kingCS+" getCS"+p_state.getCS() );
100    
101              // KLUDGE!!!              // KLUDGE!!!
102              // there are no good way in gzz to handle events :/              // there are no good way in gzz to handle events :/
103              if (p_state.getCS() == kingCS) {              if (p_state.getCS() == kingCS && notEmptyFrame(kingCS, p_state)) {
104                  if(notEmptyFrame(kingCS, p_state)) {                  m_ev.hit = new float[3];
105                      m_ev.hit = new float[3];                  int objCS = getTouchedCS(kingCS, p_state, m_ev.hit);
106                      int objCS = getTouchedCS(kingCS, p_state, m_ev.hit);                      
107                    Object k = vs.matcher.getKey(objCS);
108                      Object k = vs.matcher.getKey(objCS);                  if (k == null) {
109                      if (k == null) {                      pa("NULLLI!!");
110                          pa("NULLLI!!");                      return;
111                          return;                  }
                     }  
   
                     pa("Hit: "+objCS+" "+k+" "+m_ev.hit[0]+" "+m_ev.hit[1]);  
                     if(!(k instanceof Cell)) {  
                         pa("Not a cell?!");  
                         return ;  
                     }  
                     m_ev.accursed_obj = (Cell)k;  
                     m_ev.orig_obj_pt = getNoteXY(m_ev.accursed_obj);  
112    
113                      context.setAccursed((Cell)k);                  pa("Hit: "+objCS+" "+k+" "+m_ev.hit[0]+" "+m_ev.hit[1]);
114                      context.setCursorOffset(ppv.style.getOffsetInText(((Cell)k).t(), 1, hit[0]));                  if(!(k instanceof Cell)) {
115                        pa("Not a cell?!");
116                        return ;
117                  }                  }
118                    m_ev.accursed_obj = (Cell)k;
119                    m_ev.orig_obj_pt = getNoteXY(m_ev.accursed_obj);
120    
121                    context.setAccursed((Cell)k);
122                    context.setCursorOffset(ppv.style.getOffsetInText(((Cell)k).t(), 1, hit[0]));
123              }              }
124          }          }
125      }      }
126    
127            
128    
129    
# Line 250  public static final String rcsid = "$Id$ Line 251  public static final String rcsid = "$Id$
251                  float[] pt = new float[] { ev.getX(), ev.getY(), 0 };                  float[] pt = new float[] { ev.getX(), ev.getY(), 0 };
252    
253                  // We must transform into Frame, and then the C2F coordinate system                  // We must transform into Frame, and then the C2F coordinate system
254                  int frame = ((DefaultVobMatcher)vs.matcher).getCS(mainctrCS, "frame");                  int frame = ((DefaultVobMatcher)vs.matcher).getCS(mainctrCS, "MAINVP");
255                  int c2f = ((DefaultVobMatcher)vs.matcher).getCS(mainctrCS, "C2F");                  int c2f = ((DefaultVobMatcher)vs.matcher).getCS(frame, "C2F");
256                  if(frame < 0 || c2f < 0)                  if(frame < 0 || c2f < 0)
257                      throw new Error("No cs point!"+frame+" "+c2f);                      throw new Error("No cs point!"+frame+" "+c2f);
258                  // XXX vp, not frame!                  // XXX vp, not frame!

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13

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