Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (406)
games submitted by our members
Games in WIP (292)
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  
  Some kind of image list thing  (Read 2380 times)
0 Members and 1 Guest are viewing this topic.
Offline i30817

Junior Member





« Posted 2010-11-30 13:14:42 »

It's swing so if you don't use it you're probably not interested.

Anyway, this is just a preconfigured horizontal JList with some hacks to make tooltips less painful.
It is somewhat similar to the gnome image list (one example of which appears in the choose background image app), but they are still slightly better in that (intuitively) the left and right arrows transpose the selection to the upper and lower row when at the edges of a line. If you could point me out a way to do that i'd appreciate it.
I would put in the code here but it exceeds 10000 characters (just so you see how much code is required to bend swing into forms that were never meant to be).

http://code.google.com/p/bookjar-utils/source/browse/BookJar-utils/src/util/swing/components/ImageList.java
Offline gouessej

JGO Ninja


Medals: 33
Projects: 1


TUER


« Reply #1 - Posted 2010-11-30 16:39:09 »

Thanks for sharing.

Offline i30817

Junior Member





« Reply #2 - Posted 2010-11-30 17:23:14 »

It is less flexible than is probably useful to other people though. My approach of fixing the renderer and only abstracting a listener for the values, while it made things easy for making the look i was trying for and clean code (why i wrap the JList instead of extending and only expose the methods i need, seperate from the view), it also made that look boring. The default UI colors, a image above label cellrenderer and a half-baked cache and some thread safety assurances for it (i am up to my neck in threads to make the secondary disc cache anyway).
Games published by our own members! Check 'em out!
Try the Free Demo of Revenge of the Titans
Offline SwampChicken

Senior Member


Medals: 1



« Reply #3 - Posted 2010-12-01 08:32:48 »

thanks
Offline i30817

Junior Member





« Reply #4 - Posted 2011-05-28 07:34:09 »

I wanted to ask: anyone knows of a way to make a Jlist like this, that has multiple cells in both rows and columns, allow for different keyboard movement with the arrow keys? Instead of only using ↑ and ↓ to move up and down also allow ← and → if the selected cell mets the west or east edges of the viewport?
Offline i30817

Junior Member





« Reply #5 - Posted 2011-06-11 10:07:39 »

I did it. It was just getting the old action with the arrow keycodes from the old inputmap and actionmap, saving it has a parameter for the new action if they aren't on the edge of the row and detecting the edge and move up or down.

It's ok i think - only problem should occur if some platform doesn't use the arrow keys (the is no left movement key or something abstract like that).
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars and Titan!

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

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
cubemaster21 (67 views)
2013-05-17 21:29:12

alaslipknot (76 views)
2013-05-16 21:24:48

gouessej (109 views)
2013-05-16 00:53:38

gouessej (104 views)
2013-05-16 00:17:58

theagentd (115 views)
2013-05-15 15:01:13

theagentd (104 views)
2013-05-15 15:00:54

StreetDoggy (149 views)
2013-05-14 15:56:26

kutucuk (172 views)
2013-05-12 17:10:36

kutucuk (170 views)
2013-05-12 15:36:09

UnluckyDevil (179 views)
2013-05-12 05:09:57
Complex number cookbook
by Roquen
2013-04-24 12:47:31

2D Dynamic Lighting
by Oskuro
2013-04-17 16:46:12

2D Dynamic Lighting
by Oskuro
2013-04-17 16:45:57

2D Dynamic Lighting
by Oskuro
2013-04-17 16:23:20

Noise (bandpassed white)
by Roquen
2013-04-05 17:36:01

Noise (bandpassed white)
by Roquen
2013-04-03 16:17:38

Java Data structures
by Roquen
2013-03-29 13:21:12

Topic Request
by kutucuk
2013-03-22 21:42:01
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!
Page created in 0.07 seconds with 20 queries.