private Map idReferences = null;
// this keeps a list of currently unresolved areas or extensions
- // once the thing is resolved it is removed
+ // once an idref is resolved it is removed
// when this is empty the page can be rendered
+ private Map unresolvedIDRefs = new HashMap();
+
private Map unresolved = null;
private Map pendingResolved = null;
* @param id the id of the reference
* @param res the resolver of the reference
*/
- public void addUnresolvedIDRef(String id, Resolvable res) {
- if (unresolved == null) {
- unresolved = new HashMap();
+ public void addUnresolvedIDRef(String idref, Resolvable res) {
+ if (unresolvedIDRefs == null) {
+ unresolvedIDRefs = new HashMap();
}
- List list = (List)unresolved.get(id);
+ List list = (List)unresolvedIDRefs.get(idref);
if (list == null) {
list = new ArrayList();
- unresolved.put(id, list);
+ unresolvedIDRefs.put(idref, list);
}
list.add(res);
}
* @return true if the page is resolved and can be rendered
*/
public boolean isResolved() {
- return unresolved == null;
+ return unresolvedIDRefs == null;
}
/**
}
pendingResolved.put(id, pages);
} else {
- if (unresolved != null) {
- List todo = (List)unresolved.get(id);
+ if (unresolvedIDRefs != null) {
+ List todo = (List)unresolvedIDRefs.get(id);
if (todo != null) {
for (int count = 0; count < todo.size(); count++) {
Resolvable res = (Resolvable)todo.get(count);
}
}
}
- if (unresolved != null) {
- unresolved.remove(id);
- if (unresolved.isEmpty()) {
- unresolved = null;
+ if (unresolvedIDRefs != null) {
+ unresolvedIDRefs.remove(id);
+ if (unresolvedIDRefs.isEmpty()) {
+ unresolvedIDRefs = null;
}
}
}
* identifies to the AreaTreeHandler which idrefs it needs
* resolved. After the idrefs are resolved, the ATH calls this
* method to allow the Resolvable object to update itself with
- * the PageViewport information.
+ * the PageViewport information.
*
* @param id an ID 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 resolveIDRef(String id, List pages);
}
* for this ID. The page number text is then set to the String value
* of the page number.
*
- * @param id the id associated with the pages parameter
+ * @param id an id whose PageViewports have been determined
* @param pages the list of PageViewports associated with this ID
*/
public void resolveIDRef(String id, List pages) {
- if (pages != null) {
+ if (pageIDRef.equals(id) && pages != null) {
resolved = true;
PageViewport page = (PageViewport)pages.get(0);
- String str = page.getPageNumber();
- text = str;
+ text = page.getPageNumber();
/**@todo Update IPD ??? */
}
}