jaxe.equations.element
Class MathOperator

java.lang.Object
  extended by jaxe.equations.element.MathElement
      extended by jaxe.equations.element.MathOperator

public class MathOperator
extends MathElement

This class presents a operator, like "(" or "*"

Version:
%I%, %G%
Author:
Stephan Michels, Marco Sielaff

Field Summary
static java.lang.String ATTRIBUTE_STRETCHY
          Attribute name of the stretchy property
static java.lang.String ELEMENT
          The XML element from this class
private  double lspace
           
private  double rspace
           
private  boolean stretchy
           
 
Fields inherited from class jaxe.equations.element.MathElement
FO_URI, SVG_URI, URI
 
Constructor Summary
MathOperator()
           
 
Method Summary
 int getAscentHeight(boolean dynamicParts)
          Return the current height of the upper part of this component from the baseline
 int getDescentHeight(boolean dynamicParts)
          Return the current height of the lower part of this component from the baseline
 int getHeight(boolean dynamicParts)
          Return the current height of this element
 int getWidth(boolean dynamicParts)
          Return the current width of this element
 void paint(java.awt.Graphics g, int posX, int posY)
          Paints this element
private  void paintCurlyDelimiter(java.awt.Graphics g, int posX, int posY, char upperSymbol, char middleSymbol, char connectSymbol, char lowerSymbol)
          Paints a delimitier
private  void paintCurlyDelimiterHorizontal(java.awt.Graphics g, int posX, int posY, char upperSymbol, char middleSymbol, char connectSymbol, char lowerSymbol)
          Paints a horizontal delimitier
private  void paintDelimiter(java.awt.Graphics g, int posX, int posY, char upperSymbol, char middleSymbol, char lowerSymbol)
          Paints a delimitier
 void setLspace(double lspace)
          Set left space in em
 void setRspace(double rspace)
          Set right space in em
 void setStretchy(boolean stretchy)
          Enables, or disables if the operator should fit his size to the size of the container
 
Methods inherited from class jaxe.equations.element.MathElement
addMathElement, addText, debug, getFont, getFontMetrics, getFontSize, getMathBase, getMathElement, getMathElementCount, getMiddleShift, getParent, getSymbolFont, getSymbolFontMetrics, getSymbolGlyphVector, getText, setFontSize, setMathBase, setMathElementAt, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ELEMENT

public static final java.lang.String ELEMENT
The XML element from this class

See Also:
Constant Field Values

ATTRIBUTE_STRETCHY

public static final java.lang.String ATTRIBUTE_STRETCHY
Attribute name of the stretchy property

See Also:
Constant Field Values

stretchy

private boolean stretchy

lspace

private double lspace

rspace

private double rspace
Constructor Detail

MathOperator

public MathOperator()
Method Detail

setStretchy

public void setStretchy(boolean stretchy)
Enables, or disables if the operator should fit his size to the size of the container

Parameters:
stretchy - True, if the operater should fit this size

setLspace

public void setLspace(double lspace)
Set left space in em


setRspace

public void setRspace(double rspace)
Set right space in em


paintDelimiter

private void paintDelimiter(java.awt.Graphics g,
                            int posX,
                            int posY,
                            char upperSymbol,
                            char middleSymbol,
                            char lowerSymbol)
Paints a delimitier

Parameters:
g - The graphics context to use for painting
posX - The first left position for painting
posY - The position of the baseline
upperSymbol - The symbol for upper edge
middleSymbol - The symbol for middle part
lowerSymbol - The symbol for lower edge

paintCurlyDelimiter

private void paintCurlyDelimiter(java.awt.Graphics g,
                                 int posX,
                                 int posY,
                                 char upperSymbol,
                                 char middleSymbol,
                                 char connectSymbol,
                                 char lowerSymbol)
Paints a delimitier

Parameters:
g - The graphics context to use for painting
posX - The first left position for painting
posY - The position of the baseline
upperSymbol - The symbol for upper edge
middleSymbol - The symbol for middle part
connectSymbol - The symbol for connecting the middle part with the edges
lowerSymbol - The symbol for lower edge

paintCurlyDelimiterHorizontal

private void paintCurlyDelimiterHorizontal(java.awt.Graphics g,
                                           int posX,
                                           int posY,
                                           char upperSymbol,
                                           char middleSymbol,
                                           char connectSymbol,
                                           char lowerSymbol)
Paints a horizontal delimitier

Parameters:
g - The graphics context to use for painting
posX - The first left position for painting
posY - The position of the baseline
upperSymbol - The symbol for upper edge
middleSymbol - The symbol for middle part
connectSymbol - The symbol for connecting the middle part with the edges
lowerSymbol - The symbol for lower edge

paint

public void paint(java.awt.Graphics g,
                  int posX,
                  int posY)
Paints this element

Overrides:
paint in class MathElement
Parameters:
g - The graphics context to use for painting
posX - The first left position for painting
posY - The position of the baseline

getWidth

public int getWidth(boolean dynamicParts)
Return the current width of this element

Overrides:
getWidth in class MathElement
Parameters:
dynamicParts - Should be true, if the calculation consider the elements, which has not fixed sizes
Returns:
Width of this element

getHeight

public int getHeight(boolean dynamicParts)
Return the current height of this element

Overrides:
getHeight in class MathElement
Parameters:
dynamicParts - Should be true, if the calculation consider the elements, which has not fixed sizes
Returns:
Height of this element

getAscentHeight

public int getAscentHeight(boolean dynamicParts)
Return the current height of the upper part of this component from the baseline

Overrides:
getAscentHeight in class MathElement
Parameters:
dynamicParts - Should be true, if the calculation consider the elements, which has not fixed sizes
Returns:
Height of the upper part

getDescentHeight

public int getDescentHeight(boolean dynamicParts)
Return the current height of the lower part of this component from the baseline

Overrides:
getDescentHeight in class MathElement
Parameters:
dynamicParts - Should be true, if the calculation consider the elements, which has not fixed sizes
Returns:
Height of the lower part