Back to index

wims  3.65+svn20090927
Public Member Functions | Package Attributes | Private Attributes
fr.ove.openmath.jome.Jome Class Reference
Inheritance diagram for fr.ove.openmath.jome.Jome:
Inheritance graph
[legend]
Collaboration diagram for fr.ove.openmath.jome.Jome:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Jome ()
 The default constructor.
Dimension getPreferredSize ()
 Returns the preferred size of the fr.ove.openmath.jome.
void paint (Graphics g)
 The paint method.
void setLinear (String exp)
 Creates a formula from the specified maple-like expression.
String getLinear ()
 Returns the linear expression of the formula.
String getLinearSelection ()
 Returns the linear expression of the selection.
void setShiftX (int shiftX)
 Sets a horizontal shift to the display of the formula.
int getShiftX ()
 Returns the horizontal shift.
void setShiftY (int shiftY)
 Sets a vertical shift to the display of the formula.
int getShiftY ()
 Returns the vertical shift.
void setFont (Font font)
 Sets a new font to the context.
void setForegroundColor (Color foregroundColor)
 Sets a new color to the context.
Color getForegroundColor ()
 Returns the foreground color used.
void setBackgroundColor (Color backgroundColor)
 Sets a new background color for the display.
Color getBackgroundColor ()
 Returns the background color used.
void setSelectionColor (Color selectionColor)
 Sets a new selection color to the context.
Color getSelectionColor ()
 Returns the selection color used.
void setDrawBounds (boolean drawBounds)
 Sets if we draw the bounds of fr.ove.openmath.jome.
boolean getDrawBounds ()
 Retuns true if we want the bounds to be drawn.
void iconifySelection ()
 Iconifies the selection.
void uniconifySelectedIcons ()
 Uniconifies the selected icons.
void uniconifyAllIcons ()
 Uniconifies all icons in the expression.
void substitute (String name)
 Substitutes the selection by the specified friendly name.

Package Attributes

Display jomeDisplay
 fr.ove.openmath.jome display.
FormulaDisplay formulaDisplay
 The default display of the formula.
LinearParser linearParser = new LinearParser()

Private Attributes

Formula formula
 The formula.
GraphicContext graphicContext
 The graphic context.

Detailed Description

Definition at line 44 of file Jome.java.


Constructor & Destructor Documentation

The default constructor.

Definition at line 78 of file Jome.java.

                  {
        super();
        setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
        super.setFont(graphicContext.getFont());

        // Création de la formule (modèle)
        formula = new Formula();

        linearParser.addLinearParserListener(formula);

        // Création du gestionnaire de la sélection
        SelectionManager selectionManager = new SelectionManager();

        // Création du display par défaut de la formule (vue + contrôle)
        formulaDisplay = new FormulaDisplay();
        formulaDisplay.setGraphicContext(graphicContext);
        formulaDisplay.addControlListener(formula);
        formulaDisplay.setShiftX(10);
        formulaDisplay.setShiftY(10);
        formula.addModelListener(formulaDisplay);

        // Création du display de jome.
        // C'est également un display, qui va contenir le display (par défaut)
        // de la formule.
        jomeDisplay = new BidimDisplay(graphicContext);
        jomeDisplay.drawBounds();
        OneFormulaLayout layout = new OneFormulaLayout();
        layout.initDisplay(jomeDisplay);
        jomeDisplay.setLayout(layout);
        jomeDisplay.addSelectionEventListener(selectionManager);
        // On ajoute le display (par défaut) de la formule dans le display de fr.ove.openmath.jome
        jomeDisplay.add(formulaDisplay);

        // On ajoute de display de jome dans l'instance (i.e. en JOME)
        add(jomeDisplay);

        // On créé la formule.
        setLinear("");
    }

Here is the call graph for this function:


Member Function Documentation

Returns the background color used.

Definition at line 274 of file Jome.java.

                                      {
        return graphicContext.getBackgroundColor();
    }

Retuns true if we want the bounds to be drawn.

false otherwise.

Definition at line 310 of file Jome.java.

                                   {
        return jomeDisplay.weDrawBounds();
    }

Returns the foreground color used.

Definition at line 258 of file Jome.java.

                                      {
        return graphicContext.getForegroundColor();
    }

Returns the linear expression of the formula.

Definition at line 165 of file Jome.java.

                              {
        return formula.createLinear("");
    }

Here is the caller graph for this function:

Returns the linear expression of the selection.

Definition at line 176 of file Jome.java.

                                       {
        return formulaDisplay.getLinearSelection();
    }

Returns the preferred size of the fr.ove.openmath.jome.

Definition at line 125 of file Jome.java.

                                        {
        return jomeDisplay.getPreferredSize();
    }

Returns the selection color used.

Definition at line 290 of file Jome.java.

                                     {
        return graphicContext.getSelectionColor();
    }

Returns the horizontal shift.

Returns:
the horizontal shift.

Definition at line 202 of file Jome.java.

                           {
        return formulaDisplay.getShiftX();
    }

Returns the vertical shift.

Returns:
the vertical shift.

Definition at line 223 of file Jome.java.

                           {
        return formulaDisplay.getShiftY();
    }

Iconifies the selection.

Definition at line 321 of file Jome.java.

                                   {
        formulaDisplay.iconify();
    }
void fr.ove.openmath.jome.Jome.paint ( Graphics  g) [inline]

The paint method.

Parameters:
gwhere the formula is painted.

Definition at line 133 of file Jome.java.

                                  {
        Color oldColor = g.getColor();
        Color color = getBackground();
        if (color != null) {
            g.setColor(color);
            Dimension size = getSize();
            g.fillRect(0, 0, size.width, size.height);
            g.setColor(oldColor);
        }

        super.paint(g);
    }
void fr.ove.openmath.jome.Jome.setBackgroundColor ( Color  backgroundColor) [inline]

Sets a new background color for the display.

Parameters:
backgroundthe color used as background for the display.

Definition at line 266 of file Jome.java.

                                                          {
        graphicContext.setBackgroundColor(backgroundColor);
        repaint();
    }
void fr.ove.openmath.jome.Jome.setDrawBounds ( boolean  drawBounds) [inline]

Sets if we draw the bounds of fr.ove.openmath.jome.

Parameters:
drawBoundstrue if we want the bounds to be drawn. false otherwise.

Definition at line 299 of file Jome.java.

                                                  {
        if (drawBounds)
            jomeDisplay.drawBounds();
        else
            jomeDisplay.dontDrawBounds();
    }

Here is the caller graph for this function:

void fr.ove.openmath.jome.Jome.setFont ( Font  font) [inline]

Sets a new font to the context.

Parameters:
fontthe new font.

Definition at line 236 of file Jome.java.

                                   {
        graphicContext.setFont(font);
        formulaDisplay.setFont(font);
        jomeDisplay.invalidate();
        jomeDisplay.setComputeAttributes(true);
        validate();

        super.setFont(font);
    }

Here is the caller graph for this function:

void fr.ove.openmath.jome.Jome.setForegroundColor ( Color  foregroundColor) [inline]

Sets a new color to the context.

Parameters:
colorthe new color.

Definition at line 250 of file Jome.java.

                                                          {
        graphicContext.setForegroundColor(foregroundColor);
        repaint();
    }
void fr.ove.openmath.jome.Jome.setLinear ( String  exp) [inline]

Creates a formula from the specified maple-like expression.

Parameters:
expthe specified maple-like expression.

Definition at line 154 of file Jome.java.

                                      {
        linearParser.parse(exp);
        jomeDisplay.invalidate();
        jomeDisplay.setComputeAttributes(true);
        validate();
        repaint();
    }

Here is the caller graph for this function:

void fr.ove.openmath.jome.Jome.setSelectionColor ( Color  selectionColor) [inline]

Sets a new selection color to the context.

Parameters:
selectionColorthe new color.

Definition at line 282 of file Jome.java.

                                                        {
        graphicContext.setSelectionColor(selectionColor);
        repaint();
    }
void fr.ove.openmath.jome.Jome.setShiftX ( int  shiftX) [inline]

Sets a horizontal shift to the display of the formula.

Parameters:
shiftYthe vertical shift.

Definition at line 189 of file Jome.java.

                                      {
        shiftX = (shiftX < 1) ? 1 : shiftX;
        formulaDisplay.setShiftX(shiftX);
        jomeDisplay.invalidate();
        jomeDisplay.setComputeAttributes(true);
        validate();
        repaint();
    }
void fr.ove.openmath.jome.Jome.setShiftY ( int  shiftY) [inline]

Sets a vertical shift to the display of the formula.

Parameters:
shiftYthe vertical shift.

Definition at line 210 of file Jome.java.

                                      {
        shiftY = (shiftY < 1) ? 1 : shiftY;
        formulaDisplay.setShiftY(shiftY);
        jomeDisplay.invalidate();
        jomeDisplay.setComputeAttributes(true);
        validate();
        repaint();
    }
void fr.ove.openmath.jome.Jome.substitute ( String  name) [inline]

Substitutes the selection by the specified friendly name.

Parameters:
thename for the substitution

Definition at line 343 of file Jome.java.

                                        {
        if ((name != null) && !name.equals(""))
            formulaDisplay.substitute(name);
    }

Uniconifies all icons in the expression.

Definition at line 335 of file Jome.java.

                                    {
        formulaDisplay.uniconifyAll();
    }

Uniconifies the selected icons.

Definition at line 328 of file Jome.java.

                                         {
        formulaDisplay.uniconify();
    }

Member Data Documentation

The formula.

Definition at line 48 of file Jome.java.

FormulaDisplay fr.ove.openmath.jome.Jome.formulaDisplay [package]

The default display of the formula.

Definition at line 58 of file Jome.java.

GraphicContext fr.ove.openmath.jome.Jome.graphicContext [private]
Initial value:
 new GraphicContext(
            new Font("Times New Roman", Font.PLAIN, 14),
            Color.black,
            Color.white,
            Color.yellow)

The graphic context.

Definition at line 63 of file Jome.java.

fr.ove.openmath.jome display.

Definition at line 53 of file Jome.java.

LinearParser fr.ove.openmath.jome.Jome.linearParser = new LinearParser() [package]

Definition at line 69 of file Jome.java.


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