Topic: I got JBox2D running on an Infocast 8 (video)!

I've been lurking here a long time, never posted.

Here's the vid of it running.
http://www.youtube.com/watch?v=t1KoappC-FM

Super Mario 3 themed.  Get a coin in the pipe, get 1 point.

I also modified the jbox2d example testbed to display my TestbedTest and to also render the images.
http://www.youtube.com/watch?v=IePP8_kggKI
Yeah, I know, I'm rendering the box to spin the wrong way.  Didn't notice until after I filmed it.


I got to go to work.  I'll post details later.

Re: I got JBox2D running on an Infocast 8 (video)!

I have to clean up my source code before I post it.  I'm running it under java se embedded for ARMv5. What sucks is Oracle didn't include sound support other than a beep.  I guess they figure since it's headless, why would you need sound support.  I tried to build jamVM with gtk+ and alsa using the toolchain but gave up. I'm a novice with builds and ran into issues.  To work around this problem, I'm using the ProcessBuilder class to call aplay.

I'm attempting to create a development environment to make java app/widget development easy. 
What I have done so far:
touchscreen
mouse
snooze button
framebuffer
sound (not thrilled about using processbuilder but it works)

To do:
keyboard class
onscreen keyboard
override swing components
support for the chumby and i35

I have 2 apps done.  This stupid Mario game and a photo frame app.  I'm also almost finished with a weather widget.  Next will be a terminal emulator, after I get the keyboard working.  I'm gonna attempt to create a desktop launcher with an app installer and use the snooze button as the home button.  And, I'll try and override as much of the swing components as I can, but keeping it basic. This should make it easier to port swing based apps/games to the infocast/chumby.  Embedded java throws a headless exception when you try to create swing objects.  That's it for now.

Re: I got JBox2D running on an Infocast 8 (video)!

This is awesome!

Re: I got JBox2D running on an Infocast 8 (video)!

Hey, just wondering if you've made any progress on this?  I enjoy watching the alternative stuff people come up with for their Chumbies, and this was definitely showing promise!

5 (edited by lowerjerzey 2013-04-09 18:09:45)

Re: I got JBox2D running on an Infocast 8 (video)!

Doktor Jones wrote:

Hey, just wondering if you've made any progress on this?  I enjoy watching the alternative stuff people come up with for their Chumbies, and this was definitely showing promise!

Sorry for the long delay.  When I was working on this stuff, football season started and I assistant coached 2 teams.  Then wrestling started right after that.  Anyways, I actually started working on this again.  I stopped working on jbox2d and started making a bunch of custom components which can be used to make apps.  It's like a swing/android type interface where the swing layout manager is null.  You can make a view and add panels, textboxes, buttons, labels.... and add action listeners, touchscreen listeners, mouse listeners....  Or you can draw directly on the view/panel and make a game or whatever. Right now, I'm working on finishing the onscreen keyboard.  Here's a screen shot of what it will look like:

keyboard

Here's a quick app using the api:

    public static void main(String[] args) {
        final ChumView view = new ChumView();
        ChumPanel panel = new ChumPanel(new Dimension(250, 250), new Point(275, 175));
        view.setBackground(new  Color(122,33,190));
        panel.setBackground(Color.gray);
        panel.setBorder(new CompoundBorder(new LineBorder(Color.green, 2), new LineBorder(Color.black)));
        ChumButton blue = new ChumButton("Blue", new Dimension(100, 50), new Point(15, 100));
        blue.addAction(new ActionIF() {
            @Override
            public void actionPerformed() {
                view.setBackground(Color.blue);
                view.repaint();
            }
        });
        ChumButton red = new ChumButton("Red", new Dimension(100, 50), new Point(135, 100));
        red.setFont(new Font("Times", Font.BOLD, 20));
        red.addAction(new ActionIF() {
            @Override
            public void actionPerformed() {
                view.setBackground(Color.red);
                view.repaint();
            }
        });
        ChumTextField tf = new ChumTextField(new Dimension(150, 20), new Point(10, 10));
        tf.setText("This is a text Field!");
        panel.add(blue);
        panel.add(red);
        panel.add(tf);
        view.addPanel(panel);
        view.update();       
    }

Here's what it looks like on the infocast. I'll post a vid of it in action when I get a chance:

screenshot

You click the red button, the background turns red.  You click the blue button the background turns blue.

That's it.  That's all the code you need to make this simple app. This example shows some of the built in functions like changing colors, custom colors, fonts, adding borders, actions... and the ease of using it.  It's basically swing without the bloat(but you can add whatever bloat you want).  You have all the bells and whistles of java 1.6 (minus swing).

I started making a clock that rebuilds the weather channel's google gadget by parsing the html and getting the images and data, but decided to finish the keyboard first.  I also played a little with cssbox which generates images of webpages using pure java.
http://cssbox.sourceforge.net/

I haven't tried using it on the infocast yet but it definitely looks doable.  So, if someone wants to write his/her own browser in java for the infocast, there it is.

I'll try and find more time to work on this(baseball season started and I coach a team, plus my daughter has cheerleading competitions).