if (fobj.getExternalDestination() != null) {
area.addTrait(Trait.EXTERNAL_LINK, fobj.getExternalDestination());
} else {
- String link = fobj.getInternalDestination();
- PageViewport page = parentLM.resolveRefID(link);
+ String idref = fobj.getInternalDestination();
+ PageViewport page = parentLM.getFirstPVWithID(idref);
if (page != null) {
area.addTrait(Trait.INTERNAL_LINK, page.getKey());
} else {
- LinkResolver res = new LinkResolver(link, area);
- parentLM.addUnresolvedArea(link, res);
+ LinkResolver res = new LinkResolver(idref, area);
+ parentLM.addUnresolvedArea(idref, res);
}
}
}
*/
PageViewport getCurrentPV();
- /**
- * Resolve the id reference.
- * This is called by an area looking for an id reference.
- * If the id reference is not found then it should add a resolvable object.
- *
- * @param ref the id reference
- * @return the page containing the id reference or null if not found
- */
- PageViewport resolveRefID(String ref);
-
- /**
- * Add an id to the page.
- * (todo) add the location of the area on the page
- *
- * @param id the id reference to add.
- */
- void addIDToPage(String id);
-
- /**
- * Add an unresolved area.
- * The is used to add a resolvable object to the page for a given id.
- *
- * @param id the id reference this object needs for resolving
- * @param res the resolvable object
- */
- void addUnresolvedArea(String id, Resolvable res);
-
- /**
- * Retrieve a marker.
- * This method is used when retrieve a marker.
- *
- * @param name the class name of the marker
- * @param pos the retrieve position
- * @param boundary the boundary for retrieving the marker
- * @return the layout manaager of the retrieved marker if any
- */
- Marker retrieveMarker(String name, int pos, int boundary);
-
- /**
- * @return the LayoutManagerMaker object.
- */
- LayoutManagerMaker getLayoutManagerMaker();
-
/**
* Load next child LMs, up to child LM index pos
* @param pos index up to which child LMs are requested
LinkedList getChangedKnuthElements(List oldList, /*int flaggedPenalty,*/
int alignment);
- public static final int FLAGGED_PENALTY = 50;
+ /** @see PageSequenceLayoutManager#getFirstPVWithID(String) */
+ PageViewport getFirstPVWithID(String ref);
+
+ /** @see PageSequenceLayoutManager#addIDToPage(String) */
+ void addIDToPage(String id);
+
+ /** @see PageSequenceLayoutManager#addUnresolvedArea(String, Resolvable) */
+ void addUnresolvedArea(String id, Resolvable res);
+
+ /** @see PageSequenceLayoutManager#retrieveMarker(String, int, int) */
+ Marker retrieveMarker(String name, int pos, int boundary);
+
+ /** @see PageSequenceLayoutManager#getLayoutManagerMaker() */
+ LayoutManagerMaker getLayoutManagerMaker();
+ public static final int FLAGGED_PENALTY = 50;
}
}
/**
- * Resolve a reference ID.
- * This resolves a reference ID and returns the first PageViewport
- * that contains the reference ID or null if reference not found.
+ * This returns the first PageViewport that contains an id trait
+ * matching the idref argument, or null if no such PV exists.
*
- * @param id the reference ID to lookup
- * @return the first page viewport that contains the reference
+ * @param idref the idref trait needing to be resolved
+ * @return the first PageViewport that contains the ID trait
*/
- public PageViewport resolveRefID(String id) {
- List list = areaTreeHandler.getPageViewportsContainingID(id);
+ public PageViewport getFirstPVWithID(String idref) {
+ List list = areaTreeHandler.getPageViewportsContainingID(idref);
if (list != null && list.size() > 0) {
return (PageViewport) list.get(0);
}