Undo/redo issue

Im trying to implement undo/redo for my application by using for the
most part the code from your Processor example. For both the undo and
redo menu item. My issue now is that the methods in AppAction i.e.
canAct() and updateEnabled() are only called when a view is opened. If
I drag a label or node or edit a label or node. Any operation for that
matter the methods are no longer called. What would produce such a
result? Thank you for your time

AppAction undoAction = new AppAction(“Undo”, frame)
{
public void actionPerformed(ActionEvent e) getView().getDocument().undo(); AppAction.updateAllActions(); }
public boolean canAct()
{
return super.canAct() && (getView().getDocument().canUndo()); }
public void updateEnabled()
{
super.updateEnabled();
if (jMenuItem_Undo != null && getView() != null)

jMenuItem_Undo.setText(getView().getDocu ment().getUndoManager().getUndoPresentationName());
}
};

Hmmm. Maybe the ProcessView.viewChanged method isn’t being called because the view is no longer its own JGoViewListener. That’s what would get called whenever anything happens in a JGoView–it would call AppAction.updateAllActions(), which in turn would call AppAction.updateEnabled() on each AppAction, which in turn would call canAct().

Thank you for guiding me in the right direction walter. I still have a
couple more issues. For some reason it cannot pick up changes made to
the text in the labels and nodes. I mean if you edit the labels or
nodes I cannot trigger the undo for the menu. However if I first drag
the label and change the text from A to B. I can then click undo.
However rather than just changing the text from A to B it also places
the label in the original spot. So it performs two actions with one
undo click. Also if I drag a label then change the text from A to B to
C to D and click undo it drags the label back to its original spot and
changes the text back to A. One more item the Undo seems to works fine
when I drag nodes or labels however the redo does not seem to place the
items back to their original spot most of the time.

Thanks again for your time

Sounds like transactions either aren’t being paired up properly, or aren’t being nested properly. I’m just guessing, though.

sorry is that in regards to the undo or the redo issue? And where would
I be looking to see “if transactions either aren’t being paired up
properly, or aren’t being nested properly”?

There seems to be a bug involving undo and redo of text changes. Contact us by e-mail for a new kit (5.15 beta).

I placed the following code in copyNewValueForRedo and changeValue in
public class FlowLabel extends JGoLinkLabel in order to see why changes
in labels are not triggering undo/redo and the following is never called

case ChangedText:
System.out.println(“ChangedText”);
return;

The default: value is called for both methods when I update the label and the flag value i.e. e.getFlags() is 1

Walter would you know what might be causing this?
Thanks again for everything