2
* Copyright 1999-2004 The Apache Software Foundation.
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
2
* Licensed to the Apache Software Foundation (ASF) under one or more
3
* contributor license agreements. See the NOTICE file distributed with
4
* this work for additional information regarding copyright ownership.
5
* The ASF licenses this file to You under the Apache License, Version 2.0
6
* (the "License"); you may not use this file except in compliance with
7
* the License. You may obtain a copy of the License at
8
9
* http://www.apache.org/licenses/LICENSE-2.0
59
* Get the references for this link.
61
* @return the String array of references.
57
63
public String[] getIDRefs() {
58
64
return new String[] {idRef};
62
* Resolve by adding an internal link.
68
* Resolve by adding an internal link to the first PageViewport in the list.
64
* @see org.apache.fop.area.Resolveable#resolveIDRef(String, List)
70
* @see org.apache.fop.area.Resolvable#resolveIDRef(String, List)
66
72
public void resolveIDRef(String id, List pages) {
67
if (idRef.equals(id) && pages != null) {
73
resolveIDRef(id, (PageViewport)pages.get(0));
77
* Resolve by adding an InternalLink trait to the area
79
* @param id the target id (should be equal to the object's idRef)
80
* @param pv the PageViewport containing the first area with the given id
82
public void resolveIDRef(String id, PageViewport pv) {
83
if (idRef.equals(id) && pv != null) {
69
PageViewport page = (PageViewport)pages.get(0);
70
area.addTrait(Trait.INTERNAL_LINK, page.getKey());
85
Trait.InternalLink iLink = new Trait.InternalLink(pv.getKey(), idRef);
86
area.addTrait(Trait.INTERNAL_LINK, iLink);