Back to index

wims  3.65+svn20090927
Public Member Functions | Protected Attributes | Package Attributes
rene.zirkel.tools.BreakpointAnimator Class Reference
Inheritance diagram for rene.zirkel.tools.BreakpointAnimator:
Inheritance graph
[legend]
Collaboration diagram for rene.zirkel.tools.BreakpointAnimator:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 BreakpointAnimator ()
void mousePressed (MouseEvent e, ZirkelCanvas zc)
synchronized void reset (ZirkelCanvas zc)
void showStatus (ZirkelCanvas zc)
void save (XmlWriter xml)
void run ()
synchronized void invalidate (ZirkelCanvas zc)
boolean useSmartBoard ()
void increaseSpeed ()
void decreaseSpeed ()
void setSpeed (long delay)
void setLoop (boolean flag)
void mouseReleased (MouseEvent e, ZirkelCanvas zc)
void mouseDragged (MouseEvent e, ZirkelCanvas zc)
void mouseMoved (MouseEvent e, ZirkelCanvas zc, boolean simple)
void finishConstruction (MouseEvent e, ZirkelCanvas zc)
boolean waitForLastPoint ()
boolean waitForPoint ()
void resetFirstTime (ZirkelCanvas zc)
boolean construct (XmlTree tree, Construction c) throws ConstructionException
void construct (Construction c, String name, String params[], int nparams) throws ConstructionException
boolean testTree (XmlTree t, String tag)
void setName (XmlTag tag, ConstructionObject o)
void set (XmlTree tree, ConstructionObject o) throws ConstructionException
void setConditionals (XmlTree tree, Construction c, ConstructionObject o)
String getTag ()
void pause (boolean flag)

Protected Attributes

boolean Dragging = false

Package Attributes

MyVector Breaks
ZirkelCanvas ZC
boolean Loop = false
boolean Running = false
boolean Stopped = false
long SleepTime = 1024

Detailed Description

Definition at line 13 of file BreakpointAnimator.java.


Constructor & Destructor Documentation

Definition at line 19 of file BreakpointAnimator.java.

       {      Breaks=new MyVector();
       }

Member Function Documentation

void rene.zirkel.constructors.ObjectConstructor.construct ( Construction  c,
String  name,
String  params[],
int  nparams 
) throws ConstructionException [inline, inherited]

Definition at line 150 of file BreakpointAnimator.java.

       {      if (SleepTime==1) return;
              SleepTime=SleepTime/2;
       }
void rene.zirkel.constructors.ObjectConstructor.finishConstruction ( MouseEvent  e,
ZirkelCanvas  zc 
) [inline, inherited]
String rene.zirkel.constructors.ObjectConstructor.getTag ( ) [inline, inherited]

Definition at line 145 of file BreakpointAnimator.java.

       {      if (SleepTime>=32000) return;
              SleepTime=SleepTime*2;
       }

Reimplemented from rene.zirkel.constructors.ObjectConstructor.

Definition at line 136 of file BreakpointAnimator.java.

       {      Stopped=true;
              ZC.paintUntil(null);
       }

Here is the call graph for this function:

void rene.zirkel.constructors.ObjectConstructor.mouseDragged ( MouseEvent  e,
ZirkelCanvas  zc 
) [inline, inherited]
void rene.zirkel.constructors.ObjectConstructor.mouseMoved ( MouseEvent  e,
ZirkelCanvas  zc,
boolean  simple 
) [inline, inherited]
void rene.zirkel.tools.BreakpointAnimator.mousePressed ( MouseEvent  e,
ZirkelCanvas  zc 
) [inline]

Reimplemented from rene.zirkel.constructors.ObjectConstructor.

Definition at line 23 of file BreakpointAnimator.java.

       {      double x=zc.x(e.getX()),y=zc.y(e.getY());
              ZC=zc;
              if (Running)
              {      if (e.isShiftDown())
                            Loop=!Loop;
                     else
                     {      Stopped=true;
                            zc.paintUntil(null);
                     }
              }
              else
              {      reset(zc);
              }
       }

Here is the call graph for this function:

void rene.zirkel.constructors.ObjectConstructor.mouseReleased ( MouseEvent  e,
ZirkelCanvas  zc 
) [inline, inherited]
void rene.zirkel.constructors.ObjectConstructor.pause ( boolean  flag) [inline, inherited]

Reimplemented in rene.zirkel.tools.ObjectTracker.

Definition at line 216 of file ObjectConstructor.java.

       {
       }

Here is the caller graph for this function:

synchronized void rene.zirkel.tools.BreakpointAnimator.reset ( ZirkelCanvas  zc) [inline]

Reimplemented from rene.zirkel.constructors.ObjectConstructor.

Definition at line 39 of file BreakpointAnimator.java.

       {      super.reset(zc);
              ZC=zc;
              showStatus(zc);
              if (Running)
              {      Stopped=true;
                     zc.paintUntil(null);
              }
              else
              {      Stopped=false;
                     new Thread(this).start();
              }
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Reimplemented in rene.zirkel.tools.MoverTool.

Definition at line 56 of file ObjectConstructor.java.

       {      reset(zc);
       }

Here is the call graph for this function:

Definition at line 68 of file BreakpointAnimator.java.

       {      ZC.getConstruction().setOriginalOrder(true);
              Running=true;
              Breaks=new MyVector();
              Enumeration e=ZC.getConstruction().elements();
              while (e.hasMoreElements())
              {      ConstructionObject o=(ConstructionObject)e.nextElement();
                     if (o.isBreak()) Breaks.addElement(o);
              }
              Object H[]=Breaks.getArray();
              int N=0;
              if (Breaks.size()==0)
              {      Running=false;
                     ZC.getConstruction().setOriginalOrder(false);
                     return;
              }
              ConstructionObject O=(ConstructionObject)H[0];
              boolean forward=true;
              while (!Stopped)
              {      if (!Stopped) ZC.paintUntil(O);
                     try
                     {      Thread.sleep(SleepTime); 
                     }
                     catch (Exception ex) {      }             
                     if (Stopped) break;
                     if (Loop)
                     {      if (forward)
                            {      if (N<Breaks.size()-1)
                                   {      N++;
                                          O=(ConstructionObject)H[N];                             
                                   }
                                   else if (N==Breaks.size()-1)
                                   {      N++;
                                          forward=false;
                                          O=null;
                                   }
                            }
                            else
                            {      if (N>0)
                                   {      N--;
                                          O=(ConstructionObject)H[N];
                                   }
                                   else
                                   {      N=1;
                                          O=(ConstructionObject)H[N];
                                          forward=true;
                                   }
                            }
                     }
                     else
                     {      if (N<Breaks.size()-1)
                            {      N++;
                                   O=(ConstructionObject)H[N];
                            }
                            else if (N==Breaks.size()-1)
                            {      N++;
                                   O=null;
                            }
                            else
                            {      N=0;
                                   O=(ConstructionObject)H[N];
                            }
                     }
              }
              Running=false;
              ZC.getConstruction().setOriginalOrder(false);
       }

Here is the call graph for this function:

Definition at line 58 of file BreakpointAnimator.java.

       {      xml.startTagStart("AnimateBreakpoints"); 
              xml.printArg("time",""+SleepTime);
              if (Loop) xml.printArg("loop","true"); 
              xml.finishTagNewLine(); 
       }

Here is the call graph for this function:

Definition at line 76 of file ObjectConstructor.java.

       {      XmlTag tag=tree.getTag();
              if (tag.hasParam("n"))
              {      try
                     {      o.setNCount(new Integer(tag.getValue("n")).intValue());
                            o.setGotNCount(true);
                     }
                     catch (Exception ex)
                     {      throw new ConstructionException("Illegal count!");
                     }
              }
              if (tag.hasParam("hidden"))
              {      if (tag.getValue("hidden").equals("super")) o.setSuperHidden(true);
                     else o.setHidden(true);
              }
              if (tag.hasTrueParam("showvalue"))
              {      o.setShowValue(true);
              }
              if (tag.hasTrueParam("showname"))
              {      o.setShowName(true);
              }
              if (tag.hasTrueParam("background"))
              {      o.setBack(true);
              }
              else o.setBack(false);
              if (tag.hasTrueParam("parameter"))
              {      o.setParameter();
              }
              if (tag.hasTrueParam("mainparameter"))
              {      o.setMainParameter();
              }
              if (tag.hasTrueParam("target"))
              {      o.setTarget(true);
              }
              if (tag.hasTrueParam("break"))
              {      o.setBreak(true);
              }
              if (tag.hasTrueParam("hidebreak"))
              {      o.setHideBreak(true);
              }
              if (tag.hasTrueParam("solid"))
              {      o.setSolid(true);
              }
              if (tag.hasTrueParam("bold"))
              {      o.setBold(true);
              }
              if (tag.hasTrueParam("large"))
              {      o.setLarge(true);
              }
              if (tag.hasParam("xoffset") || tag.hasParam("yoffset"))
              {      int x=0,y=0;
                     try
                     {      if (tag.hasParam("xoffset"))
                                   x=Integer.parseInt(tag.getValue("xoffset"));
                            if (tag.hasParam("yoffset"))
                                   y=Integer.parseInt(tag.getValue("yoffset"));
                            o.setOffset(x,y);
                     }
                     catch (Exception e)
                     {      throw new ConstructionException("Illegal offset value");
                     }
              }
              if (tag.hasTrueParam("keepclose"))
              {      o.setKeepClose(true);
              }
              if (tag.hasParam("xcoffset") || tag.hasParam("ycoffset"))
              {      double x=0,y=0;
                     try
                     {      if (tag.hasParam("xcoffset"))
                                   x=new Double(tag.getValue("xcoffset")).doubleValue();
                            if (tag.hasParam("ycoffset"))
                                   y=new Double(tag.getValue("ycoffset")).doubleValue();
                            o.setcOffset(x,y);
                     }
                     catch (Exception e)
                     {      throw new ConstructionException("Illegal offset value");
                     }
              }
              if (tag.hasParam("color"))
              {      try
                     {      String s=tag.getValue("color");
                            int n=-1;
                            for (int i=0; i<ZirkelFrame.ColorStrings.length; i++)
                            {      if (s.equals(ZirkelFrame.ColorStrings[i]))
                                   {      o.setColor(i); n=i; break;
                                   }
                            }
                            if (n<0)
                            {      n=Integer.parseInt(s);
                                   if (n<0 || n>=ZirkelFrame.Colors.length)
                                          throw new Exception("");
                                   o.setColor(n);
                            }
                     }
                     catch (Exception ex)
                     {      throw new ConstructionException("Illegal color index (1-"+
                                   (ZirkelFrame.Colors.length-1)+")");
                     }
              }
              if (tag.hasParam("type"))
              {      String type=tag.getValue("type");
                     if (type.equals("thick")) o.setColorType(ConstructionObject.THICK);
                     if (type.equals("thin")) o.setColorType(ConstructionObject.THIN);
                     if (type.equals("invisible")) o.setColorType(ConstructionObject.INVISIBLE);
              }
              if (tag.hasParam("unit"))
                     o.setUnit(tag.getValue("unit"));
              else
                     o.setUnit("");
              Enumeration e=tree.getContent();
              while (e.hasMoreElements())
              {      tree=(XmlTree)e.nextElement();
                     if (tree.getTag() instanceof XmlTagText)
                     {      o.setText(((XmlTagText)tree.getTag()).getContent(),true);
                     }
              }
       }

Here is the call graph for this function:

Definition at line 194 of file ObjectConstructor.java.

       {      o.clearConditionals();
              int i=0;
              XmlTag tag=tree.getTag();
              while (tag.hasParam("ctag"+i) && tag.hasParam("cexpr"+i))
              {      String t=tag.getValue("ctag"+i);
                     String e=tag.getValue("cexpr"+i);
                     Expression ex=new Expression(e,c,o);
                     o.addConditional(t,ex);
                     i++;
              }
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 159 of file BreakpointAnimator.java.

       {      Loop=flag;
       }

Definition at line 68 of file ObjectConstructor.java.

       {      if (tag.hasParam("name"))
              {      o.setName(tag.getValue("name"));
              }
              if (tag.hasParam("alias"))
              {      o.setAlias(tag.getValue("alias"));
              }
       }

Here is the call graph for this function:

Here is the caller graph for this function:

void rene.zirkel.tools.BreakpointAnimator.setSpeed ( long  delay) [inline]

Definition at line 155 of file BreakpointAnimator.java.

       {      SleepTime=delay;
       }

Reimplemented from rene.zirkel.constructors.ObjectConstructor.

Definition at line 53 of file BreakpointAnimator.java.

       {      zc.showStatus(
                     Zirkel.name("message.animatebreak"));
       }

Here is the call graph for this function:

Here is the caller graph for this function:

boolean rene.zirkel.constructors.ObjectConstructor.testTree ( XmlTree  t,
String  tag 
) [inline, inherited]

Definition at line 65 of file ObjectConstructor.java.

       {      return t.getTag().name().equals(tag);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Reimplemented from rene.zirkel.constructors.ObjectConstructor.

Definition at line 141 of file BreakpointAnimator.java.

       {      return false;
       }

Member Data Documentation

Definition at line 15 of file BreakpointAnimator.java.

Reimplemented in rene.zirkel.tools.ZoomerTool, and rene.zirkel.tools.DrawerTool.

Definition at line 15 of file ObjectConstructor.java.

Definition at line 17 of file BreakpointAnimator.java.

Definition at line 65 of file BreakpointAnimator.java.

Definition at line 66 of file BreakpointAnimator.java.

Definition at line 65 of file BreakpointAnimator.java.

Definition at line 16 of file BreakpointAnimator.java.


The documentation for this class was generated from the following file: