You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Don Wellington <da...@yahoo.com> on 2001/08/09 03:11:23 UTC
Keeping list-item-label and list-item-body together update
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: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org
Re: Keeping list-item-label and list-item-body together update
Posted by Keiron Liddle <ke...@aftexsw.com>.
On Thu, 09 Aug 2001 03:11:23 Don Wellington 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.
Don,
Generally diffs are a good thing to supply, it makes it much easier and
saves time, thereby increasing your chances of someone putting the code in.
The information you supplied is good for an explaination but would tend to
waste someones time trying to get it back into the class files.
Also the diffs must be attached to the email (not inline, that does nasty
things).
In general I think you are on the right track with the code changes.
> 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?
This is a general problem with many of the fo objects. It should be handled
in a general way ie. better management of the areas, ids and other parts
that change during layout.
If you can come up with a good way of handling this (it is handled in
various different ways in other parts) then it might be possible to use it
generally.
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org
Re: Keeping list-item-label and list-item-body together update
Posted by Serge Pagop <se...@mathema.de>.
Hi everybody,
I want to know where I can have a FO tutorials?
thanks..
Serge...
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org
Re: Keeping list-item-label and list-item-body together update
Posted by Don Wellington <da...@yahoo.com>.
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 <da...@yahoo.com> 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:
> fop-dev-unsubscribe@xml.apache.org
> For additional commands, email:
> fop-dev-help@xml.apache.org
>
__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org