Logo Search packages:      
Sourcecode: wims version File versions

Display fr::ove::openmath::jome::ctrlview::bidim::Display::buildDisplay ( int  indexFts  )  [inline, inherited]

Builds the display of the part of the formula tree structure at the specified index.
This method has to be called when a new part of the formula tree structure has been created and the displays have not been associated yet. (modification of the formula expression, and then we only ask to build displays of the new part, and only them)
As a prerequesit, the instance which calls this method MUST have a corresponding instance (a listener) in the formula tree structure (i.e. the formula tree structure we want to display)

Parameters:
indexFts the index of the fts which needs displays to be associated, in the list of "sub-fts" of the corresponding fts of the instance (ouf !!!).
indexFts must be less than the number of elements of the correponding fts, and greater or equal than 0.
Returns:
the new display created.

Definition at line 690 of file Display.java.

References fr::ove::openmath::jome::ctrlview::bidim::Display::addControlListener(), fr::ove::openmath::jome::model::FormulaTreeStructure::addModelListener(), fr::ove::openmath::jome::ctrlview::bidim::DisplayAllocator::allocateDisplay(), fr::ove::openmath::jome::ctrlview::bidim::Display::buildDisplay(), fr::ove::openmath::jome::ctrlview::bidim::Display::displayAllocator, fr::ove::openmath::jome::model::Node::getChild(), fr::ove::openmath::jome::ctrlview::bidim::Display::getLevel(), fr::ove::openmath::jome::ctrlview::bidim::Display::getListener(), fr::ove::openmath::jome::model::Node::getNbChildren(), fr::ove::openmath::jome::ctrlview::bidim::Display::graphicContext, and fr::ove::openmath::jome::ctrlview::bidim::Display::setLevel().

                                              {
        Display childDisplay = null;
        FormulaTreeStructure fts, ftsChild;
        int count;
        
        // On récupère l'élément de la FTS donc l'instance est le display.
        fts = (FormulaTreeStructure) getListener();
        if (fts != null) {
            count = fts.getNbChildren();
            if ((indexFts >= 0) && (indexFts < count)) {
                ftsChild = (FormulaTreeStructure) fts.getChild(indexFts);
                // Allocation du display
                childDisplay = displayAllocator.allocateDisplay(graphicContext, ftsChild);
                // Le display que l'on ajoute est au même niveau que celui du père
                // (rappel: niveau = nb de fois que la réduction de taille doit être appliquée,
                // par exemple pour les exposants.) C'est le layout manager qui s'occupe de
                // faire la réduction si nécessaire.
                childDisplay.setLevel(getLevel());
                // Chacun écoute l'autre
                childDisplay.addControlListener(ftsChild);
                ftsChild.addModelListener(childDisplay);
                // On ajoute le nouveau display comme fils à l'instance
                add(childDisplay);
                // On descend dans la fts pour poursuivre la construction des display
                childDisplay.buildDisplay();
            }
        }
        
        return childDisplay;
    }


Generated by  Doxygen 1.6.0   Back to index