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
15 changes: 0 additions & 15 deletions org.eclipse.wb.core/src-draw2d/org/eclipse/wb/draw2d/Figure.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
*******************************************************************************/
package org.eclipse.wb.draw2d;

import org.eclipse.wb.internal.draw2d.FigureCanvas;
import org.eclipse.wb.internal.draw2d.FigureVisitor;

import org.eclipse.draw2d.Graphics;
Expand Down Expand Up @@ -74,20 +73,6 @@ public final void accept(FigureVisitor visitor, boolean forward) {
}
}

////////////////////////////////////////////////////////////////////////////
//
// Parent/Children
//
////////////////////////////////////////////////////////////////////////////

/**
* @return the {@link FigureCanvas} that contains this {@link Figure}.
* @noreference @nooverride
*/
public FigureCanvas getFigureCanvas() {
return ((Figure) getParent()).getFigureCanvas();
}

////////////////////////////////////////////////////////////////////////////
//
// Figure
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
*******************************************************************************/
package org.eclipse.wb.draw2d;

import org.eclipse.wb.internal.draw2d.FigureCanvas;
import org.eclipse.wb.internal.draw2d.RootFigure;

import org.eclipse.draw2d.IFigure;
Expand Down Expand Up @@ -92,18 +91,6 @@ public static final void translateFigureToAbsolute2(IFigure figure, Translatable
}
}

/**
* Translates given {@link Translatable} from this {@link Figure} local coordinates to absolute (
* {@link RootFigure} relative) coordinates.
*/
public static final void translateFigureToCanvas(Figure figure, Translatable translatable) {
translateFigureToAbsolute2(figure, translatable);
FigureCanvas figureCanvas = figure.getFigureCanvas();
translatable.performTranslate(
-figureCanvas.getViewport().getHorizontalRangeModel().getValue(),
-figureCanvas.getViewport().getVerticalRangeModel().getValue());
}

/**
* Translates given {@link Translatable} from this absolute ({@link RootFigure}
* relative) coordinates to bounds {@link IFigure} coordinates.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ private static LightweightSystem createLightweightSystem() {
}

protected void setDefaultEventManager() {
m_rootFigure.getFigureCanvas().getLightweightSystem().setEventDispatcher(new EventManager(this));
getLightweightSystem().setEventDispatcher(new EventManager(this));
}

protected void setDefaultUpdateManager() {
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 @@ -69,17 +69,10 @@ public EventDispatcher internalGetEventDispatcher() {
// RootFigure
//
////////////////////////////////////////////////////////////////////////////
/**
* @noreference @nooverride
*/
@Override
public FigureCanvas getFigureCanvas() {
return m_figureCanvas;
}

@Override
public UpdateManager getUpdateManager() {
return getFigureCanvas().getLightweightSystem().getUpdateManager();
return m_figureCanvas.getLightweightSystem().getUpdateManager();
}

/**
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 All @@ -12,9 +12,7 @@
*******************************************************************************/
package org.eclipse.wb.gef.graphical.policies;

import org.eclipse.wb.draw2d.Figure;
import org.eclipse.wb.draw2d.FigureUtils;

import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.geometry.Dimension;
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.draw2d.geometry.Rectangle;
Expand Down Expand Up @@ -156,14 +154,14 @@ private boolean isEditing() {
}

/**
* Updates location of {@link Text} widget in host {@link Figure}.
* Updates location of {@link Text} widget in host {@link IFigure}.
*/
private void relocateTextWidget() {
// prepare absolute bounds of host figure
Rectangle hostBounds;
{
hostBounds = getHostFigure().getBounds().getCopy();
FigureUtils.translateFigureToCanvas((Figure) getHostFigure().getParent(), hostBounds);
getHostFigure().translateToAbsolute(hostBounds);
}
// prepare text size
org.eclipse.swt.graphics.Point textSize;
Expand Down Expand Up @@ -191,7 +189,7 @@ private void relocateTextWidget() {

/**
* @param hostBounds
* the absolute bounds of host {@link Figure}.
* the absolute bounds of host {@link IFigure}.
* @param textSize
* the size of {@link Text} widget.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ protected final RootFigure getRootFigureInternal() {
public void setEditDomain(EditDomain domain) {
super.setEditDomain(domain);
m_eventManager = new EditEventManager(m_canvas, domain, this);
getRootFigureInternal().getFigureCanvas().getLightweightSystem().setEventDispatcher(m_eventManager);
m_canvas.getLightweightSystem().setEventDispatcher(m_eventManager);
}

/**
Expand Down
Loading