Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 103791 Details for
Bug 118858
[NoteTextLabel] Notes in diagram link mode are incorrectly sized
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
default diagram link size is the minimum preferred size
DiagramLink.patch (text/plain), 4.03 KB, created by
James Bruck
on 2008-06-05 13:46:14 EDT
(
hide
)
Description:
default diagram link size is the minimum preferred size
Filename:
MIME Type:
Creator:
James Bruck
Created:
2008-06-05 13:46:14 EDT
Size:
4.03 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.gmf.runtime.draw2d.ui >Index: src/org/eclipse/gmf/runtime/draw2d/ui/figures/WrappingLabel.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.gmf/plugins/org.eclipse.gmf.runtime.draw2d.ui/src/org/eclipse/gmf/runtime/draw2d/ui/figures/WrappingLabel.java,v >retrieving revision 1.3 >diff -u -r1.3 WrappingLabel.java >--- src/org/eclipse/gmf/runtime/draw2d/ui/figures/WrappingLabel.java 29 May 2008 21:01:20 -0000 1.3 >+++ src/org/eclipse/gmf/runtime/draw2d/ui/figures/WrappingLabel.java 5 Jun 2008 17:45:15 -0000 >@@ -913,6 +913,9 @@ > Dimension ellipsisSize = getTruncationStringSize(); > Dimension textSize = new TextUtilitiesEx(getFigureMapMode()) > .getTextExtents(getText(), currentFont); >+ if (textSize.width == 0) { >+ textSize.height = 0; >+ } > textSize.intersect(ellipsisSize); > > Dimension labelSize = calculateLabelSize(textSize); >@@ -968,6 +971,9 @@ > } else { > preferredTextSize = getTextFigure().getPreferredSize(wHint, > hHint).getCopy(); >+ if(preferredTextSize.width == 0){ >+ preferredTextSize.height = 0; >+ } > prefSize = preferredTextSize.getCopy(); > } > >#P org.eclipse.gmf.runtime.diagram.ui >Index: src/org/eclipse/gmf/runtime/diagram/ui/figures/NoteFigure.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.gmf/plugins/org.eclipse.gmf.runtime.diagram.ui/src/org/eclipse/gmf/runtime/diagram/ui/figures/NoteFigure.java,v >retrieving revision 1.9 >diff -u -r1.9 NoteFigure.java >--- src/org/eclipse/gmf/runtime/diagram/ui/figures/NoteFigure.java 3 May 2008 20:56:21 -0000 1.9 >+++ src/org/eclipse/gmf/runtime/diagram/ui/figures/NoteFigure.java 5 Jun 2008 17:45:15 -0000 >@@ -132,14 +132,6 @@ > g.fillPolygon(p); > } > >- /** >- * @see org.eclipse.draw2d.IFigure#getPreferredSize(int, int) >- */ >- public Dimension getPreferredSize(int wHint, int hHint) { >- return super.getPreferredSize(wHint, hHint).getUnioned(new Dimension( >- MapModeUtil.getMapMode(this).DPtoLP(100), >- MapModeUtil.getMapMode(this).DPtoLP(50))); >- } > > /** > * sets or resets the diagram link mode, in diagram link mode the note >Index: src/org/eclipse/gmf/runtime/diagram/ui/editparts/NoteEditPart.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.gmf/plugins/org.eclipse.gmf.runtime.diagram.ui/src/org/eclipse/gmf/runtime/diagram/ui/editparts/NoteEditPart.java,v >retrieving revision 1.8 >diff -u -r1.8 NoteEditPart.java >--- src/org/eclipse/gmf/runtime/diagram/ui/editparts/NoteEditPart.java 3 May 2008 20:56:21 -0000 1.8 >+++ src/org/eclipse/gmf/runtime/diagram/ui/editparts/NoteEditPart.java 5 Jun 2008 17:45:15 -0000 >@@ -15,6 +15,7 @@ > import java.util.Collection; > import java.util.Iterator; > >+import org.eclipse.draw2d.geometry.Dimension; > import org.eclipse.draw2d.geometry.Insets; > import org.eclipse.emf.common.notify.Notification; > import org.eclipse.emf.ecore.EObject; >@@ -70,7 +71,7 @@ > */ > protected NodeFigure createNodeFigure() { > IMapMode mm = getMapMode(); >- Insets insets = new Insets(mm.DPtoLP(5), mm.DPtoLP(5), mm.DPtoLP(5), mm.DPtoLP(14)); >+ Insets insets = new Insets(mm.DPtoLP(5), mm.DPtoLP(5), mm.DPtoLP(5), mm.DPtoLP(5)); > NoteFigure noteFigure = new NoteFigure(mm.DPtoLP(100), mm.DPtoLP(56), insets); > Object model = getModel(); > if (model!=null && model instanceof View){ >@@ -79,8 +80,11 @@ > (notationView.getEAnnotation(Properties.DIAGRAMLINK_ANNOTATION)!=null || > notationView.getType() == null || > notationView.getType().length() == 0)){ >- diagramLinkMode = true; >+ diagramLinkMode = true; > noteFigure.setDiagramLinkMode(true); >+ >+ // The default size is the minimum. >+ noteFigure.setDefaultSize(-1, -1); > } > } > return noteFigure;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
ahunter.eclipse
:
iplog+
Actions:
View
|
Diff
Attachments on
bug 118858
: 103791