Thread Locked This thread is locked - replies are not allowed.



Permlink Replies: 8 - Pages: 1 - Last Post: 27 Jun 19, 23:39 Last Post By: RobM Threads: [ Previous | Next ]
RobM

Posts: 4,190
Registered: 4-Aug-2006
Skin coding examples
Posted: 19 Nov 17, 00:31
Attachment M-ThemeImage.jaskin (104.2 KB)
This thread is intended to provide additional support to the skin developer help pages by providing examples of particular techniques. If you have any questions please post them in a new thread in the skin development forum

Attached is an example skin that implements a theme image using jAlbum 15 built in routines. It has theme dimensions and theme styles.

See the following skin files for the code needed:
skin.properties    line 16
onload.bsh          lines 14 to 45
init.bsh            lines 3 to 15
index.htt           lines 13 to 40
RobM

Posts: 4,190
Registered: 4-Aug-2006
Re: Skin coding examples
Posted: 20 Nov 17, 00:33   in response to: RobM in response to: RobM
Attached is an example skin that implements the new theme image using code in postdir.bsh.. It has controls for theme dimensions, and subfolders inheriting the root's theme image. When inheriting the root folder's theme image only that theme image is produced, all other pages reference the same file.

See the following skin files for the code needed:
init.bsh          lines 1 to 42
skin.properties    line 16
onload.bsh         lines 20 to 49
index.htt          lines 14 to 95
postdir.bsh         lines 1 to 56
RobM

Posts: 4,190
Registered: 4-Aug-2006
Re: Skin coding examples
Posted: 22 Nov 17, 23:41   in response to: RobM in response to: RobM
Attached is an example skin that implements multiple styles within an album. Each folder can have it's own style or it can inherit the style of the previous folder. For example, setting a style for each folder in the root level will result in each of their subfolders inheriting their style.

Style options are picked from the styles supported by the skin or the default value of 'inherit'. For this to work it is necessary to create alternative variables for the style file and the path to the style's support files. New variables:
${resPath}/${cssFile} instead of ${stylePath}
${resPath}${styleFolder} instead of ${resPath}

See the following skin files for the code needed:
onload.bsh  lines 51 to 89
init.bsh     lines 1 to 56
index.htt    lines 11, 12 and 17 then multiple lines with similar code to 17
slide.htt    lines 7,8 and 13 then multiple lines with similar code to 13 (same changes as in index.htt)
RobM

Posts: 4,190
Registered: 4-Aug-2006
Re: Skin coding examples
Posted: 25 Nov 17, 22:15   in response to: RobM in response to: RobM
Attached is an model skin that implements a draggable list of items. It shows how to add a JDraggableList to the skin's GUI and how to get the selected items.

onload.bsh  lines 7 to 11, 23 to 77
init.bsh     lines 3 to 23
index.htt    line 40
RobM

Posts: 4,190
Registered: 4-Aug-2006
Re: Skin coding examples
Posted: 26 Nov 17, 22:49   in response to: RobM in response to: RobM
Attached is another example skin that implements the new theme image using a modified version of the method1 code. It has controls for theme dimensions, and subfolders inheriting the root's theme image. When inheriting the root folder's theme image only that theme image is produced, all other pages reference the same file, any existing orphan files are removed from the sub-directoies.

When the theme image is 'as set' the theme image is scaled within the bounds and presented centred on the page. When set to 'cover' the images are stretched to cover the full width of the page and the height of all images adjusted to that of the root theme image - to give a consistent appearance. The exception is when there is no theme image, the space for the theme image collapses.

See the following skin files for the code needed:
skin.properties line 16
onload.bsh lines 19 to 49
init.bsh lines 1 to 28
index.htt lines 13 to 58
RobM

Posts: 4,190
Registered: 4-Aug-2006
Re: Skin coding examples
Posted: 27 Nov 17, 20:26   in response to: RobM in response to: RobM
See here for how to make a skin using JSON data.
You can download the example MinimalJSON skin here
RobM

Posts: 4,190
Registered: 4-Aug-2006
Re: Skin coding examples
Posted: 27 Nov 17, 20:42   in response to: RobM in response to: RobM
See here for how to make page templates for site aware skins
RobM

Posts: 4,190
Registered: 4-Aug-2006
Re: Skin coding examples
Posted: 27 Nov 17, 21:04   in response to: RobM in response to: RobM
If you want to support navigation between sub-albums of a 'master' album of albums, instead of the usual up/down navigation here is one technique.
RobM

Posts: 4,190
Registered: 4-Aug-2006
Re: Skin coding examples
Posted: 27 Jun 19, 23:39   in response to: RobM in response to: RobM
Adding a JTable to a skin's GUI.
First create the JTable component
Object filtersPanel = new JVariablesPanel(); //  BeanShell bug. Has to be Object or we get ClassNotFound
JTable filters = filtersPanel.getTable(); // serialized 

Then add the table to the interface
add("p hfill", filtersPanel); 

Then to use the table use ${filters} or <%=filters%> and use string manipulation to extract individual columns/rows as required.

NB, example taken from jAlbum 18.3 beta MinimalTable Skin

Legend
Forum admins
Helpful Answer
Correct Answer

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