Cant generate code after adding BasicFont to a custom figure [message #149474] |
Fri, 07 September 2007 15:48 |
Eclipse User |
|
|
|
Originally posted by: slorenc.infogix.com
I have a custom figure with a label in it. Every time I attempt to add
something to the figure definition and regenerate the code the code
generated has compilation errors.
The errors are caused by the lack of type for label (name) figure. As you
see the
private fFigureASourceNameFigure;
declaration is missing the type.
public class CustomASourceFigure extends
com.xyz.controls.diagram.figures.CustomASourceFigure {
/**
* @generated
*/
private fFigureASourceNameFigure;
/**
* @generated
*/
public CustomASourceFigure() {
Here is the relevant portion of .gmfgraph definition defining my figure.
The dashes indicate depth in the tree.
--------------
Canvas diagram
- Figure Gallery Default
--Figure Descriptor CustomAFigure (Name=CustomAFigure)
---Custom Figure CustomAFigure (Descriptor=Figure Descriptor CustomAFigure,
Name=CustomAFigure,QualifiedClassName=com.xyz.figures.Custom AFigure)
----(If I add 'BasicFont' here the error free code can't be generated.)
---Child Access getFigureANameFigure (Accessor=getFigureANameFigure,
Figure=Label ANameFigure)
--Node A (CustomAFigure) properties are (Affixed Parent Side=NONE, Content
Pane=, Figure=Figure Descriptor CustomAFigure, Name=A, Resize
Constraint=NSEW)
--Diagram Label AName (Accessor=Child Access getFigureANameFigure, Affixed
Parent Side=NONE, Container=, Content Pane=, Element Icon=false,
External=false, Figure=,Name=AName, ResizeConstraint=NSEW)
My custom figure implementation com.xyz.figures.CustomAFigure extends
org.eclipse.draw2d.ImageFigure. In the constructor I load the image and set
it in figure and specify alignment to NORTH.
My question then is how do I need to define this label so that it:
1) appears on top of the icon - it does it now. My domain model defines an
object with 'name' attribute and that's the value I am showing on the icon.
2) doesn't occupy the whole icon so I can click on the icon outside of text
and have it open some editor. Currently I have to double click and then
click to edit the label and I can't open the editor for object representing
icon.
3) have smaller font for the label.
Thanks,
Swavek
|
|
|
Powered by
FUDForum. Page generated in 0.02840 seconds