changeset 1070:c551a80f08b2

Emergency ush: Fix broken build review-thread: http://icedtea.classpath.org/pipermail/thermostat/2013-April/006411.html reviewed-by: neugens
author Mario Torre <neugens.limasoftware@gmail.com>
date Tue, 23 Apr 2013 14:02:46 +0200
parents 3b90181d422b
children 12894dbd3517
files client/swing/src/main/java/com/redhat/thermostat/client/swing/components/timeline/TimelineRulerHeader.java thread/client-swing/src/main/java/com/redhat/thermostat/thread/client/swing/impl/SwingThreadTimelineView.java thread/client-swing/src/main/java/com/redhat/thermostat/thread/client/swing/impl/timeline/ThreadTimelineHeader.java thread/client-swing/src/main/java/com/redhat/thermostat/thread/client/swing/impl/timeline/TimelineComponent.java
diffstat 4 files changed, 68 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/client/swing/src/main/java/com/redhat/thermostat/client/swing/components/timeline/TimelineRulerHeader.java	Tue Apr 23 12:45:43 2013 +0200
+++ b/client/swing/src/main/java/com/redhat/thermostat/client/swing/components/timeline/TimelineRulerHeader.java	Tue Apr 23 14:02:46 2013 +0200
@@ -48,8 +48,6 @@
 import java.text.SimpleDateFormat;
 import java.util.Date;
 
-import javax.swing.JScrollPane;
-
 import com.redhat.thermostat.client.swing.GraphicsUtils;
 import com.redhat.thermostat.client.swing.components.GradientPanel;
 import com.redhat.thermostat.client.ui.Palette;
--- a/thread/client-swing/src/main/java/com/redhat/thermostat/thread/client/swing/impl/SwingThreadTimelineView.java	Tue Apr 23 12:45:43 2013 +0200
+++ b/thread/client-swing/src/main/java/com/redhat/thermostat/thread/client/swing/impl/SwingThreadTimelineView.java	Tue Apr 23 14:02:46 2013 +0200
@@ -52,14 +52,15 @@
 
 import com.redhat.thermostat.client.swing.ComponentVisibleListener;
 import com.redhat.thermostat.client.swing.SwingComponent;
+import com.redhat.thermostat.client.swing.components.timeline.TimelineRulerHeader;
 import com.redhat.thermostat.client.swing.components.timeline.TimelineUtils;
 import com.redhat.thermostat.common.model.LongRange;
 import com.redhat.thermostat.thread.client.common.Timeline;
 import com.redhat.thermostat.thread.client.common.view.ThreadTimelineView;
 
+import com.redhat.thermostat.thread.client.swing.impl.timeline.ThreadTimelineHeader;
 import com.redhat.thermostat.thread.client.swing.impl.timeline.TimelineCellRenderer;
 import com.redhat.thermostat.thread.client.swing.impl.timeline.TimelineComponent;
-import com.redhat.thermostat.thread.client.swing.impl.timeline.TimelineRulerHeader;
 
 public class SwingThreadTimelineView extends ThreadTimelineView implements SwingComponent  {
         
@@ -112,7 +113,7 @@
         scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
 
         long now = System.currentTimeMillis();
-        header = new TimelineRulerHeader(new LongRange(now, now + TimelineUtils.STEP), scrollPane);
+        header = new ThreadTimelineHeader(new LongRange(now, now + TimelineUtils.STEP), scrollPane);
         scrollPane.setColumnHeaderView(header);
 
         ScrollChangeListener listener = new ScrollChangeListener();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/thread/client-swing/src/main/java/com/redhat/thermostat/thread/client/swing/impl/timeline/ThreadTimelineHeader.java	Tue Apr 23 14:02:46 2013 +0200
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2012, 2013 Red Hat, Inc.
+ * 
+ * This file is part of Thermostat.
+ * 
+ * Thermostat is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2, or (at your
+ * option) any later version.
+ * 
+ * Thermostat 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
+ * General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ * 
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ * 
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.thread.client.swing.impl.timeline;
+
+import javax.swing.JScrollPane;
+
+import com.redhat.thermostat.client.swing.components.timeline.TimelineRulerHeader;
+import com.redhat.thermostat.common.model.LongRange;
+
+/**
+ *
+ */
+@SuppressWarnings("serial")
+public class ThreadTimelineHeader extends TimelineRulerHeader {
+
+    private JScrollPane scrollpane;
+    
+    public ThreadTimelineHeader(LongRange range, JScrollPane scrollpane) {
+        super(range);
+        this.scrollpane = scrollpane;
+    }
+    
+    @Override
+    protected int getCurrentDisplayValue() {
+        return scrollpane.getHorizontalScrollBar().getValue();
+    }
+}
--- a/thread/client-swing/src/main/java/com/redhat/thermostat/thread/client/swing/impl/timeline/TimelineComponent.java	Tue Apr 23 12:45:43 2013 +0200
+++ b/thread/client-swing/src/main/java/com/redhat/thermostat/thread/client/swing/impl/timeline/TimelineComponent.java	Tue Apr 23 14:02:46 2013 +0200
@@ -57,9 +57,12 @@
 import com.redhat.thermostat.client.swing.GraphicsUtils;
 import com.redhat.thermostat.client.swing.components.GradientPanel;
 import com.redhat.thermostat.client.swing.components.timeline.TimelineUtils;
+
 import com.redhat.thermostat.client.ui.Palette;
+
 import com.redhat.thermostat.common.model.LongRange;
 import com.redhat.thermostat.common.model.LongRangeNormalizer;
+
 import com.redhat.thermostat.thread.client.common.Timeline;
 import com.redhat.thermostat.thread.client.common.TimelineInfo;
 
@@ -246,7 +249,7 @@
                 scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
                 scrollPane.getHorizontalScrollBar().setUnitIncrement(TimelineUtils.INC);
                 
-                final TimelineRulerHeader header = new TimelineRulerHeader(range, scrollPane);
+                final ThreadTimelineHeader header = new ThreadTimelineHeader(range, scrollPane);
                 
                 scrollPane.setColumnHeaderView(header);
                 scrollPane.setViewportView(stuff);