27 |
package org.fenfire.spanimages; |
package org.fenfire.spanimages; |
28 |
import org.fenfire.spanimages.gl.*; |
import org.fenfire.spanimages.gl.*; |
29 |
import org.nongnu.alph.*; |
import org.nongnu.alph.*; |
30 |
|
import org.fenfire.functional.Function; |
31 |
|
|
32 |
/** The central interface for creating vobs that contain |
/** The central interface for creating vobs that contain |
33 |
* images of ImageSpans. |
* images of ImageSpans. |
34 |
|
* Input: ImageSpan; Output: SpanImageVob |
35 |
* The backend of this interface takes care of all caching and other |
* The backend of this interface takes care of all caching and other |
36 |
* operations necessary. |
* operations necessary. |
37 |
* <p> |
* <p> |
39 |
* if the imagespan contains raster data, or 75 pixels per inch, if |
* if the imagespan contains raster data, or 75 pixels per inch, if |
40 |
* the imagespan contains vector data. |
* the imagespan contains vector data. |
41 |
*/ |
*/ |
42 |
public abstract class SpanImageFactory { |
public abstract class SpanImageFactory implements Function { |
43 |
private static SpanImageFactory instance; |
private static SpanImageFactory instance; |
44 |
|
|
45 |
|
/** (For tests, mostly) Get a reasonable instance |
46 |
|
* of SpanImageFactory. |
47 |
|
*/ |
48 |
public static SpanImageFactory getDefaultInstance() { |
public static SpanImageFactory getDefaultInstance() { |
49 |
// XXX This is wrong - need a mux to handle images! |
// XXX This is wrong - need a mux to handle images! |
50 |
if(instance == null) |
if(instance == null) |
51 |
instance = new CachingSpanImageFactory( |
instance = new CachingSpanImageFactory( |
52 |
new DefaultSpanImageFactory( |
new DefaultSpanImageFactory( |
53 |
new PageScrollBlockImager())); |
new PageScrollBlockImager(), |
54 |
|
new PlainPaperMaker() |
55 |
|
)); |
56 |
return instance; |
return instance; |
57 |
} |
} |
58 |
|
|
|
abstract public SpanImageVob getSpanImageVob(ImageSpan s); |
|
59 |
} |
} |
60 |
|
|
61 |
|
|