Last change
on this file since 26736 was 26736, checked in by davidb, 11 years ago |
Considering storing each note added to a note layer frame in a list so have included functionality for this in this class. However you would need to be able to account for when notes are edited/removed (perhaps set each note's data value with an incremental id).
|
File size:
1.0 KB
|
Line | |
---|
1 | package org.honours.collection;
|
---|
2 |
|
---|
3 | import java.util.ArrayList;
|
---|
4 | import java.util.List;
|
---|
5 |
|
---|
6 | import org.expeditee.gui.Frame;
|
---|
7 | import org.expeditee.items.Text;
|
---|
8 |
|
---|
9 | /**
|
---|
10 | *
|
---|
11 | * @author Korii
|
---|
12 | */
|
---|
13 | public class NoteLayer {
|
---|
14 |
|
---|
15 | private Frame _frame;
|
---|
16 | private CollectionItem _associatedItem;
|
---|
17 |
|
---|
18 | private List<Text> _notes;
|
---|
19 |
|
---|
20 | public NoteLayer(){
|
---|
21 | _notes = new ArrayList<Text>();
|
---|
22 | }
|
---|
23 |
|
---|
24 | public NoteLayer(Frame frame, CollectionItem associatedItem){
|
---|
25 | _frame = frame;
|
---|
26 | _associatedItem = associatedItem;
|
---|
27 | _notes = new ArrayList<Text>();
|
---|
28 | }
|
---|
29 |
|
---|
30 | public void setFrame(Frame frame){
|
---|
31 | _frame = frame;
|
---|
32 | }
|
---|
33 |
|
---|
34 | public Frame getFrame(){
|
---|
35 | return _frame;
|
---|
36 | }
|
---|
37 |
|
---|
38 | public void setAssociatedItem(CollectionItem cItem){
|
---|
39 | _associatedItem = cItem;
|
---|
40 | }
|
---|
41 |
|
---|
42 | public CollectionItem getItem(){
|
---|
43 | return _associatedItem;
|
---|
44 | }
|
---|
45 |
|
---|
46 | /**
|
---|
47 | * TODO: Would need to account for edited or deleted notes.
|
---|
48 | * @param note
|
---|
49 | */
|
---|
50 | public void addNote(Text note){
|
---|
51 | _notes.add(note);
|
---|
52 | }
|
---|
53 |
|
---|
54 | public List<Text> getNotes(){
|
---|
55 | return _notes;
|
---|
56 | }
|
---|
57 |
|
---|
58 | } |
---|
Note:
See
TracBrowser
for help on using the repository browser.