blob: fda8a4ce77b0c1d7343c24fd5deefeda1d331758 [file] [log] [blame]
/*********************************************************************
* Copyright (c) 2008 The University of York.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
**********************************************************************/
package org.eclipse.epsilon.eugenia.examples.flowchart.diagram.figures;
import org.eclipse.draw2d.Graphics;
import org.eclipse.draw2d.RectangleFigure;
import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
public class SquareFigure extends RectangleFigure {
@Override
public void paint(Graphics graphics) {
// Fill shape and draw outline
super.paint(graphics);
// Move label to the center of the shape
WrappingLabel label = (WrappingLabel) getChildren().get(0);
LayoutUtil.moveToCenter(label, this, graphics);
label.paint(graphics);
}
}