Theme panel

0 views
Skip to first unread message

Pär Dahlberg

unread,
Nov 2, 2008, 5:44:34 PM11/2/08
to WidgetFX Developers
I started to work on an idea I had about themeable panels. I was
thinking about a generic background panel which would be easy to add
to a new widget. With features like minimize to title bar and beeing
able to have either a unique theme for each widget or a consistent
theme for all widgets using the panel.

A couple of questions:
* First, would it be a useful idea?
* Is there something like this planned already?
* My current experiment is to be able to load a panel theme from a
class file. I looked at the WidgetInstance class to see how it is done
in WidgetFX. Nothing strange there by the looks of it, but it is using
the class com.sun.javafx.runtime.TypeInfo which I can't seem to find.
Do you know if this class has been moved?

Probably not needed, but here's the experiment if anyone is
interested. Not done at all mind you :)
http://pmdit.se/widgets/ThemePanel.zip

BTW, if you do look at the code and have suggestions for improvements
feel free to tell me. I'm not at all used to this declarative stuff :)

/Pär

Stephen Chin

unread,
Nov 5, 2008, 8:45:31 AM11/5/08
to widget...@googlegroups.com
Pär,

Sounds like a great idea!

Here are some random thoughts:

* You have probably seen the experimental dock theme support.
Widget themes are the natural next step, so I am glad you are all
over this.
* There is some new CSS theme support in the works for the JavaFX
release. This may do some of what you want or perhaps complement
your idea...
* Take a look at the Preview1SDK branch instead of the main codeline
and things should make more sense.

Cheers,
--Steve

Pär Dahlberg

unread,
Nov 5, 2008, 6:05:20 PM11/5/08
to widget...@googlegroups.com
Ahh... I should have thought about looking at other branches, but I just looked at the code I had updated to my local drive. So I might not have seen all the dock theme support yet. I'll have to take a look this weekend.

CSS support in the next JavaFX is good news indeed! I was thinking several times how nice that would be to have :)
Do you have any more info about this?

/M v h Pär
Welcome to my blog, mostly about programming: http://www.pmdit.se/blog

Pär Dahlberg

unread,
Nov 15, 2008, 12:07:21 PM11/15/08
to WidgetFX Developers
I've looked at the Widget.fx and the WidgetInstance.fx files, but I'm
having a bit of a problem with actually getting an instance of a class
with that code.

For example I've got these two classes in the
se.pmdit.widget.themepanel package:
public class TestClass {
public attribute test: TestClassImpl;
public attribute cls: String on replace {
if(cls.length() > 0 ) {
try {
var themeClass:Class = Class.forName(cls);
var name = Entry.entryMethodName();
System.out.println("name: {name}");
var args = Sequences.make(String.<<class>>) as Object;
var m: Method = themeClass.getMethod(name,
Sequence.<<class>>);
System.out.println("method: {m}");
test = m.invoke(null, args) as TestClassImpl;
System.out.println("invoke: {test}");
} catch (e:Throwable) {
System.out.println("error: {e}");
}
}
}
}

public class TestClassImpl {
attribute text: String = "nothing";
}

The output is as follows:
name: javafx$run$
method: public static java.lang.Object
se.pmdit.widget.themepanel.TestClassImpl.javafx$run$
(com.sun.javafx.runtime.sequence.Sequence)
invoke: null

Any idea why invoke would return null here?

/Pär
Reply all
Reply to author
Forward
0 new messages