Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (120)
games submitted by our members
Games in WIP (577)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Substance L&F  (Read 5869 times)
0 Members and 1 Guest are viewing this topic.
Offline CommanderKeith
« Posted 2006-07-19 06:37:04 »

I just came across this: https://substance.dev.java.net/

It is a really slick Swing look and feel implementation that looks perfect for games.  Try the webstart demo: https://substance.dev.java.net/webstart/test.jnlp

& modify the themes tab & the watermark options!  Cool


Offline darkprophet

Senior Duke




Go Go Gadget Arms


« Reply #1 - Posted 2006-07-19 16:53:32 »

substance is a pretty popular theme...its pretty nice.

Shame the hightlight colours dont work well under GTK2 (ubuntu)

DP

Friends don't let friends make MMORPGs.

Blog | Volatile-Engine
Offline oNyx

JGO Coder


Medals: 2


pixels! :x


« Reply #2 - Posted 2006-07-19 16:56:02 »

Looks pretty nice. But why doesnt it style the jframe's title thingy, too?

弾幕 ☆ @mahonnaiseblog
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline CaptainJester

JGO Knight


Medals: 12
Projects: 2
Exp: 14 years


Make it work; make it better.


« Reply #3 - Posted 2006-07-19 17:11:41 »

Looks pretty nice. But why doesnt it style the jframe's title thingy, too?
Your outer frame is always a native widget, which you can't change.

Offline kirillcool

Senior Newbie





« Reply #4 - Posted 2006-07-19 19:27:14 »

As you can see from the screenshots on the main page, Substance supports the custom decorated frame / dialog title panes. You need to either call JFrame.setDefaultLookAndFeelDecorated(true) and JDialog.setDefaultLookAndFeelDecorated(true) before you create your first frame or run your application with -Dsubstancelaf.useDecorations VM flag.
Offline oNyx

JGO Coder


Medals: 2


pixels! :x


« Reply #5 - Posted 2006-07-19 21:52:59 »

>Your outer frame is always a native widget, which you can't change.

Nah... Smiley

>substancelaf.useDecorations

Why that extra flag? (And why isnt it on by default?) I mean if you set JDialog.setDefaultLookAndFeelDecorated(true) and JFrame.setDefaultLookAndFeelDecorated(true) (which is what I did), you already show that you want that extra decoration.

edit: this post is silly Wink

弾幕 ☆ @mahonnaiseblog
Offline CaptainJester

JGO Knight


Medals: 12
Projects: 2
Exp: 14 years


Make it work; make it better.


« Reply #6 - Posted 2006-07-20 12:22:54 »

I stand corrected.  I thought that since there wasn't  a FrameUI, that it wouldn't be painted by the Look and Feel.

Offline kirillcool

Senior Newbie





« Reply #7 - Posted 2006-07-20 18:58:18 »

The additional VM flag (substancelaf.useDecorations) allows using custom decorations *without* changing the application code. It is not on by default due to [1]. If you already call the setDefault...Decorated, than there is no need to specify this VM flag (Substance will honor the user-specified mode). In addition, the title pane is "created" not by FrameUI but by RootPaneUI (since this is the common ground for JFrame and JDialog).

Kirill

[1] http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5079688
Offline oNyx

JGO Coder


Medals: 2


pixels! :x


« Reply #8 - Posted 2006-07-21 05:53:49 »

Ye that confusion was my fault really. I used some 3rd party app for testing that... and I didnt pay much attention to the source.

http://kaioa.com/k/moepii.png

That frame icon extra menu was really an awesome idea Smiley

Oh and the webstart demo isnt decorated and it doesnt seem to exit for real (leaves some zombie process behind).

弾幕 ☆ @mahonnaiseblog
Offline CommanderKeith
« Reply #9 - Posted 2006-08-08 02:25:30 »

I'm really impressed with the different Substance themes, they give Swing apps (& games) a lot of polish  Cool.  I think its because dark/high-contrast colour schemes work so well.

Here's how I've used the Substance look and feel in my game: http://www.freewebs.com/commanderkeith/STG.jnlp

If you want to see the different Substance themes in action, choose 'Options' then 'Switch to X Theme'. (the default one I'm using is Dark Violet).  To see how awesome Substance looks compared with the java default Ocean Metal L&F or the native OS L&F click 'Switch to  X Look & Feel' in the options menu.  By watching the FPS counter in the bottom right you can see the comparative performance as well.

(for those who want to actually play the game, the keys are WASD to move, E to hop in/out of tanks & mouse to aim & fire.  Page Up/Down zooms & numpad +/- changes game speed.  The VM options in the Options menu won't work with WebStart, but if you download the jars (STG.jar & substance-lite.jar) you can use them to compare performance of the J2D pipelines)

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline CommanderKeith
« Reply #10 - Posted 2006-08-08 02:46:54 »

A screenshot:



PS: I love your work Kirill!

Offline CommanderKeith
« Reply #11 - Posted 2006-08-09 06:15:06 »

Substance rendering performance is a little slower than the Ocean default L&F & a lot slower than CDE/Motif, it must be due to all of the GradientPaints Substance uses (but i think its worth it).  The other problem with it is that the substance-lite.jar file is pretty big- 500kb, nearly as much as my entire game+images. 

Is there any way that can be slimmed down Kirill? I know its already compressed, but can stuff be left out, like watermarks,etc since I'm not using them?

Thanks,
Keith

Offline kirillcool

Senior Newbie





« Reply #12 - Posted 2006-08-11 00:39:03 »

I address this issue in the project FAQ question 5, providing a number of options to cut down the jar size. Removing watermarks (including the katakana image) will remove additional ~68KB, but will create compilation problems. You can remove "unwanted" UI delegates if your application doesn't use the corresponding controls (TabbedPane is 32KB and TitlePane for custom decorated title panes is another 30KB). I already provide three different runtime libraries, the full version, the version with Swing color chooser and the lite version with Swing color chooser and without additional "feel" parts.The difference between the first and the last is about 380KB and i think that this is OK with the modern high-speed availability and the size of most of the desktop apps. I feel that my time is better spent on providing new features than on breaking up Substance into nano-modules - Substance already has a plugin architecture that allows to provide the lite version at little cost for the development.

Kirill

[1] https://substance.dev.java.net/docs/faq.html
Offline kirillcool

Senior Newbie





« Reply #13 - Posted 2006-08-11 00:42:37 »

By the way, i'm getting the following exception running the JNLP link under the latest Mustang (b94) - you should reconsider using internal classes such as a Curve in the sun.awt.geom package.

Exception in thread "Thread-8" java.lang.NoSuchMethodError: sun.awt.geom.Curve.crossingsForPath(Ljava/awt/geom/PathIterator;DD)I
   at net.slavebot.tankgame.KPolygon.contains(KPolygon.java:286)
   at net.slavebot.tankgame.KPolygon.intersects(KPolygon.java:345)
   at net.slavebot.tankgame.vehicle.VehiclePart.tentativeHitTestVehicleParts(VehiclePart.java:251)
   at net.slavebot.tankgame.vehicle.VehiclePart.tentativeHitTestVehiclePartsForCurrent(VehiclePart.java:234)
   at net.slavebot.tankgame.vehicle.VehiclePart.tentativeHitTestVehiclePartsForAll(VehiclePart.java:221)
   at net.slavebot.tankgame.vehicle.Vehicle.tentativeHitTestVehicle(Vehicle.java:82)
   at net.slavebot.tankgame.Scenario.canPlace(Scenario.java:256)
   at net.slavebot.tankgame.Scenario.placeNear(Scenario.java:220)
   at net.slavebot.tankgame.Scenario.addVehicle(Scenario.java:196)
   at net.slavebot.tankgame.Player.respawn(Player.java:345)
   at net.slavebot.tankgame.ParallaxStarMap.addNetworkPlayer(ParallaxStarMap.java:217)
   at net.slavebot.tankgame.ParallaxStarMap.<init>(ParallaxStarMap.java:73)
   at net.slavebot.tankgame.TFrame$2.run(TFrame.java:140)
   at java.lang.Thread.run(Unknown Source)
Offline CommanderKeith
« Reply #14 - Posted 2006-08-11 01:06:03 »

Thanks for your help & alerting me to that bug, I'll fix it tomorrow.  By the way I've been trying out the mixed themes and they're impressive.  Congrats on your work, there isn't a better looking L&F than Substance.

Offline CommanderKeith
« Reply #15 - Posted 2006-08-12 07:45:19 »

OK my code's fixed and works with the latest Mustang b95.  There's also an openGL Web Start version of the game I posted at www.freewebs.com/commanderkeith/STGOpenGL.jnlp as well as the default one.

Kirill, there's a problem with the substance-lite.jar when using the latest Mustang build. 

When I try to create an instance of InitialMenu (my sub-class of JInternalFrame) with Substance as the L&F I get this exception, with any other L&F there's no problem, & with the full substance.jar there's no problem.

Exception in thread "Thread-5" java.lang.NoClassDefFoundError: com/sun/java/swing/SwingUtilities2
        at org.jvnet.substance.SubstanceInternalFrameTitlePane$SubstanceTitlePaneLayout.minimumLayoutSize(SubstanceInternalFrameTitlePane.java:485)
        at java.awt.Container.minimumSize(Container.java:1668)
        at java.awt.Container.getMinimumSize(Container.java:1653)
        at javax.swing.JComponent.getMinimumSize(JComponent.java:1689)
        at java.awt.BorderLayout.minimumLayoutSize(BorderLayout.java:646)
        at org.jvnet.substance.SubstanceDesktopIconUI.getMinimumSize(SubstanceDesktopIconUI.java:172)
        at org.jvnet.substance.SubstanceDesktopIconUI.getPreferredSize(SubstanceDesktopIconUI.java:159)
        at javax.swing.JComponent.getPreferredSize(JComponent.java:1607)
        at javax.swing.JInternalFrame$JDesktopIcon.updateUI(JInternalFrame.java:2217)
        at javax.swing.JInternalFrame$JDesktopIcon.<init>(JInternalFrame.java:2146)
        at javax.swing.JInternalFrame.<init>(JInternalFrame.java:332)
        at javax.swing.JInternalFrame.<init>(JInternalFrame.java:251)
        at net.slavebot.tankgame.menu.InitialMenu.<init>(InitialMenu.java:26)
        at net.slavebot.tankgame.TFrame$2.run(TFrame.java:222)
        at java.lang.Thread.run(Thread.java:619)

For now I'm using the full substance.jar file, so you can still try the web start link.  If you have any queries about the above error then I'd be glad to help.

Thanks,
Keith

Offline kirillcool

Senior Newbie





« Reply #16 - Posted 2006-08-14 16:24:55 »

Many thanks for reporting this issue. Can't believe that SwingUtilities2 snuck into 3.0 Sad This has been fixed - you're welcome to take the latest drop of Substance 3.0 and test it.
Offline trembovetski

Senior Duke




If only I knew what I'm talking about!


« Reply #17 - Posted 2006-08-18 18:02:10 »

Many thanks for reporting this issue. Can't believe that SwingUtilities2 snuck into 3.0 Sad This has been fixed - you're welcome to take the latest drop of Substance 3.0 and test it.

Isn't it a bad idea using com.sun* classes? Non-portable, for sure..
AFAIK SwingUtilities2 (now sun.swing.SwingUtilities2) is not a public/supported interface.

Thanks,
  Dmitri

[edited: typo]
Offline trembovetski

Senior Duke




If only I knew what I'm talking about!


« Reply #18 - Posted 2006-08-18 18:09:39 »

Ah, I misunderstood your comment. It was left in version 3 by accident, it seems.
Sorry.

Dmitri
Offline kirillcool

Senior Newbie





« Reply #19 - Posted 2006-08-21 19:58:57 »

Dmitri,

The usage of SwingUtilities2 was removed - it was by mistake. Indeed it's highly unrecommended to use this class, especially since it was moved to another package in JDK 6.0
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Longarmx (52 views)
2014-10-17 03:59:02

Norakomi (43 views)
2014-10-16 15:22:06

Norakomi (33 views)
2014-10-16 15:20:20

lcass (37 views)
2014-10-15 16:18:58

TehJavaDev (68 views)
2014-10-14 00:39:48

TehJavaDev (67 views)
2014-10-14 00:35:47

TehJavaDev (60 views)
2014-10-14 00:32:37

BurntPizza (73 views)
2014-10-11 23:24:42

BurntPizza (45 views)
2014-10-11 23:10:45

BurntPizza (86 views)
2014-10-11 22:30:10
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!