[prev in list] [next in list] [prev in thread] [next in thread] 

List:       fop-cvs
Subject:    cvs commit: xml-fop/src/java/org/apache/fop/area Area.java
From:       pbwest () apache ! org
Date:       2004-07-24 5:12:51
Message-ID: 20040724051251.91358.qmail () minotaur ! apache ! org
[Download RAW message or body]

pbwest      2004/07/23 22:12:51

  Modified:    src/java/org/apache/fop/area Tag: FOP_0-20-0_Alt-Design
                        Area.java
  Log:
  Moved most frame-relative fields and methods to BlockReferenceArea.
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.1.2.27  +24 -39    xml-fop/src/java/org/apache/fop/area/Area.java
  
  Index: Area.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/area/Area.java,v
  retrieving revision 1.1.2.26
  retrieving revision 1.1.2.27
  diff -u -r1.1.2.26 -r1.1.2.27
  --- Area.java	9 Jul 2004 00:27:44 -0000	1.1.2.26
  +++ Area.java	24 Jul 2004 05:12:50 -0000	1.1.2.27
  @@ -129,20 +129,6 @@
        * differ from the writing mode of the generating FO if this is a
        * <code>reference-area</code>. */
       protected int frameWritingMode;
  -    /** True if the <code>writing-mode</code> of the frames of this area is
  -     * horizontal.  May differ from contentIsHorizontal if this is a
  -     * <code>reference-area</code>. */
  -    protected boolean frameIsHorizontal = true;
  -    /** True if the the <code>writing-mode</code> of the frames of this area is
  -     * left-to-right.  May differ from contentIsHorizontal if this is a
  -     * <code>reference-area</code>. */
  -    protected boolean frameLeftToRight = true;
  -    /** The rotation trait for the framing rectangles of this area */
  -    protected int frameRotation;
  -    /** Rotation from content to frame.  One of 0, 90, 180, 270. */
  -    protected int rotateToFrame;
  -    /** Rotation from frame to content. One of 0, 90, 180, 270. */
  -    protected int rotateToContent;
   
       protected void setup() {
           try {
  @@ -150,26 +136,14 @@
               contentIsHorizontal = WritingMode.isHorizontal(contentWritingMode);
               contentLeftToRight = WritingMode.isLeftToRight(contentWritingMode);
               contentRotation = generatedBy.getRefOrientation();
  -            frameWritingMode =
  -                ((FONode)generatedBy.getParent()).getWritingMode();
  -            frameIsHorizontal = WritingMode.isHorizontal(frameWritingMode);
  -            frameLeftToRight = WritingMode.isLeftToRight(frameWritingMode);
  -            frameRotation =
  -                ((FONode)generatedBy.getParent()).getRefOrientation();
  +            frameWritingMode = contentWritingMode;
           } catch (PropertyException e) {
               throw new RuntimeException(e.getMessage());
           }
  -        rotateToFrame = frameRotation - contentRotation;
  -        if (rotateToFrame == 0) {
  -            rotateToContent = 0;
  -        } else {
  -            if (rotateToFrame < 0) {
  -                rotateToContent = -rotateToFrame;
  -                rotateToFrame +=360;
  -            } else {
  -                rotateToContent = 360 - rotateToFrame;
  -            }
  -        }
  +        setupFrames();
  +    }
  +
  +    protected void setupFrames() {
           content = new ContentRectangle(this);
           padding = content.getPadding();
           borders = padding.getBorders();
  @@ -470,12 +444,16 @@
            * @return the writing-mode of the framing rectangles
            */
           public int getFrameWritingMode() {
  -            return frameWritingMode;
  +            return contentWritingMode;
           }
   
           /**
            * Gets the reference-orientation applying to the contents of this
            * area, expressed as a normalized angle; one of 0, 90, 180 or 270.
  +         * TODO - should this simply be 0.  Should reference-orientation on
  +         * all non-reference areas be set to 0; i.e. not rotated with respect
  +         * to the ancestor reference-area?
  +         * BEWARE - this is set to 0
            * @return the reference-orientation
            */
           public int getContentRotation() {
  @@ -483,7 +461,7 @@
           }
   
           public int getRotationToFrame() {
  -            return rotateToFrame;
  +            return 0;
           }
   
           /**
  @@ -493,11 +471,11 @@
            * @return the parent's reference-orientation
            */
           public int getFrameRotation() {
  -            return frameRotation;
  +            return contentRotation;
           }
   
           public int getRotationToContent() {
  -            return rotateToContent;
  +            return 0;
           }
   
           /**
  @@ -514,19 +492,26 @@
   
           /**
            * Gets the width of this <code>AreaGeometry</code> as seen from any
  -         * enclosing frame
  +         * enclosing frame.  For all
  +         * <code>AreaGeometry</code>s except <code>ContentRectangle</code>s,
  +         * the relative dimensions are the same for frame and contents; i.e.
  +         * height is height and width is width.
            * @return the frame-view width
            */
           protected double getFrameRelativeWidth() {
  -            return getFrameRelativeDimensions().getWidth();
  +            return getWidth();
           }
  +
           /**
            * Gets the height of this <code>AreaGeometry</code> as seen from any
  -         * enclosing frame
  +         * enclosing frame.  For all <code>AreaGeometry</code>s except
  +         * <code>ContentRectangle</code>s, the relative dimensions are the
  +         * same for frame and contents; i.e. height is height and width is
  +         * width.
            * @return the frame-view height
            */
           protected double getFrameRelativeHeight() {
  -            return getFrameRelativeDimensions().getHeight();
  +            return getHeight();
           }
           /**
            * Gets the <code>block-progression-dimension</code> of the area
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-cvs-help@xml.apache.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic