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 211894 Details for
Bug 372002
API version errors with pie chart color patch
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]
Proposed solution with new interface ColoredSlice
colored_slice.patch (text/plain), 3.03 KB, created by
Krum Tsvetkov
on 2012-03-01 11:08:57 EST
(
hide
)
Description:
Proposed solution with new interface ColoredSlice
Filename:
MIME Type:
Creator:
Krum Tsvetkov
Created:
2012-03-01 11:08:57 EST
Size:
3.03 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.mat.chart >Index: src/org/eclipse/mat/impl/chart/ChartBuilder.java >=================================================================== >--- src/org/eclipse/mat/impl/chart/ChartBuilder.java (revision 1277) >+++ src/org/eclipse/mat/impl/chart/ChartBuilder.java (working copy) >@@ -41,6 +41,7 @@ > import org.eclipse.core.runtime.Platform; > import org.eclipse.emf.common.util.EList; > import org.eclipse.mat.query.IResultPie; >+import org.eclipse.mat.query.IResultPie.ColoredSlice; > import org.eclipse.mat.query.IResultPie.Slice; > import org.eclipse.mat.util.MessageUtil; > import org.eclipse.mat.util.Units; >@@ -141,7 +142,12 @@ > { > int[] color = COLORS[index % COLORS.length]; > ColorDefinition defn; >- Color explicitColor = slices.get(index).getColor(); >+ Color explicitColor = null; >+ Slice slice = slices.get(index); >+ if (slice instanceof ColoredSlice) >+ { >+ explicitColor = ((ColoredSlice) slice).getColor(); >+ } > if (explicitColor == null) > { > defn = ColorDefinitionImpl.create(color[0], color[1], color[2]); >#P org.eclipse.mat.api >Index: src/org/eclipse/mat/snapshot/query/PieFactory.java >=================================================================== >--- src/org/eclipse/mat/snapshot/query/PieFactory.java (revision 1277) >+++ src/org/eclipse/mat/snapshot/query/PieFactory.java (working copy) >@@ -129,6 +129,7 @@ > * @param color > * Explicit color of the slice > * @return a new slice >+ * @since 1.2 > */ > public Slice addSlice(int objectId, Color color) throws SnapshotException > { >@@ -159,6 +160,7 @@ > * @param color > * Explicit color of the slice > * @return a new slice >+ * @since 1.2 > */ > public Slice addSlice(IObject object, Color color) > { >@@ -198,6 +200,7 @@ > * @param color > * the color to use for the slice > * @return a new slice >+ * @since 1.2 > */ > public Slice addSlice(int objectId, String label, long usedHeapSize, long retainedHeapSize, Color color) > { >@@ -252,7 +255,7 @@ > } > } > >- private final static class SliceImpl implements IResultPie.Slice, Serializable >+ private final static class SliceImpl implements IResultPie.ColoredSlice, Serializable > { > private static final long serialVersionUID = 1L; > >#P org.eclipse.mat.report >Index: src/org/eclipse/mat/query/IResultPie.java >=================================================================== >--- src/org/eclipse/mat/query/IResultPie.java (revision 1277) >+++ src/org/eclipse/mat/query/IResultPie.java (working copy) >@@ -36,6 +36,15 @@ > > IContextObject getContext(); > >+ } >+ >+ /** >+ * A slice of the pie with color information >+ * >+ * @since 1.2 >+ */ >+ public interface ColoredSlice extends Slice >+ { > Color getColor(); > } >
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
Actions:
View
|
Diff
Attachments on
bug 372002
: 211894