Skip to content
Snippets Groups Projects
Commit 75458d7b authored by Carsten Stocklöw's avatar Carsten Stocklöw
Browse files

refactoring, introduced tabbed view, showing all messages

parent 4ffa6506
No related branches found
No related tags found
No related merge requests found
Showing
with 454 additions and 60 deletions
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<groupId>org.universAAL.tools</groupId> <groupId>org.universAAL.tools</groupId>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<artifactId>tools.log_mon</artifactId> <artifactId>tools.log_mon</artifactId>
<version>0.1.1-SNAPSHOT</version> <version>0.1.2-SNAPSHOT</version>
<name>Log Monitor</name> <name>Log Monitor</name>
<description>Visualization of RDF graphs from log entries</description> <description>Visualization of RDF graphs from log entries</description>
<url /> <url />
......
...@@ -9,6 +9,7 @@ import org.osgi.framework.BundleActivator; ...@@ -9,6 +9,7 @@ import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext; import org.osgi.framework.BundleContext;
import org.universAAL.middleware.container.LogListener; import org.universAAL.middleware.container.LogListener;
/** /**
* The bundle activator to create the log monitor and register this OSGi * The bundle activator to create the log monitor and register this OSGi
* service. * service.
...@@ -31,4 +32,9 @@ public class Activator implements BundleActivator { ...@@ -31,4 +32,9 @@ public class Activator implements BundleActivator {
public void stop(BundleContext arg0) throws Exception { public void stop(BundleContext arg0) throws Exception {
} }
public static void main(String[] args) {
LogMonitor lm = new LogMonitor();
lm.log(0, "module", "pkg", "cls", "method", new Object[] {""}, null);
}
} }
/*
Copyright 2007-2014 Fraunhofer IGD, http://www.igd.fraunhofer.de
Fraunhofer-Gesellschaft - Institut fr Graphische Datenverarbeitung
*/
package org.universAAL.tools.logmonitor;
import javax.swing.JPanel;
import org.universAAL.middleware.container.LogListener;
public interface LogListenerEx extends LogListener {
public JPanel getPanel();
public String getTitle();
}
...@@ -4,45 +4,32 @@ ...@@ -4,45 +4,32 @@
*/ */
package org.universAAL.tools.logmonitor; package org.universAAL.tools.logmonitor;
import java.util.LinkedList;
import org.universAAL.middleware.rdf.Resource;
import org.universAAL.middleware.container.LogListener; import org.universAAL.middleware.container.LogListener;
/** /**
* Implementation of the {@link org.universAAL.middleware.util.LogListener} * Implementation of the {@link org.universAAL.middleware.util.LogListener}
* interface to be called from {@link org.universAAL.middleware.util.LogUtils} * interface to be called from
* in the bundle mw.data.representation. * {@link org.universAAL.middleware.container.utils.LogUtils}
* *
* @author cstockloew * @author cstockloew
* *
*/ */
public class LogMonitor implements LogListener { public class LogMonitor implements LogListener {
/** LogListenerEx listeners[] = new LogListenerEx[2];
* The main frame. MainGui gui = new MainGui();
*/
private RDFVis vis = new RDFVis(); LogMonitor() {
listeners[0] = new org.universAAL.tools.logmonitor.all_log.LogMonitor();
listeners[1] = new org.universAAL.tools.logmonitor.rdfvis.LogMonitor();
for (int i = 0; i < listeners.length; i++)
gui.addPanel(listeners[i].getTitle(), listeners[i].getPanel());
}
/**
* @see org.universAAL.middleware.container.LogListener
*/
public void log(int logLevel, String module, String pkg, String cls, public void log(int logLevel, String module, String pkg, String cls,
String method, Object[] msgPart, Throwable t) { String method, Object[] msgPart, Throwable t) {
for (int i = 0; i < listeners.length; i++)
// TODO: put this in a separate thread? listeners[i].log(logLevel, module, pkg, cls, method, msgPart, t);
String msg = "";
LinkedList<Resource> lst = new LinkedList<Resource>();
for (int i = 0; i < msgPart.length; i++) {
if (i > 0)
msg += " ";
Object o = msgPart[i];
msg += o;
if (o instanceof Resource)
lst.add((Resource) o);
}
for (Resource r : lst)
vis.addMessage(cls, method, msg, r, ResourceInterpreter
.getShortDescription(r));
} }
} }
/*
Copyright 2007-2014 Fraunhofer IGD, http://www.igd.fraunhofer.de
Fraunhofer-Gesellschaft - Institut fr Graphische Datenverarbeitung
*/
package org.universAAL.tools.logmonitor;
import java.awt.BorderLayout;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;
public class MainGui extends JFrame {
private static final long serialVersionUID = 1L;
private JTabbedPane tabbedPane;
/**
* Create the main frame.
*/
public MainGui() {
super("Log Monitor");
tabbedPane = new JTabbedPane();
getContentPane().add(tabbedPane, BorderLayout.CENTER);
setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
setSize(1000, 700);
setVisible(true);
}
public void addPanel(String title, JPanel panel) {
// System.out.println("Logmonitor: Adding Panel " + title);
tabbedPane.addTab(title, panel);
}
}
/*
Copyright 2007-2014 Fraunhofer IGD, http://www.igd.fraunhofer.de
Fraunhofer-Gesellschaft - Institut fr Graphische Datenverarbeitung
*/
package org.universAAL.tools.logmonitor;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import org.universAAL.middleware.container.LogListener;
public class Utils {
/**
* Get the date as a string.
*
* @return The date as a string.
*/
public static String getDateString(Date date) {
Calendar c = new GregorianCalendar();
c.setTime(date);
String dateString = new String();
dateString += c.get(Calendar.YEAR) + "-";
dateString += c.get(Calendar.MONTH) + "-";
dateString += c.get(Calendar.DAY_OF_MONTH) + " ";
dateString += c.get(Calendar.HOUR_OF_DAY) + ":";
dateString += c.get(Calendar.MINUTE) + ":";
dateString += c.get(Calendar.SECOND) + ".";
dateString += c.get(Calendar.MILLISECOND);
return dateString;
}
public static String buildMessage(Object[] msgPart) {
StringBuffer sb = new StringBuffer(256);
if (msgPart != null)
for (int i = 0; i < msgPart.length; i++)
sb.append(msgPart[i]);
return sb.toString();
}
public static String getLevel(int logLevel) {
String level = "-";
switch (logLevel) {
case LogListener.LOG_LEVEL_TRACE:
level = "TRACE";
break;
case LogListener.LOG_LEVEL_DEBUG:
level = "DEBUG";
break;
case LogListener.LOG_LEVEL_INFO:
level = "INFO";
break;
case LogListener.LOG_LEVEL_WARN:
level = "WARN";
break;
case LogListener.LOG_LEVEL_ERROR:
level = "ERROR";
break;
}
return level;
}
}
/*
Copyright 2007-2014 Fraunhofer IGD, http://www.igd.fraunhofer.de
Fraunhofer-Gesellschaft - Institut fr Graphische Datenverarbeitung
*/
package org.universAAL.tools.logmonitor.all_log;
import java.util.Date;
public class LogEntry {
public int logLevel;
public String module;
public String pkg;
public String cls;
public String method;
public Object[] msgPart;
public Throwable t;
public Date date;
LogEntry(int logLevel, String module, String pkg, String cls,
String method, Object[] msgPart, Throwable t) {
this.logLevel = logLevel;
this.module = module;
this.pkg = pkg;
this.cls = cls;
this.method = method;
this.msgPart = msgPart;
this.t = t;
this.date = new Date();
}
}
/*
Copyright 2007-2014 Fraunhofer IGD, http://www.igd.fraunhofer.de
Fraunhofer-Gesellschaft - Institut fr Graphische Datenverarbeitung
*/
package org.universAAL.tools.logmonitor.all_log;
import java.util.Hashtable;
import javax.swing.JPanel;
import org.universAAL.tools.logmonitor.LogListenerEx;
import org.universAAL.tools.logmonitor.all_log.gui.AllLogPanel;
/**
* Implementation of the {@link org.universAAL.middleware.util.LogListener}
* interface to be called from
* {@link org.universAAL.middleware.container.utils.LogUtils}
*
* @author cstockloew
*
*/
public class LogMonitor implements LogListenerEx {
private Hashtable<Integer, LogEntry> entries = new Hashtable<Integer, LogEntry>();
int num = 0;
AllLogPanel panel;
public LogMonitor() {
panel = new AllLogPanel(this);
}
/**
* @see org.universAAL.middleware.container.LogListener
*/
public void log(int logLevel, String module, String pkg, String cls,
String method, Object[] msgPart, Throwable t) {
LogEntry le = new LogEntry(logLevel, module, pkg, cls, method, msgPart,
t);
entries.put(Integer.valueOf(num++), le);
panel.addMessage(le);
}
public JPanel getPanel() {
return panel;
}
public String getTitle() {
return "All Messages";
}
public LogEntry getLogEntry(int index) {
return entries.get(Integer.valueOf(index));
}
}
/*
Copyright 2007-2014 Fraunhofer IGD, http://www.igd.fraunhofer.de
Fraunhofer-Gesellschaft - Institut fr Graphische Datenverarbeitung
*/
package org.universAAL.tools.logmonitor.all_log.gui;
import java.awt.BorderLayout;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JSplitPane;
import javax.swing.JTable;
import javax.swing.ScrollPaneConstants;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import javax.swing.table.DefaultTableModel;
import org.universAAL.tools.logmonitor.Utils;
import org.universAAL.tools.logmonitor.all_log.LogEntry;
import org.universAAL.tools.logmonitor.all_log.LogMonitor;
/**
* The main frame containing the list of all messages/log entry and the panel
* for graphical drawing of the graph.
*
* @author cstockloew
*
*/
public class AllLogPanel extends JPanel implements ListSelectionListener {
private static final long serialVersionUID = 1L;
/**
* The graphics panel where the node graph is drawn.
*/
private MessagePanel messages = new MessagePanel();
/**
* The table containing a list of all messages.
*/
private JTable table;
private LogMonitor logMonitor;
/**
* Create the main frame.
*/
public AllLogPanel(LogMonitor logMonitor) {
this.logMonitor = logMonitor;
this.setLayout(new BorderLayout());
// Message View
JScrollPane scrollpane = new JScrollPane(messages);
// getContentPane().add(scrollpane, BorderLayout.CENTER);
scrollpane
.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
scrollpane
.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
// Message overview
DefaultTableModel model = new DefaultTableModel();
model.addColumn("Date");
model.addColumn("level");
model.addColumn("module");
model.addColumn("Package");
model.addColumn("Class");
model.addColumn("Method");
model.addColumn("Message");
table = new JTable(model);
// getContentPane().add(table, BorderLayout.WEST);
JScrollPane scrollpaneTable = new JScrollPane(table);
table.getColumnModel().getColumn(0).setPreferredWidth(150);
// table.getColumnModel().getColumn(1).setPreferredWidth(80);
// table.getColumnModel().getColumn(2).setPreferredWidth(100);
table.getColumnModel().getColumn(0).setMaxWidth(150);
table.getColumnModel().getColumn(1).setMaxWidth(65);
table.getSelectionModel().addListSelectionListener(this);
// Split pane
JSplitPane split = new JSplitPane(JSplitPane.VERTICAL_SPLIT,
scrollpaneTable, scrollpane);
add(split, BorderLayout.CENTER);
split.setDividerLocation(0.4);
}
/**
* Add a new log entry.
*
* @param le
* The log entry.
*/
public void addMessage(LogEntry le) {
DefaultTableModel model = (DefaultTableModel) table.getModel();
model.addRow(new Object[] { Utils.getDateString(le.date),
Utils.getLevel(le.logLevel), le.module, le.pkg, le.cls,
le.method, Utils.buildMessage(le.msgPart) });
}
/**
* Called whenever the value of the selection in the table showing the list
* of all messages changes.
*
* @param e
* The event that characterizes the change.
*/
public void valueChanged(ListSelectionEvent e) {
if (!e.getValueIsAdjusting()) {
int viewRow = table.getSelectedRow();
if (viewRow >= 0) {
LogEntry le = logMonitor.getLogEntry(viewRow);
if (le != null)
messages.show(le);
}
}
}
}
/*
Copyright 2007-2014 Fraunhofer IGD, http://www.igd.fraunhofer.de
Fraunhofer-Gesellschaft - Institut fr Graphische Datenverarbeitung
*/
package org.universAAL.tools.logmonitor.all_log.gui;
import javax.swing.JTextPane;
import javax.swing.text.DefaultCaret;
import org.universAAL.tools.logmonitor.Utils;
import org.universAAL.tools.logmonitor.all_log.LogEntry;
public class MessagePanel extends JTextPane {
private static final long serialVersionUID = 1L;
MessagePanel() {
setEditable(false);
setContentType("text/plain");
setCaret(new DefaultCaret());
((DefaultCaret) getCaret()).setUpdatePolicy(DefaultCaret.NEVER_UPDATE);
}
public void show(LogEntry le) {
setText(Utils.buildMessage(le.msgPart));
}
}
...@@ -3,18 +3,19 @@ ...@@ -3,18 +3,19 @@
Fraunhofer-Gesellschaft - Institut fr Graphische Datenverarbeitung Fraunhofer-Gesellschaft - Institut fr Graphische Datenverarbeitung
*/ */
package org.universAAL.tools.logmonitor; package org.universAAL.tools.logmonitor.rdfvis;
import java.awt.BasicStroke; import java.awt.BasicStroke;
import java.awt.Graphics2D; import java.awt.Graphics2D;
import java.awt.Point; import java.awt.Point;
import org.universAAL.middleware.rdf.Resource; import org.universAAL.middleware.rdf.Resource;
import org.universAAL.tools.logmonitor.rdfvis.gui.GraphPanel;
/** /**
* An edge in the graphical view connecting two nodes. Every * An edge in the graphical view connecting two nodes. Every
* {@link org.universAAL.middleware.rdf.Resource} corresponds to a * {@link org.universAAL.middleware.rdf.Resource} corresponds to a
* {@link org.universAAL.tools.logmonitor.Node} in the visualization and every * {@link org.universAAL.tools.logmonitor.rdfvis.Node} in the visualization and every
* property to an Edge. * property to an Edge.
* *
* @author cstockloew * @author cstockloew
...@@ -35,7 +36,7 @@ public class Edge implements Comparable<Object> { ...@@ -35,7 +36,7 @@ public class Edge implements Comparable<Object> {
/** /**
* True, if the child node has been visited before. * True, if the child node has been visited before.
*/ */
boolean visited = false; public boolean visited = false;
/** /**
* The width of the text for this edge in the Graphics context. * The width of the text for this edge in the Graphics context.
...@@ -95,7 +96,7 @@ public class Edge implements Comparable<Object> { ...@@ -95,7 +96,7 @@ public class Edge implements Comparable<Object> {
* *
* @return The child. * @return The child.
*/ */
Node getChild() { public Node getChild() {
return child; return child;
} }
...@@ -125,7 +126,7 @@ public class Edge implements Comparable<Object> { ...@@ -125,7 +126,7 @@ public class Edge implements Comparable<Object> {
* prevent drawing over an existing node. * prevent drawing over an existing node.
* @return The bottom-right corner. * @return The bottom-right corner.
*/ */
Point drawEdge(Graphics2D g, Node parent, int x, int y, int currentWidth) { public Point drawEdge(Graphics2D g, Node parent, int x, int y, int currentWidth) {
y += GraphPanel.nodeBorder; y += GraphPanel.nodeBorder;
// draw text // draw text
......
/*
Copyright 2007-2014 Fraunhofer IGD, http://www.igd.fraunhofer.de
Fraunhofer-Gesellschaft - Institut fr Graphische Datenverarbeitung
*/
package org.universAAL.tools.logmonitor.rdfvis;
import java.util.LinkedList;
import javax.swing.JPanel;
import org.universAAL.middleware.rdf.Resource;
import org.universAAL.tools.logmonitor.LogListenerEx;
import org.universAAL.tools.logmonitor.rdfvis.gui.RDFVis;
/**
* Implementation of the {@link org.universAAL.middleware.util.LogListener}
* interface to be called from
* {@link org.universAAL.middleware.container.utils.LogUtils}.
*
* @author cstockloew
*
*/
public class LogMonitor implements LogListenerEx {
/**
* The main frame.
*/
private RDFVis vis = new RDFVis();
/**
* @see org.universAAL.middleware.container.LogListener
*/
public void log(int logLevel, String module, String pkg, String cls,
String method, Object[] msgPart, Throwable t) {
String msg = "";
LinkedList<Resource> lst = new LinkedList<Resource>();
for (int i = 0; i < msgPart.length; i++) {
if (i > 0)
msg += " ";
Object o = msgPart[i];
msg += o;
if (o instanceof Resource)
lst.add((Resource) o);
}
for (Resource r : lst)
vis.addMessage(cls, method, msg, r, ResourceInterpreter
.getShortDescription(r));
}
public JPanel getPanel() {
return vis;
}
public String getTitle() {
return "RDF graph";
}
}
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
Fraunhofer-Gesellschaft - Institut fr Graphische Datenverarbeitung Fraunhofer-Gesellschaft - Institut fr Graphische Datenverarbeitung
*/ */
package org.universAAL.tools.logmonitor; package org.universAAL.tools.logmonitor.rdfvis;
import java.awt.BasicStroke; import java.awt.BasicStroke;
import java.awt.Color; import java.awt.Color;
...@@ -19,12 +19,13 @@ import java.util.List; ...@@ -19,12 +19,13 @@ import java.util.List;
import org.universAAL.middleware.rdf.Resource; import org.universAAL.middleware.rdf.Resource;
import org.universAAL.middleware.rdf.TypeMapper; import org.universAAL.middleware.rdf.TypeMapper;
import org.universAAL.middleware.rdf.UnmodifiableResource; import org.universAAL.middleware.rdf.UnmodifiableResource;
import org.universAAL.tools.logmonitor.rdfvis.gui.GraphPanel;
/** /**
* A node in the graphical view. Every * A node in the graphical view. Every
* {@link org.universAAL.middleware.rdf.Resource} corresponds to a Node in the * {@link org.universAAL.middleware.rdf.Resource} corresponds to a Node in the
* visualization and every property to an * visualization and every property to an
* {@link org.universAAL.tools.logmonitor.Edge}. * {@link org.universAAL.tools.logmonitor.rdfvis.Edge}.
* *
* @author cstockloew * @author cstockloew
* *
...@@ -34,7 +35,7 @@ public class Node { ...@@ -34,7 +35,7 @@ public class Node {
/** /**
* The resource is an instance of this class. * The resource is an instance of this class.
*/ */
Class<?> theClass = null; public Class<?> theClass = null;
/** /**
* For literals: denotes the type of this literal. * For literals: denotes the type of this literal.
...@@ -49,28 +50,28 @@ public class Node { ...@@ -49,28 +50,28 @@ public class Node {
/** /**
* The list of all children. * The list of all children.
*/ */
LinkedList<Edge> children = new LinkedList<Edge>(); public LinkedList<Edge> children = new LinkedList<Edge>();
/** /**
* The x-coordinate of the top left corner of this node, or -1 if the * The x-coordinate of the top left corner of this node, or -1 if the
* coordinates are not yet calculated. * coordinates are not yet calculated.
*/ */
int x = -1; public int x = -1;
/** /**
* The y-coordinate of the top left corner of this node. * The y-coordinate of the top left corner of this node.
*/ */
int y; public int y;
/** /**
* The width of this node. * The width of this node.
*/ */
int width; public int width;
/** /**
* The height of this node. * The height of this node.
*/ */
int height; public int height;
/** /**
* Denotes whether this node represents an RDF Literal. * Denotes whether this node represents an RDF Literal.
...@@ -268,7 +269,7 @@ public class Node { ...@@ -268,7 +269,7 @@ public class Node {
* The offset in y-direction. * The offset in y-direction.
* @return The bottom-right corner * @return The bottom-right corner
*/ */
Point drawNode(Graphics2D g, int xoff, int yoff) { public Point drawNode(Graphics2D g, int xoff, int yoff) {
if (x == -1) { if (x == -1) {
// calculate coordinates, only done once // calculate coordinates, only done once
x = xoff; x = xoff;
......
package org.universAAL.tools.logmonitor; package org.universAAL.tools.logmonitor.rdfvis;
import java.util.List; import java.util.List;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
Fraunhofer-Gesellschaft - Institut fr Graphische Datenverarbeitung Fraunhofer-Gesellschaft - Institut fr Graphische Datenverarbeitung
*/ */
package org.universAAL.tools.logmonitor; package org.universAAL.tools.logmonitor.rdfvis.gui;
import java.awt.Color; import java.awt.Color;
import java.awt.Dimension; import java.awt.Dimension;
...@@ -20,6 +20,9 @@ import javax.swing.AbstractAction; ...@@ -20,6 +20,9 @@ import javax.swing.AbstractAction;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JPopupMenu; import javax.swing.JPopupMenu;
import org.universAAL.tools.logmonitor.rdfvis.Edge;
import org.universAAL.tools.logmonitor.rdfvis.Node;
/** /**
* The graphical panel showing the node graph. * The graphical panel showing the node graph.
* *
...@@ -33,27 +36,27 @@ public class GraphPanel extends JPanel { ...@@ -33,27 +36,27 @@ public class GraphPanel extends JPanel {
/** /**
* The distance between elements. * The distance between elements.
*/ */
static int nodeBorder = 6; public static int nodeBorder = 6;
/** /**
* The font for normal text. * The font for normal text.
*/ */
static Font fontNormal = new Font("Verdana", 0, 12); public static Font fontNormal = new Font("Verdana", 0, 12);
/** /**
* The font for bold text (e.g. java class names shown in nodes). * The font for bold text (e.g. java class names shown in nodes).
*/ */
static Font fontBold = new Font("Verdana", Font.BOLD, 12); public static Font fontBold = new Font("Verdana", Font.BOLD, 12);
/** /**
* Font metrics for normal text. Stored for performance reasons. * Font metrics for normal text. Stored for performance reasons.
*/ */
static FontMetrics fmNormal; public static FontMetrics fmNormal;
/** /**
* Font metrics for bold text. Stored for performance reasons. * Font metrics for bold text. Stored for performance reasons.
*/ */
static FontMetrics fmBold; public static FontMetrics fmBold;
/** /**
* The root node of the graph. * The root node of the graph.
...@@ -64,7 +67,7 @@ public class GraphPanel extends JPanel { ...@@ -64,7 +67,7 @@ public class GraphPanel extends JPanel {
* The currently selected node, or null, if no node is selected. The * The currently selected node, or null, if no node is selected. The
* selected node and all of its edges are shown in bold. * selected node and all of its edges are shown in bold.
*/ */
static Node selectedNode; public static Node selectedNode;
/** /**
* The coordinates of the bottom-right corner. Stored to set the slider * The coordinates of the bottom-right corner. Stored to set the slider
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
Fraunhofer-Gesellschaft - Institut fr Graphische Datenverarbeitung Fraunhofer-Gesellschaft - Institut fr Graphische Datenverarbeitung
*/ */
package org.universAAL.tools.logmonitor; package org.universAAL.tools.logmonitor.rdfvis.gui;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color; import java.awt.Color;
...@@ -19,7 +19,7 @@ import java.util.GregorianCalendar; ...@@ -19,7 +19,7 @@ import java.util.GregorianCalendar;
import java.util.LinkedList; import java.util.LinkedList;
import javax.imageio.ImageIO; import javax.imageio.ImageIO;
import javax.swing.JFrame; import javax.swing.JPanel;
import javax.swing.JScrollPane; import javax.swing.JScrollPane;
import javax.swing.JSplitPane; import javax.swing.JSplitPane;
import javax.swing.JTable; import javax.swing.JTable;
...@@ -29,6 +29,7 @@ import javax.swing.event.ListSelectionListener; ...@@ -29,6 +29,7 @@ import javax.swing.event.ListSelectionListener;
import javax.swing.table.DefaultTableModel; import javax.swing.table.DefaultTableModel;
import org.universAAL.middleware.rdf.Resource; import org.universAAL.middleware.rdf.Resource;
import org.universAAL.tools.logmonitor.rdfvis.Node;
/** /**
* The main frame containing the list of all messages/log entry and the panel * The main frame containing the list of all messages/log entry and the panel
...@@ -37,7 +38,7 @@ import org.universAAL.middleware.rdf.Resource; ...@@ -37,7 +38,7 @@ import org.universAAL.middleware.rdf.Resource;
* @author cstockloew * @author cstockloew
* *
*/ */
public class RDFVis extends JFrame implements ListSelectionListener { public class RDFVis extends JPanel implements ListSelectionListener {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -121,7 +122,7 @@ public class RDFVis extends JFrame implements ListSelectionListener { ...@@ -121,7 +122,7 @@ public class RDFVis extends JFrame implements ListSelectionListener {
* Create the main frame. * Create the main frame.
*/ */
public RDFVis() { public RDFVis() {
super("RDF Visualizer"); this.setLayout(new BorderLayout());
// RDF View // RDF View
JScrollPane scrollpane = new JScrollPane(panel); JScrollPane scrollpane = new JScrollPane(panel);
...@@ -149,12 +150,7 @@ public class RDFVis extends JFrame implements ListSelectionListener { ...@@ -149,12 +150,7 @@ public class RDFVis extends JFrame implements ListSelectionListener {
// Split pane // Split pane
JSplitPane split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, JSplitPane split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
scrollpaneTable, scrollpane); scrollpaneTable, scrollpane);
getContentPane().add(split, BorderLayout.CENTER); add(split, BorderLayout.CENTER);
// split.setDividerLocation(300);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(1000, 700);
setVisible(true);
instance = this; instance = this;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment