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).