Changeset 26605


Ignore:
Timestamp:
2013-01-08T21:34:52+13:00 (11 years ago)
Author:
davidb
Message:

Adding more code for the Collection Space feature back into GlamED, including a setCollectionSpace method for the Collection class.

Location:
other-projects/GlamED/trunk/src/org/honours
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • other-projects/GlamED/trunk/src/org/honours/CollectionSpace/CollectionSpace.java

    r26604 r26605  
    8383    private void writeThumbnails(){
    8484       
     85        Frame currFrame = null;
     86        int currX = _startX;
     87        int currY = _startY;
     88       
     89        int frameIter = 1;
     90       
     91        generateNavigationLinks(frameIter);
     92        generateDropBox(frameIter);
     93       
     94        for(int i = 0; i < _thumbnails.size(); i++)
     95        {
     96            Picture currPic = _thumbnails.get(i);
     97           
     98            if(i % _columns ==0 && i == 0){
     99               
     100            }else if(i % _columns == 0 && i > 0){
     101                currX = _startX;
     102                currY += _gap + _imageSize;
     103            }else{
     104                currX += _gap + _imageSize;
     105            }
     106           
     107            //Create a new frame to display next lot of items.
     108            if(i % (_columns * _rows) == 0 && i < _columns * _rows){
     109                currFrame = FrameIO.LoadFrame(_name + frameIter);
     110               
     111            }else if(i % (_columns * _rows) == 0 && i >= _columns * _rows){
     112                frameIter++;
     113                Frame check = FrameIO.LoadFrame(_name + frameIter);
     114                if(check == null){
     115                    //create new frame
     116                    HonoursFrameIO.generateFrame(frameIter, _name);
     117                    currFrame = FrameIO.LoadFrame(_name + frameIter);
     118                   
     119                    currX = _startX;
     120                    currY = _startY;
     121                    generateNavigationLinks(frameIter);
     122                    generateDropBox(frameIter);
     123                }
     124
     125            }
     126           
     127            currFrame.addText(currX, currY, currPic.getSource().getText(),
     128                    null, currPic.getLink());
     129            currFrame.setSaved();
     130        }
     131       
     132        _associatedCollection.setCollectionSpace(this);
    85133    }
    86134   
    87135    private void generateNavigationLinks(int frameIter){
    88136       
     137        String backText = "<<";
     138        String forwardText = ">>";
     139       
     140        int backButtonX = _startX/2;
     141        int forwardButtonX = _startX + (_columns*_gap)+(_columns*_imageSize);
     142        int buttonPosY = ((_rows*_imageSize) + (_rows*_gap))/2;
     143       
     144        Frame currFrame = FrameIO.LoadFrame(_name+frameIter);
     145        currFrame.addText(backButtonX,buttonPosY,backText,"RotateBack");
     146        currFrame.addText(forwardButtonX,buttonPosY,forwardText,"RotateNext");
     147        currFrame.setSaved();
    89148    }
    90149   
  • other-projects/GlamED/trunk/src/org/honours/collection/Collection.java

    r26588 r26605  
    66import org.expeditee.gui.Frame;
    77import org.honours.Main;
     8import org.honours.CollectionSpace.*;
    89
    910public class Collection {
     
    1213    private CopyOnWriteArrayList<CollectionItem> _items;
    1314    private CollectionInformation _collectionInfo;
     15   
     16    private CollectionSpace _collectionSpace;
    1417   
    1518    public Collection() {}
     
    4851        //_items = new ArrayList<CollectionItem>();
    4952        _items = new CopyOnWriteArrayList<CollectionItem>();
     53    }
     54   
     55    public void setCollectionSpace(CollectionSpace cs){
     56        _collectionSpace = cs;
    5057    }
    5158   
Note: See TracChangeset for help on using the changeset viewer.