Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.zest.core/src/org')
-rw-r--r--bundles/org.eclipse.zest.core/src/org/eclipse/zest/core/viewers/internal/GraphItemStyler.java2
-rw-r--r--bundles/org.eclipse.zest.core/src/org/eclipse/zest/core/widgets/Graph.java4
-rw-r--r--bundles/org.eclipse.zest.core/src/org/eclipse/zest/core/widgets/internal/XYScaledGraphics.java22
3 files changed, 16 insertions, 12 deletions
diff --git a/bundles/org.eclipse.zest.core/src/org/eclipse/zest/core/viewers/internal/GraphItemStyler.java b/bundles/org.eclipse.zest.core/src/org/eclipse/zest/core/viewers/internal/GraphItemStyler.java
index 3161481..cb2cb3d 100644
--- a/bundles/org.eclipse.zest.core/src/org/eclipse/zest/core/viewers/internal/GraphItemStyler.java
+++ b/bundles/org.eclipse.zest.core/src/org/eclipse/zest/core/viewers/internal/GraphItemStyler.java
@@ -10,11 +10,11 @@
package org.eclipse.zest.core.viewers.internal;
import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.rap.swt.SWT;
import org.eclipse.jface.viewers.IBaseLabelProvider;
import org.eclipse.jface.viewers.IColorProvider;
import org.eclipse.jface.viewers.IFontProvider;
import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.swt.SWT;
import org.eclipse.swt.SWTError;
import org.eclipse.swt.graphics.Color;
import org.eclipse.zest.core.viewers.IConnectionStyleProvider;
diff --git a/bundles/org.eclipse.zest.core/src/org/eclipse/zest/core/widgets/Graph.java b/bundles/org.eclipse.zest.core/src/org/eclipse/zest/core/widgets/Graph.java
index 42651d7..66a686b 100644
--- a/bundles/org.eclipse.zest.core/src/org/eclipse/zest/core/widgets/Graph.java
+++ b/bundles/org.eclipse.zest.core/src/org/eclipse/zest/core/widgets/Graph.java
@@ -42,6 +42,7 @@ import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.ControlPaintHandler;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Item;
@@ -181,7 +182,8 @@ public class Graph extends FigureCanvas implements IContainer {
this.figure2ItemMap = new HashMap();
revealListeners = new ArrayList(1);
- this.addPaintListener(new PaintListener() {
+ ControlPaintHandler helper = new ControlPaintHandler(this);
+ helper.addPaintListener(new PaintListener() {
public void paintControl(PaintEvent e) {
if (!revealListeners.isEmpty()) {
// Go through the reveal list and let everyone know that the
diff --git a/bundles/org.eclipse.zest.core/src/org/eclipse/zest/core/widgets/internal/XYScaledGraphics.java b/bundles/org.eclipse.zest.core/src/org/eclipse/zest/core/widgets/internal/XYScaledGraphics.java
index 1871eef..f1229aa 100644
--- a/bundles/org.eclipse.zest.core/src/org/eclipse/zest/core/widgets/internal/XYScaledGraphics.java
+++ b/bundles/org.eclipse.zest.core/src/org/eclipse/zest/core/widgets/internal/XYScaledGraphics.java
@@ -1,12 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * University of Victoria - Adapted for XY Scaled Graphics
+ * Copyright (c) 2000, 2007 IBM 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 http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: University of Victoria - Adapted for XY Scaled Graphics
*******************************************************************************/
package org.eclipse.zest.core.widgets.internal;
@@ -819,13 +817,17 @@ public class XYScaledGraphics extends ScaledGraphics {
if (localCache.font != localFont) {
//Font is different, re-calculate its height
FontMetrics metric = FigureUtilities.getFontMetrics(localFont);
- localCache.height = metric.getHeight() - metric.getDescent();
+ // UNSUPPORTED - getDescent() not implemented in RAP
+// localCache.height = metric.getHeight() - metric.getDescent();
+ localCache.height = metric.getHeight();
localCache.font = localFont;
}
if (targetCache.font != graphics.getFont()) {
FontMetrics metric = graphics.getFontMetrics();
targetCache.font = graphics.getFont();
- targetCache.height = metric.getHeight() - metric.getDescent();
+ // UNSUPPORTED - getDescent() not implemented in RAP
+// targetCache.height = metric.getHeight() - metric.getDescent();
+ targetCache.height = metric.getHeight();
}
return new Point(((int) (Math.floor((x * xZoom) + fractionalX))), (int) (Math.floor((y + localCache.height - 1) * yZoom - targetCache.height + 1 + fractionalY)));
}

Back to the top