diff --git a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/ConnectorEditPartBase.java b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/ConnectorEditPartBase.java index 62c87aef35e06bb94728b24abe3a3923a8edcbc7..0647dd188344c4109600932f35e54973c0b4a659 100644 --- a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/ConnectorEditPartBase.java +++ b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/ConnectorEditPartBase.java @@ -40,6 +40,7 @@ import org.fortiss.tooling.base.model.element.IHierarchicElement; import org.fortiss.tooling.base.model.layout.ILayoutedModelElement; import org.fortiss.tooling.base.model.layout.Point; import org.fortiss.tooling.base.ui.editpart.figure.AntiAliasedEllipse; +import org.fortiss.tooling.base.ui.editpart.figure.TransparentLabel; import org.fortiss.tooling.base.ui.editpart.policy.ConnectionGraphicalNodeEditPolicy; import org.fortiss.tooling.base.ui.editpart.policy.RemoveEditPolicy; import org.fortiss.tooling.base.ui.layout.constants.DefaultLayoutConstants; @@ -95,7 +96,7 @@ public abstract class ConnectorEditPartBase<T extends ILayoutedModelElement & IC /** {@inheritDoc} */ @Override protected Label createLabelFigure() { - Label nameLabel = new Label(); + Label nameLabel = new TransparentLabel(); nameLabel.setForegroundColor(getForegroundColor()); nameLabel.setTextAlignment(PositionConstants.LEFT | PositionConstants.TOP); diff --git a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/ElementEditPartBase.java b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/ElementEditPartBase.java index a4a961467c9c27552659f836d027a493f5eacefa..d6d6c2b50e82c69ce86d6e1cffca83b87280bbad 100644 --- a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/ElementEditPartBase.java +++ b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/ElementEditPartBase.java @@ -28,6 +28,7 @@ import org.eclipse.gef.Request; import org.eclipse.gef.RequestConstants; import org.eclipse.gef.SnapToHelper; import org.fortiss.tooling.base.model.layout.ILayoutedModelElement; +import org.fortiss.tooling.base.ui.editpart.figure.TransparentLabel; import org.fortiss.tooling.base.ui.editpart.policy.ConnectionGraphicalNodeEditPolicy; import org.fortiss.tooling.base.ui.editpart.policy.ElementLayoutEditPolicy; import org.fortiss.tooling.base.ui.editpart.policy.RemoveEditPolicy; @@ -62,7 +63,7 @@ public abstract class ElementEditPartBase<T extends ILayoutedModelElement & INam /** Creates the label figure. */ @Override public Label createLabelFigure() { - Label nameLabel = new Label(); + Label nameLabel = new TransparentLabel(); nameLabel.setForegroundColor(getForegroundColor()); nameLabel.setFont(DefaultLayoutConstants.TITLE_FONT); nameLabel.setTextAlignment(PositionConstants.LEFT diff --git a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/ExtendedLayerRootEditPart.java b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/ExtendedLayerRootEditPart.java index 4e7605156a6765d5f60d6a6aee8e01ba25461593..8642aedd4df224fe0d4de065d46a9dda861680cb 100644 --- a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/ExtendedLayerRootEditPart.java +++ b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/ExtendedLayerRootEditPart.java @@ -19,7 +19,6 @@ package org.fortiss.tooling.base.ui.editpart; import org.eclipse.draw2d.ColorConstants; import org.eclipse.draw2d.FreeformLayer; -import org.eclipse.draw2d.Graphics; import org.eclipse.draw2d.IFigure; import org.eclipse.draw2d.Layer; import org.eclipse.draw2d.LayeredPane; @@ -126,21 +125,7 @@ public class ExtendedLayerRootEditPart extends ScalableRootEditPart { /** Creates the default layer with XYLayout. */ private Layer createDefaultLayer() { - Layer l = new FreeformLayer() { - /** {@inheritDoc} */ - @Override - public void paint(Graphics graphics) { - // TODO Auto-generated method stub - super.paint(graphics); - } - - /** {@inheritDoc} */ - @Override - protected void paintChildren(Graphics graphics) { - // TODO Auto-generated method stub - super.paintChildren(graphics); - } - }; + Layer l = new FreeformLayer(); l.setOpaque(false); l.setLayoutManager(new XYLayout()); l.setBackgroundColor(ColorConstants.white); diff --git a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/figure/TransparentLabel.java b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/figure/TransparentLabel.java new file mode 100644 index 0000000000000000000000000000000000000000..0b010137468197989e15116fc679afb31258de82 --- /dev/null +++ b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/figure/TransparentLabel.java @@ -0,0 +1,68 @@ +/*--------------------------------------------------------------------------+ +$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.draw2d.IFigure; +import org.eclipse.draw2d.Label; +import org.eclipse.draw2d.TreeSearch; +import org.eclipse.swt.graphics.Image; + +/** + * A label that is transparent for the mouse location interpretation. + * + * @author hoelzl + * @author $Author$ + * @version $Rev$ + * @ConQAT.Rating RED Hash: + */ +public class TransparentLabel extends Label { + + /** Constructor. */ + public TransparentLabel() { + super(); + } + + /** Constructor. */ + public TransparentLabel(String text) { + super(text); + } + + /** Constructor. */ + public TransparentLabel(Image image) { + super(image); + } + + /** Constructor. */ + public TransparentLabel(String text, Image image) { + super(text, image); + } + + /** {@inheritDoc} */ + @Override + public IFigure findFigureAt(int x, int y, TreeSearch search) { + // implements transparency + return null; + } + + /** {@inheritDoc} */ + @Override + public boolean isOpaque() { + // implements transparency + return false; + } +}