Ooops. Screwed up.  The child nodes should have their
areas removed before the current node removes its
areas.

public void removeAreas() {
 // still to do
 int numChildren = this.children.size();
 for(int i = 0; i < numChildren; i++) {
 FONode fo = (FONode) children.elementAt(i);
 fo.removeAreas();
 }
 Area parentArea;
 int numAreas = this.allAreas.size();
 for(int i=0; i < numAreas; i++) {
  parentArea =
   ((Area)allAreas.elementAt(i)).getParent();
  parentArea.removeChild
   ((Area)allAreas.elementAt(i));
}
 this.marker = 0;
 }


--- Don Wellington <[EMAIL PROTECTED]> wrote:
> Hi all-
> 
> I have list-item-label and list-item-body kept
> together on the same page.  I will need a lesson in
> the etiquette of presenting the changes.  Should I
> send the full class files to this list?  Attempt to
> diff the class files?  A little advice woudl be
> good.
> 
> As for what I did:
> 
> FONode.java
> 
> 1) Added a protected Vector allAreas = new Vector()
> 
> 2) Filled in removeAreas() with
> public void removeAreas() {
>   // still to do
>   Area parentArea;
>   int numAreas = this.allAreas.size();
>     for(int i=0; i < numAreas; i++) {
>       parentArea =  
>          ((Area)allAreas.elementAt(i)).getParent();
>       parentArea.removeChild
>          ((Area)allAreas.elementAt(i));
>     }
>     int numChildren = this.children.size();
>     for(int i = 0; i < numChildren; i++) {
>       FONode fo = (FONode) children.elementAt(i);
>       fo.removeAreas();
>     }
>     this.marker = 0;
> }
> 
> Problem: How to set marker so that if layout is
> called
> again area will be recreated, but IDs will not. Or,
> how to remove IDs related to above areas as well. 0
> seems to work right now, but maybe markers needed to
> be enumerated?
> 
> Changes to Block.java:
> 
> 1) In layout() after this.blockArea is created
> added:
>   allAreas.add(this.blockArea);
> 
> Changes to ListItemLabel.java:
> 1) In layout():
> if(this.marker == START) {
>   String id = this.properties.get("id").getString();
>  
>                   
>   area.getIDReferences().initializeID(id,area);
>   this.marker = 0;
> }
> Simply to prevent a error due to the same ID being
> initialized again.
> 
> Changes to ListItemBody.java:
> 
> None.  It returns Status.AREA_FULL_NONE when the
> first
> item overflows the page.
> 
> Changes to ListItem.java:
> 
> 1)Changed the following from:
> 
> if (this.marker == 0) {
>    // configure id
>    area.getIDReferences().configureID(id, area);
> 
>    status = label.layout(blockArea);
>    if (status.isIncomplete()) {
>         return status;
>    }
> }
> 
> To:   
> 
> // configure id
> if(this.marker == 0){
>   area.getIDReferences().configureID(id,area);
> }
> 
> status = label.layout(blockArea);
> if (status.isIncomplete()) {
>   return status;
> }
> 
> Again prevents errors due to bad ID. I tried leaving
> this if alone mostly, and just setting the marker to
> 2. And only configuring the ID when the marker = 0,
> and the rest if the marker equaled 0 or 2, but kept
> getting a 2 >= 2 error during the rendering areas
> step, and couldn't figure out what was generating
> the
> error.
> 
> 2) Inserted:
>           if(status.laidOutNone()) {
>               label.removeAreas();
>               this.marker = 1;
>               return status;
>           }
> after:
>       status = body.layout(blockArea);
>       if (status.isIncomplete()) {
> 
> So, if it nothing is laid out in the body, I remove
> all the areas created by label set the marker equal
> to
> 1 so it doesn't redo IDs.  And return
> AREA_FULL_NONE.
> 
> Comments?
> 
> Don
> 
> __________________________________________________
> Do You Yahoo!?
> Make international calls for as low as $.04/minute
> with Yahoo! Messenger
> http://phonecard.yahoo.com/
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, email:
> [EMAIL PROTECTED]
> 


__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

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

Reply via email to