Why doesn't the glasspane show up during power calculations?

Could be better: graph with variables, press start, close dialog -> test nevertheless

Implement variables for sampSize.

Add upscale argument to C functions.

Write multi-pvalue C-function for parametric test.

Really: "G Matrix determining the graph underlying the test procedure. Note
that the diagonal need to contain only 0s, while the rows need to sum to 1."?

Persistent node colors

Finish OSTools.searchDir() functionality.

Simes and parametric tests do not reset back to graph with variables.

Check whether user defined power functions can be evaluated.

Print method for class "sampSize"?

Is the sequence correct for the Simes test (i.e. the original graph the first - especially if adjusted.pvalues=TRUE)?

incomprehensible "Result is not up to date" message from docx export

upscale does not work for Bonferroni or Simes! Also pay attention to GUI rejection.

Check with jvisualvm for bottlenecks for huge graphs

Check user defined power function

Can two GUIs in one session break things?

Is install_github(..., dependencies = TRUE) checking for the correct package versions?

Are changes to "Use experimental features" persistent during sessions?

ToDo: Buttons if one edge point is selected. Right mouse click as cancel.

Documention for value in secondStageTest looks strange.

New features use Java 6 settings. Use reflection for Java 5 compatibility.

- Multiple Setting:
   Instead of c(0,0,...) use #hypotheses text fields. Check whether tab works as expected. Tab works, but most likely we want "select all" on "focus".
   Check for empty textfields
   Remember multiple setting options and add "clear" button. Save settings under name.
   User specified power functions should be namable in the GUI. Save output as data.frame and CSV.

- Sample Sizes: Drop "n" column,  
  Replace n, \sigma, \mu with \theta θ and Standard error of \theta.
  Specify marginal power (and one field for which alpha this power was calculated).

- "Select an R correlation matrix" -> "?"
- _Always_ use correlation matrix - never covariance matrix. Check for this for imports (and ask for converting to corMat). In the GUI disable diagonal.

- Check all output whether numbers should be rounded (e.g. 0.12000000000000000032) or converted to fractions?
(Pay attention to epsilons and numerical instabilities.)

- Reodering hypotheses doesn't work.
- See ?Deprecated and ?Defunct for outdated code

- cat((graph2latex(improvedParallelGatekeeping(), nodeTikZ="minimum size=1.2cm", tikzEnv=FALSE, offset=c(300, 0)))
  has inverted arrows (arcs are too long) without manual 'nodeR=27'.

- Check verbose output of algorithm (i) when, why? ii) new FormLayout)
- Check whether option "Colored image files and reports" is respected.

- Why is there still a thread running if the GUI is closed?

- Test error handler with Java 5.

java.lang.NoSuchMethodError: gdFlush
  at org.rosuda.JRI.Rengine.rniEval(Native Method)
	at org.rosuda.REngine.JRI.JRIEngine.eval(JRIEngine.java:281)
	at org.rosuda.REngine.REngine.parseAndEval(REngine.java:102)
	at org.af.jhlir.backends.rengine.RCallServicesREngine.engineEval(RCallServicesREngine.java:92)
	at org.af.jhlir.backends.rengine.RCallServicesREngine.eval(RCallServicesREngine.java:70)
	at org.af.gMCP.gui.RCallServicesREngineWrapper.eval(RCallServicesREngineWrapper.java:15)
	at org.af.gMCP.gui.dialogs.DialogConfIntEstVar.calculateCI(DialogConfIntEstVar.java:196)
	at org.af.gMCP.gui.dialogs.DialogConfIntEstVar.insertUpdate(DialogConfIntEstVar.java:329)

Use tools::write_PACKAGES(".", type="source") to create PACKAGES and PACKAGES.gz.

Nodes are two big in this graph (and arrow heads therefore reverted - What about dropping $\alpha$?):
graph2latex(improvedParallelGatekeeping(), scale=0.7, nodeTikZ="minimum size=1.2cm", tikzEnv=FALSE, offset=c(300, 0))

- Upscale does not work yet with adjusted p-values!
- Allow upscale for Simes test? (Theory!)
- Is the shortcut really used for the Simes test (it can not be used for adjusted p-values, but if these are not asked for the shortcut should be used).

- graphAnalysis now can take a really long time (warn or put into another [cancelable] thread?)
- NEWS.Rd and news()
- Check whether graphAnalysis slows down GUI.

Does not work any more:
#' \dontrun{
#' # If Rgraphviz is installed, we can take a look at the graph:
#' library(Rgraphviz)
#' renderGraph(layoutGraph(g))
#' }

Lines like the following are spamming the log:
> eval(expression(try(1-\nu, silent=TRUE)), envir=gMCP:::gMCPenv)

- Streamline / throw out graphTest

- http://docs.oracle.com/javase/1.5.0/docs/guide/net/proxies.html - http://stackoverflow.com/questions/376101/setting-jvm-jre-to-use-windows-proxy-automatically
- Unify graphMCP and entangled graphs?
- Integrate parameter 'envir' into corMatWizard.

From xlsxjars:
 jversion <- .jcall("java.lang.System", "S", "getProperty", "java.version")
 if (jversion < "1.5.0") stop(paste("Your java version is ", jversion, ".  Need 1.5.0 or higher.", sep = ""))

- Horizontal JScrollBar is inside vertical JScrollPane (so you have to scroll down to scroll to the right/left).

- Explain that the order of the rejected hypotheses doesn't affect the end result.
- Report was send dialog is sometimes behind ErrorReport.
- Test proxy for ErrorReport.
- http://semver.org/ Should we switch from version numbers like 0.8-3 to 0.8.3?
- NICER BUGREPORT!
- Let user choose colors for entangled graphs.
- Simes and power
- Simes + parametric test for entangled graphs.
- Optionally display alpha weighting directly in entangled graphs.
- Make node bigger for a huge number of entangled layers? (Or arrange them in a different way?)
- Disable CI and adj.P for entangled graphs.
- graph2latex for entangled graphs.
- Black&White version in graph2latex
- Removing layer from entangled graphs does not remove weights?
- GUI speed optimization (try Ferber II with 15x5)
- Also check layout of (result) dialogs for big graphs.
- Check copyright notes for code under BSD Licence
- Give more information about "testing mode" - one time JOptionPane for example.
- Find good color set for entangled graphs.
- Check whether parametric test mode is set correctly in power simulations.
- Why is RControl.getR().getHistory() not accessible when the gMCP call fails?
- Umlaute in literatur.bib, e.g. Röhmel
- .asRLogical().getData()[0] can be true but NA in R
- look at warnings regarding exhaustAlpha (also optimality of graph)
- Do we really want this any more: Warn user if he uses a version that is older than 1 year.
- Warn/inform user about changes.
- Does contrMat(n=c(10, 20, 30, 40), type ="Dunnett") do what I want?!?
- Read and check ?validObject
- For parametric procedures there is no "reset" button (->variables)
- Description (.Rd files) of graphGUI and corMatWizard
- Bauer & Hackel
- "Find out what's changed in ggplot2 with"
  "news(Version=="0.9.1", package="ggplot")"
- Add line width to edge attributes (as color)
- As soon as weights for nodes are implemented, change Improved Fallback one to (w_1,w_2,w_3) and edges (now 1/2,1/2) to \gamma, 1-\gamma with \gamma=w2/(w1_w2))
- Save power scenarios
- positive Definitheit!
- Sample size is ignored in CorMatDialog
- Konsonanz erzwingen?
- Ist der Single-Step-Dunnett als Graph darstellbar?
- two-sided tests?
- Export user defined functions and allow names for them
- CI Dialog testen!
- Selection is awkward. After first dragging one edge is always fixed to the same point.
- Check in CI zu max(0, ..) bzw. min(0, ..) / means
- keine p-Werte übernehmen
- Buttons to load R objects for power dialog.
- check whether we want to use java.math.BigDecimal somewhere.
- Improve and use in manuals/examples/etc. getWeights, getMatrix (should e.g. convert "1/3" to numeric 0.3333), etc.
=== POWER ===
- Erben der Korrelationsmatrix vom Hauptfenster (warn if this is not the case?)
- Copy&Paste of Results (Table, Text, allow to save)
- Scenarios for power
- listen von Stichproben
- Output von power calculations
- positive Definitheit
- test whether correlation is applicable:
  - Simes test -> postitive regression dependence (warn)
  - Dunnett -> ?
- Sequential Power is difficult (is based at the end on a too small sample size)
- verbose output for parametric tests
- integrate the two files "tests.R" and "unirootbug.Rd" in directory "unitTests" into unit tests. 
- improve behavior of tables if "Automatically enter the editing mode, whenever a table cell gets the focus" is set to false.
- round values in CI Dialog
- "Packages should not write in the users’ home filespace, nor anywhere else on the file system apart from the R session’s temporary directory (or during installation in the location pointed to by TMPDIR: and such usage should be cleaned up). Installing into the system’s R installation (e.g., scripts to its bin directory) is not allowed. Limited exceptions may be allowed in interactive sessions if the package obtains confirmation from the user."
Check config, logfile, ...

- JHLIR creates variable .jhlir.errors in global environment.

- Characterize optimal graphs.

- Join two graphs in GUI.

- Export matrix with 1/2 as 0.5 but add label as attribute
- Save labels as edge / node attributes?

- For the resulting graph a new option keepWeight
  is introduced in the functions gMCP and rejectNode:
  A node without outgoing edges is removed.
  Should its weight become 0 or should it keep its weight?

- JToggleButton also for new edges.
- Also let an dialog (optionally) pop up to ask for the edge weight. 

Regarding LaTeXTool.StringToLaTeX:
- (1+1/2)/2 as edge weight creates an error.
- "(1+2ε)/3"  ->   "\frac{{(1+2ε)}}{3}" Why is ε not replaced.

- Options for Edge label font size etc?

Is this still the case?
- In CI-Dialog (initial weights instead of alpha are displayed - these are two errors)

- Activate parse2numeric again in PowerDialog if (and only if) graph@m doesn't contain NAs afterwards.

.tmpGraph <- generalSuccessive()

gMCP:::calcMultiPower(weights = .tmpGraph@weights, alpha = 0.05, G = .tmpGraph@m, muL = list(c(0, 0, 0, 0)), sigmaL = list(c(1, 1, 1, 1)), nL = list(c(10, 10, 10, 10)), sigma = matrix(c(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), nrow = 4), nSim = 10000, type = "quasirandom", variables = list(delta = c(0,0.5), gamma = c(0,0.5)))

Error in calcPower(weights = .tmpGraph@weights, alpha = 0.05, G = .tmpGraph@m,  : 
  unused argument(s) (test = "Bretz2011")

High priority:
==============

- Test (and perhaps fix) the following: graphGUI("graph", envir=new.env())
- Think about JavaGD devices. (User wants to plot in R Console etc.)
- Does Deducer interfere JavaGD? (When is .onLoad executed?)
- Make JavaGD only a suggest (Solaris and generally safer)
- Create function for renaming of graph nodes in R

- Show optional dialog when refresh button is pressed.
- Check java.awt.Desktop.open in the newest Ubuntu (or is there something else wrong?)
- graphTest's last.alphas at least contain strange NaN in some cases
g <- parallelGatekeeping()
graphTest(pvalues=c(0, 1, 0, 0), alpha=0.05, graph=graph)
[...]
attr(,"last.alphas")
[1] NaN NaN   0   0

- Give link to gMCP mailing list
- HighRes option for PNG export

- Update description / references in "Example Graphs"
- graphTest renames hypotheses to H1...Hn or drops them completely in the output
- Björns Mail
- "Note that with the exceptions of INDEX, LICENSE/LICENCE and NEWS, information files at the top level
  of the package will not be installed and so not be known to users of Windows and Mac OS X 
  compiled packages (and not seen by those who use R CMD INSTALL or install.packages on the tarball). 
  So any information files you wish an end user to see should be included in inst. 
  Note that if the named exceptions also occur in inst, the versions in inst will be that seen in 
  the installed package."
- "Further files to be copied to inst/doc can be specified _via_ the file vignettes/.install_extras."
- "The package environment is sealed, so you cannot use it to store
  changing values.  Use a separate environment instead: there are
  examples in package 'grDevices' for example."
- Give feedback for old objects and missing graph package in GUI
- Remove warnings: es gibt kein Paket names 'graph'
- Some edge labels like for parallel gatekeeping are set to small values (0?)
- On Windows: Autoresize of the adjacency matrix does often not work.
- "Reject and pass \alpha" does not make sense in the parametric case (actually it does, if we ...)
- Option "Show fractions" has no influence on TextFields for weights etc

I have no idea which 1/2*alpha I'm referring here to: 
- Why does matrix(c(0,1/2,0,0),2) loose half an alpha?
- Flag 1+epsilon>1 in line sum
- round adjusted p-Values up
- Think about "-Xrs" - see paragraph below.
- somehow p-value labels where disabled (but we were not in testing modus).
- Labels like 1/3+1/2*e also in decimal format: 0.3333+0.5*e
- Variable node weights
- When not using JLaTeXMath graphs with variables are not shown and saved(?) correctly
- useC produces "Final graph after 1 steps:" - simple count the number of rejected hypotheses
- think about naming of rows, cols, weights … but I guess it'll be the advise to use just the mutator methods or if you want to avoid this overhead a warning that you should know what you are doing…
- does something in Björns C code trigger the following false-positive:
Possible MalWare 'W32/NewMalware-Generic-8d27-f554' found in '5832765_287X_AZ-D_PA3__gMCP.dll'. Heuristics score: 336 
- More fairness regarding the Maurer et al. example ("improved" - what does the paper cover)
- All Dialogs should have cancel / ok buttons
- Capture verbose output
- Classpath exception

Medium priority:
================
- graphAnalysis throws: negative values not allowed in adjacency matrix for e.g. improved parallel gatekeeping.
- https://twitter.com/#!/hadleywickham: "@revodavid noooooooooooo. don't use strings + parse + eval. use calls + substitute + eval #rstats (there's also an R news article on macros)"
- Does Indefinite ProgressPanel slow the calculation significantly down ?!?
- graphAnalysis: Graph can be optimal despite the fact that some nodes are not accessible from others
- Warn user when sum of edge weights is bigger than 1
- Check mutator methods for errors (alpha > 1, edge weights > 1)
- Guide for usage under MacOS
- Test the option for rounding how many digits we want to see.
(search for DecimalFormat and replace it with getDecFormat())
- Improve speed when loading graphs
- Check for / think about conflicts: "JAVAGD_CLASS_NAME"="org/mutoss/gui/JavaGD"

Lade nötiges Paket: graph
Warnmeldung:
In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
  es gibt kein Paket namens ‘graph’


Additional features / low priority:
===================================
- Giving \d to RJava causes a segmentation fault.
- Save ConfIntPlot as png/bmp or copy to system clip board
- Do we really need PolynomF as dependencies?
- Don't create global variable like .tmpGraph etc.
- Report generation in GUI (and respect the option whether to show rejected null hypothesis)
- TikZ styles for rejected / rejectable nodes
- further tests
- After interruption of a calculation a new calculation gave:
  "unprotect(): only 0 protected items"
  Should be fixed now - but if we have time to spare, we could look further into this.
- Use of InfoNode Docking Windows? http://www.infonode.net/index.html?idw
  Would increase size by 717 kByte (and bind us to GPL=2)
- Whishlist dialog.
- suppressPackageStartupMessages

     ‘.First.lib’ is called when a package without a name space is
     attached by ‘library’.  (For packages with name spaces see
     ‘.onLoad’.)  It is called with two arguments, the name of the
     library directory where the package was found (i.e., the
     corresponding element of ‘lib.loc’), and the name of the package.
     It is a good place to put calls to ‘library.dynam’ which are
     needed when loading a package into this function (don't call
     ‘library.dynam’ directly, as this will not work if the package is
     not installed in a standard location).  ‘.First.lib’ is invoked
     after the search path interrogated by ‘search()’ has been updated,
     so ‘as.environment(match("package:name", search()))’ will return
     the environment in which the package is stored.  If calling
     ‘.First.lib’ gives an error the loading of the package is
     abandoned, and the package will be unavailable.  Similarly, if the
     option ‘".First.lib"’ has a list element with the package's name,
     this element is called in the same manner as ‘.First.lib’ when the
     package is attached.  This mechanism allows the user to set
     package ‘load hooks’ in addition to startup code as provided by
     the package maintainers, but ‘setHook’ is preferred.

For the conventions for files NEWS and ChangeLog in the GNU project see http://www.gnu.org/prep/standards/standards.html#Documentation. 

@Apple - is this a problem?

r-patched-macosx-ix86:
checking R code for possible problems ... NOTE
2010-10-02 03:00:01.838 R[97724:613] Apple AWT Java VM was loaded on first thread -- can't start AWT. 

-> reference to JGR or Deducer.

rJava: We had the following problem:

> library(rJava)
> .jinit()
> replicate(1000000,rnorm(1))
^C
Java requested System.exit(130), closing R.

We solved it by calling .jinit(parameters="-Xrs")

Does this have side effects?

From http://download.oracle.com/javase/1.3/docs/tooldocs/solaris/java.html :

-Xrs
    Reduces use of operating-system signals by the Java virtual machine (JVM). This option is available beginning with J2SE 1.3.1.
    In J2SE 1.3.0, the Shutdown Hooks facility was added to allow orderly shutdown of a Java application. The intent was to allow user cleanup code (such as closing database connections) to run at shutdown, even if the JVM terminates abruptly.
    Sun's JVM catches signals to implement shutdown hooks for abnormal JVM termination. The JVM uses SIGHUP, SIGINT, and SIGTERM to initiate the running of shutdown hooks.
    The JVM uses a similar mechanism to implement the pre-1.2 feature of dumping thread stacks for debugging purposes. Sun's JVM uses SIGQUIT to perform thread dumps.
    Applications embedding the JVM frequently need to trap signals like SIGINT or SIGTERM, which can lead to interference with the JVM's own signal handlers. To address this issue, the -Xrs command-line option has been added beginning in J2SE 1.3.1. When -Xrs is used on Sun's JVM, the signal masks for SIGINT, SIGTERM, SIGHUP, and SIGQUIT are not changed by the JVM, and signal handlers for these signals are not installed.
    There are two consequences of specifying -Xrs:
        * SIGQUIT thread dumps are not available.
        * User code is responsible for causing shutdown hooks to run, for example by calling System.exit() when the JVM is to be terminated. 

---

Note for building gMCP for older R versions:
============================================

Prof Brian Ripley: - if your LaTeX installation gets updated and you do not want to update 
R, you can update just Rd.sty from 
https://svn.r-project.org/R/trunk/share/texmf/tex/latex/Rd.sty .  Or you 
could write a file inconsolata.sty as a wrapper for zi4.sty and put it 
in your TEXINPUTS path. [http://r.789695.n4.nabble.com/inconsolata-sty-is-liable-to-disappear-texinfo-5-1-td4669976.html]

As always:
==========
- more references.
- More details in manual pages.

---
        
The current api for setting a popupMenu in Swing is

  myComponent.setComponentPopupMenu(myPopupMenu)

this way it will be shown automagically, both for mouse and keyboard triggers (the latter depends on LAF). Plus, it supports re-using the same popup across a container's children. To enable that feature:

  myChild.setInheritsPopupMenu(true)

---

Trick to open PDF files from R:
 filepath <- system.file("xy.pdf", package = "yz")
 obj <- list(file = NULL, pdf = filepath, topic = NULL)
 class(obj) <- "vignette"
 print(obj)
 
 ---
 Everything looks fine in CI dialog but:
 
 > Exception in thread "SwingWorker-pool-1260566389-thread-1" java.lang.NoSuchMethodError: gdFlush
	at org.rosuda.JRI.Rengine.rniEval(Native Method)
	at org.rosuda.REngine.JRI.JRIEngine.eval(JRIEngine.java:281)
	at org.rosuda.REngine.REngine.parseAndEval(REngine.java:102)
	at org.af.jhlir.backends.rengine.RCallServicesREngine.engineEval(RCallServicesREngine.java:92)
	at org.af.jhlir.backends.rengine.RCallServicesREngine.eval(RCallServicesREngine.java:70)
	at org.af.gMCP.gui.dialogs.DialogConfIntEstVar.calculateCI(DialogConfIntEstVar.java:190)
	at org.af.gMCP.gui.dialogs.DialogConfIntEstVar.getCIPanel(DialogConfIntEstVar.java:130)
	at org.af.gMCP.gui.dialogs.DialogConfIntEstVar.<init>(DialogConfIntEstVar.java:88)
	at org.af.gMCP.gui.graph.GraphView$1.doInBackground(GraphView.java:236)
	at org.af.gMCP.gui.graph.GraphView$1.doInBackground(GraphView.java:1)
	at org.jdesktop.swingworker.SwingWorker$1.call(Unknown Source)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
	at org.jdesktop.swingworker.SwingWorker.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:722)
 
---
Look at highr and
<<tikz-ex, engine = "tikz", fig.cap = "Funky tikz", fig.ext = 'png', cache=TRUE>>=
\usetikzlibrary{arrows}
\begin{tikzpicture}[node distance=2cm, auto,>=latex', thick, scale = 0.5]
\node (P) {$P$};
\node (B) [right of=P] {$B$};
\node (A) [below of=P] {$A$};
\node (C) [below of=B] {$C$};
\node (P1) [node distance=1.4cm, left of=P, above of=P] {$\hat{P}$};
\draw[->] (P) to node {$f$} (B);
\draw[->] (P) to node [swap] {$g$} (A);
\draw[->] (A) to node [swap] {$f$} (C);
\draw[->] (B) to node {$g$} (C);
\draw[->, bend right] (P1) to node [swap] {$\hat{g}$} (A);
\draw[->, bend left] (P1) to node {$\hat{f}$} (B);
\draw[->, dashed] (P1) to node {$k$} (P);
\end{tikzpicture}
@

Bug in Roxygen. Roxygenize inserted documentation at a total wrong place (_in_ another function in another file): 

#' @export subgraph
	subgraph <- graph@subgraphs[[k]]