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 184009 Details for
Bug 331125
[Usability] Auto-size action for nodes with list compartments
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Initial patch
331125.patch (text/plain), 3.05 KB, created by
Tatiana Fesenko
on 2010-11-29 03:30:06 EST
(
hide
)
Description:
Initial patch
Filename:
MIME Type:
Creator:
Tatiana Fesenko
Created:
2010-11-29 03:30:06 EST
Size:
3.05 KB
patch
obsolete
>Index: src/org/eclipse/papyrus/diagram/common/figure/node/SubCompartmentLayoutManager.java >=================================================================== >--- src/org/eclipse/papyrus/diagram/common/figure/node/SubCompartmentLayoutManager.java (revision 3374) >+++ src/org/eclipse/papyrus/diagram/common/figure/node/SubCompartmentLayoutManager.java (working copy) >@@ -30,7 +30,19 @@ > protected int preferedHeight = MINIMUMCOMPARTMENTSIZE; > > @Override >- protected Dimension calculatePreferredSize(IFigure container, int wHint, int hHint) { >+ protected Dimension calculatePreferredSize(IFigure figure, int wHint, int hHint) { >+ Dimension dim = new Dimension(); >+ if(figure.getChildren().size() > 0) { >+ if(figure.getChildren().get(0) instanceof ResizableCompartmentFigure) { >+ dim.height = 10; >+ dim.width = ((ResizableCompartmentFigure)figure.getChildren().get(0)).getPreferredSize().width; >+ } >+ } >+ return dim; >+ } >+ >+ @Override >+ public Dimension getMinimumSize(IFigure container, int wHint, int hHint) { > return new Dimension(10, preferedHeight); > } > >@@ -68,7 +80,7 @@ > if(dim.height == 0) { > dim.height = 20; > } >- >+ dim.width = ((ResizableCompartmentFigure)figure.getChildren().get(0)).getPreferredSize().width; > } > } > return dim; >Index: src/org/eclipse/papyrus/diagram/common/figure/node/AutomaticCompartmentLayoutManager.java >=================================================================== >--- src/org/eclipse/papyrus/diagram/common/figure/node/AutomaticCompartmentLayoutManager.java (revision 3374) >+++ src/org/eclipse/papyrus/diagram/common/figure/node/AutomaticCompartmentLayoutManager.java (working copy) >@@ -63,7 +63,9 @@ > } > if(compartmentList.size() != 0) { > for(int i = 0; i < container.getChildren().size(); i++) { >- minimumHeight += ((IFigure)container.getChildren().get(i)).getPreferredSize().height; >+ IFigure child = (IFigure)container.getChildren().get(i); >+ minimumHeight += child.getPreferredSize().height; >+ minimumWith = Math.max(minimumWith, child.getPreferredSize().width); > } > } else { > for(int i = 0; i < notCompartmentList.size(); i++) { >@@ -74,6 +76,11 @@ > minimumHeight += 7; > return new Dimension(minimumWith, minimumHeight); > } >+ >+ @Override >+ public Dimension getMinimumSize(IFigure container, int wHint, int hHint) { >+ return new Dimension(20,20); >+ } > > /** > * layout by putting label in the center of figure >@@ -243,8 +250,9 @@ > public Dimension getPreferedSize(IFigure figure) { > Dimension dim = figure.getPreferredSize(); > if(figure.getChildren().size() > 0) { >- if(figure.getChildren().get(0) instanceof ResizableCompartmentFigure) { >- dim.height = ((ResizableCompartmentFigure)figure.getChildren().get(0)).getPreferredSize().height + 10; >+ Object compartment = figure.getChildren().get(0); >+ if(compartment instanceof ResizableCompartmentFigure) { >+ dim.height = ((ResizableCompartmentFigure)compartment).getPreferredSize().height + 10; > if(dim.height == 0) { > dim.height = MINIMUM_COMPARTMENT_HEIGHT; > }
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:
rschnekenburger
:
iplog+
Actions:
View
|
Diff
Attachments on
bug 331125
: 184009