Back to index

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

An implementation of the Displayable interface. More...

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

List of all members.

Public Member Functions

 DisplayableImpl ()
 The default constructor.
 DisplayableImpl (Rectangle bounds, int ascent, int descent, int shiftX, int shiftY)
 The constructor.
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 of the instance.
GraphicContext getGraphicContext ()
 Returns the graphic context of the instance.
void setX (int x)
 Sets the x-location of the instance.
int getX ()
 Returns the x-location of the instance.
void setY (int y)
 Sets the y-location of the instance.
int getY ()
 Returns the y-location of the instance.
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.
int getWidth ()
 Returns the width of the instance.
void setWidth (int width)
 Sets the width of the instance.
int getHeight ()
 Returns the height of the instance.
void setHeight (int height)
 Sets the height 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.
void paint (Graphics g)
 The paint method of the object to display.

Private Attributes

Rectangle bounds
 The bounds of the instance.
int ascent
 Distance between the top of the bounding box of the element to display and its baseline.
int descent
 Distance between the bottom of the bounding box of the element to display and its baseline.
int shiftX
 An horizontal shift.
int shiftY
 A vertical shift.
GraphicContext graphicContext
 The graphic context of the displayable object.

Detailed Description

An implementation of the Displayable interface.


Nevertheless, it is an abstract class, because we don't know a priori how to paint it. This will be one of the tasks of the inherited classes.

Author:
© 1999 DIRAT Laurent
Version:
2.0 29/06/1999

Definition at line 45 of file DisplayableImpl.java.


Constructor & Destructor Documentation

The default constructor.


By default, all the parameters equal to 0.

Definition at line 82 of file DisplayableImpl.java.

                             {
        this(new Rectangle(), 0, 0, 0, 0);
    }
fr.ove.openmath.jome.ctrlview.bidim.DisplayableImpl.DisplayableImpl ( Rectangle  bounds,
int  ascent,
int  descent,
int  shiftX,
int  shiftY 
) [inline]

The constructor.

Parameters:
boundsthe bounds of the instance.
ascentthe ascent of the instance.
descentthe descent of the instance.
shiftXthe horizontal shift of the instance.
shiftYthe vertical shift of the instance.

Definition at line 94 of file DisplayableImpl.java.

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

Member Function Documentation

Returns the ascent.

Returns:
the ascent.

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

Definition at line 122 of file DisplayableImpl.java.

                           {
        return ascent;
    }

Here is the caller graph for this function:

Returns the descent.

Returns:
the descent.

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

Definition at line 138 of file DisplayableImpl.java.

                            {
        return descent;
    }

Returns the graphic context of the instance.

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

Definition at line 202 of file DisplayableImpl.java.

                                              {
        return graphicContext;
    }

Here is the caller graph for this function:

Returns the height of the instance.

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

Definition at line 291 of file DisplayableImpl.java.

                           {
        return bounds.height;
    }

Here is the caller graph for this function:

Returns the location of the instance.

Returns:
A Point representing the location of the instance.

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

Definition at line 263 of file DisplayableImpl.java.

                               {
        return bounds.getLocation();
    }

Returns the horizontal shift.

Returns:
the horizontal shift.

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

Definition at line 154 of file DisplayableImpl.java.

                           {
        return shiftX;
    }

Returns the vertical shift.

Returns:
the vertical shift.

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

Definition at line 170 of file DisplayableImpl.java.

                           {
        return shiftY;
    }

Returns the size of the instance.

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

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

Definition at line 306 of file DisplayableImpl.java.

                               {
        return bounds.getSize();
    }

Here is the caller graph for this function:

Returns the width of the instance.

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

Definition at line 276 of file DisplayableImpl.java.

                          {
        return bounds.width;
    }

Here is the caller graph for this function:

Returns the x-location of the instance.

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

Definition at line 223 of file DisplayableImpl.java.

                      {
        return bounds.x;
    }

Returns the y-location of the instance.

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

Definition at line 238 of file DisplayableImpl.java.

                      {
        return bounds.y;
    }

Sets the ascent.

Parameters:
ascentthe new ascent value.

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

Definition at line 114 of file DisplayableImpl.java.

                                      {
        this.ascent = ascent;
    }

Here is the caller graph for this function:

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

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.

Definition at line 181 of file DisplayableImpl.java.

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

Sets the descent.

Parameters:
descentthe new descent value.

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

Definition at line 130 of file DisplayableImpl.java.

                                        {
        this.descent = descent;
    }

Here is the caller graph for this function:

Sets the graphic context of the instance.

Parameters:
graphicContextthe graphic context.

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

Reimplemented in fr.ove.openmath.jome.ctrlview.bidim.CurlySymbol, fr.ove.openmath.jome.ctrlview.bidim.BracketSymbol, and fr.ove.openmath.jome.ctrlview.bidim.ImageSymbol.

Definition at line 192 of file DisplayableImpl.java.

                                                                 {
        // contrairement à la création d'un display, il n'y a pas allocation mais maintient d'une référence
        // sur graphicContext, qui est en fait le contexte graphique du display (dans notre cas précis) qui
        // va afficher l'objet.
        this.graphicContext = graphicContext;
    }

Sets the height of the instance.

Parameters:
heightthe height of the instance

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

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

Definition at line 299 of file DisplayableImpl.java.

                                      {
        bounds.height = height;
    }

Here is the caller graph for this function:

Sets the location of the instance.

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

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

Definition at line 247 of file DisplayableImpl.java.

                                          {
        bounds.setLocation(x, y);
    }

Sets the location of the instance.

Parameters:
locationthe location of the instance.

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

Definition at line 255 of file DisplayableImpl.java.

                                            {
        bounds.setLocation(location);
    }

Sets the horizontal shift.

Parameters:
shiftXthe new horizontal shift value.

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

Definition at line 146 of file DisplayableImpl.java.

                                      {
        this.shiftX = shiftX;
    }

Sets the vertical shift.

Parameters:
shiftYthe new vertical shift value.

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

Definition at line 162 of file DisplayableImpl.java.

                                      {
        this.shiftY = shiftY;
    }
void fr.ove.openmath.jome.ctrlview.bidim.DisplayableImpl.setSize ( int  width,
int  height 
) [inline]

Sets the size of the instance.

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

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

Definition at line 315 of file DisplayableImpl.java.

                                               {
        bounds.setSize(width, height);
    }

Sets the size of the instance.

Parameters:
sizethe size of the instance.

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

Definition at line 323 of file DisplayableImpl.java.

                                        {
        bounds.setSize(size);
    }

Sets the width of the instance.

Parameters:
widththe width of the instance

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

Definition at line 284 of file DisplayableImpl.java.

                                    {
        bounds.width = width;
    }

Here is the caller graph for this function:

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 216 of file DisplayableImpl.java.

                            {
        bounds.x = x;
    }

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 231 of file DisplayableImpl.java.

                            {
        bounds.y = y;
    }

Member Data Documentation

Distance between the top of the bounding box of the element to display and its baseline.

Definition at line 55 of file DisplayableImpl.java.

The bounds of the instance.

We keep location and size information.

Definition at line 49 of file DisplayableImpl.java.

Distance between the bottom of the bounding box of the element to display and its baseline.

Definition at line 61 of file DisplayableImpl.java.

The graphic context of the displayable object.

Definition at line 76 of file DisplayableImpl.java.

An horizontal shift.

Definition at line 66 of file DisplayableImpl.java.

A vertical shift.

Definition at line 71 of file DisplayableImpl.java.


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