aboutsummaryrefslogtreecommitdiff
path: root/inst/GUI
diff options
context:
space:
mode:
authorjranke <jranke@edb9625f-4e0d-4859-8d74-9fd3b1da38cb>2013-09-05 13:18:19 +0000
committerjranke <jranke@edb9625f-4e0d-4859-8d74-9fd3b1da38cb>2013-09-05 13:18:19 +0000
commitaddb6359238596ca98f696da2d33271b851c08ac (patch)
tree4422fc8a8348650882a503f72d68c2bee74dcb51 /inst/GUI
parent25c7431bcf8cef4a8eeaa2374ff7c5e48ef86a3c (diff)
Clean up the GUI directory, the old stuff does not really help a lot
git-svn-id: svn+ssh://svn.r-forge.r-project.org/svnroot/kinfit/pkg/mkin@89 edb9625f-4e0d-4859-8d74-9fd3b1da38cb
Diffstat (limited to 'inst/GUI')
-rw-r--r--inst/GUI/gdf-test.R12
-rw-r--r--inst/GUI/mkinGUItest.RDatabin184 -> 169 bytes
-rw-r--r--inst/GUI/mkin_project_1.RDatabin156 -> 189 bytes
-rw-r--r--inst/GUI/mkin_project_2.RDatabin161 -> 185 bytes
-rw-r--r--inst/GUI/mkin_project_3.RDatabin172 -> 217 bytes
-rw-r--r--inst/GUI/run_simple.R (renamed from inst/GUI/test-simple3.R)1
-rw-r--r--inst/GUI/server.R9
-rw-r--r--inst/GUI/shiny-test.R4
-rw-r--r--inst/GUI/simple-Gtk.R33
-rw-r--r--inst/GUI/simple.R125
-rw-r--r--inst/GUI/simple2.R65
-rw-r--r--inst/GUI/simple3.R55
-rw-r--r--inst/GUI/test-simple2.R2
-rw-r--r--inst/GUI/test.R17
-rw-r--r--inst/GUI/ui.R14
15 files changed, 58 insertions, 279 deletions
diff --git a/inst/GUI/gdf-test.R b/inst/GUI/gdf-test.R
deleted file mode 100644
index b1ec20ae..00000000
--- a/inst/GUI/gdf-test.R
+++ /dev/null
@@ -1,12 +0,0 @@
-w <- gwindow("gdf test")
-g <- ggroup(horizontal=FALSE, cont=w)
-d <- gdf(data.frame(a=c(1.1, 2.2, 3.3), b= c("one", "two", "three"), stringsAsFactors=FALSE),
- name = "Test for editing character columns", cont=g)
-size(d) <- c(400,400)
-gbutton("Change [1,2]", handler=function(h,...) {
- d[1,2] <- "test"
-}, container=g)
-gbutton("Value of [1,2]", handler=function(h,...) {
- galert(d[1,2], parent=d)
-}, cont=g)
-visible(w) <- TRUE
diff --git a/inst/GUI/mkinGUItest.RData b/inst/GUI/mkinGUItest.RData
index 21ec7920..82b7086d 100644
--- a/inst/GUI/mkinGUItest.RData
+++ b/inst/GUI/mkinGUItest.RData
Binary files differ
diff --git a/inst/GUI/mkin_project_1.RData b/inst/GUI/mkin_project_1.RData
index 24ad7616..827a1487 100644
--- a/inst/GUI/mkin_project_1.RData
+++ b/inst/GUI/mkin_project_1.RData
Binary files differ
diff --git a/inst/GUI/mkin_project_2.RData b/inst/GUI/mkin_project_2.RData
index 005e7652..1e37de70 100644
--- a/inst/GUI/mkin_project_2.RData
+++ b/inst/GUI/mkin_project_2.RData
Binary files differ
diff --git a/inst/GUI/mkin_project_3.RData b/inst/GUI/mkin_project_3.RData
index f92ed594..cdf942d9 100644
--- a/inst/GUI/mkin_project_3.RData
+++ b/inst/GUI/mkin_project_3.RData
Binary files differ
diff --git a/inst/GUI/test-simple3.R b/inst/GUI/run_simple.R
index bdac3262..1220e6e9 100644
--- a/inst/GUI/test-simple3.R
+++ b/inst/GUI/run_simple.R
@@ -1,2 +1,3 @@
require(gWidgetsWWW2)
load_app("simple3.R")
+# vim: set filetype=r:
diff --git a/inst/GUI/server.R b/inst/GUI/server.R
deleted file mode 100644
index 12386f29..00000000
--- a/inst/GUI/server.R
+++ /dev/null
@@ -1,9 +0,0 @@
-library(shiny)
-
-shinyServer(function(input, output) {
- output$test <- renderText({
- input$test
- })
-})
-
-# vim: set ts=2 sw=2 foldmethod=marker expandtab:
diff --git a/inst/GUI/shiny-test.R b/inst/GUI/shiny-test.R
deleted file mode 100644
index 712c0b22..00000000
--- a/inst/GUI/shiny-test.R
+++ /dev/null
@@ -1,4 +0,0 @@
-library(shiny)
-runApp("./")
-
-# vim: set foldmethod=marker ts=2 sw=2 expandtab:
diff --git a/inst/GUI/simple-Gtk.R b/inst/GUI/simple-Gtk.R
deleted file mode 100644
index 8affdccc..00000000
--- a/inst/GUI/simple-Gtk.R
+++ /dev/null
@@ -1,33 +0,0 @@
-# Work in progress - simple Gtk2 GUI for mkin
-require(gWidgets)
-options("guiToolkit"="RGtk2")
-
-w <- gwindow("Simple R GUI for kinetic evaluations",
- width=800, height=500)
-
-# Project definition expanding group
-pr <- gexpandgroup("Project definition", container=w)
-
-n.observed <- 1
-max.n.observed <- 9
-observed.names = c("parent", paste("M", 1:(max.n.observed - 1), sep=""))
-
-prg <- ggroup(horizontal=FALSE, cont = w)
-prl <- glayout(cont = prg)
-prl[1,1] <- glabel("Number of observed variables", cont=prl)
-prl[1,2] <- (n.observed.gw = gcombobox(
- 1:max.n.observed,
- handler = function(h, ...) {
- n.observed <- svalue(n.observed.gw)
- visible(observed.gw) <- c(
- rep(TRUE, svalue(n.observed)),
- rep(FALSE, max.n.observed - n.observed))
- },
- cont=prl))
-
-observed.gw <- gdf(
- items = data.frame(Index = 1:max.n.observed,
- Name = observed.names, stringsAsFactors=FALSE),
- name = "Names of observed variables",
- cont=prg)
-
diff --git a/inst/GUI/simple.R b/inst/GUI/simple.R
index c1874145..33ab259c 100644
--- a/inst/GUI/simple.R
+++ b/inst/GUI/simple.R
@@ -1,68 +1,57 @@
-# Work in progress - simple GUI for mkin
-w <- gwindow('Simple R GUI for kinetic evaluations', visible=FALSE)
-# Project definition {{{
-pr <- gexpandgroup("Project", cont=w)
-
-n.observed <- 1
-max.n.observed <- 9
-observed.names = c("parent", paste("M", 1:(max.n.observed - 1), sep=""))
-
-prg <- ggroup(horizontal=FALSE, cont = pr)
-prl <- glayout(cont = prg)
-prl[1,1] <- glabel("Number of observed variables", cont=prl)
-prl[1,2] <- (n.observed.gw = gcombobox(
- 1:max.n.observed,
- handler = function(h, ...) {
- n.observed <<- svalue(n.observed.gw)
- filter.expression <- paste("^[1-", n.observed, "]$", sep="")
- observed.gw$filter("Index", filter.expression)
- },
- cont=prl))
-
-observed.gw <- gdf(
- items = data.frame(Index = 1:max.n.observed,
- Name = observed.names, stringsAsFactors=FALSE),
- name = "Names of observed variables",
- width = 500, height=250, cont=prg)
-
-addSpace(prg, 15)
-prf <- gfile("Project file in binary R format (preferably use .RData as extension)",
- container = prg)
-addSpring(prg)
-addSpace(prg, 15)
-pr.ok <- gbutton("save",
- handler=function(h,...) {
- galert(svalue(prf), parent=w)
- }, container=prg)
-
-gbutton("ok", handler = function(h, ...) {
- observed <- observed.gw[1:n.observed,2]
- save(observed, file="observed.RData")
- visible(pr) <- FALSE
- },
- cont=prg
-)
-
-visible(pr) <- TRUE
-# }}}
-
-# Dataset definition
-ds <- gexpandgroup("Datasets", cont=w)
-s <- gdf(data.frame( Author = c("Meier"), Year = "3", Title = "4"),
- name = "Studies",
-cont=ds)
-
-size(s) <- c(800,200)
-visible(ds) <- TRUE
-
-# Model definition
-ms <- gexpandgroup("Models", cont=w)
-visible(ms) <- FALSE
-
-# Evaluation window
-mw <- gframe("Evaluations", cont=w)
-
-# Status bar
-gstatusbar("Powered by gWidgetsWWW", cont = w)
-visible(w) <- TRUE
-# vim: set foldmethod=marker:
+# Simple gWidgetsWWW2 GUI for mkin
+# Set the GUI title and create the parent frame {{{1
+GUI_title <- "Simple Browser based GUI for kinetic evaluations using mkin"
+w <- gwindow(GUI_title)
+sb <- gstatusbar("Powered by gWidgetsWWW2 and Rook", cont = w)
+g <- gframe(GUI_title, cont = w, use.scrollwindow = TRUE, horizontal = FALSE)
+
+# Set default values for project data objects {{{1
+project_file <- "mkin_project_1.RData"
+# Observed variables {{{2
+n.observed <- 2
+observed.names = c("parent", paste("M", 1:(n.observed - 1), sep=""))
+observed.df = data.frame(Index = 1:n.observed,
+ Name = observed.names,
+ Chemical = "NA",
+ stringsAsFactors = FALSE)
+
+# Project definition and file management {{{1
+upload_file_handler <- function(h, ...) # {{{2
+{
+ tmpfile <- normalizePath(svalue(h$obj), winslash = "/")
+ try(load(tmpfile))
+ project_file <<- pr.gf$filename
+ svalue(wf.ge) <- project_file
+ observed.gdf[,] <- observed.df
+}
+save_to_file_handler <- function(h, ...) # {{{2
+{
+ observed.df <- observed.gdf[,]
+ save(observed.df, file = project_file)
+ galert(paste("Saved project contents to", project_file), parent = w)
+}
+
+# Add widgets for project definition to an expandable group {{{1
+prg <- gexpandgroup("Project definition", cont = g)
+
+pr.vg <- ggroup(cont = prg, horizontal = FALSE)
+pr.hg <- ggroup(cont = pr.vg, horizontal = TRUE)
+pr.gf <- gfile(text = "Select project file", cont = pr.hg,
+ handler = upload_file_handler)
+pr.vg2 <- ggroup(cont = pr.hg, horizontal = FALSE)
+pr.hg2 <- ggroup(cont = pr.vg2, horizontal = TRUE)
+glabel("Current project file name is", cont = pr.hg2)
+change_project_file_handler = function(h, ...) {
+ project_file <<- as.character(svalue(h$obj))
+}
+wf.ge <- gedit(project_file, cont = pr.hg2,
+ handler = change_project_file_handler)
+
+gbutton("Save current project contents to this file", cont = pr.vg2,
+ handler = save_to_file_handler)
+
+observed.gdf <- gdf(observed.df, name = "Names of observed variables",
+ width = 500, height = 250, cont = pr.vg)
+observed.gdf$set_column_width(1, 40)
+
+# vim: set foldmethod=marker ts=2 sw=2 expandtab:
diff --git a/inst/GUI/simple2.R b/inst/GUI/simple2.R
deleted file mode 100644
index 2f725d16..00000000
--- a/inst/GUI/simple2.R
+++ /dev/null
@@ -1,65 +0,0 @@
-# Simple gWidgetsWWW2 GUI for mkin
-w <- gwindow("Simple R GUI for kinetic evaluations")
-sb <- gstatusbar("Powered by gWidgetsWWW2 and Rook", cont = w)
-g <- gframe("Simple R GUI for kinetic evaluations", cont = w,
- use.scrollwindow = TRUE, horizontal = FALSE)
-
-# Project definition {{{1
-prg <- gexpandgroup("Project definition", cont = g)
-visible(prg) <- TRUE
-
-make_observed <- function(observed.df) {
- if (!exists("observed.df")) {
- n.observed <- 2
- observed.names = c("parent", paste("M", 1:(n.observed - 1), sep=""))
- observed.df = data.frame(Index = 1:n.observed,
- Name = observed.names,
- stringsAsFactors = FALSE)
- }
-
- observed.gdf <- gdf(observed.df,
- name = "Names of observed variables",
- width = 500, height = 250, cont = prg)
- observed.gdf$set_column_width(1, 40)
-}
-
-f <- gfile(text = "Set project file", cont = prg,
- handler = function(h, ...)
- {
- tmpfile <- normalizePath(svalue(h$obj), winslash = "/")
- load(tmpfile)
- make_observed(observed.df)
- })
-
-# Editable table of studies {{{1
-stg <- gexpandgroup("Studies", cont = g)
-visible(stg) <- FALSE
-studies.df <- data.frame(Index = as.integer(1),
- Author = "FOCUS kinetics workgroup",
- Year = "2006",
- Title = "FOCUS Kinetics",
- Datasets = as.integer(3),
- stringsAsFactors = FALSE)
-studies.gdf <- gdf(studies.df,
- name = "Editable list of studies in the project",
- width = "auto",
- cont = stg)
-studies.gdf$set_column_width(1, 40)
-studies.gdf$set_column_width(2, 200)
-
-# Table of datasets to select them for editing {{{1
-dsg <- gexpandgroup("Datasets", cont = g)
-visible(dsg) <- FALSE
-ds.df <- data.frame(Index = 1:3,
- Study = as.integer(1),
- Title = paste("FOCUS dataset", c("A", "B", "C")),
- icon = asIcon(c("editor", "editor", "editor")),
- stringsAsFactors = FALSE)
-ds.gtable <- gtable(ds.df, width = "auto", cont = dsg)
-ds.gtable$set_column_width(1, 40)
-ds.gtable$set_column_width(2, 40)
-ds.gtable$set_column_width(3, 200)
-
-
-# 1}}}
-# vim: set foldmethod=marker ts=2 sw=2 expandtab:
diff --git a/inst/GUI/simple3.R b/inst/GUI/simple3.R
deleted file mode 100644
index 0b12d0f9..00000000
--- a/inst/GUI/simple3.R
+++ /dev/null
@@ -1,55 +0,0 @@
-# Simple gWidgetsWWW2 GUI for mkin
-# Set the GUI title and create the parent frame {{{1
-GUI_title <- "Simple Browser based GUI for kinetic evaluations using mkin"
-w <- gwindow(GUI_title)
-sb <- gstatusbar("Powered by gWidgetsWWW2 and Rook", cont = w)
-g <- gframe(GUI_title, cont = w, use.scrollwindow = TRUE, horizontal = FALSE)
-
-# Set default values for project data objects {{{1
-project_file <- "mkin_project_1.RData"
-# Observed variables {{{2
-n.observed <- 2
-observed.names = c("parent", paste("M", 1:(n.observed - 1), sep=""))
-observed.df = data.frame(Index = 1:n.observed,
- Name = observed.names,
- stringsAsFactors = FALSE)
-
-# Project definition and file management {{{1
-upload_file_handler <- function(h, ...) # {{{2
-{
- tmpfile <- normalizePath(svalue(h$obj), winslash = "/")
- try(load(tmpfile))
- project_file <<- pr.gf$filename
- svalue(wf.ge) <- project_file
- observed.gdf[,] <- observed.df
-}
-save_to_file_handler <- function(h, ...) # {{{2
-{
- observed.df <- observed.gdf[,]
- save(observed.df, file = project_file)
- galert(paste("Saved project contents to", project_file), parent = w)
-}
-
-prg <- gexpandgroup("Project definition", cont = g)
-
-pr.vg <- ggroup(cont = prg, horizontal = FALSE)
-pr.hg <- ggroup(cont = pr.vg, horizontal = TRUE)
-pr.gf <- gfile(text = "Select project file", cont = pr.hg,
- handler = upload_file_handler)
-pr.vg2 <- ggroup(cont = pr.hg, horizontal = FALSE)
-pr.hg2 <- ggroup(cont = pr.vg2, horizontal = TRUE)
-glabel("Current project file name is", cont = pr.hg2)
-change_project_file_handler = function(h, ...) {
- project_file <<- as.character(svalue(h$obj))
-}
-wf.ge <- gedit(project_file, cont = pr.hg2,
- handler = change_project_file_handler)
-
-gbutton("Save current project contents to this file", cont = pr.vg2,
- handler = save_to_file_handler)
-
-observed.gdf <- gdf(observed.df, name = "Names of observed variables",
- width = 500, height = 250, cont = pr.vg)
-observed.gdf$set_column_width(1, 40)
-
-# vim: set foldmethod=marker ts=2 sw=2 expandtab:
diff --git a/inst/GUI/test-simple2.R b/inst/GUI/test-simple2.R
deleted file mode 100644
index 3d33884d..00000000
--- a/inst/GUI/test-simple2.R
+++ /dev/null
@@ -1,2 +0,0 @@
-require(gWidgetsWWW2)
-load_app("simple2.R")
diff --git a/inst/GUI/test.R b/inst/GUI/test.R
deleted file mode 100644
index e33e0774..00000000
--- a/inst/GUI/test.R
+++ /dev/null
@@ -1,17 +0,0 @@
-require(gWidgetsWWW)
-localServerStart("simple.R")
-
-localServerStart("gdf-test.R")
-localServerStart("gdf-test-john.R")
-
-localServerStart("Examples/ex-actions.R", package="gWidgetsWWW")
-localServerStart("Examples/ex-add-widget-dynamically.R", package="gWidgetsWWW")
-localServerStart("Examples/ex-clt.R", package="gWidgetsWWW")
-localServerStart("Examples/ex-form.R", package="gWidgetsWWW")
-localServerStart("Examples/ex-gcombobox.R", package="gWidgetsWWW")
-localServerStart("Examples/ex-gtable.R", package="gWidgetsWWW")
-localServerStart("Examples/ex-index.R", package="gWidgetsWWW")
-localServerStart("Examples/ex-layouts.R", package="gWidgetsWWW")
-localServerStart("Examples/ex-simple-gui.R", package="gWidgetsWWW")
-localServerStart("Examples/ex-widgets.R", package="gWidgetsWWW")
-localServerStart("Examples/ex-windows.R", package="gWidgetsWWW")
diff --git a/inst/GUI/ui.R b/inst/GUI/ui.R
deleted file mode 100644
index 2b0b8687..00000000
--- a/inst/GUI/ui.R
+++ /dev/null
@@ -1,14 +0,0 @@
-library(shiny)
-shinyUI(pageWithSidebar(
-
- headerPanel("shiny GUI for mkin"),
-
- sidebarPanel(
- textInput("test", "Test:", "test input")
- ),
-
- mainPanel(
- textOutput("test")
- )
-))
-# vim: set ts=2 sw=2 foldmethod=marker expandtab:

Contact - Imprint