-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.groovy
More file actions
128 lines (106 loc) · 2.92 KB
/
test.groovy
File metadata and controls
128 lines (106 loc) · 2.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
import java.time.LocalDate
import java.time.YearMonth
//def io = new se.alipsa.gi.swing.InOut()
//def io = new se.alipsa.gi.fx.InOut()
def io = new se.alipsa.gi.console.InOut()
def file = io.chooseFile("Choose a file", ".", "Pick a file please!" )
println("File chosen was $file")
//def ym = io.promptYearMonth("Pick a yearmonth")
//println("You picked $ym")
/*
ym = io.promptYearMonth("Yearmonth picker example", "Pick a yearmonth please",
YearMonth.now().minusYears(1),
YearMonth.now().plusMonths(2),
YearMonth.now().minusMonths(1)
)
println("This time, you picked $ym")
*/
/*
def date = io.promptDate("Datepicker example", "Pick a date please", LocalDate.now().minusDays(1))
println("You picked $date")
*/
/*
def option = io.promptSelect("Select example",
"Choose your afternoon snack",
"Pick a fruit please",
["Apple", "Apricot", "Orange"],
"Apricot"
)
println("You wanted an $option this afternoon")
*/
/*
def pwd = io.promptPassword("Password demo", "Enter password:")
println("The password is $pwd")
*/
/*
def name = io.prompt("What is your first name?")
println ("Hi $name")
def input = io.prompt("Prompt example", "What is your favorite name?", "Name:")
println("Your favorite name is $input")
def day = io.prompt("Prompt example","What is your favorite day?", "Day", "Monday")
println("Your favorite day is $day")
*/
/*
def html = """
<html>
<body>
<h1>Hello world</h1>
<div>A simple text</div>
<table>
<tr><td>1</td><td>Per</td></tr>
<tr><td>2</td><td>Louise</td></tr>
</table>
</body>
</html>
"""
File file = new File("/tmp/t.html")
file.write(html)
io.view(file, "Example html page")
io.view(html, "View of html content")
*/
/*
io.viewMarkdown("""# example title
- one thing
- another thing
## Ordered list
1. *this*
2. _that_
""", 'Markdown example')
*/
/*
import se.alipsa.groovy.matrix.Matrix
Matrix matrix = Matrix.create(
"Matrix example",
[
id: [1,2,3] as int[],
name: ["Foo", "Bar", "Baz"],
expense: [123.23, 212.31, 12.1] as double[]
], [int, String, double]
)
io.view(matrix)
*/
/*
def rowList = [
[1, "Foo", 123.23],
[2, "Bar", 212.31],
[3, "Baz", 12.1]
]
io.view(rowList, 'List of lists example')
*/
//io.view(123, "apples")
//io.display(io.projectFile("src/test/resources/svgplot.svg"))
//io.display(io.projectFile("src/test/resources/areachart2.png"))
/*
import se.alipsa.groovy.matrix.*
import se.alipsa.groovy.charts.*
import static se.alipsa.groovy.matrix.ListConverter.*
empData = Matrix.create(
emp_id: 1..5,
emp_name: ["Rick","Dan","Michelle","Ryan","Gary"],
salary: [623.3,515.2,611.0,729.0,843.25],
start_date: toLocalDates("2012-01-01", "2013-09-23", "2014-11-15", "2014-05-11", "2015-03-27"),
[int, String, Number, LocalDate]
)
chart = AreaChart.create("Salaries", empData, "emp_name", "salary")
io.display(chart, "Matrix charts areachart")
*/