[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.gmf] Re: SlidableAnchor and custom polygon as NodeFigure

Thanks for your help,
but what is the EventFigure class?

protected NodeFigure createNodePlate() {
 final DefaultSizeNodeFigure result = new
 DefaultSizeNodeFigure(getMapMode().DPtoLP(40),getMapMode().DPtoLP(40)){

 @Override
 public PointList getPolygonPoints(){

//just some way to get the polygon points
Rectangle bounds = new Rectangle(getBounds());
PointList ptList = new PointList();
int[] scalePoints = ((EventFigure)getPrimaryShape()).scalePointList();
for (int i=0;i<scalePoints.length;i+=2){
ptList.addPoint(scalePoints[i]+bounds.x, scalePoints[i+1]+bounds.y);
} ptList.addPoint(scalePoints[0]+bounds.x, scalePoints[1]+bounds.y); return ptList;
}


 };
 return result;
}

hope it helps
Frank


regards, Cristian