Ignore:
Timestamp:
2013-01-16T20:12:03+13:00 (11 years ago)
Author:
davidb
Message:

Refactoring of interfaces class.

File:
1 edited

Legend:

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

    r26734 r26737  
    11package org.honours.gui;
    22
     3import java.awt.Color;
    34import java.awt.Dimension;
    45import java.util.List;
     
    4546
    4647    //used to determine positioning of the various @ao:3/4 text items.
    47     private static int _mainOverAoX = 1272;
     48    private static int _mainOverAoX = 1859;
    4849    private static int _mainOverAoY = 130;
    4950   
    50     private static int _toolbarAoX = 1272;
     51    private static int _toolbarAoX = 1859;
    5152    private static int _toolbarAoY = 130;
    5253   
    53     private static int _toggleAoX = 1272;
     54    private static int _toggleAoX = 1859;
    5455    private static int _toggleAoY = 94;
    5556   
    56     private static int _notesAoX = 1272;
     57    private static int _notesAoX = 1859;
    5758    private static int _notesAoY = 58;
    5859   
     
    211212       
    212213        boolean found = false;
     214        String notesFrameFoundName = null;
    213215        int i = 0;
    214216       
     217           
    215218        while(i < list.size() && !found){
    216219           
     
    223226                    if(t.getLink().startsWith("notes")){
    224227                        found = true;
     228                        notesFrameFoundName = t.getLink();
    225229                    }
    226230                   
     
    233237       
    234238        if(!found){
    235            
    236                
    237            
     239
    238240            //check for an overlay frame in notes frameset associated with this collection item.
    239241            NoteLayer getNoteLayer = cItem.getNoteLayer();
     
    253255                cItem.setNoteLayer(getNoteLayer);
    254256               
    255                 //Add collectionItem back into collection
    256                 //Add collection back into collections list
     257                //Add collectionItem back into collection and add collection back into collections list
    257258                Collection matchingCollection = Collection.findCollection(cItem.getFrame());
    258259                int collectionIndex = Collection.getCollectionPosition(matchingCollection);
     
    264265                Main._collections.remove(collectionIndex);
    265266                Main._collections.add(collectionIndex, matchingCollection);
     267               
    266268            }else{
    267269                getNotesOverlayFrame = getNoteLayer.getFrame();
     
    271273            newText.setData("overlayNotes");
    272274            newText.setLink(getNotesOverlayFrame.getName());
     275           
    273276        }else{
    274277           
    275278            //Obtain link to toolbar and change it.
    276             Item getToolbarLinkItem = Misc.getItemContainingData(OVERLAY_TOOLBAR_DATA, ciFrame);
    277            
    278             if(getToolbarLinkItem.getLink().equals(NAVIGATION_OVERLAY_VIEW_NOTES_UNCLICKABLE))
    279                 getToolbarLinkItem.setLink(NAVIGATION_OVERLAY_VIEW_NOTES_CLICKABLE);
     279            Item toolbarLinkItem = Misc.getItemContainingData(OVERLAY_TOOLBAR_DATA, ciFrame);
     280            String toolbarOverlayLink = toolbarLinkItem.getLink();
     281           
     282            if(toolbarOverlayLink.equals(NAVIGATION_OVERLAY_VIEW_NOTES_UNCLICKABLE)){
     283                toolbarLinkItem.setLink(NAVIGATION_OVERLAY_VIEW_NOTES_CLICKABLE);
     284            }
     285            else if(toolbarOverlayLink.equals(NAVIGATION_OVERLAY_VIEW_NOTES_CLICKABLE)){
     286                //Check for actual text items on the notes frame.
     287                Frame checkOverlayFrame = FrameIO.LoadFrame(notesFrameFoundName);
     288               
     289                if(checkOverlayFrame.getTextItems().size() == 0){
     290                    toolbarLinkItem.setLink(NAVIGATION_OVERLAY_VIEW_NOTES_UNCLICKABLE);
     291                    System.err.println("NO NOTES for collection item: " + ciFrame.getName());
     292                }else{
     293                    System.err.println(ciFrame.getName() + " " + checkOverlayFrame.getTextItems().size() + " ********");
     294                }
     295               
     296            }
    280297           
    281298        }
Note: See TracChangeset for help on using the changeset viewer.