cvs commit: xml-fop/src/org/apache/fop/fo/properties BorderColor.java

2002-12-01 Thread pbwest
pbwest  2002/12/01 06:28:46

  Modified:src/org/apache/fop/fo/properties Tag: FOP_0-20-0_Alt-Design
BorderColor.java
  Log:
  Property index arg added to getColor() calls.
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.1.2.6   +11 -5 xml-fop/src/org/apache/fop/fo/properties/Attic/BorderColor.java
  
  Index: BorderColor.java
  ===
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/properties/Attic/BorderColor.java,v
  retrieving revision 1.1.2.5
  retrieving revision 1.1.2.6
  diff -u -r1.1.2.5 -r1.1.2.6
  --- BorderColor.java  29 Nov 2002 17:08:50 -  1.1.2.5
  +++ BorderColor.java  1 Dec 2002 14:28:46 -   1.1.2.6
  @@ -102,11 +102,14 @@
   Iterator colors = list.iterator();
   
   // There must be at least one
  -top = getColor((PropertyValue)(colors.next()));
  +top = getColor(PropNames.BORDER_TOP_COLOR,
  +   (PropertyValue)(colors.next()));
   
   try {
   if (colors.hasNext())
  -right = getColor((PropertyValue)(colors.next()));
  +right = getColor
  +(PropNames.BORDER_RIGHT_COLOR, 
  + (PropertyValue)(colors.next()));
   else
   right = (ColorType)(top.clone());
   
  @@ -118,12 +121,15 @@
   }
   
   if (colors.hasNext())
  -bottom = getColor((PropertyValue)(colors.next()));
  +bottom = getColor
  +(PropNames.BORDER_BOTTOM_COLOR,
  + (PropertyValue)(colors.next()));
   if (colors.hasNext())
  -left = getColor((PropertyValue)(colors.next()));
  +left = getColor
  +(PropNames.BORDER_LEFT_COLOR, 
  + (PropertyValue)(colors.next()));
   
   // Set the properties for each
  -top.setProperty(PropNames.BORDER_TOP_COLOR);
   right.setProperty(PropNames.BORDER_RIGHT_COLOR);
   bottom.setProperty(PropNames.BORDER_BOTTOM_COLOR);
   left.setProperty(PropNames.BORDER_LEFT_COLOR);
  
  
  

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




cvs commit: xml-fop/src/org/apache/fop/fo/properties BorderColor.java

2002-11-26 Thread pbwest
pbwest  2002/11/26 18:52:08

  Modified:src/org/apache/fop/fo/properties Tag: FOP_0-20-0_Alt-Design
BorderColor.java
  Log:
  Now extends ColorTransparent.
  Extracted processList() from refineParsing().
  Fixed getColor() to try enumerated color before logging warning and
  attempting system-color.
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.1.2.4   +78 -66xml-fop/src/org/apache/fop/fo/properties/Attic/BorderColor.java
  
  Index: BorderColor.java
  ===
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/properties/Attic/BorderColor.java,v
  retrieving revision 1.1.2.3
  retrieving revision 1.1.2.4
  diff -u -r1.1.2.3 -r1.1.2.4
  --- BorderColor.java  31 Oct 2002 01:52:08 -  1.1.2.3
  +++ BorderColor.java  27 Nov 2002 02:52:08 -  1.1.2.4
  @@ -6,15 +6,17 @@
   import org.apache.fop.datatypes.PropertyValue;
   import org.apache.fop.datatypes.ColorType;
   import org.apache.fop.datatypes.NCName;
  +import org.apache.fop.datatypes.EnumType;
   import org.apache.fop.fo.FONode;
   import org.apache.fop.fo.PropNames;
   import org.apache.fop.fo.ShorthandPropSets;
   import org.apache.fop.fo.properties.Property;
  +import org.apache.fop.messaging.MessageHandler;
   
   import java.util.Map;
   import java.util.Iterator;
   
  -public class BorderColor extends Property {
  +public class BorderColor extends ColorTransparent {
   public static final int dataTypes = SHORTHAND;
   public static final int traitMapping = SHORTHAND_MAP;
   public static final int initialValueType = NOTYPE_IT;
  @@ -78,75 +80,68 @@
   return refineExpansionList(PropNames.BORDER_COLOR, foNode,
   ShorthandPropSets.expandAndCopySHand(value));
   }
  -if (type == PropertyValue.COLOR_TYPE)
  -return refineExpansionList(PropNames.BORDER_COLOR, foNode,
  -ShorthandPropSets.expandAndCopySHand(value));
  -if (type == PropertyValue.NCNAME) {
  -// Must be a standard color
  -ColorType color;
  -try {
  -color = new ColorType(PropNames.BORDER_COLOR,
  -((NCName)value).getNCName());
  -} catch (PropertyException e) {
  -throw new PropertyException
  -(((NCName)value).getNCName() +
  - not a standard color for border-color);
  -}
  -return refineExpansionList(PropNames.BORDER_COLOR, foNode,
  -ShorthandPropSets.expandAndCopySHand(color));
  -}
  -else throw new PropertyException
  -(Invalid  + value.getClass().getName() +
  - value for border-color);
  +// Form a list and pass to processList
  + PropertyValueList tmpList = new PropertyValueList(propindex);
  + tmpList.add(value);
  + return processList(tmpList);
   } else {
   if (nested) throw new PropertyException
   (PropertyValueList invalid for nested border-color 
   + refineParsing() method);
  -// List may contain only multiple color specifiers
  -// i.e. ColorTypes or NCNames specifying a standard color or
  -// 'transparent'.
  -PropertyValueList list =
  -spaceSeparatedList((PropertyValueList)value);
  -ColorType top, left, bottom, right;
  -int count = list.size();
  -if (count  2 || count  4)
  -throw new PropertyException
  -(border-color list contains  + count +  items);
  -
  -Iterator colors = list.iterator();
  -
  -// There must be at least two
  -top = getColor((PropertyValue)(colors.next()));
  -right = getColor((PropertyValue)(colors.next()));
  -try {
  -bottom = (ColorType)(top.clone());
  -left = (ColorType)(right.clone());
  -} catch (CloneNotSupportedException cnse) {
  -throw new PropertyException
  -(clone() not supported on ColorType);
  -}
  +return processList(spaceSeparatedList((PropertyValueList)value));
  +}
  +}
  +
  +private PropertyValueList processList(PropertyValueList list)
  +throws PropertyException
  +{
  +// List may contain only multiple color specifiers
  +// i.e. ColorTypes or NCNames specifying a standard color or
  +// 'transparent'.
  +ColorType top, left, bottom, right;
  +int count = list.size();
  +