[JAVA] Tabs och Data (Program för koordinater)
Hej,
Håller på med ett projekt till skolan, har dock fastnat. Se bild för att få en uppfattning av hur det ser ut just nu. Funktionaliteten är simpel. Användaren lägger till en koordinat, koordinaten läggs till i ett JTable och en bild visas över den aktuella koordinaten. Användaren kan välja att spara ett "set" (DVS de koordinater som finns i mitt JTable) till en .csv-fil. Denna kan senare självklart öppnas i programmet igen. Allt detta fungerar.
Programmet består av ett antal JPanels. En för mitt JTable, en för kartan, en för toppen. En för kartan och JTable som ligger i en splitpane.
Problem:
Jag vill nu kunna ha flera "tabs" öppna samtidigt så att användaren kan arbeta med flera "set" av koordinater samtidigt. Om användaren väljer att öppna en fil skall denne öppnas i en ny tab. Likadant skall användaren kunna gå till File/New och ett tomt "set" visas i en ny tab, detta samtidigt som andra tabs kan innehålla data. Jag har därför lagt kartan och mitt JTable i en JTabbedPane. Jag har dock ingen aning om hur resten skall gå till. Hjälp uppskattas, peka mig gärna i rätt riktning. Jag bifogar uppgiftsbeskrivningen nedan om ni har problem att förstå vad jag menar.
Koordinaterna lagras i en ArrayList<Koordinater>.
1. A way to have multiple sets of data open and be able to keep track of them.
2. A way to have multiple maps open and be able to keep track of them.
3. You should be able to copy data between map sets.
a. Though this must check that the new point is within the bounds of the
destination set. If it is not you should either choose to reject the point
or make sure to handle it properly. (If you have chosen to load non
static images the new image should contain the points but no extra
marks will be available for the extra level of difficulty this will involve
you in.)
4. The ability to place symbols on your maps at the right location
a. for example if the map is of the area round your house and you want
to have one of the places as your house a house symbol should be
placed there.
b. This will mean modifying your data structure to store the appropriate
parameter. A good way to do this will be to have a set of symbols of
known shape and then to add appropriate symbol names to your data
class and corresponding names to your stored data.
5. The ability to add descriptions to your points.
a. Again requires the data structure to be modified. A description is a
piece of free text. You could also use these to label your maps.
6. The ability to choose between display of symbols or descriptions.
Edit: Tror inte man behöver kunna redigera flera filer samtidigt. Bara möjligheten att ha flera set öppna samtidigt.