Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xdsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerCPU.java5
-rwxr-xr-xdsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerCore.java5
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerLoadMeter.java5
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerStatusBar.java5
-rwxr-xr-xdsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerThread.java5
-rw-r--r--visualizer/org.eclipse.cdt.visualizer.examples/src/org/eclipse/cdt/visualizer/examples/problemvisualizer/BarGraphicObject.java5
-rwxr-xr-xvisualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/util/GUIUtils.java36
7 files changed, 50 insertions, 16 deletions
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerCPU.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerCPU.java
index 9c05cab0f12..aeadfa3363a 100755
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerCPU.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerCPU.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Tilera Corporation and others.
+ * Copyright (c) 2012, 2014 Tilera Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,6 +9,7 @@
* William R. Swanson (Tilera Corporation) - initial API and implementation
* Marc Dumais (Ericsson) - Add CPU/core load information to the multicore visualizer (Bug 396268)
* Marc Dumais (Ericsson) - Bug 404894
+ * Xavier Raynaud (Kalray) - Bug 431690
*******************************************************************************/
package org.eclipse.cdt.dsf.gdb.multicorevisualizer.internal.ui.view;
@@ -154,7 +155,7 @@ public class MulticoreVisualizerCPU extends MulticoreVisualizerGraphicObject
int text_indent_y = 0;
int tx = m_bounds.x + m_bounds.width - text_indent_x;
int ty = m_bounds.y + m_bounds.height - text_indent_y;
- GUIUtils.drawTextAligned(gc, Integer.toString(m_id), tx, ty, false, false);
+ GUIUtils.drawTextAligned(gc, Integer.toString(m_id), m_bounds, tx, ty, false, false);
}
}
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerCore.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerCore.java
index 83541e9bac3..8f6f371cca4 100755
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerCore.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerCore.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Tilera Corporation and others.
+ * Copyright (c) 2012, 2014 Tilera Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,6 +9,7 @@
* William R. Swanson (Tilera Corporation) - initial API and implementation
* Marc Dumais (Ericsson) - Add CPU/core load information to the multicore visualizer (Bug 396268)
* Marc Dumais (Ericsson) - Bug 404894
+ * Xavier Raynaud (Kalray) - Bug 431690
*******************************************************************************/
package org.eclipse.cdt.dsf.gdb.multicorevisualizer.internal.ui.view;
@@ -201,7 +202,7 @@ public class MulticoreVisualizerCore extends MulticoreVisualizerGraphicObject
int ty = m_bounds.y + text_indent;
// make sure we use the right color for core number, even if selected.
gc.setForeground(getCoreStateColor(true));
- GUIUtils.drawTextAligned(gc, Integer.toString(m_id), tx, ty, false, true);
+ GUIUtils.drawTextAligned(gc, Integer.toString(m_id), m_bounds, tx, ty, false, true);
}
}
}
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerLoadMeter.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerLoadMeter.java
index 9a55a98d196..737b39970c9 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerLoadMeter.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerLoadMeter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2013 Ericsson
+ * Copyright (c) 2013, 2014 Ericsson and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
*
* Contributors:
* Marc Dumais (Ericsson) - Initial API and implementation (Bug 396268)
+ * Xavier Raynaud (Kalray) - Bug 431690
*******************************************************************************/
package org.eclipse.cdt.dsf.gdb.multicorevisualizer.internal.ui.view;
@@ -216,7 +217,7 @@ public class MulticoreVisualizerLoadMeter extends MulticoreVisualizerGraphicObje
gc.setForeground(IMulticoreVisualizerConstants.COLOR_LOAD_TEXT);
int tx = m_bounds.x;
int ty = m_bounds.y;
- GUIUtils.drawTextAligned(gc, load, tx, ty, true, false);
+ GUIUtils.drawTextAligned(gc, load, m_bounds, tx, ty, true, false);
}
}
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerStatusBar.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerStatusBar.java
index 9038a1d43a4..329b191f84e 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerStatusBar.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerStatusBar.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2013 Ericsson
+ * Copyright (c) 2013, 2014 Ericsson and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
*
* Contributors:
* Marc Dumais (Ericsson) - Initial API and implementation (Bug 405390)
+ * Xavier Raynaud (Kalray) - Bug 431690
*******************************************************************************/
package org.eclipse.cdt.dsf.gdb.multicorevisualizer.internal.ui.view;
@@ -54,7 +55,7 @@ public class MulticoreVisualizerStatusBar extends MulticoreVisualizerGraphicObje
gc.setForeground(IMulticoreVisualizerConstants.COLOR_STATUS_BAR_TEXT);
int tx = m_bounds.x;
int ty = m_bounds.y + 15;
- GUIUtils.drawTextAligned(gc, m_statusMessage, tx, ty, true, false);
+ GUIUtils.drawTextAligned(gc, m_statusMessage, m_bounds, tx, ty, true, false);
}
}
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerThread.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerThread.java
index c46708020b2..1b85af56507 100755
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerThread.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerThread.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Tilera Corporation and others.
+ * Copyright (c) 2012, 2014 Tilera Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
*
* Contributors:
* William R. Swanson (Tilera Corporation) - initial API and implementation
+ * Xavier Raynaud (Kalray) - Bug 431690
*******************************************************************************/
package org.eclipse.cdt.dsf.gdb.multicorevisualizer.internal.ui.view;
@@ -176,7 +177,7 @@ public class MulticoreVisualizerThread extends MulticoreVisualizerGraphicObject
// draw TID
String displayTID = Integer.toString(m_thread.getTID());
- GUIUtils.drawText(gc, displayTID, x + w + 4, y + 2);
+ GUIUtils.drawText(gc, displayTID, m_bounds, x + w + 4, y + 2);
// draw selection marker, if any
if (m_selected)
diff --git a/visualizer/org.eclipse.cdt.visualizer.examples/src/org/eclipse/cdt/visualizer/examples/problemvisualizer/BarGraphicObject.java b/visualizer/org.eclipse.cdt.visualizer.examples/src/org/eclipse/cdt/visualizer/examples/problemvisualizer/BarGraphicObject.java
index 5013b849aec..a8d98c06a63 100644
--- a/visualizer/org.eclipse.cdt.visualizer.examples/src/org/eclipse/cdt/visualizer/examples/problemvisualizer/BarGraphicObject.java
+++ b/visualizer/org.eclipse.cdt.visualizer.examples/src/org/eclipse/cdt/visualizer/examples/problemvisualizer/BarGraphicObject.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Ericsson and others.
+ * Copyright (c) 2012, 2014 Ericsson and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
*
* Contributors:
* Marc Khouzam (Ericsson) - initial API and implementation
+ * Xavier Raynaud (Kalray) - Bug 431690
*******************************************************************************/
package org.eclipse.cdt.visualizer.examples.problemvisualizer;
@@ -75,7 +76,7 @@ public class BarGraphicObject extends GraphicObject {
int text_indent = 6;
int tx = m_bounds.x + m_bounds.width - text_indent;
int ty = m_bounds.y + m_bounds.height - text_indent;
- GUIUtils.drawTextAligned(gc, m_label, tx, ty, false, false);
+ GUIUtils.drawTextAligned(gc, m_label, m_bounds, tx, ty, false, false);
}
}
diff --git a/visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/util/GUIUtils.java b/visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/util/GUIUtils.java
index c778ccd83c6..138ad4fd1fd 100755
--- a/visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/util/GUIUtils.java
+++ b/visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/util/GUIUtils.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Tilera Corporation and others.
+ * Copyright (c) 2012, 2014 Tilera Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
*
* Contributors:
* William R. Swanson (Tilera Corporation)
+ * Xavier Raynaud (Kalray) - Bug 431690
*******************************************************************************/
package org.eclipse.cdt.visualizer.ui.util;
@@ -88,6 +89,15 @@ public class GUIUtils {
gc.drawText(text, x, y, SWT.DRAW_TRANSPARENT);
}
+ /** Draws transparent text, with the default alignment (top/left). */
+ static public void drawText(GC gc, String text, Rectangle clip, int x, int y)
+ {
+ Rectangle oldClip = gc.getClipping();
+ gc.setClipping(clip);
+ drawText(gc, text, x, y);
+ gc.setClipping(oldClip);
+ }
+
/** Draws transparent text, with the specified alignments. */
static public void drawTextAligned(GC gc, String text, int x, int y, boolean left, boolean top)
{
@@ -101,7 +111,16 @@ public class GUIUtils {
gc.drawText(text, x - dx, y - dy, SWT.DRAW_TRANSPARENT);
}
}
-
+
+ /** Draws transparent text, with the specified alignments. */
+ static public void drawTextAligned(GC gc, String text, Rectangle clip, int x, int y, boolean left, boolean top)
+ {
+ Rectangle oldClip = gc.getClipping();
+ gc.setClipping(clip);
+ drawTextAligned(gc, text, x, y, left, top);
+ gc.setClipping(oldClip);
+ }
+
/** Draws transparent text, centered on the specified point. */
static public void drawTextCentered(GC gc, String text, int x, int y)
{
@@ -110,8 +129,17 @@ public class GUIUtils {
gc.drawText(text, x - (int) Math.round(te.x / 2.0),
y - (int) Math.round(te.y / 2.0), SWT.DRAW_TRANSPARENT);
}
-
-
+
+ /** Draws transparent text, centered on the specified point. */
+ static public void drawTextCentered(GC gc, String text, Rectangle clip, int x, int y)
+ {
+ Rectangle oldClip = gc.getClipping();
+ gc.setClipping(clip);
+ drawTextCentered(gc, text, x, y);
+ gc.setClipping(oldClip);
+ }
+
+
// --- graphic methods ---
/** Shrinks rectangle by specified margin on all edges. */

Back to the top