Back to index

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

A layout manager that lays display of substitued displays. More...

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

List of all members.

Public Member Functions

void validateSelection ()
 Checks the validity of the selection.
void validateDeselection (Display display)
 Checks the validity of the deselection.
void addSubstitutedDisplay (Display display)
void removeSubstitutedDisplay (Display display)
void removeSubstitutedDisplay (int rank)
Display getSubstitutedDisplay (int rank)
 Returns the substituted display at the specified rank.
int getNbSubstitutedDisplay ()
 Returns the number of substituted displays.
void updateLevel (int level)
 Updates the level of the display that is layed out.
Dimension computeAttributes ()
 Computes the size of the display and its different attributes.
void layoutContainer (Container parent)
void rebuildDisplay ()
 The display needs to be rebuilt.
void initDisplay (Display displayToLay)
 According to the operator, the layout manager has to add some components (e.g.
boolean selectLeftDisplay ()
 Returns true if during the selection, the display which is located to the left of the display that the instance lays, must be selected too.
boolean selectRightDisplay ()
 Returns true if during the selection, the display which is located to the right of the display that the instance lays, must be selected too.
void selectDisplay ()
 Selects the display (and its children if any)
void deselectDisplay ()
 Deselects the display.
void addLayoutComponent (String name, Component comp)
 Adds the specified component with the specified name to the layout.
void addLayoutComponent (Component comp, Object constraints)
 Adds the specified component to the layout, using the specified constraint object.
void removeLayoutComponent (Component comp)
 Removes the specified component from the layout.
Dimension minimumLayoutSize (Container parent)
 Calculates the minimum size dimensions for the specified panel given the components in the specified parent container.
Dimension preferredLayoutSize (Container parent)
 Calculates the preferred size dimensions for the specified panel given the components in the specified parent container.
Dimension maximumLayoutSize (Container target)
 Returns the maximum size of this component.
float getLayoutAlignmentX (Container target)
 Returns the alignment along the x axis.
float getLayoutAlignmentY (Container target)
 Returns the alignment along the y axis.
void invalidateLayout (Container target)
 Invalidates the layout, indicating that if the layout manager has cached information it should be discarded.

Protected Attributes

Display displayToLay = null
 The display laid out by the instance.

Private Attributes

Vector substitutedDisplay = new Vector()
 The list of the displays that have been iconified.

Detailed Description

A layout manager that lays display of substitued displays.

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

Definition at line 45 of file SubstitutionLayout.java.


Member Function Documentation

void fr.ove.openmath.jome.ctrlview.bidim.DisplayLayout.addLayoutComponent ( String  name,
Component  comp 
) [inline, inherited]

Adds the specified component with the specified name to the layout.

Parameters:
namethe component name
compthe component to be added

Definition at line 189 of file DisplayLayout.java.

                                                                {
    }
void fr.ove.openmath.jome.ctrlview.bidim.DisplayLayout.addLayoutComponent ( Component  comp,
Object  constraints 
) [inline, inherited]

Adds the specified component to the layout, using the specified constraint object.

Parameters:
compthe component to be added
constraintswhere/how the component is added to the layout.

Definition at line 236 of file DisplayLayout.java.

                                                                       {
           if (!(constraints instanceof Display))
              throw new IllegalArgumentException("The component to add must be a Display instance !!!");
    }

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

Definition at line 67 of file SubstitutionLayout.java.

                                                       {
        substitutedDisplay.addElement(display);
    }

Computes the size of the display and its different attributes.

Returns:
the size of the display.

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

Definition at line 61 of file AbstractStringLayout.java.

                                         {
        FontMetrics fm = displayToLay.getFontMetrics(displayToLay.getFont());
        
        displayToLay.setAscent(fm.getAscent());
        displayToLay.setDescent(fm.getDescent());
        
        int width = fm.stringWidth(((AbstractStringDisplay) displayToLay).getString()) + 2;
        int height = displayToLay.getAscent() + displayToLay.getDescent();
        
        displayToLay.setSize(width, height);
        displayToLay.setComputeAttributes(false);
        
        return new Dimension(width, height);
    }

Here is the call graph for this function:

Here is the caller graph for this function:

Deselects the display.

Parameters:
thedisplay to deselect.

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

Definition at line 107 of file DisplayLayout.java.

                                  {
        displayToLay.deselect();

        SelectionEvent selEvt = new SelectionEvent(displayToLay);
        selEvt.setAction(SelectionEvent.REMOVE, displayToLay);
        displayToLay.fireSelectionEvent(selEvt);
        
        if (displayToLay.getParent() instanceof Display) {
            Display display = (Display) displayToLay.getParent();
            ((DisplayLayout) display.getLayout()).validateDeselection(displayToLay);
        }
    }

Here is the call graph for this function:

Here is the caller graph for this function:

float fr.ove.openmath.jome.ctrlview.bidim.DisplayLayout.getLayoutAlignmentX ( Container  target) [inline, inherited]

Returns the alignment along the x axis.

This specifies how the component would like to be aligned relative to other components. The value should be a number between 0 and 1 where 0 represents alignment along the origin, 1 is aligned the furthest away from the origin, 0.5 is centered, etc.

Definition at line 258 of file DisplayLayout.java.

                                                       {
        return 0.0f;
    }
float fr.ove.openmath.jome.ctrlview.bidim.DisplayLayout.getLayoutAlignmentY ( Container  target) [inline, inherited]

Returns the alignment along the y axis.

This specifies how the component would like to be aligned relative to other components. The value should be a number between 0 and 1 where 0 represents alignment along the origin, 1 is aligned the furthest away from the origin, 0.5 is centered, etc.

Definition at line 269 of file DisplayLayout.java.

                                                       {
        return 0.0f;
    }

Returns the number of substituted displays.

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

Definition at line 98 of file SubstitutionLayout.java.

                                         {
        return substitutedDisplay.size();
    }

Returns the substituted display at the specified rank.

Parameters:
rankthe specified rank.

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

Definition at line 91 of file SubstitutionLayout.java.

                                                   {
        return (Display) substitutedDisplay.elementAt(rank);
    }
void fr.ove.openmath.jome.ctrlview.bidim.DisplayLayout.initDisplay ( Display  displayToLay) [inline, inherited]

According to the operator, the layout manager has to add some components (e.g.

brackets, ...) or has to perform some "re-oganisation" before rendering.
As soon as the layout manager is set to the display, this mehtod MUST be called with the display laid out as parameter. This method serves as well as a registering method. So all sub-classes of the instance MUST call super.initDisplay(displayToLay).

Parameters:
displayToLaythe display laid by the instance

Reimplemented in fr.ove.openmath.jome.ctrlview.bidim.EnclosingLayout, fr.ove.openmath.jome.ctrlview.bidim.SuperposedOperatorLayout, fr.ove.openmath.jome.ctrlview.bidim.VarDiffLayout, fr.ove.openmath.jome.ctrlview.bidim.MapsArrayLayout, fr.ove.openmath.jome.ctrlview.bidim.MapsToSigmaLayout, fr.ove.openmath.jome.ctrlview.bidim.IntegralLayout, fr.ove.openmath.jome.ctrlview.bidim.Mfd2SubstitutionLayout, fr.ove.openmath.jome.ctrlview.bidim.HorizontalListLayout, fr.ove.openmath.jome.ctrlview.bidim.DifferentiationLayout, fr.ove.openmath.jome.ctrlview.bidim.IntervalLayout, fr.ove.openmath.jome.ctrlview.bidim.LambdaExpLayout, fr.ove.openmath.jome.ctrlview.bidim.BetweenOperatorLayout, fr.ove.openmath.jome.ctrlview.bidim.EnumerationLayout, fr.ove.openmath.jome.ctrlview.bidim.FunctionLayout, fr.ove.openmath.jome.ctrlview.bidim.RootLayout, fr.ove.openmath.jome.ctrlview.bidim.LimitLayout, and fr.ove.openmath.jome.ctrlview.bidim.UnaryOperatorLayout.

Definition at line 58 of file DisplayLayout.java.

Here is the caller graph for this function:

void fr.ove.openmath.jome.ctrlview.bidim.DisplayLayout.invalidateLayout ( Container  target) [inline, inherited]

Invalidates the layout, indicating that if the layout manager has cached information it should be discarded.

Definition at line 277 of file DisplayLayout.java.

                                                   {
    }
void fr.ove.openmath.jome.ctrlview.bidim.AbstractStringLayout.layoutContainer ( Container  parent) [inline, inherited]

Definition at line 80 of file AbstractStringLayout.java.

                                                   {
        return;
     }
Dimension fr.ove.openmath.jome.ctrlview.bidim.DisplayLayout.maximumLayoutSize ( Container  target) [inline, inherited]

Returns the maximum size of this component.

See also:
java.awt.Component::getMinimumSize()
java.awt.Component::getPreferredSize()
LayoutManager

Definition at line 247 of file DisplayLayout.java.

                                                         {
        return preferredLayoutSize(target);
    }

Here is the call graph for this function:

Dimension fr.ove.openmath.jome.ctrlview.bidim.DisplayLayout.minimumLayoutSize ( Container  parent) [inline, inherited]

Calculates the minimum size dimensions for the specified panel given the components in the specified parent container.

Parameters:
parentthe component to be laid out
See also:
preferredLayoutSize

Definition at line 205 of file DisplayLayout.java.

                                                         {
        return preferredLayoutSize(parent);
    }

Here is the call graph for this function:

Dimension fr.ove.openmath.jome.ctrlview.bidim.DisplayLayout.preferredLayoutSize ( Container  parent) [inline, inherited]

Calculates the preferred size dimensions for the specified panel given the components in the specified parent container.

Parameters:
parentthe component to be laid out
See also:
minimumLayoutSize

Definition at line 216 of file DisplayLayout.java.

                                                           {
        if (((Display) parent).getComputeAttributes())
            return computeAttributes();
        else
            return parent.getSize();
    }

Here is the call graph for this function:

Here is the caller graph for this function:

The display needs to be rebuilt.

We do this.

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

Definition at line 88 of file AbstractStringLayout.java.

                                 {
        // En fait, celui là ne sera jamais reconstruit.
    }

Removes the specified component from the layout.

Parameters:
compthe component ot be removed

Definition at line 196 of file DisplayLayout.java.

                                                      {
    }

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

Definition at line 75 of file SubstitutionLayout.java.

                                                          {
        substitutedDisplay.removeElement(display);
    }

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

Definition at line 83 of file SubstitutionLayout.java.

                                                   {
        substitutedDisplay.removeElementAt(rank);
    }

Selects the display (and its children if any)

Parameters:
thedisplay to select.

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

Definition at line 85 of file DisplayLayout.java.

                                {
        displayToLay.select();
        
        SelectionEvent selEvt = new SelectionEvent(displayToLay);
        // On purge la liste des éléments sélectionnés.
        selEvt.setAction(SelectionEvent.PURGE, null);
        displayToLay.fireSelectionEvent(selEvt);
        selEvt.setAction(SelectionEvent.ADD, displayToLay);
        displayToLay.fireSelectionEvent(selEvt);
        
        Display display = displayToLay;
        if (displayToLay.getParent() instanceof Display) {
            display = (Display) displayToLay.getParent();
            ((DisplayLayout) display.getLayout()).validateSelection();
        }
    }

Here is the call graph for this function:

Here is the caller graph for this function:

Returns true if during the selection, the display which is located to the left of the display that the instance lays, must be selected too.

false otherwise.

Reimplemented in fr.ove.openmath.jome.ctrlview.bidim.LeftAssocPrefixedUnaryOperatorLayout, and fr.ove.openmath.jome.ctrlview.bidim.StringLayout.

Definition at line 68 of file DisplayLayout.java.

                                       {
        return false;
    }

Here is the caller graph for this function:

Returns true if during the selection, the display which is located to the right of the display that the instance lays, must be selected too.

false otherwise.

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

Definition at line 77 of file DisplayLayout.java.

                                        {
        return false;
    }

Here is the caller graph for this function:

Updates the level of the display that is layed out.


Parameters:
levelthe level put to the display

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

Definition at line 48 of file AbstractStringLayout.java.

Here is the call graph for this function:

Checks the validity of the deselection.

Parameters:
displaythe display to deselect.

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

Definition at line 61 of file SubstitutionLayout.java.

                                                     {
    }

Checks the validity of the selection.

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

Definition at line 54 of file SubstitutionLayout.java.

                                    {
    }

Member Data Documentation

The display laid out by the instance.

Definition at line 47 of file DisplayLayout.java.

The list of the displays that have been iconified.

Definition at line 49 of file SubstitutionLayout.java.


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