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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.