Ignore:
Timestamp:
05/30/08 10:14:43 (16 years ago)
Author:
ra33
Message:

Added some more unit tests
Did a bunch of refactoring
AND added a few new features... @b @v were the most significant

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/gui/FrameGraphics.java

    r78 r80  
    1616import java.util.Collection;
    1717import java.util.HashSet;
     18import java.util.Iterator;
    1819import java.util.LinkedList;
    1920import java.util.List;
     
    7374
    7475        // The link to the message frameset
    75         public static Item MessageLink = new Text(-2, MESSAGES_FRAMESET_NAME);
     76        public static Item MessageLink = new Text(-2, "@" + MESSAGES_FRAMESET_NAME);
    7677
    7778        // creator for creating the message frames
     
    9899                FrameUtils.Parse(current);
    99100                DisplayIO.UpdateTitle();
     101                setMaxSize(new Dimension(_MaxSize.width, _MessageBuffer.getHeight()
     102                                + _MaxSize.height));
    100103                Repaint();
    101104        }
     
    112115
    113116                FrameUtils.Parse(DisplayIO.getCurrentFrame());
     117                DisplayIO.UpdateTitle();
    114118                Repaint();
    115119        }
     
    133137                        _MaxSize = max;
    134138
    135                 // Mike assumes this is the height of the Message window?
    136                 _MaxSize.setSize(max.width, max.height - MESSAGE_BUFFER_HEIGHT);
     139                // Hide the message buffer if in audience mode
     140                int newMaxHeight = max.height
     141                                - (isAudienceMode() ? 0 : MESSAGE_BUFFER_HEIGHT);
     142                if (newMaxHeight > 0)
     143                        _MaxSize.setSize(max.width, newMaxHeight);
     144
    137145                if (DisplayIO.getCurrentFrame() != null) {
    138146                        DisplayIO.getCurrentFrame().setBuffer(null);
     
    140148                }
    141149
    142                 _MessageBuffer = null;
    143 
    144                 for (int i = 0; i < Messages.length; i++) {
    145                         if (Messages[i] != null) {
    146                                 Messages[i].setOffset(0, -_MaxSize.height);
    147                                 Messages[i].setMaxSize(_MaxSize);
    148                         }
    149                 }
    150 
    151                 MessageLink.setOffset(0, -_MaxSize.height);
    152                 MessageLink.setMaxSize(_MaxSize);
    153                 MessageLink.setPosition(_MaxSize.width - MESSAGE_LINK_Y_OFFSET,
    154                                 MESSAGE_LINK_X);
    155 
     150                if (newMaxHeight > 0) {
     151                        _MessageBuffer = null;
     152
     153                        for (int i = 0; i < Messages.length; i++) {
     154                                if (Messages[i] != null) {
     155                                        Messages[i].setOffset(0, -_MaxSize.height);
     156                                        Messages[i].setMaxSize(_MaxSize);
     157                                }
     158                        }
     159
     160                        MessageLink.setOffset(0, -_MaxSize.height);
     161                        MessageLink.setMaxSize(_MaxSize);
     162                        MessageLink.setPosition(_MaxSize.width - MESSAGE_LINK_Y_OFFSET,
     163                                        MESSAGE_LINK_X);
     164                }
    156165                // Repaint();
    157166        }
     
    254263                List<Item> copies = ItemUtils.CopyItems(vector.getItems());
    255264                // FrameMouseActions
    256                 for (Item i : copies) {
     265                Iterator<Item> iterator = copies.iterator();
     266                while(iterator.hasNext()){
     267                        Item i = iterator.next();
     268                        //Dont paint annotation items for @v
     269                        if (i.isAnnotation()){
     270                                iterator.remove();
     271                                continue;
     272                        }
     273                        i.setLinkMark(false);
     274                        i.setActionMark(false);
    257275                        if (!(i instanceof Line)) {
    258276                                i.setPosition((int) (i.getX() * scale + dx + 0.5), (int) (i
     
    260278                                                * scale + dy + 0.5));
    261279                                i.setThickness((int) (i.getThickness() * scale + 0.5));
     280                                i.setArrowheadLength((int) (i.getArrowheadLength() * scale + 0.5));
    262281                        }
    263282                        if (i instanceof Text)
     
    419438
    420439                        if (isActualFrame) {
    421                                 PaintItem(bg, toPaint.getFrameNameItem());
     440                                PaintItem(bg, toPaint.getNameItem());
    422441                        }
    423442
     
    476495                        _MessageBuffer = ge.getDefaultScreenDevice()
    477496                                        .getDefaultConfiguration().createCompatibleVolatileImage(
    478                                                         _MaxSize.width, MESSAGE_BUFFER_HEIGHT);
     497                                                        _MaxSize.width,
     498                                                        (isAudienceMode() ? 0 : MESSAGE_BUFFER_HEIGHT));
    479499                }
    480500
     
    507527                                g.drawImage(right, 0, 0, Item.DEFAULT_BACKGROUND, null);
    508528                }
    509                 // draw the message area
    510                 g.drawImage(_MessageBuffer, 0, _MaxSize.height, null);
     529                // Dont display the message area in audience mode
     530                if (!isAudienceMode()) {
     531                        // draw the message area
     532                        g.drawImage(_MessageBuffer, 0, _MaxSize.height, null);
     533                }
    511534                g.dispose();
    512535
     
    749772                MessageLink.setLink(_creator.getCurrent());
    750773                Repaint();
     774               
     775                System.out.println(message);
    751776        }
    752777
Note: See TracChangeset for help on using the changeset viewer.