diff --git a/src/de/tud/kom/p2psim/impl/topology/views/VisualizationTopologyView.java b/src/de/tud/kom/p2psim/impl/topology/views/VisualizationTopologyView.java index 4368e2d2e121f12d322106fcbf512465a4183ceb..6ee3a1177b0c58af1a06946665e4dcddd76ab579 100644 --- a/src/de/tud/kom/p2psim/impl/topology/views/VisualizationTopologyView.java +++ b/src/de/tud/kom/p2psim/impl/topology/views/VisualizationTopologyView.java @@ -398,44 +398,6 @@ public class VisualizationTopologyView extends JFrame public WorldPanel() { this.setLayout(null); this.setDoubleBuffered(true); -// this.addMouseListener(new MouseAdapter() { -// -// /** -// * Stores the mouse position, if the mouse button is pressed -// */ -// @Override -// public void mousePressed(MouseEvent e) { -// boolean turnedSomeoneOff = false; -// for (VisNodeInformation node : nodeInformation.values()) { -// // Make it easier to turn things off. -// if (node.clicked && node.position -// .distance(e.getPoint()) < PADDING + 2) { -// node.clicked = !node.clicked; -// VisualizationInjector -// .notifyInteractionListenersOnClick( -// node.hostId, node.clicked); -// turnedSomeoneOff = true; -// } -// } -// if (!turnedSomeoneOff) { -// // Turn sth on (limit to one node) -// for (VisNodeInformation node : nodeInformation.values()) { -// if (node.disableClickListener) { -// continue; -// } -// if (!node.clicked && node.position -// .distance(e.getPoint()) < PADDING) { -// node.clicked = !node.clicked; -// VisualizationInjector -// .notifyInteractionListenersOnClick( -// node.hostId, node.clicked); -// break; -// } -// } -// } -// } -// -// }); } public void addTopologyComponent(TopologyComponent comp) { @@ -454,31 +416,8 @@ public class VisualizationTopologyView extends JFrame @Override protected void paintComponent(Graphics g) { -// Graphics2D g2 = (Graphics2D) g; -// g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, -// RenderingHints.VALUE_ANTIALIAS_ON); -// paintNodes(g2); super.paintComponent(g); } - -// private void paintNodes(Graphics2D g2) { -// for (VisNodeInformation node : nodeInformation.values()) { -// if (node.clicked) { -// g2.setColor(Color.MAGENTA); -// g2.fillOval((int) node.position.getX() - PADDING, -// (int) node.position.getY() - PADDING, -// PADDING * 2 + 1, PADDING * 2 + 1); -// } else { -// if (showNodes) { -// // Draw nodes -// g2.setColor(Color.DARK_GRAY); -// g2.fillOval((int) node.position.getX() - NODE_PAD, -// (int) node.position.getY() - NODE_PAD, -// NODE_PAD * 2 + 1, NODE_PAD * 2 + 1); -// } -// } -// } -// } } public void notifyInteractionListenersOnClick(long hostid, diff --git a/src/de/tud/kom/p2psim/impl/topology/views/visualization/ui/MetricChartAdapter.java b/src/de/tud/kom/p2psim/impl/topology/views/visualization/ui/MetricChartAdapter.java index ee92938029255bd5c8de14aaf655cf6cdf7baca7..cdcb00132e07824cf15d50388729c24e7a0cc91b 100644 --- a/src/de/tud/kom/p2psim/impl/topology/views/visualization/ui/MetricChartAdapter.java +++ b/src/de/tud/kom/p2psim/impl/topology/views/visualization/ui/MetricChartAdapter.java @@ -86,10 +86,10 @@ public class MetricChartAdapter implements MetricPlotAdapter { } if (lowerPercentile > 0 && upperPercentile > 0) { - Metric percUpperM = MetricAnalyzer.getMetric( - "P" + upperPercentile + "_" + metric.getName()); - Metric percLowerM = MetricAnalyzer.getMetric( - "P" + lowerPercentile + "_" + metric.getName()); + Metric percUpperM = MetricAnalyzer.getMetric("P" + + upperPercentile + "_" + metric.getName()); + Metric percLowerM = MetricAnalyzer.getMetric("P" + + lowerPercentile + "_" + metric.getName()); if (percLowerM != null && percLowerM.isOverallMetric() && percUpperM != null && percUpperM.isOverallMetric()) { perc_lower = percLowerM.getOverallMetric(); @@ -108,8 +108,8 @@ public class MetricChartAdapter implements MetricPlotAdapter { } if (avg != null) { - XYChart chart = view.createPlot( - metric.getName() + " -- " + metric.getDescription()); + XYChart chart = view.createPlot(metric.getName() + " -- " + + metric.getDescription()); series = chart.getDataset().getSeries(0); // add, otherwise re-range is not working @@ -120,16 +120,16 @@ public class MetricChartAdapter implements MetricPlotAdapter { } if (min != null) { chart.getDataset().addSeries(new YIntervalSeries("Min")); - minSeries = chart.getDataset() - .getSeries(chart.getDataset().getSeriesCount() - 1); + minSeries = chart.getDataset().getSeries( + chart.getDataset().getSeriesCount() - 1); if (maxItems > 0) { minSeries.setMaximumItemCount(maxItems); } } if (max != null) { chart.getDataset().addSeries(new YIntervalSeries("Max")); - maxSeries = chart.getDataset() - .getSeries(chart.getDataset().getSeriesCount() - 1); + maxSeries = chart.getDataset().getSeries( + chart.getDataset().getSeriesCount() - 1); if (maxItems > 0) { maxSeries.setMaximumItemCount(maxItems); } @@ -163,8 +163,8 @@ public class MetricChartAdapter implements MetricPlotAdapter { } } if (avg.isValid()) - series.add(seconds, avgVal, Math.max(0, avgVal - varDown), - avgVal + varUp); + series.add(seconds, avgVal, Math.max(0, avgVal - varDown), avgVal + + varUp); } if (minSeries != null) { double minV = scaledValue(min);