return new Block.Maker();
}
+ final static int ID_PADDING = 5000; // space to add before id y position
FontState fs;
int align;
int alignLast;
if (anythingLaidOut) {
this.textIndent = 0;
- }
-
- this.blockArea =
+ }
+
+ if ( marker==0 ) {
+ // set up IDReferences
+ IDReferences idReferences = area.getIDReferences();
+ String id = this.properties.get("id").getString();
+ if ( id!=null && !id.equals("") ) {
+ if ( idReferences.doesIDExist(id) ) {
+ throw new FOPException("The id \""+id+"\" already exists in this document");
+ }
+ else {
+ idReferences.createNewId(id);
+ idReferences.removeFromIdValidationList(id);
+ idReferences.setYPosition(id,area.getPage().getBody().getYPosition() - area.getAbsoluteHeight()+ID_PADDING);
+ area.getPage().addToIDList(id);
+ }
+ }
+ }
+
+ this.blockArea =
new BlockArea(fs, area.getAllocationWidth(),
area.spaceLeft(),
startIndent,
layoutStart(area); // performs
blockArea.setAbsoluteHeight(area.getAbsoluteHeight());
+ blockArea.setIDReferences(area.getIDReferences());
blockArea.setTableCellXOffset(area.getTableCellXOffset());
int numChildren = this.children.size();
}
public Status layout(Area area) throws FOPException {
-
- String externalDest =
- this.properties.get("external-destination").getString();
-
+ String destination;
+ int linkType;
+
+ if ( !(destination = this.properties.get("internal-destination").getString()).equals(""))
+ {
+ linkType=LinkSet.INTERNAL;
+ }
+ else if ( !(destination = this.properties.get("external-destination").getString()).equals("") )
+ {
+ linkType=LinkSet.EXTERNAL;
+ }
+ else
+ {
+ throw new FOPException("internal-destination or external-destination must be specified in simple-link");
+ }
+
if (this.marker == START) {
this.marker = 0;
}
// new LinkedArea to gather up inlines
- LinkSet ls = new LinkSet(externalDest, area);
+ LinkSet ls = new LinkSet(destination, area, linkType);
Page p = area.getPage();