1
0
Fork 0
mirror of https://github.com/geometer/FBReaderJ.git synced 2025-10-06 03:50:19 +02:00

I had to comment some new code in ZLPaintContext to make the code compilable

git-svn-id: https://only.mawhrin.net/repos/FBReaderJ/trunk@114 6a642e6f-84f6-412e-ac94-c4a38d5a04b0
This commit is contained in:
griffon 2007-11-12 13:48:44 +00:00
parent fca386d7df
commit 8195b48b5b
5 changed files with 48 additions and 3 deletions

View file

@ -125,7 +125,7 @@ abstract public class ZLPaintContext {
return myBottomMargin;
}
public List<String> fontFamilies() {
/* public List<String> fontFamilies() {
if (myFamilies.isEmpty()) {
fillFamiliesList(myFamilies);
}
@ -134,6 +134,7 @@ abstract public class ZLPaintContext {
abstract public String realFontFamilyName(String fontFamily);
abstract protected void fillFamiliesList(List<String> families);
*/
}

View file

@ -0,0 +1,11 @@
package org.zlibrary.sampleview;
import org.zlibrary.core.library.ZLibrary;
public class Main {
public static void main(String[] args) {
ZLibrary.init();
ZLibrary.run(new SampleApplication());
ZLibrary.shutdown();
}
}

View file

@ -0,0 +1,10 @@
package org.zlibrary.sampleview;
import org.zlibrary.core.application.ZLApplication;
public class SampleApplication extends ZLApplication {
public SampleApplication() {
super("Sample");
setView(new SampleView(this, getContext()));
}
}

View file

@ -0,0 +1,24 @@
package org.zlibrary.sampleview;
import org.zlibrary.core.view.ZLView;
import org.zlibrary.core.view.ZLPaintContext;
class SampleView extends ZLView {
SampleView(SampleApplication application, ZLPaintContext context) {
super(application, context);
}
public void paint() {
ZLPaintContext context = getContext();
context.drawLine(0, 0, context.getWidth() - 1, context.getHeight() - 1);
context.fillRectangle(context.getWidth() / 2, context.getHeight() / 2, context.getWidth() - 2, context.getHeight() - 2);
String text = "Hello, World!";
final int w = context.stringWidth(text);
context.drawString((context.getWidth() - w) / 2, context.stringHeight(), text);
}
public String caption() {
return "SampleView";
}
}

View file

@ -8,7 +8,6 @@ import org.zlibrary.text.model.entry.ZLTextEntry;
import java.util.*;
abstract class ZLTextParagraphCursor {
private static abstract class Processor {
protected ZLTextParagraph myParagraph;
@ -45,7 +44,7 @@ abstract class ZLTextParagraphCursor {
}
/*Some useless code in C++ version here.
Is spaceInserted variable used for inserting one separator for multiple spaces?*/
Is spaceInserted variable used for inserting one separator instead of multiple spaces?*/
public void processTextEntry(ZLTextEntry textEntry) {
int dataLength = textEntry.getDataLength();