+++ /dev/null
-import java.awt.*;\r
-import java.util.*;\r
-\r
-import com.baselet.control.Constants;\r
-import com.baselet.control.Utils;\r
-\r
-@SuppressWarnings("serial")\r
-public class <!CLASSNAME!> extends com.umlet.custom.CustomElement {\r
-\r
- public CustomElementImpl() {\r
- \r
- }\r
- \r
- @Override\r
- public void paint() {\r
- Vector<String> textlines = Utils.decomposeStrings(this.getPanelAttributes());\r
- \r
- /****CUSTOM_CODE START****/\r
-//This is a tutorial for a self resizing component \r
-//In addition you are able to resize at manually\r
-//As soon as it is resized manually a new text is\r
-//added to the property panel\r
-setAutoresize(20,20,10);\r
-\r
-int y=textHeight();\r
-\r
-boolean center = true;\r
-for(int i = 0; i < textlines.size(); i++) {\r
- String textline = textlines.get(i);\r
- if(textline.equals("--")) {\r
- drawLineHorizontal((int) (y-textHeight()*0.7));\r
- center = false;\r
- if (!isManualResized()) height -= (int) (textHeight()*0.75);\r
- y += textHeight()*0.3;\r
- }\r
- else {\r
- if (center) y += printCenter(textline,y); \r
- else y += printLeft(textline,y);\r
- }\r
-}\r
-\r
-drawRectangle(0,0,onGrid(width),onGrid(height));\r
- /****CUSTOM_CODE END****/\r
- }\r
-}
\ No newline at end of file