Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
Teleteaching Standalone
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ttt
Teleteaching Standalone
Commits
d94725e5
Commit
d94725e5
authored
May 16, 2019
by
Dr. Michael Petter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
made thumbnailicon computation at the end of the slide optional
parent
11508051
Pipeline
#1846
passed with stage
in 38 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
107 additions
and
2 deletions
+107
-2
java/ttt/Experimental.java
java/ttt/Experimental.java
+102
-0
java/ttt/gui/Index.java
java/ttt/gui/Index.java
+5
-2
No files found.
java/ttt/Experimental.java
0 → 100644
View file @
d94725e5
package
ttt
;
import
java.awt.BorderLayout
;
import
java.awt.Dimension
;
import
java.awt.Toolkit
;
import
java.awt.event.ActionEvent
;
import
java.awt.event.ActionListener
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.prefs.BackingStoreException
;
import
java.util.prefs.Preferences
;
import
javax.swing.BoxLayout
;
import
javax.swing.JButton
;
import
javax.swing.JFrame
;
import
javax.swing.JLabel
;
import
javax.swing.JPanel
;
import
javax.swing.JTextField
;
public
class
Experimental
{
static
Preferences
experimentalRoot
=
TTT
.
userPrefs
.
node
(
"experimental"
);
public
static
enum
Code
{
MICTHRESHOLD
(
"micthreshold"
,
"0.00000001"
),
THUMBNAILATSTART
(
"thumbnail at start"
,
"true"
);
public
String
key
;
public
String
def
;
Code
(
String
key
,
String
def
){
this
.
key
=
key
;
this
.
def
=
def
;
}
public
String
get
()
{
return
experimentalRoot
.
get
(
key
,
def
);
}
public
void
set
(
String
val
)
{
experimentalRoot
.
put
(
key
,
val
);
}
}
public
static
void
main
(
String
[]
args
)
throws
BackingStoreException
,
IllegalArgumentException
,
IllegalAccessException
{
for
(
String
s
:
experimentalRoot
.
childrenNames
())
System
.
out
.
println
(
s
);
final
JFrame
frame
=
new
JFrame
(
"TTT Experimental Options"
);
JPanel
pane
=
new
JPanel
();
pane
.
setLayout
(
new
BoxLayout
(
pane
,
BoxLayout
.
PAGE_AXIS
));
final
Map
<
String
,
JTextField
>
map
=
new
HashMap
<>();
ActionListener
action
=
new
ActionListener
()
{
@Override
public
void
actionPerformed
(
ActionEvent
arg0
)
{
String
newval
=
map
.
get
(
arg0
.
getActionCommand
()).
getText
();
experimentalRoot
.
put
(
arg0
.
getActionCommand
(),
newval
);
try
{
experimentalRoot
.
flush
();
}
catch
(
BackingStoreException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
}
};
for
(
Code
c:
Code
.
values
())
{
JPanel
panel
=
new
JPanel
();
JLabel
label
=
new
JLabel
(
c
.
name
());
panel
.
add
(
label
);
JTextField
text
=
new
JTextField
(
experimentalRoot
.
get
(
c
.
key
,
c
.
def
.
toString
()));
panel
.
add
(
text
);
map
.
put
(
c
.
key
,
text
);
JButton
butt
=
new
JButton
(
"Save"
);
butt
.
setActionCommand
(
c
.
key
);
butt
.
addActionListener
(
action
);
panel
.
add
(
butt
);
pane
.
add
(
panel
);
}
JPanel
globpanel
=
new
JPanel
(
new
BorderLayout
());
globpanel
.
add
(
pane
,
BorderLayout
.
CENTER
);
JButton
close
=
new
JButton
(
"Close"
);
close
.
addActionListener
(
new
ActionListener
()
{
@Override
public
void
actionPerformed
(
ActionEvent
arg0
)
{
frame
.
dispose
();
}
});
globpanel
.
add
(
close
,
BorderLayout
.
SOUTH
);
frame
.
add
(
globpanel
);
frame
.
pack
();
frame
.
setDefaultCloseOperation
(
JFrame
.
DISPOSE_ON_CLOSE
);
Dimension
dim
=
Toolkit
.
getDefaultToolkit
().
getScreenSize
();
frame
.
setLocation
(
dim
.
width
/
2
-
frame
.
getSize
().
width
/
2
,
dim
.
height
/
2
-
frame
.
getSize
().
height
/
2
);
frame
.
setVisible
(
true
);
}
}
java/ttt/gui/Index.java
View file @
d94725e5
...
...
@@ -789,8 +789,11 @@ public class Index {
if
(
i
+
1
<
index
.
size
()){
timestamp
+=
(
index
.
get
(
i
+
1
).
getTimestamp
()-
timestamp
)*.
95
;
}
recording
.
setTime
(
timestamp
,
false
);
boolean
beginofslide
=
Boolean
.
parseBoolean
(
ttt
.
Experimental
.
Code
.
THUMBNAILATSTART
.
get
());
if
(
beginofslide
)
recording
.
setTime
(
indexEntry
.
getTimestamp
());
else
recording
.
setTime
(
timestamp
,
false
);
// create screenshot
Image
screenshot
=
recording
.
graphicsContext
.
getScreenshotWithoutAnnotations
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment