Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
BigDataViewer_Core_Extension
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
BioinformaticDataCompression
BigDataViewer_Core_Extension
Commits
2868b9d6
Commit
2868b9d6
authored
4 years ago
by
Vojtech Moravec
Browse files
Options
Downloads
Patches
Plain Diff
Add sendSummaryRequest.
This requests from server statistics of transfered data.
parent
c96d534a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/bdv/BigDataViewer.java
+38
-8
38 additions, 8 deletions
src/main/java/bdv/BigDataViewer.java
src/main/java/bdv/ui/viewermodepanel/DisplaySettingsPanel.java
+3
-4
3 additions, 4 deletions
...ain/java/bdv/ui/viewermodepanel/DisplaySettingsPanel.java
with
41 additions
and
12 deletions
src/main/java/bdv/BigDataViewer.java
+
38
−
8
View file @
2868b9d6
...
...
@@ -70,10 +70,9 @@ import org.scijava.ui.behaviour.io.yaml.YamlConfigIO;
import
javax.swing.*
;
import
javax.swing.filechooser.FileFilter
;
import
java.io.File
;
import
java.io.FileNotFoundException
;
import
java.io.FileWriter
;
import
java.io.IOException
;
import
java.io.*
;
import
java.net.HttpURLConnection
;
import
java.net.URL
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
@@ -109,6 +108,7 @@ public class BigDataViewer {
protected
File
proposedSettingsFile
;
private
boolean
enableCompression
;
private
String
fileName
=
null
;
public
void
toggleManualTransformation
()
{
manualTransformationEditor
.
toggle
();
...
...
@@ -412,12 +412,22 @@ public class BigDataViewer {
menu
=
new
JMenu
(
"QCMP Compression"
);
menubar
.
add
(
menu
);
final
JCheckBoxMenuItem
enableCompressionCheckBox
=
new
JCheckBoxMenuItem
(
"Enable compression"
,
true
);
enableCompressionCheckBox
.
addActionListener
(
e
->
{
enableDisableCompression
(
enableCompressionCheckBox
.
isSelected
());
final
JMenuItem
sendSummaryRequest
=
new
JMenuItem
(
"Request summary info from server"
);
sendSummaryRequest
.
addActionListener
(
event
->
{
System
.
out
.
println
(
"Send summary request."
);
try
{
sendSummaryRequest
(
fileName
+
"?p=summary"
);
}
catch
(
final
Exception
err
)
{
err
.
printStackTrace
();
}
});
menu
.
add
(
sendSummaryRequest
);
menu
.
add
(
enableCompressionCheckBox
);
// final JCheckBoxMenuItem enableCompressionCheckBox = new JCheckBoxMenuItem("Enable compression", true);
// enableCompressionCheckBox.addActionListener(e -> {
// enableDisableCompression(enableCompressionCheckBox.isSelected());
// });
// menu.add(enableCompressionCheckBox);
}
...
...
@@ -485,6 +495,7 @@ public class BigDataViewer {
final
BigDataViewer
bdv
=
open
(
spimData
,
windowTitle
,
progressWriter
,
options
);
if
(!
bdv
.
tryLoadSettings
(
xmlFilename
))
InitializeViewerState
.
initBrightness
(
0.001
,
0.999
,
bdv
.
viewerFrame
);
bdv
.
fileName
=
xmlFilename
;
return
bdv
;
}
...
...
@@ -699,4 +710,23 @@ public class BigDataViewer {
e
.
printStackTrace
();
}
}
private
static
void
sendSummaryRequest
(
final
String
url
)
throws
Exception
{
final
URL
getRequest
=
new
URL
(
url
);
final
HttpURLConnection
urlConnection
=
(
HttpURLConnection
)
getRequest
.
openConnection
();
urlConnection
.
setRequestMethod
(
"GET"
);
final
StringBuilder
result
=
new
StringBuilder
();
try
(
final
InputStream
responseStream
=
urlConnection
.
getInputStream
())
{
final
BufferedReader
reader
=
new
BufferedReader
(
new
InputStreamReader
(
responseStream
));
String
line
;
while
((
line
=
reader
.
readLine
())
!=
null
)
{
result
.
append
(
line
).
append
(
'\n'
);
}
}
System
.
out
.
println
(
"Summary request response:"
);
System
.
out
.
println
(
result
.
toString
());
}
}
This diff is collapsed.
Click to expand it.
src/main/java/bdv/ui/viewermodepanel/DisplaySettingsPanel.java
+
3
−
4
View file @
2868b9d6
...
...
@@ -31,12 +31,11 @@ package bdv.ui.viewermodepanel;
import
bdv.viewer.DisplayMode
;
import
bdv.viewer.Interpolation
;
import
bdv.viewer.ViewerState
;
import
java.awt.Color
;
import
javax.swing.ImageIcon
;
import
javax.swing.JPanel
;
import
javax.swing.SwingUtilities
;
import
net.miginfocom.swing.MigLayout
;
import
javax.swing.*
;
import
java.awt.*
;
import
static
bdv
.
viewer
.
Interpolation
.
NEARESTNEIGHBOR
;
import
static
bdv
.
viewer
.
Interpolation
.
NLINEAR
;
import
static
bdv
.
viewer
.
ViewerStateChange
.
DISPLAY_MODE_CHANGED
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment