• Post Reply Bookmark Topic Watch Topic
  • New Topic

Undo manager for awt application which can undo all user action

 
Ankush Seth
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi..everyone..i am working on an application which needs undo manager so that all the user actions such as....passing focus, changing scroll, pressing buttons,etc.
i have managed to undo only the focus system but want to undo user actions. can any one help me with this i have tried very much on this.Hope i will get a solution here.
Thanks in advance.!
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out http://docs.oracle.com/javase/6/docs/api/javax/swing/undo/UndoManager.html
If that doesnt work for you, post your SSCCE code so we can figure out what you are doing wrong
 
Ankush Seth
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks very much.....but i can't use swing in my application...i can use only awt
 
Darryl Burke
Bartender
Posts: 5154
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ankush Seth wrote:i can't use swing in my application...i can use only awt

May I ask why? AWT was superseded by Swing more than 12 years ago!
 
Ankush Seth
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know that....
i can only use awt because i am working on a platform which does not supports "SWING" so kindly help
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thats a bit confusing. What platform is that?
 
Ankush Seth
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
actually i want to undone all the user action. but my limitation is that i can't use swing classes as i am working on a set top box application. and set top boxes doesn't support swing. i have achieved the undo functionality of focus subsystem with the help of STACK in java.
The requirement is that
1.When user(with tv remote in his hand) presses the back button , his previous actions are undone. for example scroll movements ,his clicks,his choices,etc one by one
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Set top box? No idea.
I am not aware of what percentage of the standard API is available on the set top box, but you can probably roll out your own undo manager

In pseudo code
1) Undo Manager will encapsulate an action stack
2) Expose do() and undo() methods (and more as required)
3) Stack will accomodate UserAction type custom objects
4) Said object will contain all the parameters required for undoing things.
5) Ideally this type of user action should implement Undoable interface which has a method undo()
6) Share UndoManager across the application
 
Ankush Seth
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you..very much
but how the user actions are added to stack eg. when you scroll down a scroll bar.
 
Darryl Burke
Bartender
Posts: 5154
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Add an AdjustmentListener to the Scrollbar?
 
Ankush Seth
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes this listener added.but how i can add this action to stack??
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You will need the scroll bar instance and the position. Encapsulate them in the custom object and add it to the undo stack.
The undo() method will programatically scroll the scroll bar instance to the given position
 
Ankush Seth
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much Maneesh.
your help is very much helpful . thanks a lot..
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are welcome.
At the risk of hijacking your thread, I am now curious about set top box development using Java. Can you share what API you are using?
 
Ankush Seth
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes sure why not.. i am using java api for television app development.
javax.tv.xlet this the source api and org.havi.ui api for UI
this one is also needed org.davic
and you can get full information about xlets from http://www.interactivetvweb.org/ this website.
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ankush
 
Ankush Seth
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my pleasure Maneesh..
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!