home *** CD-ROM | disk | FTP | other *** search
- package webeq3.schema;
-
- import java.awt.Color;
- import java.awt.Graphics;
- import webeq3.app.Equation;
-
- public class MRow extends MStyle {
- private int stretch_ascent = 0;
- private int stretch_descent = 0;
-
- public MRow() {
- super.type = 68;
- super.kind = 3;
- }
-
- public MRow(Box var1) {
- super(var1);
- super.type = 68;
- super.kind = 3;
- }
-
- public MRow(Equation var1) {
- super(var1);
- super.type = 68;
- super.kind = 3;
- }
-
- public void paint(Graphics var1, int var2, int var3) {
- super.paint(var1, var2, var3);
- int var4 = super.my_view.offsetx;
- int var5 = super.my_view.offsety;
- if (super.syntax_info != null && ((Box)this).getNumChildren() > 1 && (((Box)this).getNumChildren() != 3 || !(((Box)this).getChild(0) instanceof MO) || !"(".equals(((Box)this).getChild(0).udata) || !(((Box)this).getChild(2) instanceof MO) || !")".equals(((Box)this).getChild(2).udata))) {
- var1.setColor(Color.lightGray.darker());
- var1.drawRect(super.absleft + var4, super.abstop + var5, super.width - 1, super.height - 1);
- }
-
- }
-
- public void position() {
- int var2 = 0;
- byte var3 = 0;
- int var4 = super.children.size();
- ((Box)this).setfont(super.depth);
- int var5 = 2 * super.fm.charWidth('x');
-
- for(int var6 = 0; var6 < var4; ++var6) {
- Box var1 = ((Box)this).getChild(var6);
- var1.setLeft(var2);
- var1.setTop(super.ascent - var1.getAscent() + var3);
- var2 += var1.getWidth();
- }
-
- }
-
- public void size() {
- super.fgcolor = ((Box)this).resolveColor(4);
- super.bgcolor = ((Box)this).resolveColor(17);
- int var3 = super.children.size();
- this.stretch_ascent = 0;
- this.stretch_descent = var3 > 0 ? -10000 : 0;
- if (var3 > 0) {
- super.descent = -10000;
- }
-
- for(int var4 = 0; var4 < var3; ++var4) {
- Box var1 = ((Box)this).getChild(var4);
- var1.depth = super.depth;
- var1.layout();
- Box var2 = var1;
- if (var1.embellished_op) {
- while(((Box)this).base_check(var2)) {
- var2 = var2.getChild(0);
- }
- }
-
- if (this.stretch_ascent < var2.getAscent()) {
- this.stretch_ascent = var2.getAscent();
- }
-
- if (this.stretch_descent < var2.getDescent()) {
- this.stretch_descent = var2.getDescent();
- }
-
- if (super.ascent < var1.getAscent()) {
- super.ascent = var1.getAscent();
- }
-
- if (super.descent < var1.getDescent()) {
- super.descent = var1.getDescent();
- }
-
- super.width += var1.getWidth();
- }
-
- if (super.syntax_info != null) {
- ++super.descent;
- ++super.width;
- }
-
- super.height = super.ascent + super.descent;
- int var5 = 0;
- int var6 = 0;
-
- for(int var7 = 0; var7 < var3; ++var7) {
- Box var8 = ((Box)this).getChild(var7);
- if (var8.is_spacelike) {
- ++var5;
- }
-
- if (var8.embellished_op) {
- ++var6;
- }
- }
-
- if (var5 == var3) {
- super.is_spacelike = true;
- }
-
- if (var5 == var3 - 1 && var6 == 1) {
- super.embellished_op = true;
- }
-
- ((Box)this).stretchTo(this.stretch_ascent, this.stretch_descent);
- switch (var3) {
- case 0:
- super.atomic = true;
- break;
- case 1:
- Box var9 = ((Box)this).getChild(0);
- super.italic = var9.isItalic();
- super.atomic = var9.isAtomic();
- break;
- default:
- super.atomic = false;
- }
-
- }
- }
-