When to call fireTableRow events in a TableModel?

Hoi All,
Could somebody confirm that the statement are true?
Propagate fireTableRowsUpdated in a TableModel AFTER+ updating the row in the model so that getValueAt and getRowValue(rowIndex) in the receiving view can fetch the update row based on the received row index in the fireTableRowsUpdated event using the view's getModel().getValueAt().
Propagate fireTableRowsDeleted in a TableModel BEFORE+ removing the row from the model so that the receiving view can fetch the to-be-deteled row based on the received row index in the fireTableRowsDeleted event using the view's getModel().getValueAt().
Propagate fireTableRowsInserted in a TableModel AFTER+ adding the row to the model so that the receiving view can fetch the inserted row based on the received row index in the fireTableRowsInserted event using the view's getModel().getValueAt().
Thnx
A

Hi Camickr,
In Java5 a fireTableModelEvent that is fired from a tableModel will 'directly'be processed by the JTable view (it is not queued) , so therefore the JTable view will 'see/view 'the tablemodel as it is just before fire-ing the tablemodelevent: therefore it is significant the exact place where you are invoking the fireEvent. This has caused me grief in my Java5 implementation because I've build a stack of up to 3 table models ( using Java 5 Generics) :
1) generic table model
2) generic table filter
3) generic table sorter
where I can make combinations like :
* only table model
* table model + filter model
* table model + filter model + sorting model
each model must fire the same (mapped) row numbers for insert/delete and update table model events becuase the view (JTable) doesn't know which model combination is used. I also wrote a generic table selection that also receives the table model event from the top table model stack (so either sorter, filter or table model) .
My idea was that amendments to the table model ( there is always a table model a to bottum of that above mentioned stack) will propagate through filter model which maps the table model first and last row event which propagate to the filtered row number to the sorting model that maps the table model event row numbers from the filter to a mapped row number based on the sorting of the rows (in the filtered table model) which propagate then finally to the JTable view.
So far so good for Java5.
Now back to your remark "new event gets generated" suggests that an async event is generated, queued onto the event thread. Is this new in Java6 or can you point me to some articles and/or code/documentation that describes this process?
Looking forward to your reply.
Andr�

Similar Messages

  • Lync Phones Disconnect Events are Firing when a call is answered

    Im working with Lync client SDk 2013. I am trying to write a simple desktop application to determine when a call is Ringing, Answered, and Disconnected. I testing my application using Lync Desk phone (polycom phones). When i call my Lync phone, i get a "Notified"
    event, and when That call is answered, i get a "Disconnected" event.
    private static LyncClient _client;
    private static void Main()
    _client = LyncClient.GetClient();
    _client.ConversationManager.ConversationAdded += ConversationManager_ConversationAdded;
    _client.ConversationManager.ConversationRemoved += ConversationManager_ConversationRemoved;
    Console.ReadLine();
    static void ConversationManager_ConversationAdded(object sender, ConversationManagerEventArgs e)
    e.Conversation.Modalities[ModalityTypes.AudioVideo].ModalityStateChanged += Program_ModalityStateChanged;
    static void Program_ModalityStateChanged(object sender, ModalityStateChangedEventArgs e)
    Console.WriteLine("Modality state changed "+ String.Format("{0} => {1}", e.OldState, e.NewState));
    static void ConversationManager_ConversationRemoved(object sender, ConversationManagerEventArgs e)
    //....some code.
    }output from this code isModality state changed Disconnected => NotifiedModality state changed Notified=> DisconnectedI did come across few nice articles, but those don't seem to help me.http://blog.thoughtstuff.co.uk/2013/01/tracking-lync-conversations-in-code/http://msdn.microsoft.com/en-us/library/office/hh345194(v=office.14).aspxIs there any way to determine when the call is answered and disconnected?Thanks

    Hi,
    You might post the issue on Lync MSDN forum and more developing expert will help to verify if this can be achieved using Lync SDK. Thank you for your understanding.
    http://social.msdn.microsoft.com/Forums/en-US/communicatorsdk/threads
    Best Regards,
    Eason Huang
    Eason Huang
    TechNet Community Support

  • HT1918 Hello!  Staff of E4 Group JSC use Apple devices for call, reading email and calendars. When the user open event in calendar of iPhone or iPad, he does not see attachments (picture №1, picture №2). But it is possible on Blackberry (picture №3).

    Hello!
    Staff of E4 Group JSC use Apple devices for call, reading email and calendars. When the user open event in calendar of iPhone or iPad, he does not see attachments (picture №1, picture №2). But it is possible on Blackberry (picture №3). How user of Apple can see these attachments? Recommend please any apps for it.

    Hello!
    Staff of E4 Group JSC use Apple devices for call, reading email and calendars. When the user open event in calendar of iPhone or iPad, he does not see attachments (picture №1, picture №2). But it is possible on Blackberry (picture №3). How user of Apple can see these attachments? Recommend please any apps for it.

  • DLL Wrapper works when functions called out of main(), not from elsewhere?

    Hello all,
    I am currently trying the JSAsio wrapper out ( http://sourceforge.net/projects/jsasio )
    Support on this project is nearly unexisting and a lot of people seem to complain that it doesn't work well.
    It works very nicely here, I wrote a few test classes which called some functions (like playing a sound or recording it) and had no problems whatsoever.
    These test classes were all static functions and ran straight out of the main() method and printed some results to the console.
         public static void main(String[] args)
              boolean result = callFunction();
              .. end..
         public static boolean callFunction()
              initASIO();
              openASIOLine();
              return true;
         }The results were all great!
    Then I tried to implement these test classes into my swing-based applications. So I want to call these same functions, as in the test classes, as a result of any user action (for example, selecting the asio driver in a combobox) But then these asio driver functions just stop to work. I get errors saying that the ASIO driver is not available. (meaning that the dll wrapper loads the wrong asio driver or can't load one at all)
    The library path and classpath are all set correctly, exactly the same as the test classes. Even copied the test code word for word in to my swing applications but it still will not work. I am calling these functions in a new Thread, and even put them in a static methods to try and get that working. When calling these asio methods from the main() method AFTER I set up my components gives me the desired results as well. But as soon as I call these same methods (which are in the same class) from a swing event, it fails;
    public class ASIOTest
         public static void main(String[] args)
              ASIOTest test = new ASIOTest();
              test.callFunction(); // <-- WORKS
         public ASIOTest()
              initializeComponents();
         private void initializeComponents()
              frame = new JFrame();
              choices = new JComboBox();
              choices.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent event)
                     // user made selection
                    new Thread(
                            new Runnable() {
                                public void run() {
                                    try
                                         callFunction(); // <-- DOES NOT WORK
                                    catch (Exception e)
                                        e.printStackTrace();
                            }).start();
         public void callFunction()
              initASIO();
              openASIOLine();
    }Is there something fundamental I am missing here?
    For what reasons can an application which uses JNI functions go wrong when working in a swing enviroment? (and out of a static context, although this does not seem to make any difference, eg. when calling these functions from static methods inside another class, inside a new thread when the user has generated an event)
    I am hoping someone could point me in the right direction :-)
    Thank you in advance,
    Steven
    Edited by: dekoffie on Apr 21, 2009 11:11 AM
    Edited by: dekoffie on Apr 21, 2009 11:16 AM

    jschell wrote:
    Two applications.
    And you probably run them two different ways.
    The environment is different so one works and the other doesn't.Thank you for your fast reply!
    Well, I am running the "updated" version from the same environment; I copied the jframe, and a jcombobox into my original test class which only ran in the java console. Consider my second code example in my original post as the "updated" version of the first code example. And as I pointed out, it works fine when I call the jni functions in the main method, but not when I call it from inside the ActionListener.
    Or am I again missing something essential by what you mean with a different environment? The classpath and the working directory is exactly the same, as is the Djava.library.path option. :-)
    Thanks again!

  • How to call server event in DO INIT method of view

    Folks,
    I have declared a server event in the view and when I am trying to call that event in DO INIT method of view , it is not firing the event .
    <i><b>
      public void wdDoInit()
        //@@begin wdDoInit()
        // set icon file names
        wdContext.currentContextElement().setIconLeftArrow("topLvlScrollerLeft.gif");
         wdContext.currentContextElement().setIconRightArrow("topLvlScrollerRight.gif");
        // hide display when errors during startup
         if(wdContext.currentContextElement().getErrorDuringInit())
              wdThis.wdFirePlugOutEmpty();
         wdThis.wdGetDaylyChangeModeAction();</b></i>

    I have created a action event
    <i><b>  public void onActionDaylyChangeMode(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionDaylyChangeMode(ServerEvent)
         wdThis.wdGetVcCatRecordEntryInterfaceController().blcEvent(VcCatRecordEntry.ACTION_CHANGE_MODE);
         wdContext.currentContextElement().setSelectedTab("TabCatRecordEntryDay");
         wdContext.currentContextElement().setTemp("Changed Tab");
        //@@end
      }</b></i>

  • Handling EDT issues when listening to model events with ModelViewPresenter

    I'm planning on using model-view-presenter (passive screen/humble dialog variant) http://martinfowler.com/eaaDev/PassiveScreen.html as the basis for my Swing application.
    view <-> presenter <-> model
    The view is very thin and dumb and only shows what presenter tells it to. Presenter listens to UI events from the view, updates the model based on them, listens to model update events, and reads view state and updates view state.
    I'm now searching for a good practise for handling EDT-threading problem. The model is inherently multithreaded in the sense that we have several threads running concurrently. They for example fetch data from different sources and update the model accordingly. An event is created, presenter listens to it and updates the view.
    There's also operations that the user initiates. Those start in EDT, presenter does some actions on the model and possibly updates the view state as a result. If the action is fast, the whole thing can be done in EDT. If the operation takes a long time, the processing needs to jump out of EDT at some point to not block the UI.
    When thinking about the events that are created from model due to some background thread, where should we jump back to EDT? There's options:
    a) jump to EDT when presenter updates the view
    view (EDT) <- presenter (either EDT or other thread) <- model (either EDT or other thread)
    b) jump to EDT when moving to presenter layer
    view (EDT) <- presenter (EDT) <- model (either EDT or other thread)
    a)
    - could be implemented by creating an AOP aspect for all View interfaces(?) The aspect would jump to EDT if not there yet always when any method of the interface is called
    - if one ModelEvent is received in non-EDT thread in Presenter, and 15 different View setters need to be called to update the view state, causes 15 separate SwingUtilities.invokeLater() calls...problem?
    - model events and eventlisteners are straight forward to implement. Presenter and model do not need to be aware of Swing (existence of event dispatch thread)
    - Presenter is multithreaded and presenter objects need to be implemented so that threading problems do not occur
    b)
    - could be implemented for example by creating special model EventListener implementations that jump back to EDT when event is received
    - model events and eventlisteners are not as straightforward to do as with a). Somewhere the events need to jump to EDT (event source or listener) and you cannot code just "simple plain" listeners and event sources
    - Presenter needs to be aware of Swing (existence of event dispatch thread and need to jump back to it when events come from model) at least in the sense that it uses the correct EventListener implementations
    - View interface could still check that thread = EDT when methods are called (using similar AOP) to ensure threading rules are not broken
    - Presenter can be single threaded (always in EDT) and presenter implementer does not need to worry as much about threading
    - note that above point requires that user-initiated long running operations, that can't be run in EDT, need to jump from EDT the model layer. If view initiates new non-EDT threads (for example using SwingWorker), Presenter still does have multiple threads running on it (although only "one way", from view to model) and needs to be made threadsafe. This is starting to sound bad, but even if Presenter is single threaded only "one way", it may still be easier to implement than presenter that is completely multithreaded?
    I think major point in deciding is the difficulty of creating thread safe Presenters. Thread safe code is notoriously difficult to implement and even things that seem trivial at first sight can cause big problems. I can't help thinking that since the application's core is already multithreaded by nature, how much more difficult can it be to make the Presenters thread safe as well? Presenters should be quite simple in any case, can receiving events from model and calling a few setters on the view cause threading problems?
    Note that this problem is not limited to programs where background threads update the data....any program where some long running operations are run outside of EDT, and may cause events that are listened to in some presenter, has to solve this issue.
    Any views or ideas?

    RickyT wrote:
    Hello Helpful Nokia Users,
    When I am using my BH 103 blue tooth stereo earphones to listen to music on my N900, the sound drops out for about half a second (or less) then the music sounds slower (like a record player that has been slowed down) for about 4 seconds, then goes back to normal. This sometimes happens on each song, one after the other, sometimes it is just @ random times.
    This NEVER happens when using plug in head phones or when I hook it up to my stereo.
    The BH 103 are about 2 years old.... would the battery be failing? Causing them to run out of power super quickly? My N95 8GB used to beep when the battery in the earphones was low, would the N900 be "pausing" instead?
    Are the BH 103 not compatiable with the N900.... even though Nokia store lists them as accessories. Would I be better off with a newer model of ear phones?
    Cheers for your help!
    i think its the battery issue .
    Reality is wrong....dreams are for real... 2pac .
    don't forget to hit that green kudos

  • Human task flow call back events with external web service

    Hi All,
    I have a requirement to call webservice inside human task flow. I have three participant in my human task flow. Let suppose A, B and C. When A approves then task will be assigned to B and when B approves it will go for C.
    My requirement is that, when A approves , then i need to call one external webservice to update database. For this i have enabled call back events from human task flow.
    In this way i got while loop inside my BPEL. In onTaskAssigned operation i am now trying to call external web service. My requriment is to call external service and get data from service. After getting response from the webservice, i want to assign it to next participant.
    But in this case, when user B approves, it goes to onTaskAssigned block and i am able to make external web service also but mean time, it has been assigned to User C which i do not want.
    I want Human task flow to wait for the web service response then only assign it to next participant.
    Please help.
    Regards,
    Sunil

    Hi Sunil
    Have you tried using WebServices Adapter. The usecase seems pretty straight forward. You have a WebService that has some code and some Operations to update some Database. First thing, I hope you have methods/Operations defined with request and response xsd for each operation.
    Now you define the main master payload, that should have all elements specific to your process and also few elements to store the output coming from each operation. Because response of each operation may need to go to other Task and get saved in the Payload also.
    You have like 3 Tasks. To complicate, I will assume that each Task can either Approve or Reject. And last 2 Tasks gets data from payload, previous task and also output from the WebService Operation (method).
    Task A -> Xor Gateway (Approve/Reject) -> If Approve -> Call WebServices Adapter -> Task B -> Xor Gateway(...) -> ......
    At each intersection, you can map the attributes for incoming and outgoing. Based on WebServices output also, you can have Another XOR Gateway and decide to send to Task B or do something else. So combinations of outputs of each service (task or webservice adapter) and XOR gateways, you can have a decent control on the overall flow.
    Note: I am hoping the webservices is Synchronous where you get the response immediately.
    Let me know if I am missing something.
    Thanks
    Ravi Jegga

  • TS3999 When I record calendar events on iPhone or iPad i can use a 24hour basis but not on my Macbook How can I change macbook calendar entries to 24 hour 'clock'

    When I record calendar events on my iphone or ipad I use a 24 clock, which is the basis on which my business runs. I cannot do the same on my Macbook, which is very frustrating and counter-intuitive (i.e. using am/pm). I asked my Apple support here in South Africa. The rep' said he could not answer immediately but would get back to me. I'm still waiting. Surely this is not a 'big' or 'unusual' problem? 

    I get 24hr everywhere not just in the dialog box
    Here's a calendar entry
    But I am not sure why you don't, let me put out a call for assisitance,

  • Help needed! Just want to cancel my year subscription. No answer from support via mail, noone answers when I call, support chat don't work.

    Help needed! Just want to cancel my year subscription. No answer from support via mail, noone answers when I call, support chat don't work.

    Hi there
    I'll pass your details to our Russian team and they'll contact you to assist further.
    Kind regards
    Bev

  • Why does my 3G iPhone no longer rings nor vibrates when receiving calls and text messages?

    Why does my 3G iPhone no longer rings nor vibrates when receiving calls and text messages?
    During a two weeks process, little by little I notice my phoe doesn't ring when I get a phone call.  So Far I have missed 22 calls that I am aware of.  Moreover, the phone does not alert me when I get a text message.  Sometimes I receive notice the next day that I received a call or a text message. 

    Follow the basic troubleshooting steps outlined in the user guide... reset, restore from backup, restore as new.

  • When I open an event, including flagged items, the photos appear one by one, not as thumbnails, so I can't export more than one phot at a time. How do I get iPhoto to show the thumbnails?

    When I open an event, including flagged items, the photos appear one by one, not as thumbnails, so I can't export more than one phot at a time. How do I get iPhoto to show the thumbnails?
    I've tried rebuilding the thumbnail database, but that hasn't helped.

    What version of iPhoto and system are you running?
    Try moving the Zoom slider at the bottom of the iPhoto window all the way to the left.  Does that let more than one photo display in the window?
    OT

  • HT1414 Can anyone shed some light on my problem with iPhone 5 please? I am 'stuck' in recovery mode and do EVERYTHING that's been suggested online. (Even Apple at Bondi said 'Oh...um...oh that' doesn't sound too good.') when I called them for help.

    To say that I am livid would be the greatest understatement EVER made in the ENTIRE history of the planet. Last night my iPhone 5 decided it would go into Recovery Mode. (That is.....a Black screen showing the iTunes logo, a white 'up' arrow and with the white cable/plug at the bottom of the screen).
    (Hold onto your Samsung Galaxys people - do NOT throw/give them away when you 'update (yeh right) to an iPhone).
    So I turned it off and left it off all of last night. I arrived at work this morning to 'sync/restore' it with my computer where it asked me to install the latest version of 'whatever it is the latest version of.' HOWEVER, as I do not have the administrative rights to do such things on my work computer, I was unable to do so and now I have been riding the 'Apple Merry-Go-Round' since 0630hrs (WAST). It comes up with the following message in a window on the screen:-
    'The iPhone "iPhone" could not be restored. An unknown error occurred (14).'
    Gee - thanks for that - I'd never have known unless I saw that little window!!!! The fact that my screen has frozen and I am unable to install, sync or restore anything kind of gives it away!!!
    'Just go to the nearest Apple Store' I hear you say. That is a 'tad' hard as I work in The Pilbara Region of North West, Western Australia (for 4+ weeks at any one time) and won't be back in 'civilisation' until next Monday week (10th of Feb, 2014)........Talk about being held to ransom by technology!! I have asked other people at work (who ALL have iPhones) and when I showed them the screen (& the whole ridiculous process) they screwed their faces up as they had never seen such a thing. Some people NEVER get asked to update/install anything on their phones.....So, I have to wonder why mine 'asks me'.......constantly.
    I fear that my 'Apple' is not an apple but that it is actually a 'Lemon.'
    Hey 'Apple' - don't let me get a hold of you!!
    Oh yeh - the opening hours actually say Sun 10:00am til 4:00pm or even 6:00pm in some places.......how convenient - when you call (them on their landline FROM a landline) you get the engaged signal!

    Thanks for that 'sberman' - because my iPhone is backed-up to my work computer (only at this stage) I have had to call our IT Department in Adleaide. (4 times this morning). The last guy managed to get the phone into 'DFU Mode' - no more recovery mode screen - (kind of 'asleep' perhaps) from my understanding of same. I am awaiting a call again from IT so they can get my computer to actually recognise my iPhone on the C Drive. This also happened to  one of my colleagues in Newman (WA). She got so frustrated with the whole process that she bought another phone the next time she was in 'civilisation.' She hasn't had any problems since. (Cross fingers).
    Thanks again, Sandra2474.

  • I just downloaded the latest version of firefox (5.0). Can I delete all the older versions that are still on my drive? 2) When I call up some web sites sometimes the web site comes up 3 or 4 times...how do I stop this from happening?

    I just downloaded the latest version of firefox (5.0). Can I delete all the older versions that are still on my drive?
    When I call up some web sites sometimes the web site comes up 3 or 4 times...how do I stop this from happening? For example if I click on a link the exact same link comes up 3 or 4 times and I have to manually delete all of them but one.

    Do you organise your email into separate folders, or do you just let it accumulate in the Inbox?
    I would strongly advise you not to let it sit in the Inbox.
    When you see this happening, try right-click on the affected folder, select '''Properties''' then '''Repair Folder'''.
    Large folders (actually, a folder in Thunderbird is stored as a file, so it is sensitive to file size limits set by the underlying file system) can be problematic. This is one reason not to let messages collect in one folder. I use Thunderbird's Archive folders so that accumulated mails over several years can happily coexist because they are effectively stored in many small folders. No single mail store folder then exceeds the 2GB or 4GB sizes that have been known to stress the OS. I appreciate that current builds of Thunderbird and a modern 64-bit OS should be able to cope, but practically I find it slows down when given huge files, so I err towards a pragmatic solution; a large number of not very big files.
    Archives are searchable, and a Saved Search folder can give you a virtual composite folder allowing access to the entire Archive.

  • Why is it that when I call my MIL with FaceTime I end up calling another person?

    When I call my mother in law with FaceTime, I end up calling a total stranger. I use her number from my contacts and it is the right number, it works just fine if I make a regular phone call. Today, I called her and talked to her for some time and after a while we decided to switch to FaceTime. While on the phone with her, I pushed the FaceTime button on my screen, the call ended, FaceTime started and instead of my MIL it was a complete stranger that answered the call. What can I do to fix this problem?

    Check to see if you have an old phone number associated with this person in your address book. When you call someone on Facetime it calls ALL numbers/emails associated with that persons contact sheet! This was my problem, this stranger has my husband's old phone number!

  • Why is it that when someone calls my dad's phone, the incoming call shows up on both our screens?

    Whenever someone is calling my dad, we both get the call. It only happens when we are close. It only happens when the calls are for him. It happens even when the other person is not doing a multiple call. Does it have something to do with us having the same Wi-Fi? He has an iPhone 5 with iOS 8 and I have an iPhone 5c with iOS 8.

    It has to do with you and him sharing an Apple ID. This is not a good practice. Create a new Apple ID: http://appleid.apple.com.
    You could also go to Settings > FaceTime > iPhone Cellular Calls and turn if off, but ultimately you'll probably run into other problems down the road by sharing an ID.

Maybe you are looking for

  • Unbound Class Variable Error

    Hi All, I am doing a webdynpro application. while deploying, it gives me an error "Unbound class Variable:'KMC_LIBS/bc.srf.framework_api.jar'. What is this error? Regards, Divya

  • Looking for file in the application server.

    Hello expert,           I want to download a file from SAP application server, but when I get into file system for application server by AL11 , I can't find out the folder for my file, why?  is that authority issue or I did the wrong way to get into

  • Optimal way to retrieve data from a linked server?

    Hi, If I create a view for our "Support Calls" list inside our database the SQL code looks like this... Code Snippet SELECT CALL.REFERENCE AS CallRef,  CALL.CUSTOMERREF AS CustomerRef,  CUSTOMER.NAME,  DATEADD(hh,CALL.OPENHRS, DATEADD(n, CALL.OPENMIN

  • Forms on Retina Display

    Hi. Does anybody run Oracle Forms 11.1.2 on a Macbook Pro Retina Display? On normal Mac displays we use clientDPI=96 in formsweb.cfg, and text looks ok. But on the the retinas, text looks blurred. Is there any way to make it look better? Thanks in ad

  • Having trouble downloading purchased music(Error Code -50)

    I just got my i-pod up and running on this new computer. When I purchased an album to download to the computer it seems to act like it is downloading and then gives me an (Error Code -50) telling me to check the advanced button to try and download la