gzz.media.impl
Class ScrollBlockManager

java.lang.Object
  |
  +--gzz.media.impl.ScrollBlockManager

public class ScrollBlockManager
extends java.lang.Object

A central place which takes care of the ordering of scroll blocks. At the moment, the ordering is transient.


Nested Class Summary
static class ScrollBlockManager.CannotLoadScrollBlockException
           
static class ScrollBlockManager.ImageSpanBase
          A base class for image spans.
static interface ScrollBlockManager.MediaserverScrollBlock
          A scrollblock that is associated with a Mediaserver block.
static class ScrollBlockManager.PageSpanBase
          A base class for page spans.
static class ScrollBlockManager.Span1DBase
          A base class for 1-D spans.
static class ScrollBlockManager.SpanBase
          A base class for physical spans that belong to one particular scrollblock.
 
Field Summary
static boolean dbg
           
 
Constructor Summary
ScrollBlockManager()
           
 
Method Summary
static int compare(ScrollBlock s1, ScrollBlock s2)
          Give an ordering of the given scrollblocks.
static ScrollBlockManager.MediaserverScrollBlock getScrollBlock(Mediaserver ms, Mediaserver.Id id)
           
static ScrollBlockManager.MediaserverScrollBlock getScrollBlock(Mediaserver ms, Mediaserver.Id id, boolean lazy)
          Get a scrollblock from a mediaserver block.
static Span getSpan(Mediaserver ms, Mediaserver.Id id, int x, int y, int w, int h)
           
static Span getSpan(Mediaserver ms, Mediaserver.Id id, int poffs, int plen, int x, int y, int w, int h)
           
static TextScrollBlock getTextScrollBlock(Mediaserver ms, Mediaserver.Id id)
          We can use this if we know a specific scroll block is a text scroll block.
static java.lang.String getTmpID()
          Create a new temporary ID for a scrollblock.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dbg

public static boolean dbg
Constructor Detail

ScrollBlockManager

public ScrollBlockManager()
Method Detail

compare

public static int compare(ScrollBlock s1,
                          ScrollBlock s2)
Give an ordering of the given scrollblocks.

Returns:
0 if equal, -1 if s1 < s2, 1 if s1 > s2.

getTmpID

public static java.lang.String getTmpID()
Create a new temporary ID for a scrollblock.


getSpan

public static Span getSpan(Mediaserver ms,
                           Mediaserver.Id id,
                           int x,
                           int y,
                           int w,
                           int h)

getSpan

public static Span getSpan(Mediaserver ms,
                           Mediaserver.Id id,
                           int poffs,
                           int plen,
                           int x,
                           int y,
                           int w,
                           int h)

getTextScrollBlock

public static TextScrollBlock getTextScrollBlock(Mediaserver ms,
                                                 Mediaserver.Id id)
                                          throws ScrollBlockManager.CannotLoadScrollBlockException
We can use this if we know a specific scroll block is a text scroll block. (We do know because we handle text transclusions in a special way.)

ScrollBlockManager.CannotLoadScrollBlockException

getScrollBlock

public static ScrollBlockManager.MediaserverScrollBlock getScrollBlock(Mediaserver ms,
                                                                       Mediaserver.Id id,
                                                                       boolean lazy)
                                                                throws ScrollBlockManager.CannotLoadScrollBlockException
Get a scrollblock from a mediaserver block. The content-type of the block determines what to do. XXX This is something of a problem: we need to be able to have spans work even when their targets are not currently accessible. The type should therefore be gotten from somewhere...

Maybe the space storage formats should be extended to include enough information on the scrollblocks: type (image/text/page/audio/video), size in standard coordinates.

OTOH, we may be able to do this on the mediaserver side, propagating the headers of blocks...

Returns:
The scrollblock.
ScrollBlockManager.CannotLoadScrollBlockException

getScrollBlock

public static ScrollBlockManager.MediaserverScrollBlock getScrollBlock(Mediaserver ms,
                                                                       Mediaserver.Id id)
                                                                throws ScrollBlockManager.CannotLoadScrollBlockException
ScrollBlockManager.CannotLoadScrollBlockException