Changeset 26742


Ignore:
Timestamp:
2013-01-17T18:44:53+13:00 (11 years ago)
Author:
davidb
Message:

Added a method that is called during loading of the system which makes sure all text items with a user-specified width value are displayed on the frame correctly.

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

Legend:

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

    r26735 r26742  
    154154                    Interfaces.setUpToggleToolbarOverlay(cItem);
    155155                    Interfaces.setUpNotesOverlay(cItem);
     156                   
     157                    HonoursFrameIO.fixTextItemWidths(cItem.getFrame());
    156158                }
    157159            }
     
    195197            CollectionItem cItem = new CollectionItem();
    196198            cItem.setFrame(curr);
     199            HonoursFrameIO.fixTextItemWidths(cItem.getFrame());
    197200           
    198201            cInfo.addRow("I", curr.getName(), assoc);
  • other-projects/GlamED/trunk/src/org/honours/gui/HonoursFrameIO.java

    r26739 r26742  
    190190    }
    191191   
    192 
     192    public static void fixTextItemWidths(Frame curr){
     193       
     194        List<Text> textItems = curr.getBodyTextItems(true);
     195       
     196        int i = textItems.size() -1;
     197       
     198        while(i > -1){
     199            Text t = textItems.get(i);
     200            if(t.getAbsoluteWidth() != null){
     201                if(t.getAbsoluteWidth() != Integer.MAX_VALUE && t.getAbsoluteWidth() > 0){
     202                    Text copy = t.copy();
     203                    curr.addItem(copy);
     204                    curr.removeItem(t);
     205                }
     206            }
     207            i--;
     208        }
     209    }
    193210   
    194211    /**
Note: See TracChangeset for help on using the changeset viewer.