Results 1 to 3 of 3
  1. #1
    residentevil is offline Member
    Join Date
    Oct 2012
    Posts
    2
    Rep Power
    0

    Default GMF Model & Table View

    I have been given this task and would appreciate it if someone helped really. I built a Graphical Model through GMF, which is as follows;

    GMF Model & Table View-pdtrc.jpg

    As you see one of the nodes in the model has been selected. The task here is to create an eclipse view with a table, which will be automatically updated upon the selection of a so-called "City Node". As you may guess from the model, the table should contain path costs to all of the cities. I will later expand my solution to include a modified Dijkstra Algorithm but right now i am stuck in the creation of a table view.

    I tried to build it using a TableViewer but it seems fairly complex since we need to set the input of the table on ContentProvider, but the twist here is that since we need a SelectionListener to obtain the City Coordinates(as it was ordered to calculate path-costs through the distance between two connected cities divided by the max speed, which was indicated on the connecting streets in the graph) and also the currently selected city, the path-costs need to be automatically calculated and displayed in the table upon the receipt of a click-event. This means that we somehow need to update the input which is gonna be handed to ContentProvider on every selection change.

    For further information, i get the current selection through selectionChanged method of ISelectionListener interface and inside this method i put the city information in an arraylist. However although i declared this arraylist outside of the method as public, i can not seem to access its members from outside of the method and thus can not pass them to contentProvider. Consequently the input of the table can not be updated. I tried to write this post as simple as possible and i hope you guys can help me. As i can not foresee now what should be done, i would really appreciate it. Thanks in advance.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,193
    Rep Power
    19

    Default Re: GMF Model & Table View

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    residentevil is offline Member
    Join Date
    Oct 2012
    Posts
    2
    Rep Power
    0

Similar Threads

  1. MVC help (Model - View - Controller)
    By AcousticBruce in forum New To Java
    Replies: 3
    Last Post: 08-21-2012, 09:30 PM
  2. How exactly does a view listen to the model in MVC?
    By AWJustAGuy in forum AWT / Swing
    Replies: 3
    Last Post: 04-29-2012, 09:01 AM
  3. Copy Default table model to another default table model?
    By greatmajestics in forum AWT / Swing
    Replies: 2
    Last Post: 04-28-2010, 04:08 PM
  4. Replies: 1
    Last Post: 01-08-2010, 06:19 AM
  5. mvc-model view controller
    By hannes in forum AWT / Swing
    Replies: 5
    Last Post: 01-08-2010, 05:52 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •