{"id":25806011,"url":"https://github.com/alipsa/rideutils","last_synced_at":"2026-06-17T10:31:29.455Z","repository":{"id":46010073,"uuid":"162875763","full_name":"Alipsa/rideutils","owner":"Alipsa","description":"Java FX GUI utilities for use in Renjin applications e.g. Ride","archived":false,"fork":false,"pushed_at":"2022-08-16T16:49:24.000Z","size":392,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-11T18:35:25.991Z","etag":null,"topics":["r-package","renjin"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Alipsa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-12-23T08:50:27.000Z","updated_at":"2022-02-16T19:59:31.000Z","dependencies_parsed_at":"2022-09-11T07:01:33.704Z","dependency_job_id":null,"html_url":"https://github.com/Alipsa/rideutils","commit_stats":null,"previous_names":["pernyfelt/rideutils"],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/Alipsa/rideutils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alipsa%2Frideutils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alipsa%2Frideutils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alipsa%2Frideutils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alipsa%2Frideutils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Alipsa","download_url":"https://codeload.github.com/Alipsa/rideutils/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alipsa%2Frideutils/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34445179,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-17T02:00:05.408Z","response_time":127,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["r-package","renjin"],"created_at":"2025-02-27T19:52:37.527Z","updated_at":"2026-06-17T10:31:29.437Z","avatar_url":"https://github.com/Alipsa.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rideutils\nGUI utilities for use in JavaFx based applications running R code via Renjin \ne.g. [Ride](https://github.com/perNyfelt/ride)\n\nAdd the following to your pom.xml to use it:\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ese.alipsa\u003c/groupId\u003e\n    \u003cartifactId\u003erideutils\u003c/artifactId\u003e\n    \u003cversion\u003e1.8.4\u003c/version\u003e\n\u003c/dependency\u003e\n```\nNote than from version 1.8.3, Java 11 is required, module name is `se.alipsa.rideutils`. \nPrevious versions required Java 8.\n\n## API / Usage overview\n\nThere is a demo gui that displays most of the functions below. To run it, either\n1. download and run the jar with dependencies e.g. `java -jar rideutils-demo-1.0-SNAPSHOT-jar-with-dependencies.jar`\n2. or: clone the repo and\nexecute the demo script `runDemo.sh` or if that is not working for you execute the following commands:\n```shell script\nmvn -DskipTests install\ncd demo\nmvn exec:java\n```\nHere is a screenshot:\n![Screenshot](https://raw.githubusercontent.com/perNyfelt/rideutils/master/doc/demogui.png \"Screenshot\")\n\nIt is a simple R gui where some sample files are loaded in the left pane. \nYou can select one, and it will load the code into the right pane which holds\nthe R code to execute. The resulting output will be in the bottom pane.\n\n## Function descriptions\n### Hamcrest extensions\n__greaterThan \u003c- function(expected)__\nAllows you do do test expressions such as `assertThat(someVar, greaterThan(22))`\nIt is vectorized so asserts that all elements are greater than the given for a vector\nif given as an argument.\n\n__lessThan \u003c- function(expected)__\nAllows you do do test expressions such as `assertThat(somVar, lessThan(22))`\nit is vectorized so asserts that all elements are less than the given for a vector\nif given as an argument.\n\n### Image View\n__readImage \u003c- function(url)__\n\n_param:_ url - the url path to the reasource to read\n\n_return value:_ A javafx.scene.image.Image that can be passed to a java program to e.g. display it\n\n__as.imageView \u003c- function(x)__\nWraps a javafx.scene.image.Image in a javafx.scene.image.ImageView\n\n_param:_ x - the Image\n\n_return value:_ as javafx.scene.image.ImageView\n\n### Utils\n__View \u003c- function(x, title = NA)__\nProvides a similar functionality as the R utils function View i.e. Invoke a spreadsheet-style data viewer on a matrix-like R object.\n\n_param:_ x - The matrix or data.frame to view, the content is formatted for viewing using format(). \n\nIt depends on an object called inout injected into the session that has a java method called View defined as\n`void View(SEXP sexp, String... title);`\n\n__display \u003c- function(x, title = NA)__\nUsed to display an image in a javafx application.\n\n_param:_ x - the filename, imageView or image object to display\n\nThe javafx application executing the R code through the Renjin scripting engine need to \ninject an object called inout that implements the following methods\n```java\nvoid display(javafx.scene.Node node, String... title);\n\nvoid display(javafx.scene.image.Image img, String... title);\n\nvoid display(String fileName, String... title);\n``` \n_Example:_\n```r\nlibrary(\"grDevices\")\nlibrary(\"graphics\")\nlibrary(\"se.alipsa:rideutils\") \n# plot a svg image to a file\nfileName \u003c- \"/tmp/svgplot.svg\"\nsvg(fileName)\nplot(sin, -pi, 2*pi)\ndev.off()\n# convert the image to a a javafx Image and display it in the javafx application, the second argument is the title of the window (optional)\ndisplay(fileName, \"svgplot\")\n```\n\n__viewPlot \u003c- function(func)__\nConvenience method to display plots\n```r\nviewPlot(\n    barplot(\n      table(mtcars$vs, mtcars$gear),\n      main=\"Car Distribution by Gears and VS\",\n      col=c(\"green\",\"red\")\n    )\n)\n\n# it returns the tempfile created \nirisFile \u003c- viewPlot(\n  hist(iris$Sepal.Width),\n  \"sepal widths\"\n)\nprint(paste(\"Created plot of iris sepal width here\", irisFile))\n```\n\n### Interactive user input\nThese are functions that allows the R program to interact with the user running it.\n\n__readline \u003c- function(prompt = \"\")__\nOverrides the base R readline function and pops up a graphical input dialog instead of reading from stdin.\n\n_Example:_\n```r\nlibrary(\"se.alipsa:rideutils\") \nvar \u003c- readline(\"enter a number\")\nprint(paste(\"var is\", var))\n```\n\n__chooseFile \u003c- function (title, initialDir = \".\", description, ...)__\nAllows a user to pick a file.\n\nThe elipsis parameter (...) are the allowed file patterns (typically extensions) that the user can pick.\n\n_Example_\n```r\nlibrary(\"se.alipsa:rideutils\") \nfile \u003c- chooseFile(\ntitle = \"Choose the forecast excel for previous month\",\ninitialDir = \".\",\ndescription = \"Excel files\",\n\"*.xls\", \"*.xlsx\"\n)\n```\n![chooseFile](https://raw.githubusercontent.com/perNyfelt/rideutils/master/doc/chooseFile.png \"chooseFile\")\n\n__chooseDir \u003c- function (title, initialDir = \".\")__\nAllows a user to pick a directory.\n\n_Example:_\n```r\nlibrary(\"se.alipsa:rideutils\") \ndir \u003c- chooseDir(\"Select output dir\", \".\")\nprint(paste(\"Dir chosen is\", dir))\n```\n![chooseDir](https://raw.githubusercontent.com/perNyfelt/rideutils/master/doc/chooseDir.png \"chooseDir\")\n\n__prompt \u003c- function(title = \"\", headerText = \"\", message = \"\")__\nAllows a user to enter string input which we can use in subsequent code.\n\n_Return value:_ It returns a string (character vector) with user input or NA if cancel was pressed.\n\n![Prompt](https://raw.githubusercontent.com/perNyfelt/rideutils/master/doc/prompt.png \"Prompt\")\n\n__promptDate \u003c- function(title = \"\", message = \"\", outputFormat = \"yyyy-MM-dd\")__\nPops up a date picker dialog allowing the user to pick a date.\n\n_@param:_ outputFormat - determines the format of the picked date in the dialog as well as in the \nreturn value\n\n_@return value:_ a character string formatted according to the outputFormat param or\nin the format \"yyyy-MM-dd\" is no outputFormat is given.\n\n_Example:_\n```r\nlibrary(\"se.alipsa:rideutils\") \ndate2 \u003c- promptDate(\"Date\", message = \"Another date\", outputFormat = \"dd MMM yyyy\")\nprint(paste(\"Date is\", date2))\n```\n![PromptDate](https://raw.githubusercontent.com/perNyfelt/rideutils/master/doc/promptDate.png \"PromptDate\")\n\n__promptYearMonth \u003c- function(title = \"\",  message = \"\", from=NA, to=NA, initial=NA, languageTag=NA, monthFormat = \"MMMM\", outputFormat = \"yyyy-MM\")__\n\nPick or type a Year Month.\n\n_@param:_ from - a character string with the start year month than can be chosen in the format \"yyyy-MM\".\nDefault value NA will be converted to the initial date minus 3 years\n\n_@param:_ to - a character string with the en year month than can be chosen in the format \"yyyy-MM\"\nDefault value NA will be converted to the initial date plus 3 years\n\n_@param:_ initial - the initial (default) value in the format \"yyyy-MM\"\nDefault value NA will be converted to current year month.\n\n_@param:_ languageTag - The short code for the local e.g. en-US. For a full list of \nlanguage tags see https://www.oracle.com/java/technologies/javase/jdk8-jre8-suported-locales.html\nDefault value NA vill be converted to the system default language setting.\n\n_@param:_ monthFormat - determines the format of the month in the dialog \n\n_@param:_ outputFormat - determines the format of the picked date in the dialog as well as in the \nreturn value\n\n_Example:_\n```r\nlibrary(\"se.alipsa:rideutils\")\n\n# simple version with all defaults\nstart \u003c- promptYearMonth(message = \"Select start month\")\n```\n![promptYearMonth](https://raw.githubusercontent.com/perNyfelt/rideutils/master/doc/promptYearMonth.png \"promptYearMonth\")\n\n\n__promptSelect \u003c- function(title = \"\", message = \"\", options, defaultValue = \"\")__\nPick one of the specified options\n_Example:_\n```r\nlibrary(\"se.alipsa:rideutils\")\n\nfruit \u003c- promptSelect(\n        title = \"todays fruit\",\n        message = \"pick the fruit of today\",\n        options = c(\"Apple\", \"Banana\", \"Orange\"),\n        defaultValue = \"Banana\"\n)\nprint(paste0(\"The fruit of today is \", fruit, \", type is \", typeof(fruit) ))\n```\nwhich will print\n```\n[1] \"The fruit of today is Orange, type is character\"\n```\n![promptSelect](https://raw.githubusercontent.com/perNyfelt/rideutils/master/doc/promptSelect.png \"promptSelect\")\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falipsa%2Frideutils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falipsa%2Frideutils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falipsa%2Frideutils/lists"}