Author: jeremias
Date: Thu Nov 29 05:08:01 2007
New Revision: 599430

URL: http://svn.apache.org/viewvc?rev=599430&view=rev
Log:
Support for baseline information (needed by at least MathML).

Modified:
    
xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/image2/ImageSize.java

Modified: 
xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/image2/ImageSize.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/image2/ImageSize.java?rev=599430&r1=599429&r2=599430&view=diff
==============================================================================
--- 
xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/image2/ImageSize.java
 (original)
+++ 
xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/image2/ImageSize.java
 Thu Nov 29 05:08:01 2007
@@ -33,10 +33,12 @@
     
     private int widthMpt;
     private int heightMpt;
+    private int baselinePositionFromBottomMpt;
     
     private double dpiHorizontal;
     private double dpiVertical;
     
+    
     /**
      * Constructor.
      * @param widthPx the width of the image in pixels
@@ -105,6 +107,28 @@
     }
     
     /**
+     * Sets the vertical position of the baseline of the image relative to the 
bottom of the image.
+     * The default is 0mpt (i.e. the image is bottom-aligned). This is used 
for MathML images, for
+     * example, which have a baseline. Using the value the images can be 
properly aligned with
+     * other text. Most other image don't have an implicit baseline.
+     * @param distance the distance from the bottom of the image in 
millipoints 
+     */
+    public void setBaselinePositionFromBottom(int distance) {
+        this.baselinePositionFromBottomMpt = distance;
+    }
+    
+    /**
+     * Returns the vertical position of the baseline of the image relative to 
the bottom of the
+     * image. The default is 0mpt (i.e. the image is bottom-aligned). This is 
used for MathML
+     * images, for example, which have a baseline. Using the value the images 
can be properly
+     * aligned with other text. Most other image don't have an implicit 
baseline.
+     * @return the distance from the bottom of the image in millipoints
+     */
+    public int getBaselinePositionFromBottom() {
+        return this.baselinePositionFromBottomMpt;
+    }
+    
+    /**
      * Returns the image's width in pixels.
      * @return the width in pixels
      */
@@ -158,6 +182,14 @@
      */
     public Dimension getDimensionMpt() {
         return new Dimension(getWidthMpt(), getHeightMpt());
+    }
+    
+    /**
+     * Returns the size in pixels as a Dimension object.
+     * @return the size in pixels
+     */
+    public Dimension getDimensionPx() {
+        return new Dimension(getWidthPx(), getHeightPx());
     }
     
     /**



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to