Fixed width basic node with multiple line

I have a JGoBasicNode called
public
class WorkflowStateNode extends JGoBasicNode, in the init() method, I initialize all the common features of the WorkflowStateNode. I need the workflowStateNode to have text in the center as label, the width of the node is fixed, but the height of the node is extendable. Since the label could be long, if it is more than 6 words, it should go to next line, that is the node could wrap its label in multiple line.
How can I achieve those features with JGoBasicNode. Or I have to use JGoTextNode? the following is my initCommon method.
private void initCommon(){
setLabelSpot(JGoObject.Center);
setDrawable(new JGoRectangle());
setSize(100, 100);
setBrush(JGoBrush.makeStockBrush(Color.white));
setInsets(new Insets(4, 10, 4, 10));
setResizable(false);
setAutoResize(false);
}
it seems that the label is still in one line.

You can call JGoText.setMultiline(true) and setWrapping(true) and specify a WrappingWidth. That will cause the width of the text label to be limited to the WrappingWidth, but the height will expand as needed. But you’ll need to setAutoResize(true), so that it will automatically resize itself as you change the text string.
If you want to have a minimum width, it might be easiest to reimplement layoutChildren to make sure the background drawable shape is the minimum size you want, or else big enough, including insets, to surround the text label.

setAutoResize(true) doesn’t seem to be working for me, when I edit the text the box doesn’t expand. I have…

    JGoText label = new JGoText("hello");
    label.setLocation(new Point(200,200));
    label.setEditable(true);
    label.setEditOnSingleClick(true);
    label.setAutoResize(true);
    label.setMultiline(true);
    label.setWrapping(true);
    label.setWrappingWidth(200);
    label.setClipping(false);

You seem to be talking about JGoText.setAutoResize, rather than JGoTextNode.setAutoResize, which this topic was talking about.
By default JGoText objects have a true value for isAutoResize(). So calling setAutoResize(true) as you do should be a no-op. Hence I cannot explain the behavior you are seeing. Most JGoText objects are auto-resizing as the text is edited, as I’m sure you have seen in the sample applications.
Maybe your JGoText object is in a JGoArea whose layoutChildren method is forcing the JGoText label to be a certain size? I’m just guessing here…

Sorry for putting this in the wrong topic, I was skimming and saw the references to setMutiline(), and setWrapping().

The problem I’m talking about is that the text boxes don’t expand dynamically as the user is editing the label. Once the box gets filled up the text gets cut off. This occurs in the examples as well.

Oh, you mean while the user is editing, rather than when the Text property is set?
Yes, that’s true, we never implemented that feature. In 5.2 we have added a JScrollPane so that it is scrollable, at least. However even then the JTextComponent does not automatically increase or decrease in size.

Yup, that’s what I meant. Not really a big deal, just something that one of my testers pointed out. But, any way I could get a patch?

Well, since you don’t seem to think I exist, I don’t know if I can do that.
But I suppose I could pretend to think that you think I pretend to exist, so I’ll look at the code and see if it can easily be back-ported to 5.1.5.

No, I do think that you pretend to exist, it’s just that if I were to stop pretending, you’d be in trouble, a long with Denmark, and Shrödinger’s cat. lol

– Thanks

Actually, can you send us e-mail? It’s a couple of files.