if (todo != null) {
for (Iterator iter = todo.iterator(); iter.hasNext();) {
Resolvable res = (Resolvable) iter.next();
- res.resolve(id, pvList);
+ res.resolveIDRef(id, pvList);
}
unresolvedIDRefs.remove(id);
}
for (Iterator resIter = list.iterator(); resIter.hasNext();) {
Resolvable res = (Resolvable)resIter.next();
if (!res.isResolved()) {
- res.resolve(id, null);
+ res.resolveIDRef(id, null);
}
}
}
String[] ids = res.getIDs();
for (int count = 0; count < ids.length; count++) {
if (idLocations.containsKey(ids[count])) {
- res.resolve(ids[count], (List) idLocations.get(ids[count]));
+ res.resolveIDRef(ids[count], (List) idLocations.get(ids[count]));
} else {
addUnresolvedIDRef(ids[count], res);
}
* PageViewport objects
* @param pages the list of PageViewport objects the ID resolves to
*/
- public void resolve(String id, List pages) {
+ public void resolveIDRef(String id, List pages) {
// this method is buggy
if (!id.equals(idRef)) {
BookmarkData bd = (BookmarkData)idRefs.get(id);
idRefs.remove(id);
if (bd != null) {
- bd.resolve(id, pages);
+ bd.resolveIDRef(id, pages);
if (bd.isResolved()) {
checkFinish();
}
/**
* Resolve by adding an internal link.
*/
- public void resolve(String id, List pages) {
+ public void resolveIDRef(String id, List pages) {
resolved = true;
if (idRef.equals(id) && pages != null) {
PageViewport page = (PageViewport)pages.get(0);
}
/**
- * This resolves reference with a list of pages.
- * The pages (PageViewport) contain the rectangle of the area.
- * @param id the id to resolve
- * @param pages the list of pages with the id area
- * may be null if not found
+ * @see org.apache.fop.area.Resolveable#resolveIDRef(String, List)
*/
- public void resolve(String id, List pages) {
+ public void resolveIDRef(String id, List pages) {
if (page == null) {
if (pendingResolved == null) {
pendingResolved = new HashMap();
if (todo != null) {
for (int count = 0; count < todo.size(); count++) {
Resolvable res = (Resolvable)todo.get(count);
- res.resolve(id, pages);
+ res.resolveIDRef(id, pages);
}
}
}
for (Iterator iter = pendingResolved.keySet().iterator();
iter.hasNext();) {
String id = (String) iter.next();
- resolve(id, (List)pendingResolved.get(id));
+ resolveIDRef(id, (List)pendingResolved.get(id));
}
pendingResolved = null;
}
String[] getIDs();
/**
- * This resolves reference with a list of pages.
- * The pages (PageViewport) contain the rectangle of the area.
- * @param id the id to resolve
- * @param pages the list of pages with the id area
- * may be null if not found
+ * This method provides the opportunity for a Resolvable object
+ * to resolve one of its unresolved idrefs with the actual set of
+ * PageViewports containing the target ID.
+ *
+ * @param id an ID possibly matching one of the Resolvable object's
+ * unresolved idref's.
+ * @param pages the list of PageViewports with the given ID
+ * may be null if ID is not tied to any
*/
- void resolve(String id, List pages);
+ void resolveIDRef(String id, List pages);
}
*/
public class UnresolvedPageNumber extends TextArea implements Resolvable {
private boolean resolved = false;
- private String pageRefId;
+ private String pageIDRef;
/**
* Create a new unresolvable page number.
* @param id the id reference for resolving this
*/
public UnresolvedPageNumber(String id) {
- pageRefId = id;
+ pageIDRef = id;
text = "?";
}
* @return the id reference for this unresolved page number
*/
public String[] getIDs() {
- return new String[] {pageRefId};
+ return new String[] {pageIDRef};
}
/**
- * Resolve this page number reference.
- * This resolves the reference by getting the page number
+ * Resolve the page number idref
+ * This resolves the idref for this object by getting the page number
* string from the first page in the list of pages that apply
- * for the id reference. The word string is then set to the
- * page number string.
+ * for this ID. The page number text is then set to the String value
+ * of the page number.
*
- * @param id the id reference being resolved
- * @param pages the list of pages for the id reference
+ * @param id the id associated with the pages parameter
+ * @param pages the list of PageViewports associated with this ID
+ * @todo determine why the ID passed in will (always?) equal the pageIDRef,
+ * explain in comments above
*/
- public void resolve(String id, List pages) {
+ public void resolveIDRef(String id, List pages) {
resolved = true;
if (pages != null) {
PageViewport page = (PageViewport)pages.get(0);