Commit 00a63886 authored by Clemens Krug's avatar Clemens Krug
Browse files

Add aggregated visualisation for multiple nodes (Geofence)

+ Add possibility to draw rectangular areas in the visualisation. Data of all nodes inside this geofence will be combined visualized
+ Add another factor when calculating the hesitation time for the DRASMobileComponents to factor in the time the node already waited.
parent e732a5e9
......@@ -52,11 +52,6 @@ public class ShowMapQuestMapViz extends JComponent
private boolean initialized = false;
private int subImageX;
private int subImageY;
private int subImageWidth;
private int subImageHeight;
private boolean drawSubImage = false;
public ShowMapQuestMapViz() {
setBounds(0, 0, VisualizationInjector.getWorldX(),
......
......@@ -475,35 +475,50 @@ public class VisualizationTopologyView extends JFrame implements TopologyView,
public void eventDispatched(AWTEvent e) {
if (e instanceof MouseEvent) {
MouseEvent me = (MouseEvent) e;
if (me.getID() == MouseEvent.MOUSE_CLICKED) {
// Another dirty hack until we have another graphic
// drawing system
if (((JFrame) worldPanel.getTopLevelAncestor())
.isActive()) {
int x = me.getXOnScreen();
int y = me.getYOnScreen();
if (x > (int) worldPanel.getLocationOnScreen()
.getX()
&& y > (int) worldPanel
.getLocationOnScreen().getY()
&& x < (int) worldPanel
.getLocationOnScreen().getX()
+ worldPanel.getWidth()
&& y < (int) worldPanel
.getLocationOnScreen().getX()
+ worldPanel.getHeight()) {
x -= (int) worldPanel.getLocationOnScreen()
.getX();
y -= (int) worldPanel.getLocationOnScreen()
.getY();
// Another dirty hack until we have another graphic
// drawing system
if (((JFrame) worldPanel.getTopLevelAncestor())
.isActive()) {
int x = me.getXOnScreen();
int y = me.getYOnScreen();
if (x > (int) worldPanel.getLocationOnScreen()
.getX()
&& y > (int) worldPanel
.getLocationOnScreen().getY()
&& x < (int) worldPanel
.getLocationOnScreen().getX()
+ worldPanel.getWidth()
&& y < (int) worldPanel
.getLocationOnScreen().getX()
+ worldPanel.getHeight()) {
x -= (int) worldPanel.getLocationOnScreen()
.getX();
y -= (int) worldPanel.getLocationOnScreen()
.getY();
if (me.getID() == MouseEvent.MOUSE_CLICKED) {
for (MouseClickListener l : mouseListeners) {
l.mouseClicked(x, y);
}
}
if (me.getID() == MouseEvent.MOUSE_RELEASED) {
for (MouseClickListener l : mouseListeners) {
l.mouseReleased(x, y);
}
}
if (me.getID() == MouseEvent.MOUSE_DRAGGED) {
for (MouseClickListener l : mouseListeners) {
l.mouseDragged(x, y);
}
}
if (me.getID() == MouseEvent.MOUSE_PRESSED) {
for (MouseClickListener l : mouseListeners) {
l.mousePressed(x, y);
}
}
}
}
}
......@@ -512,7 +527,10 @@ public class VisualizationTopologyView extends JFrame implements TopologyView,
}
public static interface MouseClickListener {
public void mouseClicked(int x, int y);
default public void mouseClicked(int x, int y) {}
default void mousePressed(int x, int y) {}
default void mouseReleased(int x, int y) {}
default void mouseDragged(int x, int y) {}
}
public static JComponent getWorldPanel() {
......@@ -695,8 +713,12 @@ public class VisualizationTopologyView extends JFrame implements TopologyView,
*/
public TopologyComponentVis getCompVisOfHost(INodeID id)
{
return compVisPerHost.get(id);
}
public HashMap<INodeID, TopologyComponentVis> getCompVisPerHost()
{
return compVisPerHost;
}
}
......@@ -177,8 +177,13 @@ public class TopologyComponentVis extends JComponent {
clicked = !clicked;
}
protected PositionVector getPosition() {
public PositionVector getPosition() {
return posVec;
}
public long getHostid()
{
return hostid;
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment