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 109780 Details for
Bug 235303
Sexy UI !
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
patch reviewed and using preferences
SexyUI_UsingPreferences.txt (text/plain), 68.75 KB, created by
Jacques LESCOT
on 2008-08-12 09:21:50 EDT
(
hide
)
Description:
patch reviewed and using preferences
Filename:
MIME Type:
Creator:
Jacques LESCOT
Created:
2008-08-12 09:21:50 EDT
Size:
68.75 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.emf.ecoretools.diagram >Index: src/org/eclipse/emf/ecoretools/diagram/edit/parts/EDataType2EditPart.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.ecoretools/plugins/org.eclipse.emf.ecoretools.diagram/src/org/eclipse/emf/ecoretools/diagram/edit/parts/EDataType2EditPart.java,v >retrieving revision 1.9 >diff -u -r1.9 EDataType2EditPart.java >--- src/org/eclipse/emf/ecoretools/diagram/edit/parts/EDataType2EditPart.java 28 Apr 2008 15:23:59 -0000 1.9 >+++ src/org/eclipse/emf/ecoretools/diagram/edit/parts/EDataType2EditPart.java 12 Aug 2008 13:15:45 -0000 >@@ -17,7 +17,6 @@ > import org.eclipse.draw2d.Graphics; > import org.eclipse.draw2d.IFigure; > import org.eclipse.draw2d.PositionConstants; >-import org.eclipse.draw2d.RectangleFigure; > import org.eclipse.draw2d.StackLayout; > import org.eclipse.draw2d.ToolbarLayout; > import org.eclipse.draw2d.geometry.Dimension; >@@ -26,10 +25,14 @@ > import org.eclipse.emf.common.notify.Notification; > import org.eclipse.emf.ecore.EObject; > import org.eclipse.emf.ecore.EcorePackage; >+import org.eclipse.emf.ecoretools.diagram.edit.figures.AlphaDropShadowBorder; > import org.eclipse.emf.ecoretools.diagram.edit.figures.FigureFromLabelUtils; >+import org.eclipse.emf.ecoretools.diagram.edit.figures.GradientRectangleFigure; >+import org.eclipse.emf.ecoretools.diagram.edit.policies.AlphaResizableShapeEditPolicy; > import org.eclipse.emf.ecoretools.diagram.edit.policies.EDataType2ItemSemanticEditPolicy; > import org.eclipse.emf.ecoretools.diagram.edit.policies.EcoreTextSelectionEditPolicy; > import org.eclipse.emf.ecoretools.diagram.part.EcoreVisualIDRegistry; >+import org.eclipse.emf.ecoretools.diagram.preferences.IEcoreToolsPreferenceConstants; > import org.eclipse.gef.EditPart; > import org.eclipse.gef.EditPolicy; > import org.eclipse.gef.editpolicies.LayoutEditPolicy; >@@ -106,10 +109,11 @@ > } > > /** >- * @generated >+ * @generated NOT > */ > protected IFigure createNodeShape() { > DataTypeFigure figure = new DataTypeFigure(); >+ figure.setShouldUseGradient((Boolean) getViewer().getProperty(IEcoreToolsPreferenceConstants.PREF_FILL_FIGURE_USING_GRADIENT)); > return primaryShape = figure; > } > >@@ -175,10 +179,13 @@ > } > > /** >- * @generated >+ * @generated NOT > */ > protected NodeFigure createNodePlate() { > DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(getMapMode().DPtoLP(40), getMapMode().DPtoLP(40)); >+ AlphaDropShadowBorder shadowBorder = new AlphaDropShadowBorder(); >+ shadowBorder.setShouldDrawDropShadow((Boolean) getViewer().getProperty(IEcoreToolsPreferenceConstants.PREF_USE_SHADOW_ON_BORDER)); >+ result.setBorder(shadowBorder); > return result; > } > >@@ -262,10 +269,15 @@ > } > } > >+ @Override >+ public EditPolicy getPrimaryDragEditPolicy() { >+ return new AlphaResizableShapeEditPolicy(); >+ } >+ > /** >- * @generated >+ * @generated NOT > */ >- public class DataTypeFigure extends RectangleFigure { >+ public class DataTypeFigure extends GradientRectangleFigure { > > /** > * @generated >Index: src/org/eclipse/emf/ecoretools/diagram/edit/parts/EClass2EditPart.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.ecoretools/plugins/org.eclipse.emf.ecoretools.diagram/src/org/eclipse/emf/ecoretools/diagram/edit/parts/EClass2EditPart.java,v >retrieving revision 1.6 >diff -u -r1.6 EClass2EditPart.java >--- src/org/eclipse/emf/ecoretools/diagram/edit/parts/EClass2EditPart.java 28 Apr 2008 15:23:59 -0000 1.6 >+++ src/org/eclipse/emf/ecoretools/diagram/edit/parts/EClass2EditPart.java 12 Aug 2008 13:15:45 -0000 >@@ -16,17 +16,20 @@ > > import org.eclipse.draw2d.IFigure; > import org.eclipse.draw2d.PositionConstants; >-import org.eclipse.draw2d.RectangleFigure; > import org.eclipse.draw2d.StackLayout; > import org.eclipse.draw2d.ToolbarLayout; > import org.eclipse.draw2d.geometry.Dimension; > import org.eclipse.emf.common.notify.Notification; > import org.eclipse.emf.ecore.EObject; > import org.eclipse.emf.ecore.EcorePackage; >+import org.eclipse.emf.ecoretools.diagram.edit.figures.AlphaDropShadowBorder; > import org.eclipse.emf.ecoretools.diagram.edit.figures.FigureFromLabelUtils; >+import org.eclipse.emf.ecoretools.diagram.edit.figures.GradientRectangleFigure; >+import org.eclipse.emf.ecoretools.diagram.edit.policies.AlphaResizableShapeEditPolicy; > import org.eclipse.emf.ecoretools.diagram.edit.policies.EClass2ItemSemanticEditPolicy; > import org.eclipse.emf.ecoretools.diagram.edit.policies.EcoreTextSelectionEditPolicy; > import org.eclipse.emf.ecoretools.diagram.part.EcoreVisualIDRegistry; >+import org.eclipse.emf.ecoretools.diagram.preferences.IEcoreToolsPreferenceConstants; > import org.eclipse.emf.ecoretools.diagram.providers.EcoreElementTypes; > import org.eclipse.gef.EditPart; > import org.eclipse.gef.EditPolicy; >@@ -132,10 +135,11 @@ > } > > /** >- * @generated >+ * @generated NOT > */ > protected IFigure createNodeShape() { > ClassFigure figure = new ClassFigure(); >+ figure.setShouldUseGradient((Boolean) getViewer().getProperty(IEcoreToolsPreferenceConstants.PREF_FILL_FIGURE_USING_GRADIENT)); > return primaryShape = figure; > } > >@@ -197,10 +201,13 @@ > } > > /** >- * @generated >+ * @generated NOT > */ > protected NodeFigure createNodePlate() { > DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(getMapMode().DPtoLP(40), getMapMode().DPtoLP(40)); >+ AlphaDropShadowBorder shadowBorder = new AlphaDropShadowBorder(); >+ shadowBorder.setShouldDrawDropShadow((Boolean) getViewer().getProperty(IEcoreToolsPreferenceConstants.PREF_USE_SHADOW_ON_BORDER)); >+ result.setBorder(shadowBorder); > return result; > } > >@@ -284,10 +291,15 @@ > } > } > >+ @Override >+ public EditPolicy getPrimaryDragEditPolicy() { >+ return new AlphaResizableShapeEditPolicy(); >+ } >+ > /** >- * @generated >+ * @generated NOT > */ >- public class ClassFigure extends RectangleFigure { >+ public class ClassFigure extends GradientRectangleFigure { > > /** > * @generated >Index: src/org/eclipse/emf/ecoretools/diagram/edit/parts/EAnnotationEditPart.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.ecoretools/plugins/org.eclipse.emf.ecoretools.diagram/src/org/eclipse/emf/ecoretools/diagram/edit/parts/EAnnotationEditPart.java,v >retrieving revision 1.7 >diff -u -r1.7 EAnnotationEditPart.java >--- src/org/eclipse/emf/ecoretools/diagram/edit/parts/EAnnotationEditPart.java 6 Jun 2008 12:04:28 -0000 1.7 >+++ src/org/eclipse/emf/ecoretools/diagram/edit/parts/EAnnotationEditPart.java 12 Aug 2008 13:15:45 -0000 >@@ -18,20 +18,24 @@ > import org.eclipse.draw2d.IFigure; > import org.eclipse.draw2d.MarginBorder; > import org.eclipse.draw2d.PositionConstants; >-import org.eclipse.draw2d.RectangleFigure; > import org.eclipse.draw2d.StackLayout; > import org.eclipse.draw2d.ToolbarLayout; > import org.eclipse.draw2d.geometry.Dimension; >+import org.eclipse.draw2d.geometry.Insets; > import org.eclipse.draw2d.geometry.Point; > import org.eclipse.draw2d.geometry.PointList; > import org.eclipse.draw2d.geometry.Rectangle; > import org.eclipse.emf.common.notify.Notification; > import org.eclipse.emf.ecore.EObject; > import org.eclipse.emf.ecore.EcorePackage; >+import org.eclipse.emf.ecoretools.diagram.edit.figures.AlphaDropShadowBorder; > import org.eclipse.emf.ecoretools.diagram.edit.figures.FigureFromLabelUtils; >+import org.eclipse.emf.ecoretools.diagram.edit.figures.GradientRectangleFigure; >+import org.eclipse.emf.ecoretools.diagram.edit.policies.AlphaResizableShapeEditPolicy; > import org.eclipse.emf.ecoretools.diagram.edit.policies.EAnnotationItemSemanticEditPolicy; > import org.eclipse.emf.ecoretools.diagram.edit.policies.EcoreTextSelectionEditPolicy; > import org.eclipse.emf.ecoretools.diagram.part.EcoreVisualIDRegistry; >+import org.eclipse.emf.ecoretools.diagram.preferences.IEcoreToolsPreferenceConstants; > import org.eclipse.emf.ecoretools.diagram.providers.EcoreElementTypes; > import org.eclipse.gef.EditPart; > import org.eclipse.gef.EditPolicy; >@@ -45,6 +49,7 @@ > import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ConstrainedToolbarLayoutEditPolicy; > import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy; > import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; >+import org.eclipse.gmf.runtime.diagram.ui.figures.DiagramColorConstants; > import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewAndElementRequest; > import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout; > import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel; >@@ -133,10 +138,11 @@ > } > > /** >- * @generated >+ * @generated NOT > */ > protected IFigure createNodeShape() { > AnnotationFigure figure = new AnnotationFigure(); >+ figure.setShouldUseGradient((Boolean) getViewer().getProperty(IEcoreToolsPreferenceConstants.PREF_FILL_FIGURE_USING_GRADIENT)); > return primaryShape = figure; > } > >@@ -208,6 +214,9 @@ > return getPrimaryShape().getPointsList(); > } > }; >+ AlphaDropShadowBorder shadowBorder = new AlphaDropShadowBorder(); >+ shadowBorder.setShouldDrawDropShadow((Boolean) getViewer().getProperty(IEcoreToolsPreferenceConstants.PREF_USE_SHADOW_ON_BORDER)); >+ result.setBorder(shadowBorder); > return result; > } > >@@ -289,10 +298,15 @@ > super.refreshVisuals(); > } > >+ @Override >+ public EditPolicy getPrimaryDragEditPolicy() { >+ return new AlphaResizableShapeEditPolicy(); >+ } >+ > /** >- * @generated >+ * @generated NOT > */ >- public class AnnotationFigure extends RectangleFigure { >+ public class AnnotationFigure extends GradientRectangleFigure { > > /** > * @generated >@@ -347,6 +361,19 @@ > desiredBounds.addPoint(point5); > > graphics.fillPolygon(desiredBounds); >+ >+ if (shouldUseGradient()) { >+ // fill gradient >+ // get gradient rectangle >+ Rectangle gradientRectangle = r.getCopy(); >+ gradientRectangle.crop(new Insets(BENT_CORNER_HEIGHT, 0, 0, 0)); >+ // draw gradient rectangle >+ graphics.pushState(); >+ graphics.setBackgroundColor(DiagramColorConstants.white); >+ graphics.setForegroundColor(getBackgroundColor()); >+ graphics.fillGradient(gradientRectangle, true); >+ graphics.popState(); >+ } > } > > @Override >Index: src/org/eclipse/emf/ecoretools/diagram/edit/parts/EPackage2EditPart.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.ecoretools/plugins/org.eclipse.emf.ecoretools.diagram/src/org/eclipse/emf/ecoretools/diagram/edit/parts/EPackage2EditPart.java,v >retrieving revision 1.8 >diff -u -r1.8 EPackage2EditPart.java >--- src/org/eclipse/emf/ecoretools/diagram/edit/parts/EPackage2EditPart.java 6 Jun 2008 12:04:28 -0000 1.8 >+++ src/org/eclipse/emf/ecoretools/diagram/edit/parts/EPackage2EditPart.java 12 Aug 2008 13:15:46 -0000 >@@ -28,11 +28,15 @@ > import org.eclipse.emf.common.notify.Notification; > import org.eclipse.emf.ecore.EObject; > import org.eclipse.emf.ecore.EcorePackage; >+import org.eclipse.emf.ecoretools.diagram.edit.figures.AlphaDropShadowBorder; > import org.eclipse.emf.ecoretools.diagram.edit.figures.FigureFromLabelUtils; >+import org.eclipse.emf.ecoretools.diagram.edit.figures.GradientRectangleFigure; > import org.eclipse.emf.ecoretools.diagram.edit.figures.PackageLabelRectangle; >+import org.eclipse.emf.ecoretools.diagram.edit.policies.AlphaResizableShapeEditPolicy; > import org.eclipse.emf.ecoretools.diagram.edit.policies.EPackage2ItemSemanticEditPolicy; > import org.eclipse.emf.ecoretools.diagram.edit.policies.OpenDiagramEditPolicy; > import org.eclipse.emf.ecoretools.diagram.part.EcoreVisualIDRegistry; >+import org.eclipse.emf.ecoretools.diagram.preferences.IEcoreToolsPreferenceConstants; > import org.eclipse.gef.EditPart; > import org.eclipse.gef.EditPolicy; > import org.eclipse.gef.Request; >@@ -124,10 +128,11 @@ > } > > /** >- * @generated >+ * @generated NOT > */ > protected IFigure createNodeShape() { > PackageFigure figure = new PackageFigure(); >+ figure.setShouldUseGradient((Boolean) getViewer().getProperty(IEcoreToolsPreferenceConstants.PREF_FILL_FIGURE_USING_GRADIENT)); > return primaryShape = figure; > } > >@@ -226,7 +231,10 @@ > return points; > } > }; >- return result; >+ AlphaDropShadowBorder shadowBorder = new AlphaDropShadowBorder(); >+ shadowBorder.setShouldDrawDropShadow((Boolean) getViewer().getProperty(IEcoreToolsPreferenceConstants.PREF_USE_SHADOW_ON_BORDER)); >+ result.setBorder(shadowBorder); >+ return result; > } > > /** >@@ -307,15 +315,20 @@ > super.refreshVisuals(); > } > >+ @Override >+ public EditPolicy getPrimaryDragEditPolicy() { >+ return new AlphaResizableShapeEditPolicy(); >+ } >+ > /** >- * @generated >+ * @generated NOT > */ >- public class PackageFigure extends RectangleFigure { >+ public class PackageFigure extends GradientRectangleFigure { > > /** >- * @generated >+ * @generated NOT > */ >- private RectangleFigure fFigurePackageBodyRectangle; >+ private GradientRectangleFigure fFigurePackageBodyRectangle; > > /** > * @generated >@@ -353,7 +366,7 @@ > private void createContents() { > > packageLabelRectangle0 = new PackageLabelRectangle(); >- packageLabelRectangle0.setLineWidth(2); >+ packageLabelRectangle0.setLineWidth(1); > > packageLabelRectangle0.setBorder(new MarginBorder(getMapMode().DPtoLP(5), getMapMode().DPtoLP(5), getMapMode().DPtoLP(5), getMapMode().DPtoLP(5))); > >@@ -397,8 +410,9 @@ > constraintFillerFigure0.grabExcessVerticalSpace = false; > this.add(fillerFigure0, constraintFillerFigure0); > >- fFigurePackageBodyRectangle = new RectangleFigure(); >- fFigurePackageBodyRectangle.setLineWidth(2); >+ fFigurePackageBodyRectangle = new GradientRectangleFigure(); >+ fFigurePackageBodyRectangle.setShouldUseGradient((Boolean) getViewer().getProperty(IEcoreToolsPreferenceConstants.PREF_FILL_FIGURE_USING_GRADIENT)); >+ fFigurePackageBodyRectangle.setLineWidth(1); > > GridData constraintFFigurePackageBodyRectangle = new GridData(); > constraintFFigurePackageBodyRectangle.verticalAlignment = GridData.FILL; >Index: src/org/eclipse/emf/ecoretools/diagram/edit/parts/EEnumEditPart.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.ecoretools/plugins/org.eclipse.emf.ecoretools.diagram/src/org/eclipse/emf/ecoretools/diagram/edit/parts/EEnumEditPart.java,v >retrieving revision 1.6 >diff -u -r1.6 EEnumEditPart.java >--- src/org/eclipse/emf/ecoretools/diagram/edit/parts/EEnumEditPart.java 28 Apr 2008 15:23:59 -0000 1.6 >+++ src/org/eclipse/emf/ecoretools/diagram/edit/parts/EEnumEditPart.java 12 Aug 2008 13:15:46 -0000 >@@ -16,17 +16,20 @@ > > import org.eclipse.draw2d.IFigure; > import org.eclipse.draw2d.PositionConstants; >-import org.eclipse.draw2d.RectangleFigure; > import org.eclipse.draw2d.StackLayout; > import org.eclipse.draw2d.ToolbarLayout; > import org.eclipse.draw2d.geometry.Dimension; > import org.eclipse.emf.common.notify.Notification; > import org.eclipse.emf.ecore.EObject; > import org.eclipse.emf.ecore.EcorePackage; >+import org.eclipse.emf.ecoretools.diagram.edit.figures.AlphaDropShadowBorder; > import org.eclipse.emf.ecoretools.diagram.edit.figures.FigureFromLabelUtils; >+import org.eclipse.emf.ecoretools.diagram.edit.figures.GradientRectangleFigure; >+import org.eclipse.emf.ecoretools.diagram.edit.policies.AlphaResizableShapeEditPolicy; > import org.eclipse.emf.ecoretools.diagram.edit.policies.EEnumItemSemanticEditPolicy; > import org.eclipse.emf.ecoretools.diagram.edit.policies.EcoreTextSelectionEditPolicy; > import org.eclipse.emf.ecoretools.diagram.part.EcoreVisualIDRegistry; >+import org.eclipse.emf.ecoretools.diagram.preferences.IEcoreToolsPreferenceConstants; > import org.eclipse.emf.ecoretools.diagram.providers.EcoreElementTypes; > import org.eclipse.gef.EditPart; > import org.eclipse.gef.EditPolicy; >@@ -128,10 +131,11 @@ > } > > /** >- * @generated >+ * @generated NOT > */ > protected IFigure createNodeShape() { > EnumerationFigure figure = new EnumerationFigure(); >+ figure.setShouldUseGradient((Boolean) getViewer().getProperty(IEcoreToolsPreferenceConstants.PREF_FILL_FIGURE_USING_GRADIENT)); > return primaryShape = figure; > } > >@@ -193,10 +197,13 @@ > } > > /** >- * @generated >+ * @generated NOT > */ > protected NodeFigure createNodePlate() { > DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(getMapMode().DPtoLP(40), getMapMode().DPtoLP(40)); >+ AlphaDropShadowBorder shadowBorder = new AlphaDropShadowBorder(); >+ shadowBorder.setShouldDrawDropShadow((Boolean) getViewer().getProperty(IEcoreToolsPreferenceConstants.PREF_USE_SHADOW_ON_BORDER)); >+ result.setBorder(shadowBorder); > return result; > } > >@@ -278,10 +285,15 @@ > super.refreshVisuals(); > } > >+ @Override >+ public EditPolicy getPrimaryDragEditPolicy() { >+ return new AlphaResizableShapeEditPolicy(); >+ } >+ > /** >- * @generated >+ * @generated NOT > */ >- public class EnumerationFigure extends RectangleFigure { >+ public class EnumerationFigure extends GradientRectangleFigure { > > /** > * @generated >Index: src/org/eclipse/emf/ecoretools/diagram/edit/parts/EClassEditPart.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.ecoretools/plugins/org.eclipse.emf.ecoretools.diagram/src/org/eclipse/emf/ecoretools/diagram/edit/parts/EClassEditPart.java,v >retrieving revision 1.7 >diff -u -r1.7 EClassEditPart.java >--- src/org/eclipse/emf/ecoretools/diagram/edit/parts/EClassEditPart.java 28 Apr 2008 15:23:59 -0000 1.7 >+++ src/org/eclipse/emf/ecoretools/diagram/edit/parts/EClassEditPart.java 12 Aug 2008 13:15:45 -0000 >@@ -16,17 +16,20 @@ > > import org.eclipse.draw2d.IFigure; > import org.eclipse.draw2d.PositionConstants; >-import org.eclipse.draw2d.RectangleFigure; > import org.eclipse.draw2d.StackLayout; > import org.eclipse.draw2d.ToolbarLayout; > import org.eclipse.draw2d.geometry.Dimension; > import org.eclipse.emf.common.notify.Notification; > import org.eclipse.emf.ecore.EObject; > import org.eclipse.emf.ecore.EcorePackage; >+import org.eclipse.emf.ecoretools.diagram.edit.figures.AlphaDropShadowBorder; > import org.eclipse.emf.ecoretools.diagram.edit.figures.FigureFromLabelUtils; >+import org.eclipse.emf.ecoretools.diagram.edit.figures.GradientRectangleFigure; >+import org.eclipse.emf.ecoretools.diagram.edit.policies.AlphaResizableShapeEditPolicy; > import org.eclipse.emf.ecoretools.diagram.edit.policies.EClassItemSemanticEditPolicy; > import org.eclipse.emf.ecoretools.diagram.edit.policies.EcoreTextSelectionEditPolicy; > import org.eclipse.emf.ecoretools.diagram.part.EcoreVisualIDRegistry; >+import org.eclipse.emf.ecoretools.diagram.preferences.IEcoreToolsPreferenceConstants; > import org.eclipse.emf.ecoretools.diagram.providers.EcoreElementTypes; > import org.eclipse.gef.EditPart; > import org.eclipse.gef.EditPolicy; >@@ -132,10 +135,11 @@ > } > > /** >- * @generated >+ * @generated NOT > */ > protected IFigure createNodeShape() { > ClassFigure figure = new ClassFigure(); >+ figure.setShouldUseGradient((Boolean) getViewer().getProperty(IEcoreToolsPreferenceConstants.PREF_FILL_FIGURE_USING_GRADIENT)); > return primaryShape = figure; > } > >@@ -197,10 +201,13 @@ > } > > /** >- * @generated >+ * @generated NOT > */ > protected NodeFigure createNodePlate() { > DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(getMapMode().DPtoLP(40), getMapMode().DPtoLP(40)); >+ AlphaDropShadowBorder shadowBorder = new AlphaDropShadowBorder(); >+ shadowBorder.setShouldDrawDropShadow((Boolean) getViewer().getProperty(IEcoreToolsPreferenceConstants.PREF_USE_SHADOW_ON_BORDER)); >+ result.setBorder(shadowBorder); > return result; > } > >@@ -282,10 +289,15 @@ > super.refreshVisuals(); > } > >+ @Override >+ public EditPolicy getPrimaryDragEditPolicy() { >+ return new AlphaResizableShapeEditPolicy(); >+ } >+ > /** >- * @generated >+ * @generated NOT > */ >- public class ClassFigure extends RectangleFigure { >+ public class ClassFigure extends GradientRectangleFigure { > > /** > * @generated >Index: src/org/eclipse/emf/ecoretools/diagram/edit/parts/EDataTypeEditPart.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.ecoretools/plugins/org.eclipse.emf.ecoretools.diagram/src/org/eclipse/emf/ecoretools/diagram/edit/parts/EDataTypeEditPart.java,v >retrieving revision 1.7 >diff -u -r1.7 EDataTypeEditPart.java >--- src/org/eclipse/emf/ecoretools/diagram/edit/parts/EDataTypeEditPart.java 28 Apr 2008 15:23:59 -0000 1.7 >+++ src/org/eclipse/emf/ecoretools/diagram/edit/parts/EDataTypeEditPart.java 12 Aug 2008 13:15:45 -0000 >@@ -17,7 +17,6 @@ > import org.eclipse.draw2d.Graphics; > import org.eclipse.draw2d.IFigure; > import org.eclipse.draw2d.PositionConstants; >-import org.eclipse.draw2d.RectangleFigure; > import org.eclipse.draw2d.StackLayout; > import org.eclipse.draw2d.ToolbarLayout; > import org.eclipse.draw2d.geometry.Dimension; >@@ -26,10 +25,14 @@ > import org.eclipse.emf.common.notify.Notification; > import org.eclipse.emf.ecore.EObject; > import org.eclipse.emf.ecore.EcorePackage; >+import org.eclipse.emf.ecoretools.diagram.edit.figures.AlphaDropShadowBorder; > import org.eclipse.emf.ecoretools.diagram.edit.figures.FigureFromLabelUtils; >+import org.eclipse.emf.ecoretools.diagram.edit.figures.GradientRectangleFigure; >+import org.eclipse.emf.ecoretools.diagram.edit.policies.AlphaResizableShapeEditPolicy; > import org.eclipse.emf.ecoretools.diagram.edit.policies.EDataTypeItemSemanticEditPolicy; > import org.eclipse.emf.ecoretools.diagram.edit.policies.EcoreTextSelectionEditPolicy; > import org.eclipse.emf.ecoretools.diagram.part.EcoreVisualIDRegistry; >+import org.eclipse.emf.ecoretools.diagram.preferences.IEcoreToolsPreferenceConstants; > import org.eclipse.gef.EditPart; > import org.eclipse.gef.EditPolicy; > import org.eclipse.gef.editpolicies.LayoutEditPolicy; >@@ -106,10 +109,11 @@ > } > > /** >- * @generated >+ * @generated NOT > */ > protected IFigure createNodeShape() { > DataTypeFigure figure = new DataTypeFigure(); >+ figure.setShouldUseGradient((Boolean) getViewer().getProperty(IEcoreToolsPreferenceConstants.PREF_FILL_FIGURE_USING_GRADIENT)); > return primaryShape = figure; > } > >@@ -175,10 +179,13 @@ > } > > /** >- * @generated >+ * @generated NOT > */ > protected NodeFigure createNodePlate() { > DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(getMapMode().DPtoLP(40), getMapMode().DPtoLP(40)); >+ AlphaDropShadowBorder shadowBorder = new AlphaDropShadowBorder(); >+ shadowBorder.setShouldDrawDropShadow((Boolean) getViewer().getProperty(IEcoreToolsPreferenceConstants.PREF_USE_SHADOW_ON_BORDER)); >+ result.setBorder(shadowBorder); > return result; > } > >@@ -260,10 +267,15 @@ > super.refreshVisuals(); > } > >+ @Override >+ public EditPolicy getPrimaryDragEditPolicy() { >+ return new AlphaResizableShapeEditPolicy(); >+ } >+ > /** >- * @generated >+ * @generated NOT > */ >- public class DataTypeFigure extends RectangleFigure { >+ public class DataTypeFigure extends GradientRectangleFigure { > > /** > * @generated >Index: src/org/eclipse/emf/ecoretools/diagram/edit/parts/EPackageContentsEditPart.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.ecoretools/plugins/org.eclipse.emf.ecoretools.diagram/src/org/eclipse/emf/ecoretools/diagram/edit/parts/EPackageContentsEditPart.java,v >retrieving revision 1.11 >diff -u -r1.11 EPackageContentsEditPart.java >--- src/org/eclipse/emf/ecoretools/diagram/edit/parts/EPackageContentsEditPart.java 28 Apr 2008 08:41:30 -0000 1.11 >+++ src/org/eclipse/emf/ecoretools/diagram/edit/parts/EPackageContentsEditPart.java 12 Aug 2008 13:15:46 -0000 >@@ -15,6 +15,7 @@ > package org.eclipse.emf.ecoretools.diagram.edit.parts; > > import org.eclipse.draw2d.IFigure; >+import org.eclipse.emf.ecoretools.diagram.edit.policies.AlphaXYLayoutEditPolicy; > import org.eclipse.emf.ecoretools.diagram.edit.policies.EPackageContentsCanonicalEditPolicy; > import org.eclipse.emf.ecoretools.diagram.edit.policies.EPackageContentsItemSemanticEditPolicy; > import org.eclipse.emf.ecoretools.diagram.edit.policies.EcoretoolsEditPolicyRoles; >@@ -75,6 +76,8 @@ > installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CreationEditPolicy()); > installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new PackageDiagramDragDropEditPolicy()); > installEditPolicy(EcoretoolsEditPolicyRoles.PSEUDO_CANONICAL_ROLE, new EPackageContentsCanonicalEditPolicy()); >+ installEditPolicy(EditPolicy.LAYOUT_ROLE, new AlphaXYLayoutEditPolicy()); >+ // EPackageCompartment can not be connected ! > } > > /** >Index: src/org/eclipse/emf/ecoretools/diagram/edit/parts/EPackageEditPart.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.ecoretools/plugins/org.eclipse.emf.ecoretools.diagram/src/org/eclipse/emf/ecoretools/diagram/edit/parts/EPackageEditPart.java,v >retrieving revision 1.6 >diff -u -r1.6 EPackageEditPart.java >--- src/org/eclipse/emf/ecoretools/diagram/edit/parts/EPackageEditPart.java 28 Apr 2008 08:41:31 -0000 1.6 >+++ src/org/eclipse/emf/ecoretools/diagram/edit/parts/EPackageEditPart.java 12 Aug 2008 13:15:46 -0000 >@@ -14,10 +14,12 @@ > > package org.eclipse.emf.ecoretools.diagram.edit.parts; > >+import org.eclipse.emf.ecoretools.diagram.edit.policies.AlphaXYLayoutEditPolicy; > import org.eclipse.emf.ecoretools.diagram.edit.policies.EPackageCanonicalEditPolicy; > import org.eclipse.emf.ecoretools.diagram.edit.policies.EPackageItemSemanticEditPolicy; > import org.eclipse.emf.ecoretools.diagram.edit.policies.EcoretoolsEditPolicyRoles; > import org.eclipse.emf.ecoretools.diagram.edit.policies.PackageDiagramDragDropEditPolicy; >+import org.eclipse.gef.EditPolicy; > import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart; > import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; > import org.eclipse.gmf.runtime.notation.View; >@@ -53,6 +55,7 @@ > installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new EPackageItemSemanticEditPolicy()); > installEditPolicy(EcoretoolsEditPolicyRoles.PSEUDO_CANONICAL_ROLE, new EPackageCanonicalEditPolicy()); > installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new PackageDiagramDragDropEditPolicy()); >+ installEditPolicy(EditPolicy.LAYOUT_ROLE, new AlphaXYLayoutEditPolicy()); > > // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.POPUPBAR_ROLE); > } >Index: src/org/eclipse/emf/ecoretools/diagram/edit/parts/EEnum2EditPart.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.ecoretools/plugins/org.eclipse.emf.ecoretools.diagram/src/org/eclipse/emf/ecoretools/diagram/edit/parts/EEnum2EditPart.java,v >retrieving revision 1.7 >diff -u -r1.7 EEnum2EditPart.java >--- src/org/eclipse/emf/ecoretools/diagram/edit/parts/EEnum2EditPart.java 28 Apr 2008 15:23:59 -0000 1.7 >+++ src/org/eclipse/emf/ecoretools/diagram/edit/parts/EEnum2EditPart.java 12 Aug 2008 13:15:46 -0000 >@@ -16,17 +16,20 @@ > > import org.eclipse.draw2d.IFigure; > import org.eclipse.draw2d.PositionConstants; >-import org.eclipse.draw2d.RectangleFigure; > import org.eclipse.draw2d.StackLayout; > import org.eclipse.draw2d.ToolbarLayout; > import org.eclipse.draw2d.geometry.Dimension; > import org.eclipse.emf.common.notify.Notification; > import org.eclipse.emf.ecore.EObject; > import org.eclipse.emf.ecore.EcorePackage; >+import org.eclipse.emf.ecoretools.diagram.edit.figures.AlphaDropShadowBorder; > import org.eclipse.emf.ecoretools.diagram.edit.figures.FigureFromLabelUtils; >+import org.eclipse.emf.ecoretools.diagram.edit.figures.GradientRectangleFigure; >+import org.eclipse.emf.ecoretools.diagram.edit.policies.AlphaResizableShapeEditPolicy; > import org.eclipse.emf.ecoretools.diagram.edit.policies.EEnum2ItemSemanticEditPolicy; > import org.eclipse.emf.ecoretools.diagram.edit.policies.EcoreTextSelectionEditPolicy; > import org.eclipse.emf.ecoretools.diagram.part.EcoreVisualIDRegistry; >+import org.eclipse.emf.ecoretools.diagram.preferences.IEcoreToolsPreferenceConstants; > import org.eclipse.emf.ecoretools.diagram.providers.EcoreElementTypes; > import org.eclipse.gef.EditPart; > import org.eclipse.gef.EditPolicy; >@@ -128,10 +131,11 @@ > } > > /** >- * @generated >+ * @generated NOT > */ > protected IFigure createNodeShape() { > EnumerationFigure figure = new EnumerationFigure(); >+ figure.setShouldUseGradient((Boolean) getViewer().getProperty(IEcoreToolsPreferenceConstants.PREF_FILL_FIGURE_USING_GRADIENT)); > return primaryShape = figure; > } > >@@ -193,10 +197,13 @@ > } > > /** >- * @generated >+ * @generated NOT > */ > protected NodeFigure createNodePlate() { > DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(getMapMode().DPtoLP(40), getMapMode().DPtoLP(40)); >+ AlphaDropShadowBorder shadowBorder = new AlphaDropShadowBorder(); >+ shadowBorder.setShouldDrawDropShadow((Boolean) getViewer().getProperty(IEcoreToolsPreferenceConstants.PREF_USE_SHADOW_ON_BORDER)); >+ result.setBorder(shadowBorder); > return result; > } > >@@ -280,10 +287,15 @@ > } > } > >+ @Override >+ public EditPolicy getPrimaryDragEditPolicy() { >+ return new AlphaResizableShapeEditPolicy(); >+ } >+ > /** >- * @generated >+ * @generated NOT > */ >- public class EnumerationFigure extends RectangleFigure { >+ public class EnumerationFigure extends GradientRectangleFigure { > > /** > * @generated >Index: src/org/eclipse/emf/ecoretools/diagram/view/factories/EEnumViewFactory.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.ecoretools/plugins/org.eclipse.emf.ecoretools.diagram/src/org/eclipse/emf/ecoretools/diagram/view/factories/EEnumViewFactory.java,v >retrieving revision 1.2 >diff -u -r1.2 EEnumViewFactory.java >--- src/org/eclipse/emf/ecoretools/diagram/view/factories/EEnumViewFactory.java 28 Apr 2008 08:41:31 -0000 1.2 >+++ src/org/eclipse/emf/ecoretools/diagram/view/factories/EEnumViewFactory.java 12 Aug 2008 13:15:46 -0000 >@@ -18,6 +18,7 @@ > import java.util.List; > > import org.eclipse.core.runtime.IAdaptable; >+import org.eclipse.draw2d.ColorConstants; > import org.eclipse.emf.ecore.EAnnotation; > import org.eclipse.emf.ecore.EObject; > import org.eclipse.emf.ecore.EcoreFactory; >@@ -41,7 +42,9 @@ > */ > public class EEnumViewFactory extends AbstractShapeViewFactory { > >- static final Color THIS_FORE = new Color(null, 0, 0, 0); >+ static final Color THIS_FONT = ColorConstants.darkGray; >+ >+ static final Color THIS_FORE = ColorConstants.gray; > > static final Color THIS_BACK = new Color(null, 248, 249, 209); > >@@ -53,7 +56,7 @@ > ShapeStyle style = (ShapeStyle) view.getStyle(NotationPackage.Literals.SHAPE_STYLE); > style.setFillColor(FigureUtilities.colorToInteger(THIS_BACK)); > style.setLineColor(FigureUtilities.colorToInteger(THIS_FORE)); >- style.setFontColor(FigureUtilities.colorToInteger(THIS_FORE)); >+ style.setFontColor(FigureUtilities.colorToInteger(THIS_FONT)); > style.setFontHeight(fontHeight); > } > >Index: src/org/eclipse/emf/ecoretools/diagram/view/factories/EClass2ViewFactory.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.ecoretools/plugins/org.eclipse.emf.ecoretools.diagram/src/org/eclipse/emf/ecoretools/diagram/view/factories/EClass2ViewFactory.java,v >retrieving revision 1.2 >diff -u -r1.2 EClass2ViewFactory.java >--- src/org/eclipse/emf/ecoretools/diagram/view/factories/EClass2ViewFactory.java 28 Apr 2008 08:41:31 -0000 1.2 >+++ src/org/eclipse/emf/ecoretools/diagram/view/factories/EClass2ViewFactory.java 12 Aug 2008 13:15:46 -0000 >@@ -18,6 +18,7 @@ > import java.util.List; > > import org.eclipse.core.runtime.IAdaptable; >+import org.eclipse.draw2d.ColorConstants; > import org.eclipse.emf.ecore.EObject; > import org.eclipse.emf.ecoretools.diagram.edit.parts.EClass2EditPart; > import org.eclipse.emf.ecoretools.diagram.edit.parts.EClassAttributes2EditPart; >@@ -39,7 +40,9 @@ > */ > public class EClass2ViewFactory extends AbstractShapeViewFactory { > >- static final Color THIS_FORE = new Color(null, 0, 0, 0); >+ static final Color THIS_FONT = ColorConstants.darkGray; >+ >+ static final Color THIS_FORE = ColorConstants.gray; > > static final Color THIS_BACK = new Color(null, 248, 249, 209); > >@@ -51,7 +54,7 @@ > ShapeStyle style = (ShapeStyle) view.getStyle(NotationPackage.Literals.SHAPE_STYLE); > style.setFillColor(FigureUtilities.colorToInteger(THIS_BACK)); > style.setLineColor(FigureUtilities.colorToInteger(THIS_FORE)); >- style.setFontColor(FigureUtilities.colorToInteger(THIS_FORE)); >+ style.setFontColor(FigureUtilities.colorToInteger(THIS_FONT)); > style.setFontHeight(fontHeight); > } > >Index: src/org/eclipse/emf/ecoretools/diagram/view/factories/EPackage2ViewFactory.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.ecoretools/plugins/org.eclipse.emf.ecoretools.diagram/src/org/eclipse/emf/ecoretools/diagram/view/factories/EPackage2ViewFactory.java,v >retrieving revision 1.2 >diff -u -r1.2 EPackage2ViewFactory.java >--- src/org/eclipse/emf/ecoretools/diagram/view/factories/EPackage2ViewFactory.java 28 Apr 2008 08:41:31 -0000 1.2 >+++ src/org/eclipse/emf/ecoretools/diagram/view/factories/EPackage2ViewFactory.java 12 Aug 2008 13:15:46 -0000 >@@ -18,6 +18,7 @@ > import java.util.List; > > import org.eclipse.core.runtime.IAdaptable; >+import org.eclipse.draw2d.ColorConstants; > import org.eclipse.emf.ecore.EAnnotation; > import org.eclipse.emf.ecore.EObject; > import org.eclipse.emf.ecore.EcoreFactory; >@@ -42,9 +43,9 @@ > */ > public class EPackage2ViewFactory extends AbstractShapeViewFactory { > >- static final Color THIS_FORE = new Color(null, 0, 0, 0); >+ static final Color THIS_FORE = ColorConstants.darkGray; > >- static final Color THIS_BACK = new Color(null, 190, 166, 206); >+ static final Color THIS_BACK = new Color(null, 183, 167, 200); > > static final int fontHeight = 10; > >Index: src/org/eclipse/emf/ecoretools/diagram/view/factories/EAnnotationReferencesViewFactory.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.ecoretools/plugins/org.eclipse.emf.ecoretools.diagram/src/org/eclipse/emf/ecoretools/diagram/view/factories/EAnnotationReferencesViewFactory.java,v >retrieving revision 1.3 >diff -u -r1.3 EAnnotationReferencesViewFactory.java >--- src/org/eclipse/emf/ecoretools/diagram/view/factories/EAnnotationReferencesViewFactory.java 28 Apr 2008 08:41:31 -0000 1.3 >+++ src/org/eclipse/emf/ecoretools/diagram/view/factories/EAnnotationReferencesViewFactory.java 12 Aug 2008 13:15:46 -0000 >@@ -18,6 +18,7 @@ > import java.util.List; > > import org.eclipse.core.runtime.IAdaptable; >+import org.eclipse.draw2d.ColorConstants; > import org.eclipse.emf.ecoretools.diagram.edit.parts.EAnnotationReferencesEditPart; > import org.eclipse.emf.ecoretools.diagram.part.EcoreVisualIDRegistry; > import org.eclipse.gmf.runtime.diagram.ui.view.factories.ConnectionViewFactory; >@@ -33,7 +34,7 @@ > */ > public class EAnnotationReferencesViewFactory extends ConnectionViewFactory { > >- static final Color THIS_FORE = new Color(null, 0, 0, 0); >+ static final Color THIS_FORE = ColorConstants.darkGray; > > @Override > protected void initializeFromPreferences(View view) { >Index: src/org/eclipse/emf/ecoretools/diagram/view/factories/EClassViewFactory.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.ecoretools/plugins/org.eclipse.emf.ecoretools.diagram/src/org/eclipse/emf/ecoretools/diagram/view/factories/EClassViewFactory.java,v >retrieving revision 1.2 >diff -u -r1.2 EClassViewFactory.java >--- src/org/eclipse/emf/ecoretools/diagram/view/factories/EClassViewFactory.java 28 Apr 2008 08:41:31 -0000 1.2 >+++ src/org/eclipse/emf/ecoretools/diagram/view/factories/EClassViewFactory.java 12 Aug 2008 13:15:46 -0000 >@@ -18,6 +18,7 @@ > import java.util.List; > > import org.eclipse.core.runtime.IAdaptable; >+import org.eclipse.draw2d.ColorConstants; > import org.eclipse.emf.ecore.EAnnotation; > import org.eclipse.emf.ecore.EObject; > import org.eclipse.emf.ecore.EcoreFactory; >@@ -42,7 +43,9 @@ > */ > public class EClassViewFactory extends AbstractShapeViewFactory { > >- static final Color THIS_FORE = new Color(null, 0, 0, 0); >+ static final Color THIS_FONT = ColorConstants.darkGray; >+ >+ static final Color THIS_FORE = ColorConstants.gray; > > static final Color THIS_BACK = new Color(null, 248, 249, 209); > >@@ -54,7 +57,7 @@ > ShapeStyle style = (ShapeStyle) view.getStyle(NotationPackage.Literals.SHAPE_STYLE); > style.setFillColor(FigureUtilities.colorToInteger(THIS_BACK)); > style.setLineColor(FigureUtilities.colorToInteger(THIS_FORE)); >- style.setFontColor(FigureUtilities.colorToInteger(THIS_FORE)); >+ style.setFontColor(FigureUtilities.colorToInteger(THIS_FONT)); > style.setFontHeight(fontHeight); > } > >Index: src/org/eclipse/emf/ecoretools/diagram/view/factories/EEnum2ViewFactory.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.ecoretools/plugins/org.eclipse.emf.ecoretools.diagram/src/org/eclipse/emf/ecoretools/diagram/view/factories/EEnum2ViewFactory.java,v >retrieving revision 1.2 >diff -u -r1.2 EEnum2ViewFactory.java >--- src/org/eclipse/emf/ecoretools/diagram/view/factories/EEnum2ViewFactory.java 28 Apr 2008 08:41:31 -0000 1.2 >+++ src/org/eclipse/emf/ecoretools/diagram/view/factories/EEnum2ViewFactory.java 12 Aug 2008 13:15:46 -0000 >@@ -18,6 +18,7 @@ > import java.util.List; > > import org.eclipse.core.runtime.IAdaptable; >+import org.eclipse.draw2d.ColorConstants; > import org.eclipse.emf.ecore.EObject; > import org.eclipse.emf.ecoretools.diagram.edit.parts.EEnum2EditPart; > import org.eclipse.emf.ecoretools.diagram.edit.parts.EEnumLiteralsEditPart; >@@ -38,7 +39,9 @@ > */ > public class EEnum2ViewFactory extends AbstractShapeViewFactory { > >- static final Color THIS_FORE = new Color(null, 0, 0, 0); >+ static final Color THIS_FONT = ColorConstants.darkGray; >+ >+ static final Color THIS_FORE = ColorConstants.gray; > > static final Color THIS_BACK = new Color(null, 248, 249, 209); > >@@ -50,7 +53,7 @@ > ShapeStyle style = (ShapeStyle) view.getStyle(NotationPackage.Literals.SHAPE_STYLE); > style.setFillColor(FigureUtilities.colorToInteger(THIS_BACK)); > style.setLineColor(FigureUtilities.colorToInteger(THIS_FORE)); >- style.setFontColor(FigureUtilities.colorToInteger(THIS_FORE)); >+ style.setFontColor(FigureUtilities.colorToInteger(THIS_FONT)); > style.setFontHeight(fontHeight); > } > >Index: src/org/eclipse/emf/ecoretools/diagram/view/factories/EClassESuperTypesViewFactory.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.ecoretools/plugins/org.eclipse.emf.ecoretools.diagram/src/org/eclipse/emf/ecoretools/diagram/view/factories/EClassESuperTypesViewFactory.java,v >retrieving revision 1.5 >diff -u -r1.5 EClassESuperTypesViewFactory.java >--- src/org/eclipse/emf/ecoretools/diagram/view/factories/EClassESuperTypesViewFactory.java 28 Apr 2008 08:41:31 -0000 1.5 >+++ src/org/eclipse/emf/ecoretools/diagram/view/factories/EClassESuperTypesViewFactory.java 12 Aug 2008 13:15:46 -0000 >@@ -18,6 +18,7 @@ > import java.util.List; > > import org.eclipse.core.runtime.IAdaptable; >+import org.eclipse.draw2d.ColorConstants; > import org.eclipse.emf.ecoretools.diagram.edit.parts.EClassESuperTypesEditPart; > import org.eclipse.emf.ecoretools.diagram.part.EcoreVisualIDRegistry; > import org.eclipse.gmf.runtime.diagram.ui.view.factories.ConnectionViewFactory; >@@ -34,7 +35,7 @@ > */ > public class EClassESuperTypesViewFactory extends ConnectionViewFactory { > >- static final Color THIS_FORE = new Color(null, 0, 0, 0); >+ static final Color THIS_FORE = ColorConstants.darkGray; > > @Override > protected void initializeFromPreferences(View view) { >Index: src/org/eclipse/emf/ecoretools/diagram/view/factories/EReferenceViewFactory.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.ecoretools/plugins/org.eclipse.emf.ecoretools.diagram/src/org/eclipse/emf/ecoretools/diagram/view/factories/EReferenceViewFactory.java,v >retrieving revision 1.3 >diff -u -r1.3 EReferenceViewFactory.java >--- src/org/eclipse/emf/ecoretools/diagram/view/factories/EReferenceViewFactory.java 28 Apr 2008 08:41:31 -0000 1.3 >+++ src/org/eclipse/emf/ecoretools/diagram/view/factories/EReferenceViewFactory.java 12 Aug 2008 13:15:46 -0000 >@@ -18,6 +18,7 @@ > import java.util.List; > > import org.eclipse.core.runtime.IAdaptable; >+import org.eclipse.draw2d.ColorConstants; > import org.eclipse.emf.ecore.EObject; > import org.eclipse.emf.ecoretools.diagram.edit.parts.EReferenceEditPart; > import org.eclipse.emf.ecoretools.diagram.edit.parts.EReferenceLowerBoundUpperBoundEditPart; >@@ -39,7 +40,7 @@ > */ > public class EReferenceViewFactory extends ConnectionViewFactory { > >- static final Color THIS_FORE = new Color(null, 0, 0, 0); >+ static final Color THIS_FORE = ColorConstants.darkGray; > > static final int fontHeight = 10; > >Index: src/org/eclipse/emf/ecoretools/diagram/view/factories/EAnnotationViewFactory.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.ecoretools/plugins/org.eclipse.emf.ecoretools.diagram/src/org/eclipse/emf/ecoretools/diagram/view/factories/EAnnotationViewFactory.java,v >retrieving revision 1.2 >diff -u -r1.2 EAnnotationViewFactory.java >--- src/org/eclipse/emf/ecoretools/diagram/view/factories/EAnnotationViewFactory.java 28 Apr 2008 08:41:31 -0000 1.2 >+++ src/org/eclipse/emf/ecoretools/diagram/view/factories/EAnnotationViewFactory.java 12 Aug 2008 13:15:46 -0000 >@@ -18,6 +18,7 @@ > import java.util.List; > > import org.eclipse.core.runtime.IAdaptable; >+import org.eclipse.draw2d.ColorConstants; > import org.eclipse.emf.ecore.EAnnotation; > import org.eclipse.emf.ecore.EObject; > import org.eclipse.emf.ecore.EcoreFactory; >@@ -41,7 +42,7 @@ > */ > public class EAnnotationViewFactory extends AbstractShapeViewFactory { > >- static final Color THIS_FORE = new Color(null, 0, 0, 0); >+ static final Color THIS_FORE = ColorConstants.darkGray; > > static final Color THIS_BACK = new Color(null, 232, 211, 223); > >Index: src/org/eclipse/emf/ecoretools/diagram/view/factories/EDataType2ViewFactory.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.ecoretools/plugins/org.eclipse.emf.ecoretools.diagram/src/org/eclipse/emf/ecoretools/diagram/view/factories/EDataType2ViewFactory.java,v >retrieving revision 1.2 >diff -u -r1.2 EDataType2ViewFactory.java >--- src/org/eclipse/emf/ecoretools/diagram/view/factories/EDataType2ViewFactory.java 28 Apr 2008 08:41:31 -0000 1.2 >+++ src/org/eclipse/emf/ecoretools/diagram/view/factories/EDataType2ViewFactory.java 12 Aug 2008 13:15:46 -0000 >@@ -18,6 +18,7 @@ > import java.util.List; > > import org.eclipse.core.runtime.IAdaptable; >+import org.eclipse.draw2d.ColorConstants; > import org.eclipse.emf.ecore.EObject; > import org.eclipse.emf.ecoretools.diagram.edit.parts.EDataType2EditPart; > import org.eclipse.emf.ecoretools.diagram.edit.parts.EDataTypeInstanceClass2EditPart; >@@ -38,7 +39,9 @@ > */ > public class EDataType2ViewFactory extends AbstractShapeViewFactory { > >- static final Color THIS_FORE = new Color(null, 0, 0, 0); >+ static final Color THIS_FONT = ColorConstants.darkGray; >+ >+ static final Color THIS_FORE = ColorConstants.gray; > > static final Color THIS_BACK = new Color(null, 248, 249, 209); > >@@ -50,7 +53,7 @@ > ShapeStyle style = (ShapeStyle) view.getStyle(NotationPackage.Literals.SHAPE_STYLE); > style.setFillColor(FigureUtilities.colorToInteger(THIS_BACK)); > style.setLineColor(FigureUtilities.colorToInteger(THIS_FORE)); >- style.setFontColor(FigureUtilities.colorToInteger(THIS_FORE)); >+ style.setFontColor(FigureUtilities.colorToInteger(THIS_FONT)); > style.setFontHeight(fontHeight); > } > >Index: src/org/eclipse/emf/ecoretools/diagram/view/factories/EDataTypeViewFactory.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.ecoretools/plugins/org.eclipse.emf.ecoretools.diagram/src/org/eclipse/emf/ecoretools/diagram/view/factories/EDataTypeViewFactory.java,v >retrieving revision 1.2 >diff -u -r1.2 EDataTypeViewFactory.java >--- src/org/eclipse/emf/ecoretools/diagram/view/factories/EDataTypeViewFactory.java 28 Apr 2008 08:41:31 -0000 1.2 >+++ src/org/eclipse/emf/ecoretools/diagram/view/factories/EDataTypeViewFactory.java 12 Aug 2008 13:15:46 -0000 >@@ -18,6 +18,7 @@ > import java.util.List; > > import org.eclipse.core.runtime.IAdaptable; >+import org.eclipse.draw2d.ColorConstants; > import org.eclipse.emf.ecore.EAnnotation; > import org.eclipse.emf.ecore.EObject; > import org.eclipse.emf.ecore.EcoreFactory; >@@ -41,7 +42,9 @@ > */ > public class EDataTypeViewFactory extends AbstractShapeViewFactory { > >- static final Color THIS_FORE = new Color(null, 0, 0, 0); >+ static final Color THIS_FONT = ColorConstants.darkGray; >+ >+ static final Color THIS_FORE = ColorConstants.gray; > > static final Color THIS_BACK = new Color(null, 248, 249, 209); > >@@ -53,7 +56,7 @@ > ShapeStyle style = (ShapeStyle) view.getStyle(NotationPackage.Literals.SHAPE_STYLE); > style.setFillColor(FigureUtilities.colorToInteger(THIS_BACK)); > style.setLineColor(FigureUtilities.colorToInteger(THIS_FORE)); >- style.setFontColor(FigureUtilities.colorToInteger(THIS_FORE)); >+ style.setFontColor(FigureUtilities.colorToInteger(THIS_FONT)); > style.setFontHeight(fontHeight); > } > >Index: src/org/eclipse/emf/ecoretools/diagram/preferences/DiagramPreferenceInitializer.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.ecoretools/plugins/org.eclipse.emf.ecoretools.diagram/src/org/eclipse/emf/ecoretools/diagram/preferences/DiagramPreferenceInitializer.java,v >retrieving revision 1.2 >diff -u -r1.2 DiagramPreferenceInitializer.java >--- src/org/eclipse/emf/ecoretools/diagram/preferences/DiagramPreferenceInitializer.java 28 Apr 2008 08:41:33 -0000 1.2 >+++ src/org/eclipse/emf/ecoretools/diagram/preferences/DiagramPreferenceInitializer.java 12 Aug 2008 13:15:46 -0000 >@@ -1,5 +1,5 @@ > /*********************************************************************** >- * Copyright (c) 2007 Anyware Technologies >+ * Copyright (c) 2007, 2008 Anyware Technologies > * > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 >@@ -24,7 +24,9 @@ > public class DiagramPreferenceInitializer extends AbstractPreferenceInitializer { > > /** >- * @generated >+ * Initialize new preferences added to support Sexy UI feature >+ * >+ * @generated NOT > */ > @Override > public void initializeDefaultPreferences() { >@@ -34,6 +36,9 @@ > DiagramAppearancePreferencePage.initDefaults(store); > DiagramConnectionsPreferencePage.initDefaults(store); > DiagramRulersAndGridPreferencePage.initDefaults(store); >+ >+ store.setDefault(IEcoreToolsPreferenceConstants.PREF_FILL_FIGURE_USING_GRADIENT, true); >+ store.setDefault(IEcoreToolsPreferenceConstants.PREF_USE_SHADOW_ON_BORDER, true); > } > > /** >Index: src/org/eclipse/emf/ecoretools/diagram/preferences/DiagramAppearancePreferencePage.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.ecoretools/plugins/org.eclipse.emf.ecoretools.diagram/src/org/eclipse/emf/ecoretools/diagram/preferences/DiagramAppearancePreferencePage.java,v >retrieving revision 1.2 >diff -u -r1.2 DiagramAppearancePreferencePage.java >--- src/org/eclipse/emf/ecoretools/diagram/preferences/DiagramAppearancePreferencePage.java 28 Apr 2008 08:41:33 -0000 1.2 >+++ src/org/eclipse/emf/ecoretools/diagram/preferences/DiagramAppearancePreferencePage.java 12 Aug 2008 13:15:46 -0000 >@@ -1,5 +1,5 @@ > /*********************************************************************** >- * Copyright (c) 2007 Anyware Technologies >+ * Copyright (c) 2007, 2008 Anyware Technologies > * > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 >@@ -16,16 +16,79 @@ > > import org.eclipse.emf.ecoretools.diagram.part.EcoreDiagramEditorPlugin; > import org.eclipse.gmf.runtime.diagram.ui.preferences.AppearancePreferencePage; >+import org.eclipse.jface.preference.BooleanFieldEditor; >+import org.eclipse.swt.SWT; >+import org.eclipse.swt.custom.StyledText; >+import org.eclipse.swt.layout.GridData; >+import org.eclipse.swt.layout.GridLayout; >+import org.eclipse.swt.widgets.Composite; >+import org.eclipse.swt.widgets.Group; >+import org.eclipse.swt.widgets.Label; > > /** > * @generated > */ > public class DiagramAppearancePreferencePage extends AppearancePreferencePage { > >+ private BooleanFieldEditor fillFigureUsingGradient = null; >+ private BooleanFieldEditor useShadowOnBorder = null; >+ > /** > * @generated > */ > public DiagramAppearancePreferencePage() { > setPreferenceStore(EcoreDiagramEditorPlugin.getInstance().getPreferenceStore()); > } >+ >+ /* >+ * (non-Javadoc) >+ * >+ * @see org.eclipse.gmf.runtime.common.ui.preferences.AbstractPreferencePage# >+ * addFields(org.eclipse.swt.widgets.Composite) >+ */ >+ protected void addFields(Composite parent) { >+ Composite main = createPageLayout(parent); >+ createFontAndColorGroup(main); >+ createSexyUIGroup(main); >+ } >+ >+ /** >+ * Create the sexyUI group for the preference page >+ * >+ * @param parent >+ * @return composite fontAndColourGroup >+ */ >+ protected Composite createSexyUIGroup(Composite parent) { >+ >+ Group group = new Group(parent, SWT.NONE); >+ group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); >+ group.setLayout(new GridLayout(3, false)); >+ Composite composite = new Composite(group, SWT.NONE); >+ GridLayout gridLayout = new GridLayout(3, false); >+ composite.setLayout(gridLayout); >+ GridData gridData = new GridData(GridData.FILL_HORIZONTAL); >+ gridData.grabExcessHorizontalSpace = true; >+ gridData.horizontalSpan = 3; >+ composite.setLayoutData(gridData); >+ group.setText("Sexy UI - Figures rendering"); >+ >+ fillFigureUsingGradient = new BooleanFieldEditor( >+ IEcoreToolsPreferenceConstants.PREF_FILL_FIGURE_USING_GRADIENT, "Use gradient to fill figures", composite); >+ addField(fillFigureUsingGradient); >+ >+ useShadowOnBorder = new BooleanFieldEditor(IEcoreToolsPreferenceConstants.PREF_USE_SHADOW_ON_BORDER, >+ "Show shadow on border", composite); >+ addField(useShadowOnBorder); >+ >+ createNoteComposite(parent.getFont(), group, "Note:", "those preferences will take effect only on new diagrams."); >+ >+ GridLayout layout = new GridLayout(); >+ layout.numColumns = 3; >+ layout.marginWidth = 0; >+ layout.marginHeight = 0; >+ layout.horizontalSpacing = 8; >+ composite.setLayout(layout); >+ >+ return group; >+ } > } >Index: src/org/eclipse/emf/ecoretools/diagram/part/EcoreDiagramEditor.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.ecoretools/plugins/org.eclipse.emf.ecoretools.diagram/src/org/eclipse/emf/ecoretools/diagram/part/EcoreDiagramEditor.java,v >retrieving revision 1.13 >diff -u -r1.13 EcoreDiagramEditor.java >--- src/org/eclipse/emf/ecoretools/diagram/part/EcoreDiagramEditor.java 28 Apr 2008 15:23:59 -0000 1.13 >+++ src/org/eclipse/emf/ecoretools/diagram/part/EcoreDiagramEditor.java 12 Aug 2008 13:15:46 -0000 >@@ -1,5 +1,5 @@ > /*********************************************************************** >- * Copyright (c) 2007 Anyware Technologies >+ * Copyright (c) 2007, 2008 Anyware Technologies > * > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 >@@ -40,13 +40,12 @@ > import org.eclipse.emf.ecore.resource.Resource; > import org.eclipse.emf.ecoretools.diagram.navigator.EcoreNavigatorItem; > import org.eclipse.emf.ecoretools.diagram.outline.EcoreDiagramOutlinePage; >+import org.eclipse.emf.ecoretools.diagram.preferences.IEcoreToolsPreferenceConstants; > import org.eclipse.emf.edit.ui.dnd.LocalTransfer; > import org.eclipse.emf.transaction.TransactionalEditingDomain; > import org.eclipse.emf.workspace.EMFCommandOperation; > import org.eclipse.emf.workspace.util.WorkspaceSynchronizer; > import org.eclipse.gef.EditPartViewer; >-import org.eclipse.gef.MouseWheelHandler; >-import org.eclipse.gef.MouseWheelZoomHandler; > import org.eclipse.gef.palette.PaletteRoot; > import org.eclipse.gmf.runtime.common.ui.services.marker.MarkerNavigationService; > import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint; >@@ -66,7 +65,6 @@ > import org.eclipse.jface.viewers.StructuredSelection; > import org.eclipse.jface.window.Window; > import org.eclipse.osgi.util.NLS; >-import org.eclipse.swt.SWT; > import org.eclipse.swt.dnd.Transfer; > import org.eclipse.swt.dnd.TransferData; > import org.eclipse.swt.widgets.Shell; >@@ -439,15 +437,16 @@ > } > > /** >- * Remove this method when the feature 210642 will be implemented >+ * Store Sexy UI preferences at the Viewer level so that it can be reached later by controllers. > * > * @see org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor#initializeGraphicalViewerContents() > */ > @Override > protected void initializeGraphicalViewerContents() { >+ // Sexy UI preferences >+ getGraphicalViewer().setProperty(IEcoreToolsPreferenceConstants.PREF_FILL_FIGURE_USING_GRADIENT, EcoreDiagramEditorPlugin.getInstance().getPreferenceStore().getBoolean(IEcoreToolsPreferenceConstants.PREF_FILL_FIGURE_USING_GRADIENT)); >+ getGraphicalViewer().setProperty(IEcoreToolsPreferenceConstants.PREF_USE_SHADOW_ON_BORDER, EcoreDiagramEditorPlugin.getInstance().getPreferenceStore().getBoolean(IEcoreToolsPreferenceConstants.PREF_USE_SHADOW_ON_BORDER)); > super.initializeGraphicalViewerContents(); >- // Scroll-wheel Zoom >- getGraphicalViewer().setProperty(MouseWheelHandler.KeyGenerator.getKey(SWT.CTRL), MouseWheelZoomHandler.SINGLETON); > } > > @Override >Index: custom-src/org/eclipse/emf/ecoretools/diagram/edit/policies/AlphaResizableShapeEditPolicy.java >=================================================================== >RCS file: custom-src/org/eclipse/emf/ecoretools/diagram/edit/policies/AlphaResizableShapeEditPolicy.java >diff -N custom-src/org/eclipse/emf/ecoretools/diagram/edit/policies/AlphaResizableShapeEditPolicy.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ custom-src/org/eclipse/emf/ecoretools/diagram/edit/policies/AlphaResizableShapeEditPolicy.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,40 @@ >+/*********************************************************************** >+ * Copyright (c) 2008 Anyware Technologies >+ * >+ * 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: >+ * Simon Bernard (Anyware Technologies) - initial API and implementation >+ * >+ * $Id$ >+ **********************************************************************/ >+package org.eclipse.emf.ecoretools.diagram.edit.policies; >+ >+import org.eclipse.draw2d.IFigure; >+import org.eclipse.draw2d.RectangleFigure; >+import org.eclipse.emf.ecoretools.diagram.edit.figures.GhostRectangleFigure; >+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ResizableShapeEditPolicy; >+ >+/** >+ * ResizableShapeEditPolicy which draw rectangle feedback with alpha property >+ * instead of XOR<br> >+ * Useful to have a best display with gradient figure <br> >+ * creation : 17 mai. 08 >+ * >+ * @author <a href="mailto:simon.bernard@anyware-tech.com">Simon Bernard</a> >+ */ >+public class AlphaResizableShapeEditPolicy extends ResizableShapeEditPolicy { >+ >+ @Override >+ protected IFigure createDragSourceFeedbackFigure() { >+ // Use a ghost rectangle for feedback >+ RectangleFigure r = new GhostRectangleFigure(); >+ r.setBounds(getInitialFeedbackBounds()); >+ addFeedback(r); >+ return r; >+ } >+ >+} >Index: custom-src/org/eclipse/emf/ecoretools/diagram/edit/policies/AlphaXYLayoutEditPolicy.java >=================================================================== >RCS file: custom-src/org/eclipse/emf/ecoretools/diagram/edit/policies/AlphaXYLayoutEditPolicy.java >diff -N custom-src/org/eclipse/emf/ecoretools/diagram/edit/policies/AlphaXYLayoutEditPolicy.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ custom-src/org/eclipse/emf/ecoretools/diagram/edit/policies/AlphaXYLayoutEditPolicy.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,38 @@ >+/*********************************************************************** >+ * Copyright (c) 2008 Anyware Technologies >+ * >+ * 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: >+ * Simon Bernard (Anyware Technologies) - initial API and implementation >+ * >+ * $Id$ >+ **********************************************************************/ >+package org.eclipse.emf.ecoretools.diagram.edit.policies; >+ >+import org.eclipse.draw2d.IFigure; >+import org.eclipse.emf.ecoretools.diagram.edit.figures.GhostRectangleFigure; >+import org.eclipse.gef.requests.CreateRequest; >+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.XYLayoutEditPolicy; >+ >+/** >+ * XYLayoutEditPolicy which draw rectangle feedback with alpha property instead >+ * of XOR<br> >+ * Useful to have a best display with gradient figure <br> >+ * creation : 17 mai. 08 >+ * >+ * @author <a href="mailto:simon.bernard@anyware-tech.com">Simon Bernard</a> >+ */ >+public class AlphaXYLayoutEditPolicy extends XYLayoutEditPolicy { >+ >+ @Override >+ protected IFigure createSizeOnDropFeedback(CreateRequest createRequest) { >+ GhostRectangleFigure feedack = new GhostRectangleFigure(); >+ addFeedback(feedack); >+ return feedack; >+ } >+ >+} >Index: custom-src/org/eclipse/emf/ecoretools/diagram/edit/figures/AlphaDropShadowBorder.java >=================================================================== >RCS file: custom-src/org/eclipse/emf/ecoretools/diagram/edit/figures/AlphaDropShadowBorder.java >diff -N custom-src/org/eclipse/emf/ecoretools/diagram/edit/figures/AlphaDropShadowBorder.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ custom-src/org/eclipse/emf/ecoretools/diagram/edit/figures/AlphaDropShadowBorder.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,103 @@ >+/*********************************************************************** >+ * Copyright (c) 2008 Anyware Technologies >+ * >+ * 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: >+ * Simon Bernard (Anyware Technologies) - initial API and implementation >+ * >+ * $Id$ >+ **********************************************************************/ >+package org.eclipse.emf.ecoretools.diagram.edit.figures; >+ >+import org.eclipse.draw2d.AbstractBackground; >+import org.eclipse.draw2d.Graphics; >+import org.eclipse.draw2d.IFigure; >+import org.eclipse.draw2d.geometry.Insets; >+import org.eclipse.draw2d.geometry.PointList; >+import org.eclipse.draw2d.geometry.Rectangle; >+import org.eclipse.gmf.runtime.diagram.ui.figures.DiagramColorConstants; >+import org.eclipse.gmf.runtime.draw2d.ui.figures.DropShadowBorder; >+import org.eclipse.gmf.runtime.draw2d.ui.figures.IPolygonAnchorableFigure; >+import org.eclipse.gmf.runtime.draw2d.ui.mapmode.MapModeUtil; >+import org.eclipse.swt.graphics.Color; >+ >+/** >+ * A border using a shadow<br> >+ * creation : 17 mai. 08 >+ * >+ * @author <a href="mailto:simon.bernard@anyware-tech.com">Simon Bernard</a> >+ */ >+public class AlphaDropShadowBorder extends AbstractBackground implements DropShadowBorder { >+ >+ private static final int DEFAULT_SHIFT_VALUE = 1; >+ >+ private static final Color SHADOW_COLOR = DiagramColorConstants.diagramDarkGray; >+ >+ private static final int DEFAULT_TRANSPARENCY = 65; >+ >+ private boolean shouldDrawShadow = true; >+ >+ private int shift = DEFAULT_SHIFT_VALUE; >+ >+ public void setShouldDrawDropShadow(boolean drawDropShadow) { >+ shouldDrawShadow = drawDropShadow; >+ } >+ >+ public boolean shouldDrawDropShadow() { >+ return shouldDrawShadow; >+ } >+ >+ /** >+ * Method for determining the inset the border will take up on the shape. >+ * >+ * @param figure >+ * Figure that will be inset from the border >+ * @return Insets the Insets for the border on the given figure. >+ */ >+ public Insets getInsets(IFigure figure) { >+ Insets insetsNew = new Insets(); >+ insetsNew.top = 0; >+ insetsNew.left = 0; >+ insetsNew.bottom = MapModeUtil.getMapMode(figure).DPtoLP(shift * 2); >+ insetsNew.right = MapModeUtil.getMapMode(figure).DPtoLP(shift * 2); >+ return insetsNew; >+ } >+ >+ public Insets getTransparentInsets(IFigure figure) { >+ Insets insetsNew = new Insets(); >+ insetsNew.top = 0; >+ insetsNew.left = 0; >+ insetsNew.bottom = MapModeUtil.getMapMode(figure).DPtoLP(shift * 2); >+ insetsNew.right = MapModeUtil.getMapMode(figure).DPtoLP(shift * 2); >+ return insetsNew; >+ } >+ >+ @Override >+ public void paintBackground(IFigure figure, Graphics graphics, Insets insets) { >+ if (shouldDrawDropShadow()) { >+ graphics.pushState(); >+ graphics.setBackgroundColor(SHADOW_COLOR); >+ graphics.setAlpha(DEFAULT_TRANSPARENCY); >+ >+ if (figure instanceof IPolygonAnchorableFigure) { >+ PointList polygonPoints = ((IPolygonAnchorableFigure) figure).getPolygonPoints(); >+ polygonPoints.translate(shift, shift); >+ graphics.fillPolygon(polygonPoints); >+ polygonPoints.translate(shift, shift); >+ graphics.fillPolygon(polygonPoints); >+ } else { >+ Rectangle bounds = figure.getBounds().getCopy(); >+ bounds.translate(shift, shift); >+ graphics.fillRoundRectangle(bounds, 0, 0); >+ bounds.translate(shift, shift); >+ graphics.fillRoundRectangle(bounds, 0, 0); >+ } >+ >+ graphics.popState(); >+ } >+ } >+} >Index: custom-src/org/eclipse/emf/ecoretools/diagram/edit/figures/GhostRectangleFigure.java >=================================================================== >RCS file: custom-src/org/eclipse/emf/ecoretools/diagram/edit/figures/GhostRectangleFigure.java >diff -N custom-src/org/eclipse/emf/ecoretools/diagram/edit/figures/GhostRectangleFigure.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ custom-src/org/eclipse/emf/ecoretools/diagram/edit/figures/GhostRectangleFigure.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,42 @@ >+/*********************************************************************** >+ * Copyright (c) 2008 Anyware Technologies >+ * >+ * 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: >+ * Simon Bernard (Anyware Technologies) - initial API and implementation >+ * >+ * $Id$ >+ **********************************************************************/ >+package org.eclipse.emf.ecoretools.diagram.edit.figures; >+ >+import org.eclipse.draw2d.Graphics; >+import org.eclipse.draw2d.RectangleFigure; >+import org.eclipse.gmf.runtime.diagram.ui.figures.DiagramColorConstants; >+ >+/** >+ * A "ghost" rectangleFigure <br> >+ * Useful for feedback on figures which use gradient <br> >+ * creation : 17 mai. 08 >+ * >+ * @author <a href="mailto:simon.bernard@anyware-tech.com">Simon Bernard</a> >+ */ >+public class GhostRectangleFigure extends RectangleFigure { >+ >+ public GhostRectangleFigure() { >+ setBackgroundColor(DiagramColorConstants.diagramGray); >+ setForegroundColor(DiagramColorConstants.black); >+ setLineStyle(Graphics.LINE_DOT); >+ } >+ >+ @Override >+ protected void fillShape(Graphics graphics) { >+ graphics.pushState(); >+ graphics.setAlpha(125); >+ super.fillShape(graphics); >+ graphics.popState(); >+ } >+} >Index: custom-src/org/eclipse/emf/ecoretools/diagram/preferences/IEcoreToolsPreferenceConstants.java >=================================================================== >RCS file: custom-src/org/eclipse/emf/ecoretools/diagram/preferences/IEcoreToolsPreferenceConstants.java >diff -N custom-src/org/eclipse/emf/ecoretools/diagram/preferences/IEcoreToolsPreferenceConstants.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ custom-src/org/eclipse/emf/ecoretools/diagram/preferences/IEcoreToolsPreferenceConstants.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,31 @@ >+/*********************************************************************** >+ * Copyright (c) 2008 Anyware Technologies >+ * >+ * 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: >+ * Jacques Lescot (Anyware Technologies) - initial API and implementation >+ * >+ * $Id$ >+ **********************************************************************/ >+package org.eclipse.emf.ecoretools.diagram.preferences; >+ >+/** >+ * Defines custom preference constants for the Ecore Tools graphical editor >+ * <p> >+ * This interface defines constants only, it is <EM>not</EM> intended to be implemented by clients. >+ * </p> >+ * >+ * @author Jacques Lescot >+ */ >+public interface IEcoreToolsPreferenceConstants { >+ >+ /** use Gradient to render figures - Appearance Preference */ >+ public static final String PREF_FILL_FIGURE_USING_GRADIENT = "Appearance.fillFigureUsingGradient"; //$NON-NLS-1$ >+ >+ /** use Shadow on borders when rendering figures - Appearance Preference */ >+ public static final String PREF_USE_SHADOW_ON_BORDER = "Appearance.useShadowOnBorder"; //$NON-NLS-1$ >+} >Index: custom-src/org/eclipse/emf/ecoretools/diagram/edit/figures/GradientRectangleFigure.java >=================================================================== >RCS file: custom-src/org/eclipse/emf/ecoretools/diagram/edit/figures/GradientRectangleFigure.java >diff -N custom-src/org/eclipse/emf/ecoretools/diagram/edit/figures/GradientRectangleFigure.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ custom-src/org/eclipse/emf/ecoretools/diagram/edit/figures/GradientRectangleFigure.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,63 @@ >+/*********************************************************************** >+ * Copyright (c) 2008 Anyware Technologies >+ * >+ * 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: >+ * Simon Bernard (Anyware Technologies) - initial API and implementation >+ * >+ * $Id$ >+ **********************************************************************/ >+package org.eclipse.emf.ecoretools.diagram.edit.figures; >+ >+import org.eclipse.draw2d.Graphics; >+import org.eclipse.draw2d.RectangleFigure; >+import org.eclipse.gmf.runtime.diagram.ui.figures.DiagramColorConstants; >+ >+/** >+ * A Rectangle which is draw with gradient property<br> >+ * creation : 17 mai. 08 >+ * >+ * @author <a href="mailto:simon.bernard@anyware-tech.com">Simon Bernard</a> >+ */ >+public class GradientRectangleFigure extends RectangleFigure { >+ >+ private boolean useGradient = true; >+ >+ /** >+ * Sets whether the gradient should be used when rendering the figure >+ * >+ * @param drawDropShadow >+ */ >+ public void setShouldUseGradient(boolean shouldUseGradient) { >+ this.useGradient = shouldUseGradient; >+ } >+ >+ /** >+ * @return true if gradient should be used when rendering the figure >+ */ >+ public boolean shouldUseGradient() { >+ return useGradient; >+ } >+ >+ @Override >+ protected void fillShape(Graphics graphics) { >+ if (shouldUseGradient()) { >+ graphics.pushState(); >+ graphics.setBackgroundColor(DiagramColorConstants.white); >+ graphics.setForegroundColor(getBackgroundColor()); >+ graphics.fillGradient(getBounds(), true); >+ graphics.popState(); >+ } else { >+ super.fillShape(graphics); >+ } >+ } >+ >+ @Override >+ protected void outlineShape(Graphics graphics) { >+ super.outlineShape(graphics); >+ } >+}
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 235303
:
103278
|
105183
| 109780 |
109781