Back to index

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

The display for variables and numbers. More...

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

List of all members.

Public Member Functions

 StringDisplay (GraphicContext graphicContext, String string, boolean isSymbolOperatorDisplay)
 The constructor.
void consumeModelEvent (ModelEvent modelEvent)
 Consumes (i.e.
void setString (String string)
 Sets a new string to the display.
String getString ()
 Returns the string to display.
void scaleDisplay ()
 Scales the display.
void paint (Graphics g)
 Paints the display.
int computeInsertionPosition (int mouseX)
 Returns the insertion position for the moving of displays.
void ToString ()
 For debugg only !!!!
void whoAmI ()
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 moveSelectedDisplays (int mouseX)
 Moves the selected displays to the mouse position.
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 addControlListener (ControlListener controlListener)
 Registers another listener to be informed of changes of the display.
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 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.
Dimension getPreferredSize ()
 Returns the preferred 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 ??

Detailed Description

The display for variables and numbers.

Author:
© 1999 DIRAT Laurent
Version:
2.0 04/08/1999

Definition at line 47 of file StringDisplay.java.


Constructor & Destructor Documentation

fr.ove.openmath.jome.ctrlview.bidim.StringDisplay.StringDisplay ( GraphicContext  graphicContext,
String  string,
boolean  isSymbolOperatorDisplay 
) [inline]

The constructor.

Parameters:
graphicContextthe graphic context of the display.
stringthe string to display
isSymbolOperatorDisplaytrue if the instance is the display of an operator. false otherwise.

Definition at line 55 of file StringDisplay.java.

                                                                                                         {
        super(graphicContext, string);
        setIsSymbolOperatorDisplay(isSymbolOperatorDisplay);
        StringLayout layout = new StringLayout();
        layout.initDisplay(this);
        setLayout(layout);
        
        addMouseListener(
            new MouseAdapter() {
                public void mouseEntered(MouseEvent e) {
                    if (!isSymbolOperatorDisplay()) {
                        if (getListener() instanceof VariableOrNumber) {
                            VariableOrNumber listener = (VariableOrNumber) getListener();
                            if (listener.isNumber() && !listener.isInteger()) {
                                // On a affaire à un float
                                String value = listener.getValue();
                                
                                //if (!value.equals(StringDisplay.this.getString())) {
                                if (!value.equals(getString())) {
                                    setString(value);
                                    invalidate();
                                    computeAncestorsAttributes();
                                    Container container = StringDisplay.this;
                                    while (container.getParent() != null)
                                        container = container.getParent();
                                        
                                    container.validate();
                                    container.repaint();
                                }
                            }
                        }
                    }
                }
                
                public void mouseExited(MouseEvent e) {
                    if (!isSymbolOperatorDisplay()) {
                        if (getListener() instanceof VariableOrNumber) {
                            VariableOrNumber listener = (VariableOrNumber) getListener();
                            if (listener.isNumber() && !listener.isInteger()) {
                                // On a affaire à un float
                                String value = listener.getValue();
                                String newString = NumberUtils.formatDouble(value);
                                
                                if (!newString.equals(value)) {
                                    setString(newString);
                                    StringDisplay.this.invalidate();
                                    StringDisplay.this.computeAncestorsAttributes();
                                    Container container = StringDisplay.this;
                                    while (container.getParent() != null)
                                        container = container.getParent();
                                        
                                    container.validate();
                                    container.repaint();
                                }
                            }
                        }
                    }
                }
            }
        );
    }

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.Display.addControlListener ( ControlListener  controlListener) [inline, inherited]

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

Parameters:
controlListenera listener to add.

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

Definition at line 1381 of file Display.java.

                                                                    {
        listener = controlListener;
    }

Here is the caller 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 from fr.ove.openmath.jome.ctrlview.bidim.Display.

Definition at line 140 of file AbstractStringDisplay.java.

                                                    {
        int insertionPosition;
        // Si l'instance courante est un display d'opérateur, alors la position
        // d'insertion est la position de l'opérande dont le display suit l'instance
        // courante.
        if (isSymbolOperatorDisplay()) {
            Display display = (Display) getParent();
            display = (Display) display.getComponent(getRank() + 1);  // On est sûr de pouvoir prendre rank+1
            // puisque si on est sur une display d'opérateur, au pire on a un template.
            insertionPosition = ((FormulaTreeStructure) display.getListener()).getRank();
        }
        else {
            // 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 l'instance est le display + 1.
            if (mouseX <= (getWidth() / 2))
                insertionPosition = ((FormulaTreeStructure) getListener()).getRank();
            else
                insertionPosition = ((FormulaTreeStructure) getListener()).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:

Consumes (i.e.

treats) the event received from the model.

Parameters:
modelEventthe event to consume.

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

Definition at line 121 of file StringDisplay.java.

                                                         {
        // En principe, c'est le seul événement que doit recevoir ce type de display
        // De plus, forcément, le display représenté n'est pas le display d'un opérateur.
        switch (modelEvent.getAction()) {
            case ModelEvent.UPDATE :
                //System.out.println("ModelEvent.UPDATE : on update le StringDisplay");
                VariableOrNumber src = (VariableOrNumber) modelEvent.getSource();
                
                // On met à jour le display.
                // Ca c'est pour la troncature de l'affichage d'une nombre flottant dépassant
                // 2 chiffres après la virgule
                if (!isSymbolOperatorDisplay()) {
                    if (src.isNumber() && !src.isInteger())
                        // On a affaire à un float
                        setString(NumberUtils.formatDouble(src.getValue()));
                    else
                        setString(src.getValue());
                }
                else
                    setString(src.getValue());

                computeAncestorsAttributes();
                invalidate();
        }
    }

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

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 rank of the display.

Definition at line 447 of file Display.java.

                         {
        return rank;
    }

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:

Returns the string to display.

Returns:
the string.

Definition at line 75 of file AbstractStringDisplay.java.

                              {
        return string;
    }

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.AbstractStringDisplay.paint ( Graphics  g) [inline, inherited]

Paints the display.

Parameters:
gwhere we paint the display.

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

Definition at line 98 of file AbstractStringDisplay.java.

                                  {
        super.paint(g);
        
        Color old = g.getColor();
        Font oldFont = g.getFont();
        Rectangle bounds = getBounds();
        
        if (isSelected())
            g.setColor(getSelectionColor());
        else
            g.setColor(getBackgroundColor());
            
        g.fillRect(0, 0, bounds.width /*- 1*/, bounds.height /*- 1*/);
        
        g.setColor(getForegroundColor());
        g.setFont(getFont());
        
        if (weDrawBounds())
            g.drawRect(0, 0, bounds.width - 1, bounds.height - 1);
        
        
        if ( string.equals("*") )
            g.drawString(string, 1, getHeight());
        else if ( string.equals("-") )
            g.drawString(string, 1, getAscent() - (int) Math.round(getDescent()*(40.0f/100.0f)));
        else
            g.drawString(string, 1, getAscent());
        
        /*
        // on trace la baseline
        g.setColor(Color.red);
        g.drawLine(0, getAscent(), bounds.width, getAscent());
        */
        
        g.setColor(old);
        g.setFont(oldFont);
    }

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 from fr.ove.openmath.jome.ctrlview.bidim.Display.

Definition at line 82 of file AbstractStringDisplay.java.

                               {
        //System.out.println("string : " + string +"   Level = " + getLevel());
        setTheFont(getGraphicContext().scaleFont(getLevel()));
        // Il faut que le layout manager recalcule les attributs du display.
        setComputeAttributes(true);
        // Ceci est nécessaire pour que ce soit le layout manager qui retourne
        // la preferredSize du display, et donc qu'il y ait recalcul des attributs.
        // Sinon, le container considère qu'il a une taille valide, et donc retourne
        // comme preferredSize, la précédente, sans qu'il demande le recalcul au LM.
        invalidate();
    }    

Here is the call 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:

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.AbstractStringDisplay.setString ( String  string) [inline, inherited]

Sets a new string to the display.

Parameters:
stringthe string to set.

Definition at line 67 of file AbstractStringDisplay.java.

                                           {
        this.string = string;
    }

Here is the caller graph for this function:

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 from fr.ove.openmath.jome.ctrlview.bidim.Display.

Definition at line 169 of file AbstractStringDisplay.java.

                           {
        super.ToString();
        System.out.println(" string = " + string);
    }

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 from fr.ove.openmath.jome.ctrlview.bidim.Display.

Definition at line 174 of file AbstractStringDisplay.java.

                         {
        System.out.println("I am the StringDisplay : " + string);
        System.out.println("My level is " + getLevel());
    }

Here is the call graph for this function:


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 documentation for this class was generated from the following file: