Added window with header information ...
This commit is contained in:
parent
7d44d54356
commit
52e59f48e8
@ -0,0 +1,62 @@
|
|||||||
|
/**
|
||||||
|
*
|
||||||
|
* Copyright 2013 Paul Scherrer Institute. All rights reserved.
|
||||||
|
*
|
||||||
|
* This code is free software: you can redistribute it and/or modify it under
|
||||||
|
* the terms of the GNU Lesser General Public License as published by the Free
|
||||||
|
* Software Foundation, either version 3 of the License, or (at your option) any
|
||||||
|
* later version.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but without any
|
||||||
|
* warranty; without even the implied warranty of merchantability or fitness for
|
||||||
|
* a particular purpose. See the GNU Lesser General Public License for more
|
||||||
|
* details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public License
|
||||||
|
* along with this code. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
package ch.psi.imagej.zeromq;
|
||||||
|
|
||||||
|
import javax.swing.JFrame;
|
||||||
|
import javax.swing.JLabel;
|
||||||
|
import java.awt.GridLayout;
|
||||||
|
import java.util.Map;
|
||||||
|
import javax.swing.SwingConstants;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author ebner
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@SuppressWarnings("serial")
|
||||||
|
public class HeaderInfo extends JFrame {
|
||||||
|
|
||||||
|
private JLabel lblHeader;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create the panel.
|
||||||
|
*/
|
||||||
|
public HeaderInfo() {
|
||||||
|
getContentPane().setLayout(new GridLayout(0, 1, 0, 0));
|
||||||
|
|
||||||
|
lblHeader = new JLabel("Header ...");
|
||||||
|
lblHeader.setVerticalAlignment(SwingConstants.TOP);
|
||||||
|
getContentPane().add(lblHeader);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setText(Map<String,Object> m){
|
||||||
|
StringBuilder b = new StringBuilder();
|
||||||
|
b.append("<html>");
|
||||||
|
for(String k : m.keySet()){
|
||||||
|
b.append(k);
|
||||||
|
b.append(" ");
|
||||||
|
b.append(m.get(k));
|
||||||
|
b.append("<br/>");
|
||||||
|
}
|
||||||
|
b.append("</html>");
|
||||||
|
lblHeader.setText(b.toString());
|
||||||
|
this.pack();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -68,7 +68,7 @@ public class ZeroMQViewer implements PlugIn {
|
|||||||
private JComboBox<String> comboBoxMethod;
|
private JComboBox<String> comboBoxMethod;
|
||||||
|
|
||||||
private ObjectMapper mapper = new ObjectMapper(new JsonFactory());
|
private ObjectMapper mapper = new ObjectMapper(new JsonFactory());
|
||||||
// private HeaderInfo hinfo = new HeaderInfo();
|
private HeaderInfo hinfo = new HeaderInfo();
|
||||||
|
|
||||||
public void run(String arg) {
|
public void run(String arg) {
|
||||||
IJ.showStatus("Running ZeroMQ Viewer");
|
IJ.showStatus("Running ZeroMQ Viewer");
|
||||||
@ -89,7 +89,7 @@ public class ZeroMQViewer implements PlugIn {
|
|||||||
while (isPluginRunning) {
|
while (isPluginRunning) {
|
||||||
semaphore.acquire();
|
semaphore.acquire();
|
||||||
collect=true;
|
collect=true;
|
||||||
// hinfo.setVisible(true);
|
hinfo.setVisible(true);
|
||||||
try{
|
try{
|
||||||
if(img!=null){
|
if(img!=null){
|
||||||
img.close();
|
img.close();
|
||||||
@ -174,6 +174,8 @@ public class ZeroMQViewer implements PlugIn {
|
|||||||
img.show();
|
img.show();
|
||||||
}
|
}
|
||||||
img.setTitle(header);
|
img.setTitle(header);
|
||||||
|
hinfo.setText(m);
|
||||||
|
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
logger.info("Header type is not supported ...");
|
logger.info("Header type is not supported ...");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user