home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2001 December / dppcpro1201.iso / Extras / maple / Viewer / WebEQ / MMLViewerInstall.cab / MMLViewerApplet.cab / webeq3 / schema / MFenced.class (.txt) < prev    next >
Encoding:
Java Class File  |  2001-05-24  |  2.4 KB  |  115 lines

  1. package webeq3.schema;
  2.  
  3. import java.util.Vector;
  4. import webeq3.app.Equation;
  5. import webeq3.util.OutputHandler;
  6.  
  7. public class MFenced extends MRow {
  8.    Vector children_orig = null;
  9.  
  10.    public MFenced(Box var1) {
  11.       super(var1);
  12.       super.type = 68;
  13.    }
  14.  
  15.    public MFenced() {
  16.       super.type = 68;
  17.    }
  18.  
  19.    public MFenced(Equation var1) {
  20.       super(var1);
  21.       super.type = 68;
  22.    }
  23.  
  24.    public void size() {
  25.       if (super.attributes[42] != null) {
  26.          super.attribute_stack[42].pop();
  27.       }
  28.  
  29.       if (super.attributes[43] != null) {
  30.          super.attribute_stack[43].pop();
  31.       }
  32.  
  33.       if (super.attributes[52] != null) {
  34.          super.attribute_stack[52].pop();
  35.       }
  36.  
  37.       super.fgcolor = ((Box)this).resolveColor(4);
  38.       super.bgcolor = ((Box)this).resolveColor(17);
  39.       super.atomic = false;
  40.       if (this.children_orig == null) {
  41.          this.children_orig = super.children;
  42.          super.children = new Vector();
  43.          String var1 = ((Box)this).getAttributeByIndex(42);
  44.          MO var2 = new MO(this);
  45.          ((Box)var2).addData(var1);
  46.          ((Box)this).addChild(var2);
  47.          var1 = ((Box)this).getAttributeByIndex(52);
  48.          int var3 = var1.length();
  49.          Object var4 = null;
  50.          Object var5 = null;
  51.  
  52.          for(int var6 = 0; var6 < this.children_orig.size() - 1; ++var6) {
  53.             Box var10 = (Box)this.children_orig.elementAt(var6);
  54.             var10.setParent(this);
  55.             ((Box)this).addChild(var10);
  56.             if (var3 > 0) {
  57.                MO var12 = new MO(this);
  58.                if (var6 < var3) {
  59.                   ((Box)var12).addData(var1.substring(var6, var6 + 1));
  60.                } else {
  61.                   ((Box)var12).addData(var1.substring(var3 - 1));
  62.                }
  63.  
  64.                ((Box)this).addChild(var12);
  65.             }
  66.          }
  67.  
  68.          if (this.children_orig.size() > 0) {
  69.             Box var11 = (Box)this.children_orig.elementAt(this.children_orig.size() - 1);
  70.             var11.setParent(this);
  71.             ((Box)this).addChild(var11);
  72.          }
  73.  
  74.          var1 = ((Box)this).getAttributeByIndex(43);
  75.          MO var7 = new MO(this);
  76.          ((Box)var7).addData(var1);
  77.          ((Box)this).addChild(var7);
  78.       }
  79.  
  80.       super.size();
  81.    }
  82.  
  83.    public void position() {
  84.       if (super.attributes[42] != null) {
  85.          super.attribute_stack[42].push(super.attributes[42]);
  86.       }
  87.  
  88.       if (super.attributes[43] != null) {
  89.          super.attribute_stack[43].push(super.attributes[43]);
  90.       }
  91.  
  92.       if (super.attributes[52] != null) {
  93.          super.attribute_stack[52].push(super.attributes[52]);
  94.       }
  95.  
  96.       super.position();
  97.    }
  98.  
  99.    public void printSelected(String var1, OutputHandler var2, boolean var3, boolean var4, String var5, boolean var6, int var7) {
  100.       if (var3 && !super.reverse_video) {
  101.          for(int var9 = 0; var9 < super.children.size(); ++var9) {
  102.             ((Box)this).getChild(var9).printSelected(var1, var2, var3, var4, var5, var6, var7);
  103.          }
  104.       } else if (var6 && super.cpeer != null) {
  105.          super.cpeer.printSelected(var1, var2, var3, var4, var5, var6, var7);
  106.       } else {
  107.          Vector var8 = super.children;
  108.          super.children = this.children_orig;
  109.          super.printSelected(var1, var2, var3, var4, var5, var6, var7);
  110.          super.children = var8;
  111.       }
  112.  
  113.    }
  114. }
  115.