Don't show figure inside other figure compartment [message #486508] |
Thu, 17 September 2009 21:31 |
marco Messages: 82 Registered: September 2009 |
Member |
|
|
I have this problem.
When I create a new figure A that has a compartment.I create a figure B
inside figure A but figure B is not show...it's cover by figure A.
If i create a link from figure A to figure B i see the line of the link
but don't see figure B.
I used the Java class DiamondFigure
package org.eclipse.epsilon.eugenia.examples.flowchart.diagram.figur es;
import org.eclipse.draw2d.Figure;
import org.eclipse.draw2d.Graphics;
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.draw2d.geometry.PointList;
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
public class DiamondFigure extends Figure {
@Override
public void paint(Graphics graphics) {
Rectangle r = getBounds();
// Define the points of a diamond
Point p1 = new Point(r.x, r.y + r.height/2);
Point p2 = new Point(r.x + r.width/2, r.y);
Point p3 = new Point(r.x + r.width, r.y + r.height/2);
Point p4 = new Point(r.x + r.width/2, r.y + r.height - 1);
PointList pointList = new PointList();
pointList.addPoint(p1);
pointList.addPoint(p2);
pointList.addPoint(p3);
pointList.addPoint(p4);
// Fill the shape
graphics.fillPolygon(pointList);
// Draw the outline
graphics.drawLine(p1, p2);
graphics.drawLine(p2, p3);
graphics.drawLine(p3, p4);
graphics.drawLine(p4, p1);
// Move the label to the centre of the diamond
WrappingLabel label = (WrappingLabel) getChildren().get(0);
LayoutUtil.moveToCenter(label, this, graphics);
label.paint(graphics);
}
}
What should I change to make the transparent layer or to solve my problem
can make claw Figure B is on top of the figure A.
thank you very much
marco
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03365 seconds