a74e9208e145db922c1215b0a9b4b44734bc5aa1
Stefan Schuermans start of implementation (ha...

Stefan Schuermans authored 13 years ago

1) /* JFlexiPix - Java implementation of FlexiPix output library
2)  *
3)  * Copyright 2010-2011 Stefan Schuermans <stefan blinkenarea org>
4)  *
5)  * This program is free software: you can redistribute it and/or modify
6)  * it under the terms of the GNU General Public License as published by
7)  * the Free Software Foundation, version 3 of the License.
8)  *
9)  *
10)  * This program is distributed in the hope that it will be useful,
11)  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12)  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13)  * GNU General Public License for more details.
14)  *
15)  * You should have received a copy of the GNU Lesser General Public License
16)  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17)  */
18) 
19) package org.blinkenarea.JFlexiPix.examples;
20) 
21) import org.blinkenarea.JFlexiPix.*;
22) 
23) public class Blink
24) {
25)   // entry point
26)   public static void main(String [] args)
27)   {
28)     String config;
29)     Display display;
30)     int width, height, i;
31)     byte [] white = {(byte)255, (byte)255, (byte)255};
32) 
33)     // check usage
34)     if (args.length < 1) {
35)       System.out.println("usage: java Blink <config.flp>");
36)       return;
37)     }
38)     config = args[0];
39) 
40)     /* create a display, take configuration from a file,
41)        deliver messages to message method of new Msg object */
42)     try {
43)       display = new Display(config, new Msg());
44)     } catch (Exception e) {
45)       System.out.println("could not create display\n");
46)       e.printStackTrace();
47)       return;
48)     }
49) 
50)     // get size and show it
51)     width  = display.getWidth();
52)     height = display.getHeight();
53)     System.out.println("display size:");
54)     System.out.println(String.format("  width:  %5d", width ));
55)     System.out.println(String.format("  height: %5d", height));
56) 
57)     // blink display
58)     System.out.println("blink");
59)     for (i = 0; i < 5; ++i) {
60) 
61)       System.out.println("on");
Stefan Schuermans added additional base index...

Stefan Schuermans authored 13 years ago

62)       display.data(white, 0, 0, 0, 0, 0, width, height);