@@ -55,10 +55,12 @@ public class AddText extends BuildingBlock {
5555 public AddText (Main Main ){
5656 super ("Text" , Main );
5757 setTextFont (Main .sig .newFont (UIManager .getDefaults ().getFont ("TabbedPane.font" ).getFamily (), "plain" , 12 , "#000000" ));
58+ setX (20 );setY (20 );
5859 }
5960 public AddText (String name ,Main Main ){
6061 super (name , Main );
6162 setTextFont (Main .sig .newFont (UIManager .getDefaults ().getFont ("TabbedPane.font" ).getFamily (), "plain" , 12 , "#000000" ));
63+ setX (20 );setY (20 );
6264 }
6365
6466 /**
@@ -67,18 +69,7 @@ public AddText(String name,Main Main){
6769 public String getText () {
6870 return text ;
6971 }
70- /**
71- * @return the x coord
72- */
73- public int getX () {
74- return x ;
75- }
76- /**
77- * @return the y coord
78- */
79- public int getY () {
80- return y ;
81- }
72+
8273 /**
8374 * @return the textFont
8475 */
@@ -103,18 +94,7 @@ public int getAngdeg() {
10394 public void setText (String text ) {
10495 this .text = text ;
10596 }
106- /**
107- * @param x the x coord to set
108- */
109- public void setX (int x ) {
110- this .x = x ;
111- }
112- /**
113- * @param y the y coord to set
114- */
115- public void setY (int y ) {
116- this .y = y ;
117- }
97+
11898 /**
11999 * @param textFont the textFont to set
120100 */
@@ -639,7 +619,7 @@ public BufferedImage display(BufferedImage image){
639619 if (getChildCount () > 0 ){
640620 //send this to each child to rerender(filter)
641621 for (int i = 0 ; i < getChildCount (); i ++){
642- if (!((( BuildingBlock ) ((DefaultMutableTreeNode ) getChildAt (i )).getUserObject ()) instanceof com . inverseinnovations . VisualMALSignatureDesigner . BuildingBlock . Filter . Filter )){
622+ if (!((BuildingBlock ) ((DefaultMutableTreeNode ) getChildAt (i )).getUserObject ()). isFilter ( )){
643623 image = Main .sig .filter .composite (image , ((BuildingBlock ) ((DefaultMutableTreeNode ) getChildAt (i )).getUserObject ()).display (image ), 0 , 0 );
644624 }
645625 else {//if filter
@@ -656,4 +636,11 @@ public BufferedImage display(BufferedImage image){
656636 protected BufferedImage generateImage (){
657637 return Main .sig .makeText (getText (), getX (), getY (), getTextFont (), getAlign (), getAngdeg ());
658638 }
639+ @ Override
640+ public String generateScript (){
641+ return "sig.makeText(\" " +getText ()+"\" , " +getX ()+", " +getY ()+", " +generateFont ()+", " +getAlign ()+", " +getAngdeg ()+")" ;
642+ }
643+ protected String generateFont (){
644+ return "sig.newFont(\" " +getTextFont ().getFontname ()+"\" , \" " +getTextFont ().getStyle ()+"\" , " +getTextFont ().getSize ()+", \" " +getTextFont ().getHexColor ()+"\" )" ;
645+ }
659646}
0 commit comments