From: Ben Soares Date: Fri, 11 Dec 2020 17:02:36 +0000 (+0000) Subject: JAL-3594 Adjustments to allow JalviewJS to use ChannelProperties, and new utils/chann... X-Git-Tag: Develop-2_11_2_0-d20201215~10 X-Git-Url: http://source.jalview.org/gitweb/?p=jalview.git;a=commitdiff_plain;h=a0ca13ac05f537ec85620b982650df13826c121e JAL-3594 Adjustments to allow JalviewJS to use ChannelProperties, and new utils/channels dir for jalviewjs and jalviewjs-release --- diff --git a/build.gradle b/build.gradle index db1b533..d5b39e3 100644 --- a/build.gradle +++ b/build.gradle @@ -98,7 +98,7 @@ ext { getdownChannelName = CHANNEL.toLowerCase() // default to "default". Currently only has different cosmetics for "develop", "release", "default" - propertiesChannelName = ["develop", "release", "test-release"].contains(getdownChannelName) ? getdownChannelName : "default" + propertiesChannelName = ["develop", "release", "test-release", "jalviewjs", "jalviewjs-release" ].contains(getdownChannelName) ? getdownChannelName : "default" // Import channel_properties channelDir = string("${jalviewDir}/${channel_properties_dir}/${propertiesChannelName}") channelGradleProperties = string("${channelDir}/channel_gradle.properties") @@ -221,7 +221,7 @@ ext { install4jExtraScheme = "jalviewb" break - case "RELEASE": + case [ "RELEASE", "JALVIEWJS-RELEASE" ]: getdownAppDistDir = getdown_app_dir_release reportRsyncCommand = true install4jSuffix = "" @@ -307,7 +307,7 @@ ext { install4jInstallerName = "${jalview_name} Test Installer" break - case "LOCAL": + case [ "LOCAL", "JALVIEWJS" ]: JALVIEW_VERSION = "TEST" getdownAppBase = file(getdownWebsiteDir).toURI().toString() getdownLauncher = string("${jalviewDir}/${getdown_lib_dir}/${getdown_launcher_local}") @@ -1270,12 +1270,16 @@ task buildIndices(type: JavaExec) { outputs.file("${workingDir}/JavaHelpSearch/TMAP") } -task prepare { +task buildResources { dependsOn copyResources + dependsOn copyChannelResources + dependsOn createBuildProperties +} + +task prepare { + dependsOn buildResources dependsOn copyDocs dependsOn copyHelp - dependsOn createBuildProperties - dependsOn copyChannelResources dependsOn convertMdFiles dependsOn buildIndices } @@ -2313,7 +2317,9 @@ task jalviewjsSyncAllLibs (type: Sync) { task jalviewjsSyncResources (type: Sync) { - def inputFiles = fileTree(dir: resourceDir) + dependsOn buildResources + + def inputFiles = fileTree(dir: resourcesBuildDir) def outputDir = "${jalviewDir}/${jalviewjsSiteDir}/${jalviewjs_j2s_subdir}" from inputFiles diff --git a/src/jalview/gui/SplashScreen.java b/src/jalview/gui/SplashScreen.java index a8a849e..2d5e63b 100755 --- a/src/jalview/gui/SplashScreen.java +++ b/src/jalview/gui/SplashScreen.java @@ -59,7 +59,8 @@ public class SplashScreen extends JPanel private JPanel iconimg = new JPanel(new BorderLayout()); - // could change fg, bg, font later to use ChannelProperties + // could change fg, bg, font later to use ChannelProperties (these are not + // actually being used!) private static Color bg = Color.WHITE; private static Color fg = Color.BLACK; @@ -237,8 +238,9 @@ public class SplashScreen extends JPanel * SwingJS doesn't have HTMLEditorKit, required for a JTextPane * to display formatted html, so we use a simple alternative */ - String text = "


" - + newtext + ""; + String text = "
" + newtext + + "
"; JLabel ta = new JLabel(text); ta.setOpaque(true); ta.setBackground(Color.white); @@ -264,15 +266,17 @@ public class SplashScreen extends JPanel splashText.addMouseListener(closer); splashText.setVisible(true); - splashText.setSize(new Dimension(750, 375 + logoSize)); + splashText.setSize(new Dimension(750, + 375 + logoSize + (Platform.isJS() ? 40 : 0))); splashText.setBackground(bg); splashText.setForeground(fg); splashText.setFont(font); add(splashText, BorderLayout.CENTER); revalidate(); - iframe.setBounds((Desktop.instance.getWidth() - 750) / 2, - (Desktop.instance.getHeight() - 375) / 2, 750, - splashText.getHeight() + iconimg.getHeight()); + int width = Math.max(splashText.getWidth(), iconimg.getWidth()); + int height = splashText.getHeight() + iconimg.getHeight(); + iframe.setBounds((Desktop.instance.getWidth() - width) / 2, + (Desktop.instance.getHeight() - height) / 2, width, height); iframe.validate(); iframe.setVisible(true); return true; diff --git a/src/jalview/util/ChannelProperties.java b/src/jalview/util/ChannelProperties.java index c33198b..ede528f 100644 --- a/src/jalview/util/ChannelProperties.java +++ b/src/jalview/util/ChannelProperties.java @@ -18,7 +18,7 @@ import jalview.bin.Cache; public class ChannelProperties { - private static final String CHANNEL_PROPERTIES_FILENAME = "/channel_properties"; + private static final String CHANNEL_PROPERTIES_FILENAME = "/channel.props"; private static final Properties channelProps; @@ -63,8 +63,12 @@ public class ChannelProperties if (channelPropsURL == null) { // complete failure of channel_properties, set all properties to defaults - System.err.println("Failed to find '" + CHANNEL_PROPERTIES_FILENAME - + "' file, using defaults"); + System.err + .println("Failed to find '" + CHANNEL_PROPERTIES_FILENAME + + "' file at '" + + (channelPropsURL == null ? "null" + : channelPropsURL.toString()) + + "'. Using class defaultProps."); tryChannelProps = defaultProps; } else @@ -258,4 +262,4 @@ public class ChannelProperties { return iconList; } -} \ No newline at end of file +} diff --git a/utils/channels/default/resources/channel_properties b/utils/channels/default/resources/channel.props similarity index 100% rename from utils/channels/default/resources/channel_properties rename to utils/channels/default/resources/channel.props diff --git a/utils/channels/develop/resources/channel_properties b/utils/channels/develop/resources/channel.props similarity index 100% rename from utils/channels/develop/resources/channel_properties rename to utils/channels/develop/resources/channel.props diff --git a/utils/channels/jalviewjs-release b/utils/channels/jalviewjs-release new file mode 120000 index 0000000..a43e739 --- /dev/null +++ b/utils/channels/jalviewjs-release @@ -0,0 +1 @@ +jalviewjs \ No newline at end of file diff --git a/utils/channels/jalviewjs/channel_gradle.properties b/utils/channels/jalviewjs/channel_gradle.properties new file mode 100644 index 0000000..38dcf09 --- /dev/null +++ b/utils/channels/jalviewjs/channel_gradle.properties @@ -0,0 +1,22 @@ +# These properties will be read into the build.gradle REPLACING any properties with the same name in gradle.properties +# BEFORE local_properties is read +# The purpose of this is to change cosmetic/themed items, and use the channel specific channels_properties file in Jalview +getdown_images_dir = utils/channels/jalviewjs/images +getdown_background_image = jalviewjs_getdown_background.png +getdown_instant_background_image = jalviewjs_getdown_background_initialising.png +getdown_error_background = jalviewjs_getdown_background_error.png +getdown_progress_image = jalviewjs_getdown_progress_bar.png +getdown_mac_dock_icon = jalview_logo.icns +getdown_icon = jalview_logo.png +getdown_txt_allow_offline = true +getdown_txt_max_concurrent_downloads = 10 +getdown_txt_ui.install_error = https://www.jalview.org/faq/getdownerror +getdown_txt_ui.hide_decorations = true +install4j_images_dir = utils/channels/jalviewjs/images +install4j_mac_icons_file = jalview_logo.icns +install4j_windows_icons_file = jalview_logo.ico +install4j_png_icon_file = jalview_logo.png +install4j_background = jalview_logo_background_fade-640x480.png +install4j_dmg_background = jalview_default_dmg_background-72dpi.png +install4j_dmg_ds_store = jalview_default_dmg_DS_Store + diff --git a/utils/channels/jalviewjs/images/UoD_banner-28.png b/utils/channels/jalviewjs/images/UoD_banner-28.png new file mode 100644 index 0000000..5a7a940 Binary files /dev/null and b/utils/channels/jalviewjs/images/UoD_banner-28.png differ diff --git a/utils/channels/jalviewjs/images/UoD_banner-32.png b/utils/channels/jalviewjs/images/UoD_banner-32.png new file mode 100644 index 0000000..d7dd5d2 Binary files /dev/null and b/utils/channels/jalviewjs/images/UoD_banner-32.png differ diff --git a/utils/channels/jalviewjs/images/barton_group-30.png b/utils/channels/jalviewjs/images/barton_group-30.png new file mode 100644 index 0000000..40c95d5 Binary files /dev/null and b/utils/channels/jalviewjs/images/barton_group-30.png differ diff --git a/utils/channels/jalviewjs/images/barton_group-512.png b/utils/channels/jalviewjs/images/barton_group-512.png new file mode 100644 index 0000000..cd5fa37 Binary files /dev/null and b/utils/channels/jalviewjs/images/barton_group-512.png differ diff --git a/utils/channels/jalviewjs/images/barton_group-62.png b/utils/channels/jalviewjs/images/barton_group-62.png new file mode 100644 index 0000000..542acd9 Binary files /dev/null and b/utils/channels/jalviewjs/images/barton_group-62.png differ diff --git a/utils/channels/jalviewjs/images/barton_group-white-512.png b/utils/channels/jalviewjs/images/barton_group-white-512.png new file mode 100644 index 0000000..f04412c Binary files /dev/null and b/utils/channels/jalviewjs/images/barton_group-white-512.png differ diff --git a/utils/channels/jalviewjs/images/barton_group-white-62.png b/utils/channels/jalviewjs/images/barton_group-white-62.png new file mode 100644 index 0000000..5e5a83a Binary files /dev/null and b/utils/channels/jalviewjs/images/barton_group-white-62.png differ diff --git a/utils/channels/jalviewjs/images/barton_group-white.svg b/utils/channels/jalviewjs/images/barton_group-white.svg new file mode 100644 index 0000000..27824f7 --- /dev/null +++ b/utils/channels/jalviewjs/images/barton_group-white.svg @@ -0,0 +1,128 @@ + +image/svg+xml + + + + + + + + + + + + + diff --git a/utils/channels/jalviewjs/images/barton_group.svg b/utils/channels/jalviewjs/images/barton_group.svg new file mode 100644 index 0000000..2becec4 --- /dev/null +++ b/utils/channels/jalviewjs/images/barton_group.svg @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + diff --git a/utils/channels/jalviewjs/images/jalview_getdown_progress_bar.png b/utils/channels/jalviewjs/images/jalview_getdown_progress_bar.png new file mode 100644 index 0000000..71066e8 Binary files /dev/null and b/utils/channels/jalviewjs/images/jalview_getdown_progress_bar.png differ diff --git a/utils/channels/jalviewjs/images/jalview_logo.icns b/utils/channels/jalviewjs/images/jalview_logo.icns new file mode 100644 index 0000000..7f03345 Binary files /dev/null and b/utils/channels/jalviewjs/images/jalview_logo.icns differ diff --git a/utils/channels/jalviewjs/images/jalview_logo.ico b/utils/channels/jalviewjs/images/jalview_logo.ico new file mode 100644 index 0000000..1fe7f0f Binary files /dev/null and b/utils/channels/jalviewjs/images/jalview_logo.ico differ diff --git a/utils/channels/jalviewjs/images/jalview_logo.png b/utils/channels/jalviewjs/images/jalview_logo.png new file mode 100644 index 0000000..340f8e5 Binary files /dev/null and b/utils/channels/jalviewjs/images/jalview_logo.png differ diff --git a/utils/channels/jalviewjs/images/jalview_logo.svg b/utils/channels/jalviewjs/images/jalview_logo.svg new file mode 100644 index 0000000..c7f3dba --- /dev/null +++ b/utils/channels/jalviewjs/images/jalview_logo.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/utils/channels/jalviewjs/images/jalview_logo_background_fade-640x480.png b/utils/channels/jalviewjs/images/jalview_logo_background_fade-640x480.png new file mode 100644 index 0000000..8d56365 Binary files /dev/null and b/utils/channels/jalviewjs/images/jalview_logo_background_fade-640x480.png differ diff --git a/utils/channels/jalviewjs/images/jalviewjs_banner.xcf b/utils/channels/jalviewjs/images/jalviewjs_banner.xcf new file mode 100644 index 0000000..72d2a6a Binary files /dev/null and b/utils/channels/jalviewjs/images/jalviewjs_banner.xcf differ diff --git a/utils/channels/jalviewjs/images/jalviewjs_getdown_background.png b/utils/channels/jalviewjs/images/jalviewjs_getdown_background.png new file mode 100644 index 0000000..9d0de22 Binary files /dev/null and b/utils/channels/jalviewjs/images/jalviewjs_getdown_background.png differ diff --git a/utils/channels/jalviewjs/images/jalviewjs_getdown_background.xcf b/utils/channels/jalviewjs/images/jalviewjs_getdown_background.xcf new file mode 100644 index 0000000..14f3ee0 Binary files /dev/null and b/utils/channels/jalviewjs/images/jalviewjs_getdown_background.xcf differ diff --git a/utils/channels/jalviewjs/images/jalviewjs_getdown_background_error.png b/utils/channels/jalviewjs/images/jalviewjs_getdown_background_error.png new file mode 100644 index 0000000..b548b5b Binary files /dev/null and b/utils/channels/jalviewjs/images/jalviewjs_getdown_background_error.png differ diff --git a/utils/channels/jalviewjs/images/jalviewjs_getdown_background_initialising.png b/utils/channels/jalviewjs/images/jalviewjs_getdown_background_initialising.png new file mode 100644 index 0000000..13ee00e Binary files /dev/null and b/utils/channels/jalviewjs/images/jalviewjs_getdown_background_initialising.png differ diff --git a/utils/channels/jalviewjs/resources/channel.props b/utils/channels/jalviewjs/resources/channel.props new file mode 100644 index 0000000..02e117d --- /dev/null +++ b/utils/channels/jalviewjs/resources/channel.props @@ -0,0 +1,18 @@ +app_name=JalviewJS +banner=/images/jalviewjs_banner.png +logo.16=/images/jalview_logo-16.png +logo.32=/images/jalview_logo-32.png +logo.38=/images/jalview_logo-38.png +logo.48=/images/jalview_logo-48.png +logo.64=/images/jalview_logo-64.png +logo.128=/images/jalview_logo-128.png +logo.256=/images/jalview_logo-256.png +logo.512=/images/jalview_logo-512.png +rotatable_logo.48=/images/rotatable_jalview_logo-38.png +bg_logo.28=/images/barton_group-28.png +bg_logo.30=/images/barton_group-30.png +bg_logo.32=/images/barton_group-32.png +uod_banner.28=/images/UoD_banner-28.png +uod_banner.30=/images/UoD_banner-30.png +uod_banner.32=/images/UoD_banner-32.png +default_appbase=https://www.jalview.org/getdown/release/1.8 diff --git a/utils/channels/jalviewjs/resources/images/UoD_banner-28.png b/utils/channels/jalviewjs/resources/images/UoD_banner-28.png new file mode 100644 index 0000000..5a7a940 Binary files /dev/null and b/utils/channels/jalviewjs/resources/images/UoD_banner-28.png differ diff --git a/utils/channels/jalviewjs/resources/images/UoD_banner-30.png b/utils/channels/jalviewjs/resources/images/UoD_banner-30.png new file mode 100644 index 0000000..3f56b13 Binary files /dev/null and b/utils/channels/jalviewjs/resources/images/UoD_banner-30.png differ diff --git a/utils/channels/jalviewjs/resources/images/UoD_banner-32.png b/utils/channels/jalviewjs/resources/images/UoD_banner-32.png new file mode 100644 index 0000000..d7dd5d2 Binary files /dev/null and b/utils/channels/jalviewjs/resources/images/UoD_banner-32.png differ diff --git a/utils/channels/jalviewjs/resources/images/UoD_banner.png b/utils/channels/jalviewjs/resources/images/UoD_banner.png new file mode 100644 index 0000000..2aff7e2 Binary files /dev/null and b/utils/channels/jalviewjs/resources/images/UoD_banner.png differ diff --git a/utils/channels/jalviewjs/resources/images/barton_group-28.png b/utils/channels/jalviewjs/resources/images/barton_group-28.png new file mode 100644 index 0000000..8d95482 Binary files /dev/null and b/utils/channels/jalviewjs/resources/images/barton_group-28.png differ diff --git a/utils/channels/jalviewjs/resources/images/barton_group-30.png b/utils/channels/jalviewjs/resources/images/barton_group-30.png new file mode 100644 index 0000000..40c95d5 Binary files /dev/null and b/utils/channels/jalviewjs/resources/images/barton_group-30.png differ diff --git a/utils/channels/jalviewjs/resources/images/barton_group-32.png b/utils/channels/jalviewjs/resources/images/barton_group-32.png new file mode 100644 index 0000000..70de633 Binary files /dev/null and b/utils/channels/jalviewjs/resources/images/barton_group-32.png differ diff --git a/utils/channels/jalviewjs/resources/images/jalview_logo-128.png b/utils/channels/jalviewjs/resources/images/jalview_logo-128.png new file mode 100644 index 0000000..63fa253 Binary files /dev/null and b/utils/channels/jalviewjs/resources/images/jalview_logo-128.png differ diff --git a/utils/channels/jalviewjs/resources/images/jalview_logo-16.png b/utils/channels/jalviewjs/resources/images/jalview_logo-16.png new file mode 100644 index 0000000..9a1adfb Binary files /dev/null and b/utils/channels/jalviewjs/resources/images/jalview_logo-16.png differ diff --git a/utils/channels/jalviewjs/resources/images/jalview_logo-256.png b/utils/channels/jalviewjs/resources/images/jalview_logo-256.png new file mode 100644 index 0000000..6963612 Binary files /dev/null and b/utils/channels/jalviewjs/resources/images/jalview_logo-256.png differ diff --git a/utils/channels/jalviewjs/resources/images/jalview_logo-32.png b/utils/channels/jalviewjs/resources/images/jalview_logo-32.png new file mode 100644 index 0000000..7af5791 Binary files /dev/null and b/utils/channels/jalviewjs/resources/images/jalview_logo-32.png differ diff --git a/utils/channels/jalviewjs/resources/images/jalview_logo-38.png b/utils/channels/jalviewjs/resources/images/jalview_logo-38.png new file mode 100644 index 0000000..0b60196 Binary files /dev/null and b/utils/channels/jalviewjs/resources/images/jalview_logo-38.png differ diff --git a/utils/channels/jalviewjs/resources/images/jalview_logo-48.png b/utils/channels/jalviewjs/resources/images/jalview_logo-48.png new file mode 100644 index 0000000..297e6cc Binary files /dev/null and b/utils/channels/jalviewjs/resources/images/jalview_logo-48.png differ diff --git a/utils/channels/jalviewjs/resources/images/jalview_logo-512.png b/utils/channels/jalviewjs/resources/images/jalview_logo-512.png new file mode 100644 index 0000000..340f8e5 Binary files /dev/null and b/utils/channels/jalviewjs/resources/images/jalview_logo-512.png differ diff --git a/utils/channels/jalviewjs/resources/images/jalview_logo-64.png b/utils/channels/jalviewjs/resources/images/jalview_logo-64.png new file mode 100644 index 0000000..2505ae9 Binary files /dev/null and b/utils/channels/jalviewjs/resources/images/jalview_logo-64.png differ diff --git a/utils/channels/jalviewjs/resources/images/jalviewjs_banner.png b/utils/channels/jalviewjs/resources/images/jalviewjs_banner.png new file mode 100644 index 0000000..075f90d Binary files /dev/null and b/utils/channels/jalviewjs/resources/images/jalviewjs_banner.png differ diff --git a/utils/channels/jalviewjs/resources/images/rotatable_jalview_logo-38.png b/utils/channels/jalviewjs/resources/images/rotatable_jalview_logo-38.png new file mode 100644 index 0000000..e584298 Binary files /dev/null and b/utils/channels/jalviewjs/resources/images/rotatable_jalview_logo-38.png differ diff --git a/utils/channels/release/resources/channel_properties b/utils/channels/release/resources/channel.props similarity index 100% rename from utils/channels/release/resources/channel_properties rename to utils/channels/release/resources/channel.props diff --git a/utils/channels/test-release/resources/channel_properties b/utils/channels/test-release/resources/channel.props similarity index 100% rename from utils/channels/test-release/resources/channel_properties rename to utils/channels/test-release/resources/channel.props