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:
parent
fca386d7df
commit
8195b48b5b
5 changed files with 48 additions and 3 deletions
|
@ -125,7 +125,7 @@ abstract public class ZLPaintContext {
|
||||||
return myBottomMargin;
|
return myBottomMargin;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<String> fontFamilies() {
|
/* public List<String> fontFamilies() {
|
||||||
if (myFamilies.isEmpty()) {
|
if (myFamilies.isEmpty()) {
|
||||||
fillFamiliesList(myFamilies);
|
fillFamiliesList(myFamilies);
|
||||||
}
|
}
|
||||||
|
@ -134,6 +134,7 @@ abstract public class ZLPaintContext {
|
||||||
|
|
||||||
abstract public String realFontFamilyName(String fontFamily);
|
abstract public String realFontFamilyName(String fontFamily);
|
||||||
abstract protected void fillFamiliesList(List<String> families);
|
abstract protected void fillFamiliesList(List<String> families);
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
11
src/org/zlibrary/sampleview/Main.java
Normal file
11
src/org/zlibrary/sampleview/Main.java
Normal 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();
|
||||||
|
}
|
||||||
|
}
|
10
src/org/zlibrary/sampleview/SampleApplication.java
Normal file
10
src/org/zlibrary/sampleview/SampleApplication.java
Normal 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()));
|
||||||
|
}
|
||||||
|
}
|
24
src/org/zlibrary/sampleview/SampleView.java
Normal file
24
src/org/zlibrary/sampleview/SampleView.java
Normal 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";
|
||||||
|
}
|
||||||
|
}
|
|
@ -8,7 +8,6 @@ import org.zlibrary.text.model.entry.ZLTextEntry;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
abstract class ZLTextParagraphCursor {
|
abstract class ZLTextParagraphCursor {
|
||||||
|
|
||||||
|
|
||||||
private static abstract class Processor {
|
private static abstract class Processor {
|
||||||
protected ZLTextParagraph myParagraph;
|
protected ZLTextParagraph myParagraph;
|
||||||
|
@ -45,7 +44,7 @@ abstract class ZLTextParagraphCursor {
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Some useless code in C++ version here.
|
/*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) {
|
public void processTextEntry(ZLTextEntry textEntry) {
|
||||||
int dataLength = textEntry.getDataLength();
|
int dataLength = textEntry.getDataLength();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue