Statistics
| Revision:

root / tmp / org.txm.groovy.core / src / groovy / org / txm / macroproto / PlotEllipsesMacro.groovy @ 822

History | View | Annotate | Download (984 Bytes)

1
// STANDARD DECLARATIONS
2
package org.txm.macroproto
3

    
4
import org.kohsuke.args4j.*
5

    
6
import groovy.transform.Field
7

    
8
import org.txm.ca.core.functions.CA
9
import org.txm.rcpapplication.swt.widget.parameters.*
10
import org.txm.statsengine.r.core.RWorkspace
11

    
12
// BEGINNING OF PARAMETERS
13

    
14
if (!(corpusViewSelection instanceof CA)) {
15
        println "Selection is not a CA. Please select a CA result in the Corpus view"
16
        return;
17
}
18

    
19
@Field @Option(name="outputFile", usage="an example file", widget="FileSave", required=true, def="file.svg")
20
def outputFile
21

    
22
@Field @Option(name="draw", usage="'row' or 'col'", widget="String", required=true, def="row")
23
def draw
24
// Open the parameters input dialog box
25
if (!ParametersDialog.open(this)) return;
26

    
27
// END OF PARAMETERS
28
def ca = corpusViewSelection
29
def s = ca.getSymbol()
30
def RW = RWorkspace.getRWorkspaceInstance()
31

    
32
def script = """
33
plot($s);
34
ellipseCA($s, ellipse=c("$draw"));
35
"""
36

    
37
RW.plot(outputFile, script);
38

    
39
println "Done: "+outputFile.getAbsolutePath()