Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import org.eclipse.wb.core.model.AbstractComponentInfo;
import org.eclipse.wb.core.model.IAbstractComponentInfo;
import org.eclipse.wb.core.model.ITopBoundsSupport;
import org.eclipse.wb.draw2d.Figure;
import org.eclipse.wb.draw2d.FigureUtils;
import org.eclipse.wb.gef.core.requests.ChangeBoundsRequest;
import org.eclipse.wb.gef.graphical.handles.Handle;
Expand All @@ -25,6 +24,7 @@
import org.eclipse.wb.gef.graphical.policies.SelectionEditPolicy;
import org.eclipse.wb.gef.graphical.tools.ResizeTracker;

import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.PositionConstants;
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.gef.Request;
Expand Down Expand Up @@ -139,7 +139,7 @@ protected void showResizeFeedback(ChangeBoundsRequest request) {
// prepare feedback bounds
Rectangle bounds;
{
Figure hostFigure = getHostFigure();
IFigure hostFigure = getHostFigure();
bounds = request.getTransformedRectangle(hostFigure.getBounds());
sanitizeBounds(bounds);
FigureUtils.translateFigureToAbsolute(hostFigure, bounds);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2011 Google, Inc.
* Copyright (c) 2011, 2025 Google, Inc. and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
Expand All @@ -12,28 +12,29 @@
*******************************************************************************/
package org.eclipse.wb.draw2d;

import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.geometry.Rectangle;

/**
* Implementation of {@link AbstractRelativeLocator} that uses some {@link Figure} as reference.
* Implementation of {@link AbstractRelativeLocator} that uses some {@link IFigure} as reference.
*
* @author lobas_av
* @coverage gef.draw2d
*/
public final class RelativeLocator extends AbstractRelativeLocator {
private final Figure m_reference;
private final IFigure m_reference;

////////////////////////////////////////////////////////////////////////////
//
// Constructors
//
////////////////////////////////////////////////////////////////////////////
public RelativeLocator(Figure reference, double relativeX, double relativeY) {
public RelativeLocator(IFigure reference, double relativeX, double relativeY) {
super(relativeX, relativeY);
m_reference = reference;
}

public RelativeLocator(Figure reference, int location) {
public RelativeLocator(IFigure reference, int location) {
super(location);
m_reference = reference;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
*******************************************************************************/
package org.eclipse.wb.gef.graphical.policies;

import org.eclipse.wb.draw2d.Figure;
import org.eclipse.wb.draw2d.Layer;
import org.eclipse.wb.gef.core.EditPart;
import org.eclipse.wb.gef.core.IEditPartViewer;
Expand Down Expand Up @@ -46,9 +45,9 @@ public GraphicalEditPart getHost() {
//
////////////////////////////////////////////////////////////////////////////
/**
* Convenience method to return the host's {@link Figure}.
* Convenience method to return the host's {@link IFigure}.
*/
protected final Figure getHostFigure() {
protected final IFigure getHostFigure() {
return getHost().getFigure();
}

Expand Down Expand Up @@ -82,17 +81,17 @@ protected Layer getFeedbackLayer() {
}

/**
* Adds the specified <code>{@link Figure}</code> to the {@link IEditPartViewer#FEEDBACK_LAYER}.
* Adds the specified <code>{@link IFigure}</code> to the {@link IEditPartViewer#FEEDBACK_LAYER}.
*/
protected final void addFeedback(Figure figure) {
protected final void addFeedback(IFigure figure) {
getFeedbackLayer().add(figure);
}

/**
* Removes the specified <code>{@link Figure}</code> to the {@link IEditPartViewer#FEEDBACK_LAYER}
* Removes the specified <code>{@link IFigure}</code> to the {@link IEditPartViewer#FEEDBACK_LAYER}
* .
*/
protected final void removeFeedback(Figure figure) {
protected final void removeFeedback(IFigure figure) {
getFeedbackLayer().remove(figure);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2011, 2024 Google, Inc.
* Copyright (c) 2011, 2025 Google, Inc. and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
Expand All @@ -13,7 +13,6 @@
package org.eclipse.wb.core.gef.policy.layout.flow;

import org.eclipse.wb.core.gef.policy.PolicyUtils;
import org.eclipse.wb.draw2d.Figure;
import org.eclipse.wb.draw2d.FigureUtils;
import org.eclipse.wb.draw2d.Polyline;
import org.eclipse.wb.gef.core.requests.AbstractCreateRequest;
Expand All @@ -25,6 +24,7 @@
import org.eclipse.wb.internal.core.utils.GenericsUtils;

import org.eclipse.draw2d.ColorConstants;
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.draw2d.geometry.Transposer;
Expand Down Expand Up @@ -373,7 +373,7 @@ public int compare(EditPart part_1, EditPart part_2) {

private void showLayoutTargetFeedback_noReference(boolean horizontal, boolean rtl) {
Polyline feedbackLine = getLineFeedback();
Figure hostFigure = getHostFigure();
IFigure hostFigure = getHostFigure();
Rectangle bounds = hostFigure.getBounds().getCopy();
FigureUtils.translateFigureToAbsolute(hostFigure, bounds);
// prepare points
Expand Down Expand Up @@ -506,8 +506,8 @@ private static Point getLocationFromRequest(Request request) {
}

/**
* @return absolute bounds of given {@link EditPart}'s {@link Figure}, transposed if needed by
* layout.
* @return absolute bounds of given {@link EditPart}'s {@link IFigure},
* transposed if needed by layout.
*/
private static Rectangle getAbsoluteBounds(boolean horizontal, EditPart editPart) {
Rectangle bounds = PolicyUtils.getAbsoluteBounds((GraphicalEditPart) editPart);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.eclipse.wb.gef.graphical.tools.ResizeTracker;

import org.eclipse.draw2d.ColorConstants;
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.PositionConstants;
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.gef.Request;
Expand Down Expand Up @@ -153,7 +154,7 @@ private void showResizeFeedback(ChangeBoundsRequest request) {
// prepare bounds
Rectangle bounds;
{
Figure hostFigure = getHostFigure();
IFigure hostFigure = getHostFigure();
bounds = request.getTransformedRectangle(hostFigure.getBounds());
FigureUtils.translateFigureToAbsolute(hostFigure, bounds.shrink(-1, -1));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ protected Color getBorderColor() {
* @return {@link Locator} that positions handles on component side.
*/
protected final Locator createComponentLocator(int direction, double percent) {
Figure reference = getHostFigure();
IFigure reference = getHostFigure();
if (direction == PositionConstants.WEST) {
return new RelativeLocator(reference, 0, percent);
} else if (direction == PositionConstants.EAST) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2011, 2024 Google, Inc. and others.
* Copyright (c) 2011, 2025 Google, Inc. and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
Expand Down Expand Up @@ -372,7 +372,7 @@ private void showMoveFeedback(ChangeBoundsRequest request) {
// is this edit parts moved by using a keyboard
boolean isKeyboardMoving = isKeyboardMoving();
// prepare dots feedback if enabled
Figure hostFigure = getHostFigure();
IFigure hostFigure = getHostFigure();
if (m_dotsFeedback == null) {
if ((useGridSnapping() || isKeyboardMoving()) && isShowGridFeedback()) {
m_dotsFeedback = new DotsFeedback<>(this, hostFigure);
Expand Down Expand Up @@ -664,7 +664,7 @@ private void showCreationFeedback(CreateRequest request) {
m_startLocation = widgetBounds.getLocation();
}
//
Figure hostFigure = getHostFigure();
IFigure hostFigure = getHostFigure();
// create dots feedback
if (m_dotsFeedback == null) {
if (useGridSnapping() || isKeyboardMoving()) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2011 Google, Inc.
* Copyright (c) 2011, 2025 Google, Inc. and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
Expand All @@ -17,6 +17,7 @@
import org.eclipse.wb.draw2d.FigureUtils;

import org.eclipse.draw2d.Graphics;
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.geometry.Rectangle;

/**
Expand All @@ -34,7 +35,7 @@ public class DotsFeedback<C extends IAbstractComponentInfo> extends Figure {
// Constructor
//
////////////////////////////////////////////////////////////////////////////
public DotsFeedback(AbsoluteBasedLayoutEditPolicy<C> layoutEditPolicy, Figure hostFigure) {
public DotsFeedback(AbsoluteBasedLayoutEditPolicy<C> layoutEditPolicy, IFigure hostFigure) {
m_layoutEditPolicy = layoutEditPolicy;
// prepare bounds to draw on client-area only
Rectangle bounds = hostFigure.getBounds().getCopy();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2011, 2024 Google, Inc.
* Copyright (c) 2011, 2025 Google, Inc. and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
Expand All @@ -13,7 +13,6 @@
package org.eclipse.wb.internal.core.gef.policy.menu;

import org.eclipse.wb.core.gef.policy.PolicyUtils;
import org.eclipse.wb.draw2d.Figure;
import org.eclipse.wb.draw2d.FigureUtils;
import org.eclipse.wb.draw2d.Layer;
import org.eclipse.wb.gef.core.IEditPartViewer;
Expand All @@ -29,6 +28,7 @@
import org.eclipse.wb.internal.core.model.menu.IMenuObjectInfo;
import org.eclipse.wb.internal.core.model.menu.MenuObjectInfoUtils;

import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.gef.EditPart;
import org.eclipse.gef.Request;
Expand Down Expand Up @@ -98,7 +98,7 @@ public org.eclipse.wb.gef.core.EditPart getTargetEditPart(Request request) {
return null;
}
// prepare location in figure
Figure figure = getHostFigure();
IFigure figure = getHostFigure();
Point location = ((DropRequest) request).getLocation().getCopy();
FigureUtils.translateAbsoluteToFigure2(figure, location);
// if request's mouse location are in middle 1/3 height (width) of figure then return getHost()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.eclipse.wb.internal.swt.model.widgets.IControlInfo;

import org.eclipse.draw2d.ColorConstants;
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.PositionConstants;
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.gef.Request;
Expand Down Expand Up @@ -151,7 +152,7 @@ private void showResizeFeedback(ChangeBoundsRequest request) {
// prepare bounds
Rectangle bounds;
{
Figure hostFigure = getHostFigure();
IFigure hostFigure = getHostFigure();
bounds = request.getTransformedRectangle(hostFigure.getBounds());
FigureUtils.translateFigureToAbsolute(hostFigure, bounds);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2011, 2024 Google, Inc. and others.
* Copyright (c) 2011, 2025 Google, Inc. and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
Expand Down Expand Up @@ -28,6 +28,7 @@

import org.eclipse.draw2d.ColorConstants;
import org.eclipse.draw2d.Graphics;
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.TextUtilities;
import org.eclipse.draw2d.geometry.Dimension;
import org.eclipse.draw2d.geometry.Interval;
Expand All @@ -51,7 +52,7 @@ public final class ColumnHeaderEditPart<C extends IControlInfo> extends Dimensio
////////////////////////////////////////////////////////////////////////////
public ColumnHeaderEditPart(ITableWrapLayoutInfo<C> layout,
TableWrapColumnInfo<C> column,
Figure containerFigure) {
IFigure containerFigure) {
super(layout, column, containerFigure);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

import org.eclipse.wb.core.gef.header.Headers;
import org.eclipse.wb.core.gef.header.IHeaderMenuProvider;
import org.eclipse.wb.draw2d.Figure;
import org.eclipse.wb.draw2d.FigureUtils;
import org.eclipse.wb.gef.core.EditPart;
import org.eclipse.wb.gef.core.tools.ParentTargetDragEditPartTracker;
Expand All @@ -27,6 +26,7 @@
import org.eclipse.wb.internal.rcp.model.forms.layout.table.TableWrapDimensionInfo;
import org.eclipse.wb.internal.swt.model.widgets.IControlInfo;

import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.gef.Request;
import org.eclipse.gef.RequestConstants;
Expand All @@ -52,7 +52,7 @@ public abstract class DimensionHeaderEditPart<C extends IControlInfo> extends Gr
////////////////////////////////////////////////////////////////////////////
protected final ITableWrapLayoutInfo<C> m_layout;
protected final TableWrapDimensionInfo<C> m_dimension;
private final Figure m_containerFigure;
private final IFigure m_containerFigure;

////////////////////////////////////////////////////////////////////////////
//
Expand All @@ -61,7 +61,7 @@ public abstract class DimensionHeaderEditPart<C extends IControlInfo> extends Gr
////////////////////////////////////////////////////////////////////////////
public DimensionHeaderEditPart(ITableWrapLayoutInfo<C> layout,
TableWrapDimensionInfo<C> dimension,
Figure containerFigure) {
IFigure containerFigure) {
m_layout = layout;
m_dimension = dimension;
m_containerFigure = containerFigure;
Expand All @@ -88,7 +88,7 @@ public final TableWrapDimensionInfo<C> getDimension() {
}

/**
* @return the offset of {@link Figure} with headers relative to the absolute layer.
* @return the offset of {@link IFigure} with headers relative to the absolute layer.
*/
public final Point getOffset() {
Point offset = new Point(0, 0);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2011, 2024 Google, Inc. and others.
* Copyright (c) 2011, 2025 Google, Inc. and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
Expand Down Expand Up @@ -28,6 +28,7 @@

import org.eclipse.draw2d.ColorConstants;
import org.eclipse.draw2d.Graphics;
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.TextUtilities;
import org.eclipse.draw2d.geometry.Dimension;
import org.eclipse.draw2d.geometry.Interval;
Expand All @@ -51,7 +52,7 @@ public final class RowHeaderEditPart<C extends IControlInfo> extends DimensionHe
////////////////////////////////////////////////////////////////////////////
public RowHeaderEditPart(ITableWrapLayoutInfo<C> layout,
TableWrapRowInfo<C> row,
Figure containerFigure) {
IFigure containerFigure) {
super(layout, row, containerFigure);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2011, 2023 Google, Inc.
* Copyright (c) 2011, 2025 Google, Inc. and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
Expand All @@ -13,7 +13,6 @@
package org.eclipse.wb.internal.rcp.gef.policy.forms.layout.grid.header.selection;

import org.eclipse.wb.core.gef.header.AbstractHeaderSelectionEditPolicy;
import org.eclipse.wb.draw2d.Figure;
import org.eclipse.wb.draw2d.FigureUtils;
import org.eclipse.wb.gef.graphical.handles.Handle;
import org.eclipse.wb.gef.graphical.handles.MoveHandle;
Expand Down Expand Up @@ -91,7 +90,7 @@ protected final TableWrapDimensionInfo<C> getDimension() {
private class HeaderMoveHandleLocator implements Locator {
@Override
public void relocate(IFigure target) {
Figure reference = getHostFigure();
IFigure reference = getHostFigure();
Rectangle bounds = reference.getBounds().getCopy();
FigureUtils.translateFigureToFigure(reference, target, bounds);
target.setBounds(bounds);
Expand Down
Loading
Loading