2
* =========================================================================
3
* This file is originally part of the JMathTeX Library - http://jmathtex.sourceforge.net
5
* Copyright (C) 2004-2007 Universiteit Gent
6
* Copyright (C) 2009 DENIZET Calixte
8
* This program is free software; you can redistribute it and/or modify
9
* it under the terms of the GNU General Public License as published by
10
* the Free Software Foundation; either version 2 of the License, or (at
11
* your option) any later version.
13
* This program is distributed in the hope that it will be useful, but
14
* WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
* General Public License for more details.
18
* A copy of the GNU General Public License can be found in the file
19
* LICENSE.txt provided with the source distribution of this program (see
20
* the META-INF directory in the source jar). This license can also be
21
* found on the GNU website at http://www.gnu.org/licenses/gpl.html.
23
* If you did not receive a copy of the GNU General Public License along
24
* with this program, contact the lead developer, or write to the Free
25
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
30
package org.scilab.forge.jlatexmath;
33
* An atom representing another atom that should be drawn invisibly.
35
public class PhantomAtom extends Atom implements Row {
37
// RowAtom to be drawn invisibly
38
private RowAtom elements;
40
// dimensions to be taken into account
41
private boolean w = true, h = true, d = true;
43
public PhantomAtom(Atom el) {
45
elements = new RowAtom();
47
elements = new RowAtom(el);
50
public PhantomAtom(Atom el, boolean width, boolean height, boolean depth) {
57
public Box createBox(TeXEnvironment env) {
58
Box res = elements.createBox(env);
59
return new StrutBox((w ? res.getWidth() : 0), (h ? res.getHeight() : 0),
60
(d ? res.getDepth() : 0), res.getShift());
63
public int getLeftType() {
64
return elements.getLeftType();
67
public int getRightType() {
68
return elements.getRightType();
71
public void setPreviousAtom(Dummy prev) {
72
elements.setPreviousAtom(prev);