/* ScrollblockNodeLinker.java * * Copyright (c) 2003, : Tuomas J. Lukka * * This file is part of Fenfire. * * Fenfire is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Fenfire is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General * Public License for more details. * * You should have received a copy of the GNU Lesser General * Public License along with Fenfire; if not, write to the Free * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * * */ /* * Written by : Tuomas J. Lukka */ package org.fenfire.view.buoy; import org.fenfire.*; import java.util.List; import java.util.Set; import java.util.HashSet; import java.util.Iterator; import java.awt.event.MouseEvent; import org.nongnu.alph.*; import org.nongnu.libvob.*; import org.nongnu.libvob.buoy.*; import com.hp.hpl.mesa.rdf.jena.model.*; /** Make links between cells that transclude from scrollblocks and * views of the scrollblocks. *

* The links are made to the first span of the enfilade of the cell * in the scrollblock. */ public class ScrollBlockNodeLinker implements BuoyNodeViewLinker { public org.fenfire.index.Index enfiladeOverlap; public org.fenfire.index.XuIndexer xuIndex; public VStreamNodeTexter nodeTexter; public ScrollBlockNodeLinker(Space space) { enfiladeOverlap = org.fenfire.index.IndexManager.getEnfiladeOverlap(space); nodeTexter = (VStreamNodeTexter)space.getNodeTexter(); } public BuoyViewNodeType transclusionPageSpanNodeType; /** Node type to use for showing scrollblocks xulinked to. */ public BuoyViewNodeType xulinkPageSpanNodeType; public BuoyViewNodeType cellNodeType; public void doLinks(RDFNode c, VobScene vs, int cs, BuoyViewNodeType cellNodeType, BuoyLinkListener listener) { // XXX Dangerous! Shouldn't need to do this!!! // Fix architecture this.cellNodeType = cellNodeType; // Find all transclusion and put buoys of scrollblocks // of pagespans // Enfilade1D enf = nodeTexter.getEnfilade(c, null); for(Iterator i = org.nongnu.alph.util.EnfUtil. getScrollBlockRepresentatives(enf).iterator(); i.hasNext(); ) { Span s = (Span)i.next(); ScrollBlock sb = s.getScrollBlock(); if(s instanceof PageSpan) { sb.getCurrent(); listener.link(1, cs, transclusionPageSpanNodeType, new org.fenfire.util.Pair(c, sb), s); } } } // XXX Reverse links! Scrollblock to }