読者です 読者をやめる 読者になる 読者になる

Trying to make the e-book reader in JavaFX

This entry JavaFX Advent Calendar 2012 is day 15.

Yesterday @ skrb 's  irof san drawing song by JavaFX was.

This is a translated version of JavaFXで電子書籍リーダーを作ってみた.

 

This year is e-book first year. You e-book do you enjoy life?

A recent study session JavaFX 8th at @aoetk to see a demo of the Pagination control do I use this control to feel good?

f: id: tarchan: 20121215191920p: plain

 To be displayed in the specified page spread when you click the index of the left. (screenshot of manga is "ブラックジャックによろしく"). I will send the next page by pressing the up and down cursor key. Like to continue to slide and I feel good.

 

Source code was published on GitHub.

tarchan / TwoFace · GitHub

Pagination control JavaFX does not appear in the library in Scene Builder 1.1-b13, had to be added by editing the FXML.

Is the only supported format PDF. To read the PDF is PDFRenderer-0.9.1.jar was used. Image PDFRenderer returned java.awt.Image class so, at this rate JavaFX it can not be displayed in the control. So SwingFXUtils.toFXImage method javafx.scene.image.Image are converted into class. To find this method from a PNG image to a temporary file and writes  javafx.scene.image.Image hassle because it was loaded into the class that I was saved ;-)

        PDFPage pdfPage = pdfFile.getPage(idx);
        Rectangle2D rect = pdfPage.getBBox();
        int width = (int) rect.getWidth();
        int height = (int) rect.getHeight();
        java.awt.Image awtImage = pdfPage.getImage(width, height, rect, null, true, true);
        image = SwingFXUtils.toFXImage((BufferedImage) awtImage, image);

At home iMac and Magic Trackpad environment does not correspond so that the, I was expecting that the Pagination control can flick x-(

I want you to support it by all means Pagination control buttons of the window full screen so valid.

Japanese manga has so many right binding, we want a option to specify the direction of the scroll Pagination control it. Stylesheet Why does direction specified properties?