Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Don't show figure inside other figure compartment
Don't show figure inside other figure compartment [message #486508] Thu, 17 September 2009 21:31 Go to next message
marco  is currently offline marco Friend
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
Re: Don't show figure inside other figure compartment [message #486589 is a reply to message #486508] Fri, 18 September 2009 10:28 Go to previous messageGo to next message
Alex Shatalin is currently offline Alex ShatalinFriend
Messages: 141
Registered: July 2009
Senior Member
Hello marco,

I suggest you extending Shape instead of plain Figure and implement fillShape()/outlineShape()
methods (you can first just move current implementation into outlineShape()
method.

-----------------
Alex Shatalin
Re: Don't show figure inside other figure compartment [message #486662 is a reply to message #486589] Fri, 18 September 2009 14:32 Go to previous message
marco  is currently offline marco Friend
Messages: 82
Registered: September 2009
Member
hello

sorry but you could tell me what to change in the Java class

there is a manual eclipse ...

hello thanks
Previous Topic:Shared Editing Domain settings for drag-drop
Next Topic:Position of side affixed children is not updated properly - Bug in GMF 2.2?
Goto Forum:
  


Current Time: Fri Apr 26 10:13:23 GMT 2024

Powered by FUDForum. Page generated in 0.03365 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top