This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 59 - Pages: 4 [ 1 2 3 4 | Next ] - Last Post: 11 Sep 09, 15:08 Last Post By: ctwist
davidekholm

Posts: 3,451
Registered: 18-Oct-2002
Custom image specific user interfaces
Posted: 15 Mar 09, 12:50
 
  Click to reply to this thread Reply
I've just released a skin that demonstrates how skin developers can add a custom image specific user interface to Jalbum's image editing panel. Read all about it and download it here: http://jalbum.net/skins/skin/CustomEditUI

Looking forward to what you come up with!
SkiFreak

Posts: 3
Registered: 15-Jan-2007
Re: Custom image specific user interfaces
Posted: 15 Mar 09, 13:26   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
Where is the information written? Into the image? If so, where?
JeffTucker

Posts: 8,109
Registered: 31-Jan-2006
Re: Custom image specific user interfaces
Posted: 15 Mar 09, 13:32   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
Quick question: if the custom panel lets the user enter, say, "kategori" for an image, what's the call for it in the .htt? Is it ${kategori} or is it ${local.kategori}?
JeffTucker

Posts: 8,109
Registered: 31-Jan-2006
Re: Custom image specific user interfaces
Posted: 15 Mar 09, 13:36   in response to: SkiFreak in response to: SkiFreak
 
  Click to reply to this thread Reply
SkiFreak wrote:
Where is the information written? Into the image? If so, where?

Nope, it's in the Image Directory / .jalbum / imagefilename.info.
davidekholm

Posts: 3,451
Registered: 18-Oct-2002
Re: Custom image specific user interfaces
Posted: 15 Mar 09, 13:54   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
EarlyOut wrote:
Quick question: if the custom panel lets the user enter, say, "kategori" for an image, what's the call for it in the .htt? Is it ${kategori} or is it ${local.kategori}?

${kategori} works fine. See the slide.htt file of this sample skin.
JeffTucker

Posts: 8,109
Registered: 31-Jan-2006
Re: Custom image specific user interfaces
Posted: 15 Mar 09, 14:00   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
An odd little side effect....

Say you have an album-level variable called "plats," and it's set in the regular Settings GUI to "Global." Now you use the custom interface to let the user change that value for just the second image out of three, to "North Pole." When you make the album, the first image shows "Global," the second shows "North Pole," and the third shows nothing. The image-specific variable wipes out the album-level variable.

The moral of the story is that if you use image-level variables, give them variable names that aren't the same as variables at the album level.
davidekholm

Posts: 3,451
Registered: 18-Oct-2002
Re: Custom image specific user interfaces
Posted: 15 Mar 09, 14:21   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
Thanks for reporting. I'll try to see if I can work my way around that side effect.
JeffTucker

Posts: 8,109
Registered: 31-Jan-2006
Re: Custom image specific user interfaces
Posted: 15 Mar 09, 14:32   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
Well, that's not necessarily a bad thing. But what's confusing is that "Variables" don't work the same way.

An example: the skin GUI sets myVar="Global" for the album. But in the editing pane, the user goes to the Variables tab, and puts in "myVar" as the name, and "North Pole" as the value. In the skin, the only way to access that is by ${local.myVar}. The user-entered variable never overrides the album-level variable.

But with the Custom tab, something can be entered for myVar, and the local value is called by ${myVar}.

I'm not sure which way I prefer, and it probably depends on how the skin author wants to use those local variables. But they should all work the same way, whether entered on the Variables tab or on the Custom tab.
ctwist

Posts: 476
Registered: 27-Sep-2003
Re: Custom image specific user interfaces
Posted: 16 Mar 09, 02:54   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
Looks good, but is there a way to migrate existing variables to the new user interface variables? If this has to be done manually, there will be some frustrated users.
davidekholm

Posts: 3,451
Registered: 18-Oct-2002
Re: Custom image specific user interfaces
Posted: 16 Mar 09, 08:19   in response to: ctwist in response to: ctwist
 
  Click to reply to this thread Reply
What kind of migration?
ctwist

Posts: 476
Registered: 27-Sep-2003
Re: Custom image specific user interfaces
Posted: 16 Mar 09, 12:06   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
In the .info files, the old variables, e.g.
  <void method="put"> 
   <string>userVariables</string> 
   <object class="java.util.HashMap"> 
    <void method="put"> 
     <string>new</string> 
     <string>true</string> 
    </void> 
   </object> 
  </void> 
are structured differently from the new ones, e.g.
  <void method="put"> 
   <string>SIVNew</string> 
   <string>true</string> 
  </void>
so the old variables will not be found by the new custom panel. It looks like the variables will have to re-entered, to get them into the new format.

Also, there is less flexibility in the names. I chose the names of the old variables to be meaningful to the users, since the user had to enter this name. E.g. one of the variables is named "new". I can't name the new version "new", since it is a reserved word and would cause a syntax error in onload.bsh.
davidekholm

Posts: 3,451
Registered: 18-Oct-2002
Re: Custom image specific user interfaces
Posted: 16 Mar 09, 12:12   in response to: ctwist in response to: ctwist
 
  Click to reply to this thread Reply
I'm not planning on making any migration tool for this actually. I want to keep user variables and skin variables separated. We do the same on the album level. Also, using the very few reserved Java words for variable names isn't good, so avoid using names like "new", "for", "if" etc.
ctwist

Posts: 476
Registered: 27-Sep-2003
Re: Custom image specific user interfaces
Posted: 16 Mar 09, 12:35   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
I want the custom panel's contents to vary, depending on the file type. E.g. folders and images need different data. Since onload.bsh cannot refer to currentFile, I can't see how to do this. Is this possible?
davidekholm

Posts: 3,451
Registered: 18-Oct-2002
Re: Custom image specific user interfaces
Posted: 16 Mar 09, 15:26   in response to: ctwist in response to: ctwist
 
  Click to reply to this thread Reply
It is possible. The JCustomPanel class has a method called setAlbumObject that is called every time the user navigates between images and folders. Just override that method (and call super.setAlbumObject(ao); ) and you will be able to customize the appearance depending on file type by inspecting the AlbumObject that is passed as parameter.

I attach the source code for JCustomPanel so you see the inner workings.
ctwist

Posts: 476
Registered: 27-Sep-2003
Re: Custom image specific user interfaces
Posted: 17 Mar 09, 03:56   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
It worked at the first attempt! I'm in shock. I'm gradually getting the hang of Java, one step at a time.
Legend
Forum admins
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums