Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Zest: Patch for method fishEye and wrong container size
Zest: Patch for method fishEye and wrong container size [message #485904] Tue, 15 September 2009 14:03
Eclipse UserFriend
Originally posted by: eclipse.cs-dev.de

I think the method fishEye(..) in class GraphNode computes a wrong
container size. The calculation is based on a the font size. But few lines
late the font size was changed. After that, the text is to big for the
container.

Here is my patch:

### Eclipse Workspace Patch 1.0
#P org.eclipse.zest.core
Index: src/org/eclipse/zest/core/widgets/GraphNode.java
============================================================ =======
RCS file:
/cvsroot/tools/org.eclipse.gef/plugins/org.eclipse.zest.core /src/org/eclipse/zest/core/widgets/GraphNode.java,v
retrieving revision 1.40
diff -u -r1.40 GraphNode.java
--- src/org/eclipse/zest/core/widgets/GraphNode.java 23 Apr 2009 02:41:22
-0000 1.40
+++ src/org/eclipse/zest/core/widgets/GraphNode.java 15 Sep 2009 14:02:38
-0000
@@ -678,6 +678,12 @@
private Font fishEyeFont = null;
private boolean isFisheyeEnabled;

+ /**
+ * @param enable
+ * @param animate
+ * @return
+ * FIXED 09.09.2009 - Reihenfolge des FontData Blocks im Quelltext
getauscht.
+ */
protected IFigure fishEye(boolean enable, boolean animate) {
if (isDisposed) {
// If a fisheyed figure is still left on the canvas, we could get
@@ -695,6 +701,12 @@
// Get the current Bounds
Rectangle rectangle = nodeFigure.getBounds().getCopy();

+ // Hier eingefügt
+ FontData fontData =
Display.getCurrent().getSystemFont().getFontData()[0];
+// fontData.height = 12;
+ fishEyeFont = new Font(Display.getCurrent(), fontData);
+ fishEyeFigure.setFont(fishEyeFont);
+
// Calculate how much we have to expand the current bounds to get to
the new bounds
Dimension newSize = fishEyeFigure.getPreferredSize();
Rectangle currentSize = rectangle.getCopy();
@@ -708,10 +720,7 @@
return null;
}

- FontData fontData =
Display.getCurrent().getSystemFont().getFontData()[0];
- fontData.height = 12;
- fishEyeFont = new Font(Display.getCurrent(), fontData);
- fishEyeFigure.setFont(fishEyeFont);
+ // Hier entfernt

//Add the fisheye
this.getGraphModel().fishEye(nodeFigure, fishEyeFigure, rectangle,
true);
Previous Topic:Zest: Use of setUseHashlookup(false)
Next Topic:Zest: Bug in Graph setSelection() ?
Goto Forum:
  


Current Time: Fri Mar 29 11:26:18 GMT 2024

Powered by FUDForum. Page generated in 0.04550 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top