Re: cvs commit: xml-fop/src/java/org/apache/fop/traits LayoutProps.java SpaceVal.java

2004-11-26 Thread Glen Mazza
--- Finn Bock <[EMAIL PROTECTED]> wrote:
> 
> > We've been doing the same with PR_ (properties)
> and
> > FO_ (FO's) for quite some time.  
> 
> To avoid a name conflict somewhere.
> 

Yes, I was wondering why you didn't originally do that
for the enumeration constants as well.  I like their
self-documenting value in particular though.

> How about having 3 interfaces: 'Properties',
> 'Elements' and 'Enums' 
> which contains the constants without any prefix. And
> then decide that 
> these interfaces are never implemented, but the
> constants are always 
> accessed using the interface name:
>  Enums.TRUE
> 
> That would keep the searchability and perhaps even
> help us when (if) we 
> move to typesafe enums.
> 

-0.  I prefer the simplicity of the current method,
and like the way the code looks as-is.  But I can
easily see how others may view this solution as more
professional.

Glen



Re: cvs commit: xml-fop/src/java/org/apache/fop/traits LayoutProps.java SpaceVal.java

2004-11-26 Thread Finn Bock
[Glen]
 2.) Appended EN_ to enumeration constants to
[J.Pietschmann]
Yuk. Having a large number of identifiers in the
same scope with
an identical prefix isn't very good for
autocompletion both in
Emacs and Eclipse. 
[Glen]
We've been doing the same with PR_ (properties) and
FO_ (FO's) for quite some time.  
To avoid a name conflict somewhere.
After hitting the
EN_, you're at the same place you would be without the
prefix.  Furthermore, you can now hunt away for your
enumeration constants without them being intermixed
with the PR_'s and FO_'s.
It was also a commenting issue:  TRUE and FALSE, for
example, without a prefix, just weren't self
documenting enough to emphasize that we're working
with enumeration constants here.  (Remember, we
removed the old interfaces--per your desire as well as
mine--such as WritingMode.LR_TB or whatever that
previously provided that emphasis.)
How about having 3 interfaces: 'Properties', 'Elements' and 'Enums' 
which contains the constants without any prefix. And then decide that 
these interfaces are never implemented, but the constants are always 
accessed using the interface name:
Enums.TRUE

That would keep the searchability and perhaps even help us when (if) we 
move to typesafe enums.

regards,
finn


Re: cvs commit: xml-fop/src/java/org/apache/fop/traits LayoutProps.java SpaceVal.java

2004-11-25 Thread Glen Mazza
--- "J.Pietschmann" <[EMAIL PROTECTED]> wrote:

> [EMAIL PROTECTED] wrote:
> > gmazza  2004/11/24 13:07:31
> >   2.) Appended EN_ to enumeration constants to
> make them better S&R'able throughout app.
> 
> Yuk. Having a large number of identifiers in the
> same scope with
> an identical prefix isn't very good for
> autocompletion both in
> Emacs and Eclipse. 

We've been doing the same with PR_ (properties) and
FO_ (FO's) for quite some time.  After hitting the
EN_, you're at the same place you would be without the
prefix.  Furthermore, you can now hunt away for your
enumeration constants without them being intermixed
with the PR_'s and FO_'s.

It was also a commenting issue:  TRUE and FALSE, for
example, without a prefix, just weren't self
documenting enough to emphasize that we're working
with enumeration constants here.  (Remember, we
removed the old interfaces--per your desire as well as
mine--such as WritingMode.LR_TB or whatever that
previously provided that emphasis.)


> I also don't quite get the point
> about the
> better S&R'ability.
> 

Because it gives us a very convenient handle ("EN_")
to identify all the places where enumeration constants
are currently being used.  So if we wanted to switch
from "EN_", to "ENUM_", it would just be a quick S&R. 
Sans handle, that would be a very cumbersome
file-by-file manual process--which I just did
yesterday, in order to get the EN_'s in place to begin
with.

Glen



Re: cvs commit: xml-fop/src/java/org/apache/fop/traits LayoutProps.java SpaceVal.java

2004-11-25 Thread J.Pietschmann
[EMAIL PROTECTED] wrote:
gmazza  2004/11/24 13:07:31
  2.) Appended EN_ to enumeration constants to make them better S&R'able 
throughout app.
Yuk. Having a large number of identifiers in the same scope with
an identical prefix isn't very good for autocompletion both in
Emacs and Eclipse. I also don't quite get the point about the
better S&R'ability.
J.Pietschmann


cvs commit: xml-fop/src/java/org/apache/fop/traits LayoutProps.java SpaceVal.java

2003-12-22 Thread gmazza
gmazza  2003/12/22 13:37:44

  Modified:.build.xml
   src/codegen fo-property-mapping.xsl properties.xsl
   src/java/org/apache/fop/datatypes CondLength.java
   src/java/org/apache/fop/fo FObj.java Property.java
PropertyList.java PropertyManager.java
   src/java/org/apache/fop/fo/flow Block.java TableRow.java
   src/java/org/apache/fop/fo/properties
CommonBorderAndPadding.java
   src/java/org/apache/fop/layoutmgr PageLayoutManager.java
   src/java/org/apache/fop/render/rtf RTFHandler.java
TableAttributesConverter.java
TextAttributesConverter.java
   src/java/org/apache/fop/traits LayoutProps.java
SpaceVal.java
  Added:   src/codegen prop-val-enum-interfaces.xsl
   src/java/org/apache/fop/fo Constants.java
  Removed: src/codegen enumgen.xsl
   src/java/org/apache/fop/fo/properties Constants.java
  Log:
  1.) renamed enumgen.xsl to longer but hopefully clearer
  prop-val-enum-interfaces.xsl
  
  2.) Moved Constants.java from fo.properties to fo package, to reduce the
  need for layout and renderers to import directly from the properties package.
  
  Revision  ChangesPath
  1.95  +1 -2  xml-fop/build.xml
  
  Index: build.xml
  ===
  RCS file: /home/cvs/xml-fop/build.xml,v
  retrieving revision 1.94
  retrieving revision 1.95
  diff -u -r1.94 -r1.95
  --- build.xml 20 Dec 2003 17:40:01 -  1.94
  +++ build.xml 22 Dec 2003 21:37:43 -  1.95
  @@ -209,7 +209,6 @@
   
   
   
  -
   
   
   
  @@ -355,7 +354,7 @@
   out="${build.gensrc}/${replacestring}/fo/properties/fo_${ignore_this}"/>
   
  -
   
  
  
  
  1.4   +2 -1  xml-fop/src/codegen/fo-property-mapping.xsl
  
  Index: fo-property-mapping.xsl
  ===
  RCS file: /home/cvs/xml-fop/src/codegen/fo-property-mapping.xsl,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- fo-property-mapping.xsl   22 Dec 2003 03:53:31 -  1.3
  +++ fo-property-mapping.xsl   22 Dec 2003 21:37:43 -  1.4
  @@ -104,6 +104,7 @@
   
   import java.util.HashMap;
   import java.util.Set;
  +import org.apache.fop.fo.Constants;
   import org.apache.fop.fo.Property;
   //import org.apache.fop.svg.*;
   
  
  
  
  1.23  +2 -1  xml-fop/src/codegen/properties.xsl
  
  Index: properties.xsl
  ===
  RCS file: /home/cvs/xml-fop/src/codegen/properties.xsl,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- properties.xsl22 Dec 2003 03:53:31 -  1.22
  +++ properties.xsl22 Dec 2003 21:37:43 -  1.23
  @@ -311,6 +311,7 @@
   
   
 package org.apache.fop.fo.properties;
  +import org.apache.fop.fo.Constants;
   
 
   
  
  
  
  1.1  xml-fop/src/codegen/prop-val-enum-interfaces.xsl
  
  Index: prop-val-enum-interfaces.xsl
  ===
   
  http://www.w3.org/1999/XSL/Transform";
  xmlns:lxslt="http://xml.apache.org/xslt";
  xmlns:redirect="org.apache.xalan.xslt.extensions.Redirect"
  extension-element-prefixes="redirect">
  
  
  
  
  
  
  
  
  

  

  


  

  

  


  


  

  

  
package org.apache.fop.fo.properties;
  
  import org.apache.fop.fo.Constants;
  
  


  public interface 


   extends 
  
  .Enums

 {

  
  int 
  
   = Constants.
  
  ;


  

 }
  
  

  
  
  


  

  
  public interface 
  
   {
  
  

  int 

 = Constants.

;
  
  
  }
  

  
  

  

  
  


  

  

  
  

  public interface 

 extends 

.Enums { }
  
  

  
  

  false
  

  
  
  


  

  


  

  

  



  

  

  
  
  public interface 
  
   extends 
  
  .Enums.
  
   { }

  

  
 

cvs commit: xml-fop/src/java/org/apache/fop/traits LayoutProps.java SpaceVal.java

2003-11-05 Thread gmazza
gmazza  2003/11/05 15:48:47

  Modified:src/java/org/apache/fop/fo/properties CommonBackground.java
CommonBorderAndPadding.java
   src/java/org/apache/fop/traits LayoutProps.java
SpaceVal.java
  Log:
  toString() methods implemented for these objects for help in
  testing/debugging.
  
  Revision  ChangesPath
  1.2   +10 -2 
xml-fop/src/java/org/apache/fop/fo/properties/CommonBackground.java
  
  Index: CommonBackground.java
  ===
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/fo/properties/CommonBackground.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CommonBackground.java 12 Aug 2003 18:02:45 -  1.1
  +++ CommonBackground.java 5 Nov 2003 23:48:47 -   1.2
  @@ -66,5 +66,13 @@
   public int backRepeat;
   public Length backPosHorizontal;
   public Length backPosVertical;
  -
  +
  +public String toString() {
  +return "CommonBackground:\n" +
  +"backAttachment = " + backAttachment + "; backColor = " + 
  +((backColor != null) ? backColor.toString() : "null") + "\n" +
  +"backImage = " + backImage + "; backRepeat = " + backRepeat + "\n" +
  +"backPosHorizontal = " + backPosHorizontal + 
  +"; backPosVertical = " + backPosVertical + "\n";
  +}
   }
  
  
  
  1.2   +11 -3 
xml-fop/src/java/org/apache/fop/fo/properties/CommonBorderAndPadding.java
  
  Index: CommonBorderAndPadding.java
  ===
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/fo/properties/CommonBorderAndPadding.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CommonBorderAndPadding.java   12 Aug 2003 18:02:45 -  1.1
  +++ CommonBorderAndPadding.java   5 Nov 2003 23:48:47 -   1.2
  @@ -175,7 +175,6 @@
   return getPadding(TOP, bDiscard);
   }
   
  -
   public int getBorderWidth(int side, boolean bDiscard) {
   if ((borderInfo[side] == null)
   || (borderInfo[side].mStyle == Constants.NONE)
  @@ -209,5 +208,14 @@
   return padding[side].iLength;
   }
   }
  -
  +
  +public String toString() {
  +return "CommonBordersAndPadding (Before, After, Start, End):\n" +
  +"Borders: (" + getBorderTopWidth(false) + ", " + 
getBorderBottomWidth(false) + ", " +
  +getBorderLeftWidth(false) + ", " + getBorderRightWidth(false) + ")\n" +
  +"Border Colors: (" + getBorderColor(BEFORE) + ", " + getBorderColor(AFTER) 
+ ", " +
  +getBorderColor(START) + ", " + getBorderColor(END) + ")\n" +
  +"Padding: (" + getPaddingTop(false) + ", " + getPaddingBottom(false) + ", " 
+
  +getPaddingLeft(false) + ", " + getPaddingRight(false) + ")\n";
  +}
   }
  
  
  
  1.2   +8 -0  xml-fop/src/java/org/apache/fop/traits/LayoutProps.java
  
  Index: LayoutProps.java
  ===
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/traits/LayoutProps.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- LayoutProps.java  11 Mar 2003 13:05:36 -  1.1
  +++ LayoutProps.java  5 Nov 2003 23:48:47 -   1.2
  @@ -99,5 +99,13 @@
   // Parent span always overrides child span
   bIsSpan = parentLP.bIsSpan;
   }
  +
  +public String toString() {
  +return "LayoutProps:\n" +
  +"breakBefore = " + breakBefore + "; breakAfter = " + breakAfter + "\n" +
  +"spaceBefore = " + ((spaceBefore != null) ? spaceBefore.toString() : 
"null") + "\n" +
  +"spaceAfter = " + ((spaceAfter != null) ? spaceAfter.toString() : "null") + 
"\n" +
  +"bIsSpan = " + bIsSpan + "\n";
  +}
   }
   
  
  
  
  1.3   +3 -0  xml-fop/src/java/org/apache/fop/traits/SpaceVal.java
  
  Index: SpaceVal.java
  ===
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/traits/SpaceVal.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SpaceVal.java 28 Aug 2003 19:08:59 -  1.2
  +++ SpaceVal.java 5 Nov 2003 23:48:47 -   1.3
  @@ -133,5 +133,8 @@
   return space;
   }
   
  +public String toString() {
  +return "SpaceVal: " + getSpace().toString();
  +}
   }
   
  
  
  

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