Back to index

wims  3.65+svn20090927
WidthDepthProcessor.java
Go to the documentation of this file.
00001 /*
00002 $Id: WidthDepthProcessor.java,v 1.3 2003/02/18 11:48:47 sander Exp $
00003 */
00004 
00005 
00006 /*
00007 Copyright (C) 2001-2002 Mainline Project (I3S - ESSI - CNRS -UNSA)
00008 
00009 This library is free software; you can redistribute it and/or
00010 modify it under the terms of the GNU Lesser General Public
00011 License as published by the Free Software Foundation; either
00012 version 2.1 of the License, or (at your option) any later version.
00013 
00014 This library is distributed in the hope that it will be useful,
00015 but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017 Lesser General Public License for more details.
00018 
00019 You should have received a copy of the GNU Lesser General Public
00020 License along with this library; if not, write to the Free Software
00021 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00022 
00023 For further information on the GNU Lesser General Public License,
00024 see: http://www.gnu.org/copyleft/lesser.html
00025 For further information on this library, contact: mainline@essi.fr
00026 */
00027 
00028 
00029 package fr.ove.openmath.jome.model.processor;
00030 
00031 import fr.ove.openmath.jome.model.*;
00032 import fr.ove.openmath.jome.model.events.*;
00033 import java.util.*;
00034 
00050 public class WidthDepthProcessor extends ProcessorImpl implements WidthProcessorInterface, DepthProcessorInterface {
00054     private DepthProcessor depth;
00055     
00059     private WidthProcessor width;
00060     
00061     
00066     public WidthDepthProcessor(Formula formula) {
00067         super(formula);
00068         depth = new DepthProcessor(formula);
00069         width = new WidthProcessor(formula);
00070     }
00071     
00075     public void doProcess() {
00076         Formula formula = getFormula();
00077         
00078         if (formula != null) {
00079             width.setProcessingId(getProcessingId());
00080             width.doProcess();
00081             depth.setProcessingId(getProcessingId());
00082             depth.doProcess();
00083             
00084             /*
00085             switch (getProcessingId()) {
00086                 case COMPUTE :
00087                     width.setProcessingId(COMPUTE);
00088                     width.doProcess();
00089                     depth.setProcessingId(COMPUTE);
00090                     depth.doProcess();
00091                     break;
00092                 case SIMPLE_ICONIFICATION :
00093                     width.setProcessingId(SIMPLE_ICONIFICATION);
00094                     width.doProcess();
00095                     depth.setProcessingId(SIMPLE_ICONIFICATION);
00096                     depth.doProcess();
00097                     break;
00098                 case RECURSIVE_ICONIFICATION :
00099                     width.setProcessingId(RECURSIVE_ICONIFICATION);
00100                     width.doProcess();
00101                     depth.setProcessingId(RECURSIVE_ICONIFICATION);
00102                     depth.doProcess();
00103                     break;
00104                 case COMPUTE_AND_ICONIFY :
00105                     width.setProcessingId(COMPUTE_AND_ICONIFY);
00106                     width.doProcess();
00107                     depth.setProcessingId(COMPUTE_AND_ICONIFY);
00108                     depth.doProcess();
00109             }
00110             */
00111         }
00112     }
00113     
00119     public void setLevel(int level) {
00120         width.setLevel(level);
00121         depth.setLevel(level);
00122     }
00123     
00124     // #########################################
00125     // ### Interface DepthProcessorInterface ###
00126     // #########################################
00127     
00134     public void setDepthLevel(int depthLevel) {
00135         depth.setLevel(depthLevel);
00136     }
00137     
00143     public int getDepthLevel() {
00144         return depth.getLevel();
00145     }
00146     
00150     public int getMaxDepthValue() {
00151         return depth.getMaxDepthValue();
00152     }
00153     
00154     // #########################################
00155     // ### Interface WidthProcessorInterface ###
00156     // #########################################
00157     
00164     public void setWidthLevel(int widthLevel) {
00165         width.setLevel(widthLevel);
00166     }
00167     
00173     public int getWidthLevel() {
00174         return width.getLevel();
00175     }
00176     
00181     public void setView(int view) {
00182         width.setView(view);
00183     }
00184     
00188     public int getView() {
00189         return width.getView();
00190     }
00191     
00195     public Vector getWidthList() {
00196         return width.getWidthList();
00197     }
00198     
00202     public int getBiggestWidth() {
00203         return width.getBiggestWidth();
00204     }
00205 }