Back to index

wims  3.65+svn20090927
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Static Private Attributes
fr.ove.openmath.jome.ctrlview.bidim.FormulaDisplay Class Reference

The bidimensional display of the elements of the formula. More...

Inheritance diagram for fr.ove.openmath.jome.ctrlview.bidim.FormulaDisplay:
Inheritance graph
[legend]
Collaboration diagram for fr.ove.openmath.jome.ctrlview.bidim.FormulaDisplay:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 FormulaDisplay ()
 The default constructor.
void addControlListener (ControlListener controlListener)
 Registers another listener to be informed of changes of the display.
Dimension getPreferredSize ()
 Returns the preferred size of the display.
void setLayout (LayoutManager lm)
 Sets the layout manager for the display.
String getLinearSelection ()
 Returns the linear expression of the selection.
void paint (Graphics g)
 Paints the display.
void consumeModelEvent (ModelEvent modelEvent)
 Consumes (i.e.
boolean isSelected ()
 Checks if the display is selected or not.
boolean weDrawBounds ()
 Checks if the bound must be drawn or not.
boolean isSymbolOperatorDisplay ()
boolean isDisplay (FormulaTreeStructure fts)
 Returns true if the instance is a display of the specified formula tree structure.
void setIsSymbolOperatorDisplay (boolean isSymbolOperatorDisplay)
 Sets if the instance represents the display of the symbol of an operator.
void drawBounds ()
 The bounds of the display have to be drawn.
void dontDrawBounds ()
 The bounds of the display don't have to be drawn.
void setLevel (int level)
 Sets the level of the display.
int getLevel ()
 Returns the level of the display.
void incLevel ()
 Increments the level value.
void decLevel ()
 Decrements the level value.
void setUpdateLevel (boolean updateLevel)
 Sets the level to be updated.
boolean getUpdateLevel ()
 Checks if we need to update the level of the display.
void updateAncestorsLevel ()
 Recurses into the tree of the display to inform the ancestors of the instance that they need to update their level.
void updateChildrenLevel ()
 Recurses into the tree of the display to inform the children of the instance that they need to update their level.
void setComputeAttributes (boolean computeAttributes)
 Sets the attributes to be computed.
boolean getComputeAttributes ()
 Checks if we need to compute the display.
void computeAncestorsAttributes ()
 Recurses into the tree of the display to inform the ancestors of the instance that they need to compute their attributes.
void computeChildrenAttributes ()
 Recurses into the tree of the display to inform the children of the instance that they need to compute their attributes.
void setRank (int rank)
 Sets the rank of the display.
int getRank ()
 Returns the rank of the display.
void adjustRank ()
 Adjusts the rank of its children.
void removeAllDisplays ()
 Removes all the displays of the instance.
void scaleDisplay ()
 Scales the display.
void moveSelectedDisplays (int mouseX)
 Moves the selected displays to the mouse position.
int computeInsertionPosition (int mouseX)
 Returns the insertion position for the moving of displays.
void setDisplayAllocator (DisplayAllocator displayAllocator)
 Sets the display allocator.
DisplayAllocator getDisplayAllocator ()
 Returns the display allocator.
void buildDisplay ()
 Builds the display of the formula tree structure.
Display buildDisplay (int indexFts)
 Builds the display of the part of the formula tree structure at the specified index.
void add (Display display)
 Adds a child display to the instance.
void remove (int index)
 Removes from the instance the display at the specified index.
void removeAll ()
 Removes the specified display to the instance.
void setFont (Font font)
 Sets a new font to the context.
void substitute (String name)
 Substitutes the selection by the specified friendly name.
void setAscent (int ascent)
 Sets the ascent.
int getAscent ()
 Returns the ascent.
void setDescent (int descent)
 Sets the descent.
int getDescent ()
 Returns the descent.
void setShiftX (int shiftX)
 Sets the horizontal shift.
int getShiftX ()
 Returns the horizontal shift.
void setShiftY (int shiftY)
 Sets the vertical shift.
int getShiftY ()
 Returns the vertical shift.
void setAttributes (int ascent, int descent, int shiftX, int shiftY)
 Sets all the attributes.
void setGraphicContext (GraphicContext graphicContext)
 Sets the graphic context to the display.
GraphicContext getGraphicContext ()
 Returns the graphic context of the display.
void setX (int x)
 Sets the x-location of the instance.
int getX ()
 Returns the x-location of the display.
void setY (int y)
 Sets the y-location of the instance.
int getY ()
 Returns the y-location of the display.
void setWidth (int width)
 Sets the width of the instance.
int getWidth ()
 Returns the width of the display.
void setHeight (int height)
 Sets the height of the instance.
int getHeight ()
 Returns the height of the display.
void select ()
 Selects the display.
void deselect ()
 Deselects the display.
void setSelected ()
 Sets the display as selected.
void setNotSelected ()
 Sets the display as not selected.
boolean gotSelectedElements ()
 Returns true if the display have components selected or is selected.
void setForegroundColor (Color foregroundColor)
 Sets a new color to the context.
Color getForegroundColor ()
 Returns the color used by the graphic context.
void setBackgroundColor (Color backgroundColor)
 Sets a new color to the context.
Color getBackgroundColor ()
 Returns the color used by the graphic context.
void setSelectionColor (Color selectionColor)
 Sets a new selection color to the context.
Color getSelectionColor ()
 Returns the color used in the graphic context to hilight the selection.
void setIconName (String iconName)
 Associates an icon name to the instance.
String getIconName ()
 Returns the name of the icon associated to the instance.
boolean isIcon ()
void iconify ()
 Iconifies all the selected elements of the formula.
void uniconify ()
 Uniconifies all the selected icons which are in the formula.
void uniconifyAll ()
 Uniconifies all the selected icons.
void setIsIconifiable (boolean isIconifiable)
 Sets the istance as iconifiable.
boolean isIconifiable ()
 Returns true if the instance is iconifiable.
void removeAllControlListener ()
 Removes all the listeners.
void removeControlListener (ControlListener controlListener)
 Removes a listener.
void fireControlEvent (ControlEvent controlEvent)
 Fires a Control event to registered listeners.
ControlListener getListener ()
 Returns the listener of the dispay.
void addSelectionEventListener (SelectionEventListener selectionEventListener)
 Registers another listener to be informed of changes of the display.
void removeSelectionEventListener (SelectionEventListener selectionEventListener)
 Removes a listener.
void fireSelectionEvent (SelectionEvent selectionEvent)
 Fires a SelectionEvent event to registered listeners.
void ToString ()
 For debugg only !!!!
void whoAmI ()
void setLocation (int x, int y)
 Sets the location of the instance.
void setLocation (Point location)
 Sets the location of the instance.
Point getLocation ()
 Returns the location of the instance.
Dimension getSize ()
 Returns the size of the instance.
void setSize (int width, int height)
 Sets the size of the instance.
void setSize (Dimension size)
 Sets the size of the instance.

Protected Member Functions

boolean doRemoveFromListListeners ()
 Returns true if we remove the instance from the list of listeners.
void setDoRemoveFromListListeners (boolean doRemoveFromListListeners)
 Sets if during the removal of the instance from the its father, we remove it from the list of listeners it is listening to.
void removeFromListListeners (boolean doRemoveFromListListeners)
 Sets if during the manipulation of children of the instance, the children manipulated have to be removed from the list od listeners.
void setTheFont (Font font)

Protected Attributes

boolean isSelected = false
 Indicates whether the symbol is selected or not.
boolean dragNDrop
 Are we in drag'n drop mode ??

Private Member Functions

Vector getSelection ()
 Returns the selected displays.
FormulaTreeStructure getFtsSelection ()
 Returns the formula tree structure associated with the selected displays.

Static Private Attributes

static ImageLoader loader
 The image loader.

Detailed Description

The bidimensional display of the elements of the formula.

Author:
© 1999 DIRAT Laurent
Version:
2.0 17/12/1999

Definition at line 47 of file FormulaDisplay.java.


Constructor & Destructor Documentation

The default constructor.

Definition at line 56 of file FormulaDisplay.java.

                            {
        super(new GraphicContext());
        
        // On affecte le layout manager d'une formule.
        OneFormulaLayout layout = new OneFormulaLayout();
        layout.initDisplay(this);
        super.setLayout(layout);
        
        // Création du gestionnaire de la sélection
        SelectionManager selectionManager = new SelectionManager();
        addSelectionEventListener(selectionManager);
        
        // On charge les icones
        loader = new ImageLoader(this);
    }

Here is the call graph for this function:


Member Function Documentation

void fr.ove.openmath.jome.ctrlview.bidim.Display.add ( Display  display) [inline, inherited]

Adds a child display to the instance.

The child is added as the last child of the set of children of the instance.

Parameters:
displaythe display to add.

Definition at line 730 of file Display.java.

                                     {
        super.add(display, display);
        display.setRank(getComponentCount() - 1);
    }

Here is the call graph for this function:

Here is the caller graph for this function:

void fr.ove.openmath.jome.ctrlview.bidim.FormulaDisplay.addControlListener ( ControlListener  controlListener) [inline]

Registers another listener to be informed of changes of the display.

Parameters:
controlListenera listener to add.

Reimplemented from fr.ove.openmath.jome.ctrlview.bidim.Display.

Definition at line 76 of file FormulaDisplay.java.

                                                                    {
        
        // ben ça, ça marche pas encore comme voulu !!!
        // au moins dans café.
        
        super.addControlListener(controlListener);
        buildDisplay();
        invalidate();
        setComputeAttributes(true);
        validate();
        repaint();
    }

Here is the call graph for this function:

void fr.ove.openmath.jome.ctrlview.bidim.Display.addSelectionEventListener ( SelectionEventListener  selectionEventListener) [inline, inherited]

Registers another listener to be informed of changes of the display.

Parameters:
selectionEventListenera listener to add.

Definition at line 1425 of file Display.java.

                                                                                         {
        selectionManager = selectionEventListener;
    }

Here is the caller graph for this function:

Adjusts the rank of its children.

Definition at line 454 of file Display.java.

                             {
        int count = getComponentCount();
        for (int i = 0; i < count; i++)
            ((Display) getComponent(i)).setRank(i);
    }

Here is the caller graph for this function:

Builds the display of the formula tree structure.


This method has to be called when a formula tree structure has been created and the displays have not been associated yet.
As a prerequesit, the instance which call this method MUST have a corresponding instance (a listener) in the formula tree structure (i.e. the formula tree structure we want to display).

Definition at line 651 of file Display.java.

                               {
        Display childDisplay;
        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) { // Bon malgrè le prérequis, on fait le test quand même
            count = fts.getNbChildren();
            
            // On parcourre la liste des fils de la fts, pour leur associer le display qui va bien
            for (int i = 0; i < count; i++) {
                ftsChild = (FormulaTreeStructure) fts.getChild(i);
                // Allocation du display
                childDisplay = displayAllocator.allocateDisplay(graphicContext, ftsChild);
                // 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();
            }
        }
    }

Here is the call graph for this function:

Here is the caller graph for this function:

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:
indexFtsthe 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.

                                              {
        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;
    }

Here is the call graph for this function:

Recurses into the tree of the display to inform the ancestors of the instance that they need to compute their attributes.

Definition at line 410 of file Display.java.

                                             {
        computeAttributes = true;
        Container parent = getParent();
        while (parent instanceof Display) {
            ((Display) parent).setComputeAttributes(true);
            parent = parent.getParent();
        }
    }

Here is the call graph for this function:

Here is the caller graph for this function:

Recurses into the tree of the display to inform the children of the instance that they need to compute their attributes.

Definition at line 423 of file Display.java.

                                            {
        computeAttributes = true;
        int count = getComponentCount();
        for (int i = 0; i < count; i++)
            ((Display) getComponent(i)).computeChildrenAttributes();
    }

Returns the insertion position for the moving of displays.

Parameters:
mouseXthe mouse position.

Reimplemented in fr.ove.openmath.jome.ctrlview.bidim.AbstractStringDisplay.

Definition at line 604 of file Display.java.

                                                    {
        int insertionPosition;
        
        // On regarde la position de la souris.
        // Si elle est inférieure à la moitié de la largeur de l'instance, alors
        // la position d'insertion est la position de l'opérande dont l'instance est
        // le display. Sinon, la position d'insertion est la position de l'opérande 
        // dont l'instance est le display + 1.
        if (mouseX <= (getWidth() / 2))
            insertionPosition = ((FormulaTreeStructure) listener).getRank();
        else
            insertionPosition = ((FormulaTreeStructure) listener).getRank() + 1;
            // Pas de pb de test pour savoir si on n'est pas sur le dernier opérande
            // puisqu'on est obligé dans ce cas de retourner le nbre réel + 1 pour dire
            // effectivement que l'on insère à la dernière position.

        // On retourne la position d'insertion calculée.
        return insertionPosition;
    }

Here is the call graph for this function:

Here is the caller graph for this function:

Consumes (i.e.

treats) the event received from the model.

Parameters:
modelEventthe event to consume.

Reimplemented in fr.ove.openmath.jome.ctrlview.bidim.StringDisplay, and fr.ove.openmath.jome.ctrlview.bidim.SubstitutionDisplay.

Definition at line 93 of file BidimDisplay.java.

                                                         {
        FormulaTreeStructure fts = null;
        int action = modelEvent.getAction();
        switch (action) {
            case ModelEvent.ADD :
                // On ajoute un dispay.
                // On récupère le FTS dont on doit ajouter, et par là même, créer le display
                // qui lui est associé.
                fts = (FormulaTreeStructure) modelEvent.getArgument();
                Display newDisplay = buildDisplay(fts.getRank());
                
                if (fts.isIcon()) {
                    SubstitutedDisplayManager iconLM = (SubstitutedDisplayManager) newDisplay.getLayout();
                    // On se trouve dans un cas particulier où, ajouter le display de l'icone
                    // entraîne des modifications sur le display qui le contient (i.e. l'instance courante).
                    // Il faut éliminer tous les displays dont les fts sont iconifiées.
                    FormulaTreeStructure iconifiedFts = null;
                    Display iconifiedDisplay = null;
                    int nbIconified = ((Icon) fts).getNbIconified();
                    for (int i = 0; i < nbIconified; i++) {
                        // Prend une fts iconifiée
                        iconifiedFts = ((Icon) fts).getIconified(i);
                        // On recherche le display qui lui est associé
                        int count = getComponentCount();
                        for (int j = 0; j < count; j++) {
                            iconifiedDisplay = (Display) getComponent(j);
                            if (iconifiedDisplay.isDisplay(iconifiedFts))
                                break;
                        }
                        
                        if (iconifiedDisplay != null) {
                            // On en garde une trace en l'ajoutant dans le LM.
                            // Utile pour la désiconification.
                            iconLM.addSubstitutedDisplay(iconifiedDisplay);
                            // On l'enlève du père, mais on ne veut pas qu'il soit supprimé
                            // de la liste des listeners qu'il écoute
                            iconifiedDisplay.setDoRemoveFromListListeners(false);
                            remove(iconifiedDisplay);
                            iconifiedDisplay = null;
                        }
                    }
                    
                    // On reconstruit le father pour que l'ordre des displays qui le composent
                    // corresponde à l'odre des fts dont ils sont les displays.
                    ((DisplayLayout) getLayout()).rebuildDisplay();
                }

                break;
                
            case ModelEvent.UPDATE :
                Container container = this;
                
                //container.invalidate();
                
                while (container.getParent() != null)
                    container = container.getParent();
                    
                container.validate();
                break;
                
            case ModelEvent.REBUILD :
                //System.out.println("ModelEvent.REBUILD : on rebuild le display");
                // Dans un premier temps, on regarde si la reconstruction du display n'a pas
                // été demandée lors d'une désiconification. Donc, on parcourt la liste des
                // displays contenus dans l'instance courante pour vérifier si chacun est
                // associé à un élément de la FTS. Si tel est le cas, on peut demander la 
                // reconstruction du display. Sinon, on est dans le cas de la désiconification,
                // et donc il faut rajouter dans la liste des displays de l'instance courante
                // tous les displays qui ont été préalablement iconifiés.
                
                FormulaTreeStructure theFts = (FormulaTreeStructure) getListener();
                FormulaTreeStructure theFtsChild = null;
                Display theFtsChildDisplay = null;
                int nbDisplay = getComponentCount();
                // On parcourt la liste des displays.
                for (int i = 0; i < nbDisplay; i++) {
                    theFtsChildDisplay = (Display) getComponent(i);
                    theFtsChild = (FormulaTreeStructure) theFtsChildDisplay.getListener();
                    // Si theFtsChild est une icone et qu'elle n'appartient à la liste des fils de son père
                    // (ça veut donc dire qu'on l'a supprimée lors d'une désiconification), on désiconifie
                    if (theFtsChild.isIcon() && !theFts.hasChild(theFtsChild)) {
                        Display displaySubstituted;
                        SubstitutedDisplayManager theIconLM = (SubstitutedDisplayManager) theFtsChildDisplay.getLayout();
                        // Tous les displays qui étaient iconifés sont rajoutés à l'instance courante.
                        for (int j = 0; j < theIconLM.getNbSubstitutedDisplay(); j++) {
                            displaySubstituted = theIconLM.getSubstitutedDisplay(j);
                            add(displaySubstituted);
                            // Lors de l'iconification, quand on supprime le display iconifié, on ne veut
                            // pas qu'il soit enlevé de la liste des listeners qu'il écoute.
                            // Par contre, quand on revient là, on se remet dans l'état par défaut qui est
                            // que l'on veut les supprimer de la liste des listeners.
                            displaySubstituted.setDoRemoveFromListListeners(true);
                        }
                        // On enlève le display de l'icon
                        remove(theFtsChildDisplay);
                        // On réajuste le nombre de displays contenus dans l'instance courante.
                        nbDisplay = getComponentCount();
                        // Idem pour l'index. Puisqu'on a enlevé un display, si on ne décrémente
                        // pas i, on va en sauter 1.
                        i--;
                    }
                }
                
                // On regarde si tous les éléments de la fts ont des displays associés.
                // Sinon, il faut leur en construire un.
                int count = theFts.getNbChildren();
                boolean buildDisplay = true;
                for (int i = 0; i < count; i++) {
                    buildDisplay = true;
                    theFtsChild = (FormulaTreeStructure) theFts.getChild(i);
                    for (int j = 0; j < nbDisplay; j++) {
                        theFtsChildDisplay = (Display) getComponent(j);
                        if (theFtsChildDisplay.isDisplay(theFtsChild)) {
                            buildDisplay = false;
                            break;
                        }
                    }
                    if (buildDisplay) {
                        buildDisplay(theFtsChild.getRank());
                    }
                }
                
                // Maintenant on peut reconstruire le display, en fait le bon réagencement des
                // displays contenus dans l'instance.
                ((DisplayLayout) getLayout()).rebuildDisplay();
                break;
                
             case ModelEvent.CREATE :
                buildDisplay();
                invalidate();
                setComputeAttributes(true);
                validate();
                repaint();
                break;
                
             case ModelEvent.CLEAR :
                removeAll();
        }
    }

Here is the call graph for this function:

Decrements the level value.

Definition at line 331 of file Display.java.

                           {
        level--;
    }

Deselects the display.

Deselects the instance and its children if any.

Definition at line 1120 of file Display.java.

                           {
        if (isSelected) {
            isSelected = false;
            int count = getComponentCount();
            for (int i = 0; i < count; i++)
                ((Display) getComponent(i)).deselect();
        }
    }

Here is the call graph for this function:

Here is the caller graph for this function:

The bounds of the display don't have to be drawn.

Definition at line 289 of file Display.java.

                                 {
        weDrawBounds = false;
    }

Here is the call graph for this function:

Returns true if we remove the instance from the list of listeners.

false otherwise.

Definition at line 803 of file Display.java.

Here is the caller graph for this function:

The bounds of the display have to be drawn.

Definition at line 282 of file Display.java.

                             {
        weDrawBounds = true;
    }

Here is the call graph for this function:

void fr.ove.openmath.jome.ctrlview.bidim.Display.fireControlEvent ( ControlEvent  controlEvent) [inline, inherited]

Fires a Control event to registered listeners.

Parameters:
controlEventevent encapsulating relevant information.

Definition at line 1404 of file Display.java.

                                                            {
        listener.consumeControlEvent(controlEvent);
    }

Here is the caller graph for this function:

Fires a SelectionEvent event to registered listeners.

Parameters:
selectionEventevent encapsulating relevant information.

Definition at line 1442 of file Display.java.

                                                                  {
        selectionManager.consumeSelectionEvent(selectionEvent);
    }

Returns the ascent.

Returns:
the ascent.

Implements fr.ove.openmath.jome.ctrlview.bidim.Displayable.

Definition at line 945 of file Display.java.

                           {
        return ascent;
    }

Here is the caller graph for this function:

Returns the color used by the graphic context.

Implements fr.ove.openmath.jome.ctrlview.bidim.Colorizable.

Definition at line 1200 of file Display.java.

Here is the call graph for this function:

Here is the caller graph for this function:

Checks if we need to compute the display.

Returns:
true if needed. false otherwise.

Definition at line 402 of file Display.java.

                                          {
        return computeAttributes;
    }

Returns the descent.

Returns:
the descent.

Implements fr.ove.openmath.jome.ctrlview.bidim.Displayable.

Definition at line 961 of file Display.java.

                            {
        return descent;
    }

Here is the caller graph for this function:

Returns the display allocator.

Returns:
the display allocator, or null if none has been specified.

Definition at line 640 of file Display.java.

                                                  {
        return displayAllocator;
    }

Here is the caller graph for this function:

Returns the color used by the graphic context.

Implements fr.ove.openmath.jome.ctrlview.bidim.Colorizable.

Definition at line 1185 of file Display.java.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns the formula tree structure associated with the selected displays.


Returns null if there is no selected displays. For example, let us assume that the formula is a+b+c, and a and c are selected. The fts returned is the fts of a+c.

Parameters:
selectionthe list of selected displays.

Definition at line 179 of file FormulaDisplay.java.

                                                   {
        FormulaTreeStructure ftsSelection = null;
        Vector selection = getSelection();
        
        if (selection != null) {
            ftsSelection = (FormulaTreeStructure) selection.elementAt(0);
            if ((selection.size() == 1) && 
                (!ftsSelection.isIcon() || (ftsSelection.isIcon() && (((Icon) ftsSelection).getNbIconified() == 1)))) {
                ftsSelection = (FormulaTreeStructure) ftsSelection.clone();
            }
            else {
                FormulaTreeStructure childFts = null;
                
                // On récupère le père dans la FTS du premier élément sélectionné
                // pour savoir à quel type d'opération on a affaire.
                ftsSelection = (FormulaTreeStructure) ftsSelection.getFather();
                ftsSelection = (FormulaTreeStructure) ftsSelection.duplicate();
                int count = selection.size();
                for (int i = 0; i < count; i++) {
                    childFts = (FormulaTreeStructure) selection.elementAt(i);
                    childFts = (FormulaTreeStructure) childFts.clone();
                    ftsSelection.addChild(childFts);
                }
            }
        }
        
        return ftsSelection;
    }

Here is the call graph for this function:

Here is the caller graph for this function:

Returns the graphic context of the display.

Implements fr.ove.openmath.jome.ctrlview.bidim.Displayable.

Definition at line 1022 of file Display.java.

                                              {
        return graphicContext;
    }

Returns the height of the display.

Implements fr.ove.openmath.jome.ctrlview.bidim.Sizable.

Definition at line 1094 of file Display.java.

                           {
        return getSize().height;
    }

Here is the call graph for this function:

Here is the caller graph for this function:

Returns the name of the icon associated to the instance.

Returns:
The name of the icon, or null if there is no name associated.

Definition at line 1244 of file Display.java.

                                {
        return null; // ce n'est pas un display que l'on va iconifier.
    }

Returns the level of the display.

Definition at line 317 of file Display.java.

                          {
        return level;
    }

Here is the caller graph for this function:

Returns the linear expression of the selection.

Definition at line 122 of file FormulaDisplay.java.

                                       {
        FormulaTreeStructure ftsSelection = getFtsSelection();
        
        if (ftsSelection == null)
            return "";
        else 
            return ftsSelection.createLinear("");
    }

Here is the call graph for this function:

ControlListener fr.ove.openmath.jome.ctrlview.bidim.Display.getListener ( ) [inline, inherited]

Returns the listener of the dispay.

(i.e. a fts)

Definition at line 1411 of file Display.java.

                                         {
        return listener;
    }

Returns the location of the instance.

Returns:
A Point representing the location of the instance.

Implemented in fr.ove.openmath.jome.ctrlview.bidim.DisplayableImpl.

Here is the caller graph for this function:

Returns the preferred size of the display.

Implements fr.ove.openmath.jome.ctrlview.bidim.Sizable.

Definition at line 92 of file FormulaDisplay.java.

                                        {
        Dimension prefSize;
        
        if (getComponentCount() == 0)
            // si y a rien à afficher, on fixe une taille quelconque pour voir qque chose
            prefSize = new Dimension(/*100, 50*/10, 10);
        else
            prefSize = super.getPreferredSize();
            
        return prefSize;
    }

Returns the rank of the display.

Definition at line 447 of file Display.java.

                         {
        return rank;
    }

Here is the caller graph for this function:

Returns the selected displays.


Display of symbol operator are not in this list.

Definition at line 135 of file FormulaDisplay.java.

                                  {
        SelectionEvent selectionEvent = new SelectionEvent(this);

        // On récupère la taille de la sélection.
        Integer selectionSize = null;
        selectionEvent.setAction(SelectionEvent.GET_SELECTION_SIZE, selectionSize);
        fireSelectionEvent(selectionEvent);
        selectionSize = (Integer) selectionEvent.getArgument();
        // Si différente de 0, il y a qque chose à récupérer.
        if (selectionSize.intValue() != 0) {
            // On récupère la sélection entière.
            Vector selection = null;
            selectionEvent.setAction(SelectionEvent.GET_SELECTION, selection);
            fireSelectionEvent(selectionEvent);
            selection = (Vector) selectionEvent.getArgument();
            // On créé la liste des éléments à récupérer. (on enlève les displays
            // d'opérateurs parasites, et aux displays qui restent, on récupère
            // la fts dont ils sont le display).
            Display selectionDisplay;
            FormulaTreeStructure fts;
            Vector toGet = new Vector();
            for (int i = 0; i < selectionSize.intValue(); i++) {
                selectionDisplay = (Display) selection.elementAt(i);
                if (!selectionDisplay.isSymbolOperatorDisplay()) {
                    // On récupère le fts associé au display.
                    fts = (FormulaTreeStructure) selectionDisplay.getListener();
                    // On l'ajoute à la liste des fts à iconifier
                    toGet.addElement(fts);
                }
            }

            return toGet;
        }
        
        return null;
    }

Here is the call graph for this function:

Here is the caller graph for this function:

Returns the color used in the graphic context to hilight the selection.

Implements fr.ove.openmath.jome.ctrlview.bidim.Colorizable.

Definition at line 1215 of file Display.java.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns the horizontal shift.

Returns:
the horizontal shift.

Implements fr.ove.openmath.jome.ctrlview.bidim.Displayable.

Definition at line 977 of file Display.java.

                           {
        return shiftX;
    }

Here is the caller graph for this function:

Returns the vertical shift.

Returns:
the vertical shift.

Implements fr.ove.openmath.jome.ctrlview.bidim.Displayable.

Definition at line 993 of file Display.java.

                           {
        return shiftY;
    }

Here is the caller graph for this function:

Returns the size of the instance.

Implemented in fr.ove.openmath.jome.ctrlview.bidim.DisplayableImpl, and fr.ove.openmath.jome.ctrlview.bidim.SquaredBracketSymbol.

Here is the caller graph for this function:

Checks if we need to update the level of the display.

Returns:
true if needed. false otherwise.

Definition at line 353 of file Display.java.

                                    {
        return updateLevel;
    }

Here is the caller graph for this function:

Returns the width of the display.

Implements fr.ove.openmath.jome.ctrlview.bidim.Sizable.

Definition at line 1079 of file Display.java.

                          {
        return getSize().width;
    }

Here is the call graph for this function:

Here is the caller graph for this function:

Returns the x-location of the display.

Implements fr.ove.openmath.jome.ctrlview.bidim.Localisable.

Definition at line 1043 of file Display.java.

                      {
        return getLocation().x;
    }

Here is the call graph for this function:

Here is the caller graph for this function:

Returns the y-location of the display.

Implements fr.ove.openmath.jome.ctrlview.bidim.Localisable.

Definition at line 1058 of file Display.java.

                      {
        return getLocation().y;
    }

Here is the call graph for this function:

Here is the caller graph for this function:

Returns true if the display have components selected or is selected.


false otherwise.

Definition at line 1156 of file Display.java.

                                         {
        if (isSelected)
            return true;
            
        int count = getComponentCount();
        for (int i = 0; i < count; i++)
            if (((Display) getComponent(i)).gotSelectedElements())
                return true;
        
        return false;
    }

Here is the call graph for this function:

Here is the caller graph for this function:

Iconifies all the selected elements of the formula.

Definition at line 1258 of file Display.java.

                          {
        SelectionEvent selectionEvent = new SelectionEvent(this);

        // On récupère la taille de la sélection.
        Integer selectionSize = null;
        selectionEvent.setAction(SelectionEvent.GET_SELECTION_SIZE, selectionSize);
        fireSelectionEvent(selectionEvent);
        selectionSize = (Integer) selectionEvent.getArgument();
        // Si différente de 0, il y a qque chose à iconifier.
        if (selectionSize.intValue() != 0) {
            // On récupère la sélection entière.
            Vector selection = null;
            selectionEvent.setAction(SelectionEvent.GET_SELECTION, selection);
            fireSelectionEvent(selectionEvent);
            selection = (Vector) selectionEvent.getArgument();
            // On créé la liste des éléments à iconifier. (on enlève les displays
            // d'opérateurs parasites, et aux displays qui restent, on récupère
            // la fts dont ils sont le display).
            Display display;
            FormulaTreeStructure fts;
            Vector toIconify = new Vector();
            for (int i = 0; i < selectionSize.intValue(); i++) {
                display = (Display) selection.elementAt(i);
                if (!display.isSymbolOperatorDisplay()) {
                    // On désélectionne le display
                    display.deselect();
                    // On récupère le fts associé au display.
                    fts = (FormulaTreeStructure) display.getListener();
                    // On l'ajoute à la liste des fts à iconifier
                    toIconify.addElement(fts);
                }
            }
            // On purge la sélection
            selectionEvent.setAction(SelectionEvent.PURGE, null);
            fireSelectionEvent(selectionEvent);
            // On envoie l'événement au modèle pour lui dire qu'il faut iconifier
            ControlEvent controlEvent = new ControlEvent(this);
            controlEvent.setAction(ControlEvent.ICONIFY, toIconify);
            fireControlEvent(controlEvent);
        }
    }

Here is the call graph for this function:

Here is the caller graph for this function:

Increments the level value.

Definition at line 324 of file Display.java.

                           {
        level++;
    }

Returns true if the instance is a display of the specified formula tree structure.

false otherwise.

Definition at line 245 of file Display.java.

                                                       {
        // On recupère la liste de tous les listeners de fts
        Vector listeners = fts.getListeners();
        
        return listeners.contains(this);
    }

Here is the call graph for this function:

Here is the caller graph for this function:

Returns:
true if the instance is an icon. false otherwise.

Definition at line 1251 of file Display.java.

                            {
        return false; // ce n'est pas un display que l'on va iconifier.
    }

Returns true if the instance is iconifiable.

false otherwise.

Definition at line 1365 of file Display.java.

                                   {
        // Ce n'est pas un display que l'on va iconifier
        return false;
    }

Checks if the display is selected or not.

Returns:
true if the display is selected. false otherwise.

Definition at line 1148 of file Display.java.

                                {
        return isSelected;
    }

Here is the caller graph for this function:

Returns:
true if the instance represents the display of the symbol of an operator. false otherwise.

Definition at line 270 of file Display.java.

Here is the caller graph for this function:

void fr.ove.openmath.jome.ctrlview.bidim.Display.moveSelectedDisplays ( int  mouseX) [inline, inherited]

Moves the selected displays to the mouse position.

Parameters:
mouseXthe mouse position.

Definition at line 516 of file Display.java.

                                                 {
        SelectionEvent selectionEvent = new SelectionEvent(this);

        // On récupère la taille de la sélection.
        Integer selectionSize = null;
        selectionEvent.setAction(SelectionEvent.GET_SELECTION_SIZE, selectionSize);
        fireSelectionEvent(selectionEvent);
        selectionSize = (Integer) selectionEvent.getArgument();
        // Si différente de 0, on peut faire du drag'n drop de qque chose.
        if (selectionSize.intValue() != 0) {
            // On récupère la sélection entière.
            Vector selection = null;
            selectionEvent.setAction(SelectionEvent.GET_SELECTION, selection);
            fireSelectionEvent(selectionEvent);
            selection = (Vector) selectionEvent.getArgument();
            Display display = (Display) selection.elementAt(0);
            // On récupère le fts associé au display.
            FormulaTreeStructure fts = (FormulaTreeStructure) display.getListener();
            // On récupère l'opérateur dont les display sont les opérandes.
            fts = (FormulaTreeStructure) fts.getFather();
            // On fonction du type de cet opérateur, on permet ou pas le drag'n
            // drop.
            if (!fts.getAreOperandsMovable())
                return;  // Pour ces opérateur là, on ne permet pas le drag'n drop.

            // Il faut maintenant savoir où on va dropper la sélection.
            // On récupère le display de l'opérateur, et on cherche cette position
            display = (Display) display.getParent();
            
            // On ajuste la position de la souris pour qu'on soit en coordonnée relative
            // dans le repère de display.
            // ATTENTION : l'instance courante est celle qui a reçu le mouseDragged. Elle
            // a reçu également le mouseReleased. Ce qui fait que le mouseX est une coordonnée
            // relative à l'instance. Donc, pour ramener notre coordonnée relativement à display
            // il faut rajouter la coordonnée de l'instance.
            Display tmp = this;
            while (tmp != display) {
                mouseX += tmp.getX();
                tmp = (Display) tmp.getParent();
            }
            
            // On regarde si la position de la souris ainsi calculée est toujours contenue
            // dans le display. Si ce n'est pas le cas, on se trouve dans un cas particulier.
            int insertionPosition;
            if (mouseX <= 0) {
                // On a droppé à gauche de display, on insère donc au début de celui-ci
                // Cela revient à dropper sur le premier display de la liste.
                tmp = (Display) display.getComponentAt(1, display.getAscent());
                insertionPosition = tmp.computeInsertionPosition(1);
            }
            else if (mouseX >= display.getWidth()) {
                // On a droppé à droite de display, on insère donc à la fin de celui-ci
                // Cela revient dropper sur le dernier display de la liste.
                tmp = (Display) display.getComponentAt(display.getWidth() - 1, display.getAscent());
                insertionPosition = tmp.computeInsertionPosition(display.getWidth() - 1 - tmp.getX());
            }
            else {
                // On a droppé qque part dans display. On récupère ce display.
                tmp = (Display) display.getComponentAt(mouseX, display.getAscent());
                insertionPosition = tmp.computeInsertionPosition(mouseX - tmp.getX());
            }
            
            // On créé la liste des opérandes à permuter
            Vector operands = new Vector();
            for (Enumeration e = selection.elements(); e.hasMoreElements(); ) {
                tmp = (Display) e.nextElement();
                // Si l'on n'a pas affaire à un display d'operateur, alors on ajoute l'operande
                // dans la liste.
                if (!tmp.isSymbolOperatorDisplay()) {
                    tmp.deselect();
                    operands.addElement(tmp.getListener());
                }
            }
            
            // On fait la permutation
            // Faut-il rajouter l'événement pour rester dans la philosophie ???
            fts.moveOperands(operands, insertionPosition);
            
            // On purge la liste de sélection
            selectionEvent.setAction(SelectionEvent.PURGE, null);
            fireSelectionEvent(selectionEvent);
        }
    }

Here is the call graph for this function:

Here is the caller graph for this function:

void fr.ove.openmath.jome.ctrlview.bidim.BidimDisplay.paint ( Graphics  g) [inline, inherited]

Paints the display.

Parameters:
gwhere we paint the display.

Implements fr.ove.openmath.jome.ctrlview.bidim.Displayable.

Reimplemented in fr.ove.openmath.jome.ctrlview.bidim.AbstractStringDisplay, and fr.ove.openmath.jome.ctrlview.bidim.SymbolDisplay.

Definition at line 59 of file BidimDisplay.java.

                                  {
        Color old = g.getColor();
        Rectangle bounds = getBounds();
        GraphicContext gc = getGraphicContext();
        
        if (isSelected())
            g.setColor(gc.getSelectionColor());
        else
            g.setColor(gc.getBackgroundColor());
            
        g.fillRect(0, 0, bounds.width, bounds.height);
        
        g.setColor(gc.getForegroundColor());
        
        if (weDrawBounds())
            g.drawRect(0, 0, bounds.width -1, bounds.height - 1);
        
        /*
        // on trace la baseline
        g.setColor(Color.red);
        g.drawLine(0, getAscent(), bounds.width, getAscent());
        */
                
        g.setColor(old);
        super.paint(g);
    }

Here is the call graph for this function:

void fr.ove.openmath.jome.ctrlview.bidim.Display.remove ( int  index) [inline, inherited]

Removes from the instance the display at the specified index.

Parameters:
indexthe specified index.

Definition at line 739 of file Display.java.

                                  {
        try {
            Display display = (Display) getComponent(index);
            
            if (display.doRemoveFromListListeners())
                // On enlève maintenant le display supprimé de la liste des listeners de la fts
                // qu'il écoutait
                display.removeFromListListeners();
            
            // On enlève le display de la liste
            super.remove(index);
            
            // On réajuste maintenant le rank des fils de l'instance
            adjustRank();
        }
        catch (ArrayIndexOutOfBoundsException e) {
            System.out.println("Trying to remove display with a wrong index");
            e.printStackTrace();
        }
    }

Here is the call graph for this function:

Here is the caller graph for this function:

Removes the specified display to the instance.

Parameters:
displaythe display to remove.

public void remove(Display display) { super.remove(display); On enlève maintenant le display supprimé de la liste des listeners de la fts qu'il écoutait display.removeFromListListeners();

On réajuste maintenant le rank des fils de l'instance adjustRank(); } Removes all the displays of the instance.

Definition at line 778 of file Display.java.

                            {
        /*
        for (int i = 0; i < getComponentCount(); i++)
            remove(i);
        */
        for (int i = 0; i < getComponentCount(); )
            remove(i);
            
        computeAncestorsAttributes();
    }

Here is the call graph for this function:

Here is the caller graph for this function:

Removes all the listeners.

Definition at line 1388 of file Display.java.

                                           {
        listener = null;
    }

Removes all the displays of the instance.


The fundamental difference with removeAll is in that case, the displays removed are not removed form the list of listeners of the formula tree structure they are listening to.

Definition at line 469 of file Display.java.

                                    {
        Display display;
        int count = getComponentCount();
        for (int i = 0; i < count; ) {
            display = (Display) getComponent(i);
            // Si c'est le display d'un opérateur, alors on l'enlève de la liste et en plus, on l'enlève
            // de la liste des listeners de la fts qu'il écoutait.
            // Le remove surchargé.
            // si ce n'est pas le cas, on ne fait que le supprimer des fils de l'instance.
            if (display.isSymbolOperatorDisplay)
                //remove(display);
                remove(i);
            else
                //super.remove(display);
                super.remove(i);
                
            count--;
        }
    }

Here is the call graph for this function:

Here is the caller graph for this function:

void fr.ove.openmath.jome.ctrlview.bidim.Display.removeControlListener ( ControlListener  controlListener) [inline, inherited]

Removes a listener.

Parameters:
controlListenera listener to remove.

Definition at line 1396 of file Display.java.

                                                                       {
        listener  = null;
    }

Here is the caller graph for this function:

void fr.ove.openmath.jome.ctrlview.bidim.Display.removeFromListListeners ( boolean  doRemoveFromListListeners) [inline, protected, inherited]

Sets if during the manipulation of children of the instance, the children manipulated have to be removed from the list od listeners.

Parameters:
doRemoveFromListListenerstrue if we remove the children manipulated from the list of listeners. false otherwise.

Definition at line 813 of file Display.java.

                                                                              {
        int count = getComponentCount();
        for (int i = 0; i < count; i++)
            ((Display) getComponent(i)).doRemoveFromListListeners = doRemoveFromListListeners;
    }

Here is the call graph for this function:

Here is the caller graph for this function:

void fr.ove.openmath.jome.ctrlview.bidim.Display.removeSelectionEventListener ( SelectionEventListener  selectionEventListener) [inline, inherited]

Removes a listener.

Parameters:
selectionEventListenerlistener to remove.

Definition at line 1433 of file Display.java.

                                                                                            {
        if (selectionEventListener == selectionManager)
            selectionManager = null;
    }

Scales the display.

Reimplemented in fr.ove.openmath.jome.ctrlview.bidim.SymbolDisplay, and fr.ove.openmath.jome.ctrlview.bidim.AbstractStringDisplay.

Definition at line 492 of file Display.java.

                               {
        setTheFont(graphicContext.scaleFont(level));
        setComputeAttributes(true);
        
        int count = getComponentCount();
        for (int i = 0; i < count; i++)
            ((Display) getComponent(i)).scaleDisplay();
        
        // On regarde si le display de l'instance est le display d'une icone.
        // Si tel est le cas, il faut que l'on scale les displays iconifiés.
        FormulaTreeStructure fts = (FormulaTreeStructure) getListener();
        if ((fts != null) && fts.isIcon()) {
            SubstitutedDisplayManager layout = (SubstitutedDisplayManager) getLayout();
            count = layout.getNbSubstitutedDisplay();
            for (int i = 0; i < count; i++)
                layout.getSubstitutedDisplay(i).scaleDisplay();
        }
    }

Here is the call graph for this function:

Here is the caller graph for this function:

Selects the display.

Selects the instance and its children if any.

Definition at line 1108 of file Display.java.

                         {
        if (!isSelected) {
            isSelected = true;
            int count = getComponentCount();
            for (int i = 0; i < count; i++)
                ((Display) getComponent(i)).select();
        }
    }

Here is the call graph for this function:

Here is the caller graph for this function:

void fr.ove.openmath.jome.ctrlview.bidim.Display.setAscent ( int  ascent) [inline, inherited]

Sets the ascent.

Parameters:
ascentthe new ascent value.

Implements fr.ove.openmath.jome.ctrlview.bidim.Displayable.

Definition at line 937 of file Display.java.

                                      {
        this.ascent = ascent;
    }

Here is the caller graph for this function:

void fr.ove.openmath.jome.ctrlview.bidim.Display.setAttributes ( int  ascent,
int  descent,
int  shiftX,
int  shiftY 
) [inline, inherited]

Sets all the attributes.

Parameters:
ascentthe new ascent value.
descentthe new descent value.
shiftXthe new horizontal shift value.
shiftYthe new vertical shift value.

Implements fr.ove.openmath.jome.ctrlview.bidim.Displayable.

Reimplemented in fr.ove.openmath.jome.ctrlview.bidim.SymbolDisplay.

Definition at line 1004 of file Display.java.

                                                                               {
        this.ascent = ascent;
        this.descent = descent;
        this.shiftX = shiftX;
        this.shiftY = shiftY;
    }

Here is the caller graph for this function:

void fr.ove.openmath.jome.ctrlview.bidim.Display.setBackgroundColor ( Color  backgroundColor) [inline, inherited]

Sets a new color to the context.

Parameters:
backgroundColorthe new color.

Implements fr.ove.openmath.jome.ctrlview.bidim.Colorizable.

Definition at line 1193 of file Display.java.

                                                          {
        graphicContext.setBackgroundColor(backgroundColor);
    }

Here is the call graph for this function:

void fr.ove.openmath.jome.ctrlview.bidim.Display.setComputeAttributes ( boolean  computeAttributes) [inline, inherited]

Sets the attributes to be computed.

Parameters:
computeAttributestrue if the display attributes need to be computed. false otherwise.

Definition at line 394 of file Display.java.

Here is the caller graph for this function:

void fr.ove.openmath.jome.ctrlview.bidim.Display.setDescent ( int  descent) [inline, inherited]

Sets the descent.

Parameters:
descentthe new descent value.

Implements fr.ove.openmath.jome.ctrlview.bidim.Displayable.

Definition at line 953 of file Display.java.

                                        {
        this.descent = descent;
    }

Here is the caller graph for this function:

Sets the display allocator.

Parameters:
displayAllocatorthe display allocator

Definition at line 632 of file Display.java.

Here is the caller graph for this function:

void fr.ove.openmath.jome.ctrlview.bidim.Display.setDoRemoveFromListListeners ( boolean  doRemoveFromListListeners) [inline, protected, inherited]

Sets if during the removal of the instance from the its father, we remove it from the list of listeners it is listening to.

Parameters:
doRemoveFromListListenerstrue if we remove the instance from the list of listeners. false otherwise.

Definition at line 795 of file Display.java.

Here is the call graph for this function:

Here is the caller graph for this function:

void fr.ove.openmath.jome.ctrlview.bidim.Display.setFont ( Font  font) [inline, inherited]

Sets a new font to the context.

Parameters:
fontthe new font.

Definition at line 842 of file Display.java.

                                   {
        setTheFont(font);
        
        graphicContext.setFont(font);
        
        int count = getComponentCount();
        // On parcourre tous les displays fils et ont leur affecte la nouvelle font.
        for (int i = 0; i < count; i++)
            ((Display) getComponent(i)).setFont(font);
            
        // On calcule la taille de la nouvelle font utilisée en fonction du niveau
        // du display.
        scaleDisplay();
            
        // On indique au layout manager que la taille du display (container) n'est plus
        // valide.
        invalidate();
        
        // On regarde si le display de l'instance est le display d'une icone.
        // Si tel est le cas, il faut que l'on mette la nouvelle font aux displays iconifiés.
        FormulaTreeStructure fts = (FormulaTreeStructure) getListener();
        if ((fts != null) && fts.isIcon()) {
            SubstitutedDisplayManager layout = (SubstitutedDisplayManager) getLayout();
            count = layout.getNbSubstitutedDisplay();
            for (int i = 0; i < count; i++)
                layout.getSubstitutedDisplay(i).setFont(font);
        }
    }

Here is the call graph for this function:

Here is the caller graph for this function:

void fr.ove.openmath.jome.ctrlview.bidim.Display.setForegroundColor ( Color  foregroundColor) [inline, inherited]

Sets a new color to the context.

Parameters:
foregroundColorthe new color.

Implements fr.ove.openmath.jome.ctrlview.bidim.Colorizable.

Definition at line 1178 of file Display.java.

                                                          {
        graphicContext.setForegroundColor(foregroundColor);
    }

Here is the call graph for this function:

Sets the graphic context to the display.

Parameters:
contextGraphicthe graphic context.

Implements fr.ove.openmath.jome.ctrlview.bidim.Displayable.

Reimplemented in fr.ove.openmath.jome.ctrlview.bidim.SymbolDisplay.

Definition at line 1015 of file Display.java.

void fr.ove.openmath.jome.ctrlview.bidim.Display.setHeight ( int  height) [inline, inherited]

Sets the height of the instance.

Parameters:
heightthe height of the instance

Implements fr.ove.openmath.jome.ctrlview.bidim.Sizable.

Definition at line 1087 of file Display.java.

Here is the call graph for this function:

Here is the caller graph for this function:

void fr.ove.openmath.jome.ctrlview.bidim.Display.setIconName ( String  iconName) [inline, inherited]

Associates an icon name to the instance.

Parameters:
iconNamethe name of the icon

Definition at line 1234 of file Display.java.

                                             {
        // on ne fait rien, ce n'est pas un display que l'on va iconifier.
    }
void fr.ove.openmath.jome.ctrlview.bidim.Display.setIsIconifiable ( boolean  isIconifiable) [inline, inherited]

Sets the istance as iconifiable.

Parameters:
isIconifiabletrue if the instance is iconifiable. false otherwise.

Definition at line 1357 of file Display.java.

                                                        {
        // Ce n'est pas un display que l'on va iconifier
    }
void fr.ove.openmath.jome.ctrlview.bidim.Display.setIsSymbolOperatorDisplay ( boolean  isSymbolOperatorDisplay) [inline, inherited]

Sets if the instance represents the display of the symbol of an operator.

Parameters:
isSymbolOperatordisplaytrue if the instance represents the display of the symbol of an operator. false otherwise.

Definition at line 262 of file Display.java.

Here is the call graph for this function:

Here is the caller graph for this function:

Sets the layout manager for the display.


In fact does nothing because the instance has its own display and must only have the one it has. Overrinden just to prevent unwanted manipulation.

Parameters:
mgrthe specified layout manager

Definition at line 110 of file FormulaDisplay.java.

                                            {
    }
void fr.ove.openmath.jome.ctrlview.bidim.Display.setLevel ( int  level) [inline, inherited]

Sets the level of the display.

Parameters:
levelthe level of the display.

Definition at line 310 of file Display.java.

                                    {
        this.level = level;
    }

Here is the caller graph for this function:

void fr.ove.openmath.jome.ctrlview.bidim.Localisable.setLocation ( int  x,
int  y 
) [inherited]

Sets the location of the instance.

Parameters:
xthe x-location of the instance.
ythe y-location of the instance.

Implemented in fr.ove.openmath.jome.ctrlview.bidim.DisplayableImpl.

Here is the caller graph for this function:

Sets the location of the instance.

Parameters:
locationthe location of the instance.

Implemented in fr.ove.openmath.jome.ctrlview.bidim.DisplayableImpl.

Sets the display as not selected.

Definition at line 1139 of file Display.java.

                                 {
        isSelected = false;
    }

Here is the call graph for this function:

Here is the caller graph for this function:

void fr.ove.openmath.jome.ctrlview.bidim.Display.setRank ( int  rank) [inline, inherited]

Sets the rank of the display.

Parameters:
rankthe rank.

Definition at line 440 of file Display.java.

                                  {
        this.rank = rank;
    }

Here is the caller graph for this function:

Sets the display as selected.

Definition at line 1132 of file Display.java.

                              {
        isSelected = true;
    }

Here is the call graph for this function:

Here is the caller graph for this function:

void fr.ove.openmath.jome.ctrlview.bidim.Display.setSelectionColor ( Color  selectionColor) [inline, inherited]

Sets a new selection color to the context.

Parameters:
selectionColorthe new color.

Implements fr.ove.openmath.jome.ctrlview.bidim.Colorizable.

Definition at line 1208 of file Display.java.

                                                        {
        graphicContext.setSelectionColor(selectionColor);
    }

Here is the call graph for this function:

void fr.ove.openmath.jome.ctrlview.bidim.Display.setShiftX ( int  shiftX) [inline, inherited]

Sets the horizontal shift.

Parameters:
shiftthe new horizontal shift value.

Implements fr.ove.openmath.jome.ctrlview.bidim.Displayable.

Definition at line 969 of file Display.java.

                                      {
        this.shiftX = shiftX;
    }

Here is the caller graph for this function:

void fr.ove.openmath.jome.ctrlview.bidim.Display.setShiftY ( int  shiftY) [inline, inherited]

Sets the vertical shift.

Parameters:
shiftYthe new vertical shift value.

Implements fr.ove.openmath.jome.ctrlview.bidim.Displayable.

Definition at line 985 of file Display.java.

                                      {
        this.shiftY = shiftY;
    }

Here is the caller graph for this function:

void fr.ove.openmath.jome.ctrlview.bidim.Sizable.setSize ( int  width,
int  height 
) [inherited]

Sets the size of the instance.

Parameters:
widththe width of the instance.
heightthe height of the instance

Implemented in fr.ove.openmath.jome.ctrlview.bidim.DisplayableImpl.

Here is the caller graph for this function:

void fr.ove.openmath.jome.ctrlview.bidim.Sizable.setSize ( Dimension  size) [inherited]

Sets the size of the instance.

Parameters:
sizethe size of the instance.

Implemented in fr.ove.openmath.jome.ctrlview.bidim.DisplayableImpl.

void fr.ove.openmath.jome.ctrlview.bidim.Display.setTheFont ( Font  font) [inline, protected, inherited]

Definition at line 871 of file Display.java.

                                         {
        super.setFont(font);
    }

Here is the caller graph for this function:

void fr.ove.openmath.jome.ctrlview.bidim.Display.setUpdateLevel ( boolean  updateLevel) [inline, inherited]

Sets the level to be updated.

Parameters:
updateLeveltrue if the display level need to be updated. false otherwise.

Definition at line 340 of file Display.java.

                                                    {
        this.updateLevel = updateLevel;
        if (updateLevel) {
            int count = getComponentCount();
            for (int i = 0; i < count; i++)
                ((Display) getComponent(i)).setUpdateLevel(updateLevel);
        }
    }

Here is the caller graph for this function:

void fr.ove.openmath.jome.ctrlview.bidim.Display.setWidth ( int  width) [inline, inherited]

Sets the width of the instance.

Parameters:
widththe width of the instance

Implements fr.ove.openmath.jome.ctrlview.bidim.Sizable.

Definition at line 1072 of file Display.java.

Here is the call graph for this function:

Here is the caller graph for this function:

void fr.ove.openmath.jome.ctrlview.bidim.Display.setX ( int  x) [inline, inherited]

Sets the x-location of the instance.

Parameters:
xthe x-location of the instance.

Implements fr.ove.openmath.jome.ctrlview.bidim.Localisable.

Definition at line 1036 of file Display.java.

Here is the call graph for this function:

void fr.ove.openmath.jome.ctrlview.bidim.Display.setY ( int  y) [inline, inherited]

Sets the y-location of the instance.

Parameters:
ythe y-location of the instance.

Implements fr.ove.openmath.jome.ctrlview.bidim.Localisable.

Definition at line 1051 of file Display.java.

Here is the call graph for this function:

void fr.ove.openmath.jome.ctrlview.bidim.Display.substitute ( String  name) [inline, inherited]

Substitutes the selection by the specified friendly name.

Parameters:
thename for the substitution

Definition at line 879 of file Display.java.

                                        {
        SelectionEvent selectionEvent = new SelectionEvent(this);

        // On récupère la taille de la sélection.
        Integer selectionSize = null;
        selectionEvent.setAction(SelectionEvent.GET_SELECTION_SIZE, selectionSize);
        fireSelectionEvent(selectionEvent);
        selectionSize = (Integer) selectionEvent.getArgument();
        // Si différent de 0, il y a qque chose à substituer.
        if (selectionSize.intValue() != 0) {
            // On récupère la sélection entière.
            Vector selection = null;
            selectionEvent.setAction(SelectionEvent.GET_SELECTION, selection);
            fireSelectionEvent(selectionEvent);
            selection = (Vector) selectionEvent.getArgument();
            // On créé la liste des éléments à iconifier. (on enlève les displays
            // d'opérateurs parasites, et aux displays qui restent, on récupère
            // la fts dont ils sont le display).
            Display display;
            FormulaTreeStructure fts;
            Vector toIconify = new Vector();
            for (int i = 0; i < selectionSize.intValue(); i++) {
                display = (Display) selection.elementAt(i);
                if (!display.isSymbolOperatorDisplay()) {
                    // On désélectionne le display
                    display.deselect();
                    // On récupère le fts associé au display.
                    fts = (FormulaTreeStructure) display.getListener();
                    // On l'ajoute à la liste des fts à iconifier
                    toIconify.addElement(fts);
                }
            }
            // On purge la sélection
            selectionEvent.setAction(SelectionEvent.PURGE, null);
            fireSelectionEvent(selectionEvent);
            
            // On rajoute comme premier élément à toIconify le nom de la substitution
            toIconify.insertElementAt(name, 0);
            
            // On envoie l'événement au modèle pour lui dire qu'il faut faire la substitution
            ControlEvent controlEvent = new ControlEvent(this);
            controlEvent.setAction(ControlEvent.SUBSTITUTE, toIconify);
            fireControlEvent(controlEvent);
        }
    }

Here is the call graph for this function:

For debugg only !!!!

Reimplemented in fr.ove.openmath.jome.ctrlview.bidim.AbstractStringDisplay.

Definition at line 1452 of file Display.java.

                           {
        System.out.println(super.toString());
        System.out.println("\t x = " + getX() + " y = " + getY());
        System.out.println("\t ascent = " + ascent + " descent = " + descent);
        System.out.println("\t width = " + getWidth() + " height = " + getHeight());
    }

Here is the call graph for this function:

Uniconifies all the selected icons which are in the formula.

Definition at line 1303 of file Display.java.

                            {
        SelectionEvent selectionEvent = new SelectionEvent(this);
        // On récupère la taille de la sélection.
        Integer selectionSize = null;
        selectionEvent.setAction(SelectionEvent.GET_SELECTION_SIZE, selectionSize);
        fireSelectionEvent(selectionEvent);
        selectionSize = (Integer) selectionEvent.getArgument();
        // Si différente de 0, il y a éventuellement qque chose à désiconifier.
        if (selectionSize.intValue() != 0) {
            // On récupère la sélection entière.
            Vector selection = null;
            selectionEvent.setAction(SelectionEvent.GET_SELECTION, selection);
            fireSelectionEvent(selectionEvent);
            selection = (Vector) selectionEvent.getArgument();
            selectionEvent.setAction(SelectionEvent.PURGE, null);
            fireSelectionEvent(selectionEvent);
            // On parcourt la liste de sélection, et si l'on a affaire à une icone
            // on la désiconifie.
            Display display = null;
            FormulaTreeStructure fts = null;
            for (int i = 0; i < selectionSize.intValue(); i++) {
                display = (Display) selection.elementAt(i);
                // On désélectionne le display.
                display.deselect();
                // On récupère le fts associé au display.
                fts = (FormulaTreeStructure) display.getListener();
                if (fts.isIcon()) {
                    display.computeAncestorsAttributes();
                    // On envoie un événement pour dire au modèle qu'il doit
                    // déisconifier fts.
                    ControlEvent controlEvent = new ControlEvent(this);
                    controlEvent.setAction(ControlEvent.UNICONIFY, fts);
                    fireControlEvent(controlEvent);
                }
            }
        }
    }

Here is the call graph for this function:

Here is the caller graph for this function:

Uniconifies all the selected icons.


If the icons contains other icons, these are uniconified. There is a recursion process.

Definition at line 1346 of file Display.java.

                               {
        ControlEvent controlEvent = new ControlEvent(this);
        controlEvent.setAction(ControlEvent.UNICONIFY_ALL, null);
        fireControlEvent(controlEvent);
    }

Here is the call graph for this function:

Recurses into the tree of the display to inform the ancestors of the instance that they need to update their level.

Definition at line 361 of file Display.java.

                                       {
        Container parent = getParent();
        while (parent instanceof Display) {
            ((Display) parent).setUpdateLevel(true);
            parent = parent.getParent();
        }
    }

Here is the call graph for this function:

Recurses into the tree of the display to inform the children of the instance that they need to update their level.

Definition at line 373 of file Display.java.

                                      {
        Display childDisplay;
        int count = getComponentCount();
        for (int i = 0; i < count; i++) {
            childDisplay = (Display) getComponent(i);
            childDisplay.setUpdateLevel(true);
            childDisplay.updateChildrenLevel();
        }
    }

Here is the call graph for this function:

Here is the caller graph for this function:

Checks if the bound must be drawn or not.

Returns:
true if we have to draw the bounds of the display. false otherwise.

Definition at line 298 of file Display.java.

                                  {
        return weDrawBounds;
    }

Here is the caller graph for this function:

Reimplemented in fr.ove.openmath.jome.ctrlview.bidim.AbstractStringDisplay.

Definition at line 1459 of file Display.java.

                         {
        System.out.println("I am a " + getClass().getName() + " with the " + getLayout().getClass().getName()  + " manager");
        System.out.println("My level is " + level);
        System.out.println("My children are :");
        for (int i = 0; i < getComponentCount(); i++)
            ((Display) getComponent(i)).whoAmI();
    }

Member Data Documentation

Are we in drag'n drop mode ??

Definition at line 120 of file Display.java.

Indicates whether the symbol is selected or not.

Definition at line 74 of file Display.java.

The image loader.

Definition at line 51 of file FormulaDisplay.java.


The documentation for this class was generated from the following file: