| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
|
| 17 | |
|
| 18 | |
|
| 19 | |
package net.sourceforge.jeuclid.elements.presentation.script; |
| 20 | |
|
| 21 | |
import net.sourceforge.jeuclid.LayoutContext; |
| 22 | |
import net.sourceforge.jeuclid.elements.JEuclidElement; |
| 23 | |
import net.sourceforge.jeuclid.layout.LayoutInfo; |
| 24 | |
import net.sourceforge.jeuclid.layout.LayoutStage; |
| 25 | |
import net.sourceforge.jeuclid.layout.LayoutView; |
| 26 | |
|
| 27 | |
import org.apache.batik.dom.AbstractDocument; |
| 28 | |
import org.w3c.dom.mathml.MathMLScriptElement; |
| 29 | |
|
| 30 | |
|
| 31 | |
|
| 32 | |
|
| 33 | |
|
| 34 | |
|
| 35 | |
|
| 36 | |
|
| 37 | |
|
| 38 | 0 | public abstract class AbstractSubSuper extends AbstractScriptElement implements |
| 39 | |
MathMLScriptElement { |
| 40 | |
|
| 41 | |
|
| 42 | |
|
| 43 | |
|
| 44 | |
|
| 45 | |
|
| 46 | |
|
| 47 | |
|
| 48 | |
|
| 49 | |
public AbstractSubSuper(final String qname, final AbstractDocument odoc) { |
| 50 | 7524 | super(qname, odoc); |
| 51 | 7524 | } |
| 52 | |
|
| 53 | |
|
| 54 | |
public abstract JEuclidElement getBase(); |
| 55 | |
|
| 56 | |
|
| 57 | |
public abstract JEuclidElement getSuperscript(); |
| 58 | |
|
| 59 | |
|
| 60 | |
public abstract JEuclidElement getSubscript(); |
| 61 | |
|
| 62 | |
|
| 63 | |
@Override |
| 64 | |
public boolean hasChildPostscripts(final JEuclidElement child, |
| 65 | |
final LayoutContext context) { |
| 66 | 0 | return child.isSameNode(this.getBase()); |
| 67 | |
} |
| 68 | |
|
| 69 | |
|
| 70 | |
@Override |
| 71 | |
protected void layoutStageInvariant(final LayoutView view, |
| 72 | |
final LayoutInfo info, final LayoutStage stage, |
| 73 | |
final LayoutContext context) { |
| 74 | 2299 | ScriptSupport.layout(view, info, stage, this |
| 75 | |
.applyLocalAttributesToContext(context), this, this.getBase(), |
| 76 | |
this.getSubscript(), this.getSuperscript(), this |
| 77 | |
.getSubscriptshift(), this.getSuperscriptshift()); |
| 78 | 2299 | } |
| 79 | |
} |