Skip to content
Snippets Groups Projects
Commit 43fad416 authored by Florian Hölzl's avatar Florian Hölzl
Browse files

YELLOW

refs 311
parent e41ec176
No related branches found
No related tags found
No related merge requests found
Showing
with 15 additions and 148 deletions
......@@ -17,7 +17,6 @@ $Id$
+--------------------------------------------------------------------------*/
package org.fortiss.tooling.base.ui.editor;
import static org.conqat.ide.commons.gef.editpart.EditPartUtils.fullRefresh;
import static org.eclipse.gef.editparts.ZoomManager.FIT_ALL;
import static org.eclipse.gef.editparts.ZoomManager.FIT_HEIGHT;
import static org.eclipse.gef.editparts.ZoomManager.FIT_WIDTH;
......@@ -66,8 +65,6 @@ import org.eclipse.gef.ui.actions.ZoomOutAction;
import org.eclipse.gef.ui.parts.ScrollingGraphicalViewer;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.viewers.IPostSelectionProvider;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
......@@ -81,12 +78,10 @@ import org.eclipse.ui.IEditorSite;
import org.eclipse.ui.ISelectionListener;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.PartInitException;
import org.fortiss.tooling.base.ui.ToolingBaseUIActivator;
import org.fortiss.tooling.base.ui.dnd.gef.ElementCompositionDropTargetListener;
import org.fortiss.tooling.base.ui.editpart.ConnectorEditPartBase;
import org.fortiss.tooling.base.ui.editpart.DiagramEditPartBase;
import org.fortiss.tooling.base.ui.editpart.ExtendedLayerRootEditPart;
import org.fortiss.tooling.base.ui.editpart.figure.EVisualStyle;
import org.fortiss.tooling.base.ui.layout.IDiagramLayoutConfiguration;
import org.fortiss.tooling.kernel.ui.extension.base.EObjectActionBase;
import org.fortiss.tooling.kernel.ui.extension.data.ContextMenuContextProvider;
......@@ -102,7 +97,7 @@ import org.fortiss.tooling.kernel.ui.util.EObjectSelectionUtils;
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating GREEN Hash: 2BE9DAC51D493CE6884BC5780CCBA3BD
* @ConQAT.Rating YELLOW Hash: 1DAA46B0A90D204373497B5FDDA92A68
*/
public class DiagramEditorBase<T extends EObject> extends GEFEditorBase<T>
implements IPostSelectionProvider, ContextMenuContextProvider {
......@@ -179,8 +174,6 @@ public class DiagramEditorBase<T extends EObject> extends GEFEditorBase<T>
createContextMenu();
getSite().setSelectionProvider(this);
ToolingBaseUIActivator.getDefault().getPreferenceStore()
.addPropertyChangeListener(propertyChangeListener);
createActions();
updateActions(propertyActions);
......@@ -217,14 +210,6 @@ public class DiagramEditorBase<T extends EObject> extends GEFEditorBase<T>
});
}
/** {@inheritDoc} */
@Override
public void dispose() {
ToolingBaseUIActivator.getDefault().getPreferenceStore()
.removePropertyChangeListener(propertyChangeListener);
super.dispose();
}
/**
* Returns the root object used as content root. Sub-classes may override to
* provide a different content root object. The default implementation uses
......@@ -247,17 +232,6 @@ public class DiagramEditorBase<T extends EObject> extends GEFEditorBase<T>
return true;
}
/** Listener used to refresh on editor preference changes. */
private final IPropertyChangeListener propertyChangeListener = new IPropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent event) {
if (event.getProperty().equals(EVisualStyle.ID)) {
fullRefresh(viewer.getRootEditPart());
}
}
};
/** Installs zoom suport for this graphical viewer. */
private void createZoomSupport() {
RootEditPart rootPart = viewer.getRootEditPart();
......
<!--
$Id: package.html 2692 2012-01-09 13:17:37Z doebber $
@version $Rev: 2692 $
@ConQAT.Rating YELLOW Hash: F801474731B7D554546403E14C8D8A0C
@ConQAT.Rating GREEN Hash: 5AB9D16BE756B2725851564D78CC5ADE
-->
<body>
Package for base implementations of different editor types.
......
......@@ -73,7 +73,7 @@ import org.fortiss.tooling.kernel.ui.service.IModelElementHandlerService;
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: AA7E698D18A510E82F864B9CEE5667FD
* @ConQAT.Rating GREEN Hash: A3E4A702B8E644BAA152153CBEC63DB2
*/
public abstract class PositionedEditPartBase<T extends ILayoutedModelElement>
extends GraphicalEditPartBase<T> implements NodeEditPart {
......
<!--
$Id: package.html 2692 2012-01-09 13:17:37Z doebber $
@version $Rev: 2692 $
@ConQAT.Rating YELLOW Hash: 4D0D987237039215AD61BEBB8636FA9C
@ConQAT.Rating GREEN Hash: C7AE64DD1954DDC12E42813DB0326140
-->
<body>
Package for edit part anchors.
......
<!--
$Id: package.html 2692 2012-01-09 13:17:37Z doebber $
@version $Rev: 2692 $
@ConQAT.Rating YELLOW Hash: 94BE4B4B098B7A0476C413BB52590DDD
@ConQAT.Rating GREEN Hash: B8C9E7EA38BCFF04CC2BD2E5A069C012
-->
<body>
Package for bendpoint related commands.
......
<!--
$Id: package.html 2692 2012-01-09 13:17:37Z doebber $
@version $Rev: 2692 $
@ConQAT.Rating YELLOW Hash: E05BA61D9E7EA04D74C2BCEAE231626B
@ConQAT.Rating GREEN Hash: 8D282E03DC06A747D19DD8AF07C66896
-->
<body>
Package for commands used with the edit parts.
......
/*--------------------------------------------------------------------------+
$Id$
| |
| Copyright 2011 ForTISS GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.tooling.base.ui.editpart.figure;
import org.eclipse.jface.preference.IPreferenceStore;
import org.fortiss.tooling.base.ui.ToolingBaseUIActivator;
/**
* The visual style that {@link PrettyInsetEllipse} and
* {@link PrettyRoundedRectangle} use for representation.
*
* @author schwitzer
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating GREEN Hash: A56EAF879DF84E2265CA1617D0E8C55F
*/
public enum EVisualStyle {
/** Traditional (since 2007) CCTS style with soft gradients. */
Traditional,
/** Glossy (since 2010) CCTS style with glossy reflective gradients. */
Glossy;
/** Constant used as key for the preference-store of this plug-in. */
public static final String ID = "figures.visualStyle";
/** Cached preference-store to lookup visual style. */
private static IPreferenceStore preferenceStore = ToolingBaseUIActivator
.getDefault().getPreferenceStore();
/**
* Returns the visual style from the preference store of this plug-in's
* {@link ToolingBaseUIActivator}.
*/
public static EVisualStyle get() {
final String name = preferenceStore.getString(ID);
if (name == null || name.length() == 0) {
return Traditional; // Default.
}
return valueOf(name);
}
/**
* Sets the visual style in the preference store of this plug-in's
* {@link ToolingBaseUIActivator}.
*/
public static void set(EVisualStyle style) {
preferenceStore.setValue(ID, style.name());
}
}
......@@ -23,7 +23,6 @@ import org.eclipse.draw2d.Shape;
import org.eclipse.draw2d.geometry.Insets;
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Path;
/**
......@@ -38,7 +37,7 @@ import org.eclipse.swt.graphics.Path;
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating RED Hash: 84A2AF464E9E0229F704456147BCFAFD
* @ConQAT.Rating YELLOW Hash: C1FCEA2CFFEFF34C4C5C9D6C5C5E978C
*/
public class PrettyInsetEllipse extends Shape {
......@@ -86,28 +85,9 @@ public class PrettyInsetEllipse extends Shape {
*/
@Override
protected void outlineShape(Graphics gfx) {
EVisualStyle style = EVisualStyle.get();
gfx.pushState();
gfx.setAntialias(SWT.ON);
// TODO @review CD: During last iteration most of the glossy look
// implementation disappeared. Yet this remained. As seen before the
// only effect are ugly borders. I suggest removal.
if (style == EVisualStyle.Glossy) {
// Glossy style.
gfx.setLineCap(SWT.CAP_ROUND);
final int scale = (int) gfx.getAbsoluteScale();
gfx.setLineWidth(scale + 1);
Color bg = ColorConstants.orange;
Color bgdark = new Color(bg.getDevice(), Math.max(0,
(bg.getRed() - 20)), Math.max(0, (bg.getGreen() - 20)),
Math.max(0, (bg.getBlue() - 20)));
gfx.setForegroundColor(bgdark);
gfx.drawOval(getCroppedBounds());
bgdark.dispose();
} else {
// Traditional style is default.
gfx.drawOval(getCroppedBounds().resize(-1, -1));
}
gfx.drawOval(getCroppedBounds().resize(-1, -1));
gfx.popState();
}
}
......@@ -23,7 +23,6 @@ import org.eclipse.draw2d.Shape;
import org.eclipse.draw2d.geometry.Insets;
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
/**
* This shape consists of a rounded rectangle that is surrounded by transparent
......@@ -36,7 +35,7 @@ import org.eclipse.swt.graphics.Color;
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating RED Hash: 366867FD2CA94416DC46D9459E4F5F15
* @ConQAT.Rating YELLOW Hash: C9D3041BB437E75F6FF0ECBD4F2CC4A7
*/
public class PrettyRoundedRectangle extends Shape {
......@@ -76,30 +75,10 @@ public class PrettyRoundedRectangle extends Shape {
*/
@Override
protected void outlineShape(Graphics gfx) {
final EVisualStyle style = EVisualStyle.get();
gfx.pushState();
gfx.setAntialias(SWT.ON);
// TODO @review CD: During last iteration most of the glossy look
// implementation disappeared. Yet this remained. As seen before the
// only effect are ugly borders. I suggest removal.
if (style == EVisualStyle.Glossy) {
// Glossy style.
gfx.setLineCap(SWT.CAP_ROUND);
int scale = (int) gfx.getAbsoluteScale();
gfx.setLineWidth(scale + 1);
Color bg = gfx.getBackgroundColor();
Color bgdark = new Color(bg.getDevice(), Math.max(0,
(bg.getRed() - 80)), Math.max(0, (bg.getGreen() - 80)),
Math.max(0, (bg.getBlue() - 80)));
gfx.setForegroundColor(bgdark);
gfx.drawRoundRectangle(getCroppedBounds().resize(-1, -1),
cornerRadius, cornerRadius);
bgdark.dispose();
} else {
// Traditional style is default.
gfx.drawRoundRectangle(getCroppedBounds().resize(-1, -1),
cornerRadius, cornerRadius);
}
gfx.drawRoundRectangle(getCroppedBounds().resize(-1, -1), cornerRadius,
cornerRadius);
gfx.popState();
}
}
<!--
$Id: package.html 2692 2012-01-09 13:17:37Z doebber $
@version $Rev: 2692 $
@ConQAT.Rating YELLOW Hash: 76033D0C696F97767C914E8F51CD2AF0
@ConQAT.Rating GREEN Hash: 9B24AFCE9F85925EAD47E0E497AC9B41
-->
<body>
Package for figures of edit parts.
......
<!--
$Id: package.html 2692 2012-01-09 13:17:37Z doebber $
@version $Rev: 2692 $
@ConQAT.Rating YELLOW Hash: 3178FF60342D30042F5D68182E926302
@ConQAT.Rating GREEN Hash: 713307ECD30B7A560001045DDC0F0AFE
-->
<body>
Package for basic edit part implementations.
......
<!--
$Id: package.html 2692 2012-01-09 13:17:37Z doebber $
@version $Rev: 2692 $
@ConQAT.Rating YELLOW Hash: 1906769CB9223C3A7B7FABB2A085EE9E
@ConQAT.Rating GREEN Hash: 7936960D072BA5875B7B86C7DBEC6C8D
-->
<body>
Package for editing policies.
......
<!--
$Id: package.html 2692 2012-01-09 13:17:37Z doebber $
@version $Rev: 2692 $
@ConQAT.Rating YELLOW Hash: 54A75D1EE392B2FCE2EE4B3EC2F1F91E
@ConQAT.Rating GREEN Hash: 6106089938B438ED0AB48D24BA97C20E
-->
<body>
Package for creation requests.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment