Java-Gaming.org    
Featured games (78)
games approved by the League of Dukes
Games in Showcase (426)
Games in Android Showcase (89)
games submitted by our members
Games in WIP (466)
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 2763 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

« In padded room »



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!
Legends of Yore - The Casual Retro Roguelike
Offline SwampChicken
« 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.

 

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

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (75 views)
2014-04-15 18:08:23

BurntPizza (68 views)
2014-04-15 03:46:01

UprightPath (80 views)
2014-04-14 17:39:50

UprightPath (65 views)
2014-04-14 17:35:47

Porlus (81 views)
2014-04-14 15:48:38

tom_mai78101 (105 views)
2014-04-10 04:04:31

BurntPizza (165 views)
2014-04-08 23:06:04

tom_mai78101 (261 views)
2014-04-05 13:34:39

trollwarrior1 (210 views)
2014-04-04 12:06:45

CJLetsGame (220 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
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!