Changeset 404


Ignore:
Timestamp:
11/18/08 15:35:08 (16 years ago)
Author:
ra33
Message:

fixed getmail so it splits text items

Location:
trunk/src/org/expeditee
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/agents/mail/MailSession.java

    r362 r404  
    458458                                        Text newItem = readMessage(msgs[msgNum], msgNum + 1, frame,
    459459                                                        point);
     460                                        // TODO: May want to reverse the order of mail messages
    460461                                        if (newItem != null) {
    461462                                                mailItems.add(newItem);
     
    565566                                                while (thisLine != null) {
    566567                                                        // A blank line is a signal to start a new text item
    567                                                         if (thisLine.trim() == "") {
     568                                                        if (thisLine.trim().equals("")) {
    568569                                                                addTextItem(frames, nextText.toString());
    569570                                                                nextText = new StringBuffer();
     
    597598                                if (nextText.length() == 0)
    598599                                        return;
    599 
    600                                 frames.addText(nextText.substring(0, nextText.length() - 1),
    601                                                 null, null, null, false);
     600                                // Remove the last char if its a newline
     601                                if (nextText.charAt(nextText.length() - 1) == '\n')
     602                                        nextText = nextText.substring(0, nextText.length() - 1);
     603                                //TODO: Make the space a setting in frame creator.
     604                                frames.addSpace(10);
     605                                frames.addText(nextText, null, null, null, false);
    602606                        }
    603607                }.start();
  • trunk/src/org/expeditee/gui/FrameMouseActions.java

    r390 r404  
    294294
    295295                // pre-cache the frame if it is linked
    296                 if (on != null && on.getLink() != null && on.isLinkValid()) {
    297                         FrameIO.Precache(on.getAbsoluteLink());
    298                 }
     296
     297                // If pre-caching is done, it must be done in the background
     298
     299                // if (on != null && on.getLink() != null && on.isLinkValid()) {
     300                // FrameIO.Precache(on.getAbsoluteLink());
     301                // }
    299302
    300303                // check for delete command
     
    697700                                        /*
    698701                                         * Find the first linked item or the first unlinked Dot This
    699                                          * code assumes that items are are ordered from top to bottom.
    700                                          * TODO make sure the list will always be ordered correctly!!
     702                                         * code assumes that items are are ordered from top to
     703                                         * bottom. TODO make sure the list will always be ordered
     704                                         * correctly!!
    701705                                         */
    702                                         if (i.hasLink() || i instanceof Dot){
     706                                        if (i.hasLink() || i instanceof Dot) {
    703707                                                clicked = i;
    704708                                                break;
     
    13981402                                                copies.add(d[i]);
    13991403                                        }
    1400                                        
     1404
    14011405                                        current.nextDot();
    14021406
  • trunk/src/org/expeditee/items/Text.java

    r400 r404  
    200200                return _maxWidth;
    201201        }
    202        
    203         /**
    204          * Returns the maximum width of this Text item when justifcation is used.
    205          * If the width is negative, it means no explicit width has been set
     202
     203        /**
     204         * Returns the maximum width of this Text item when justifcation is used. If
     205         * the width is negative, it means no explicit width has been set
    206206         *
    207207         * @return The maximum width of this Text item when justification is used
     
    380380        }
    381381
     382        /**
     383         * Used by the frame reader to construct multi-line text items. It must run
     384         * quickly, so that the system still responds well for long text items.
     385         *
     386         * @param text
     387         */
    382388        public void appendLine(String text) {
    383389                if (text == null)
     
    388394
    389395                _text.append(text);
    390                 rebuild(false);
    391396        }
    392397
     
    14251430        private boolean hasFixedWidth() {
    14261431                assert (_maxWidth != null);
    1427                 if(_maxWidth == null){
     1432                if (_maxWidth == null) {
    14281433                        justify(false);
    14291434                }
     
    15291534                if (_textLayouts.size() < 1) {
    15301535                        rebuild(true);
    1531                         System.out.println("Error: " + _text);
    1532                         return;
     1536                        //System.out.println("Error: " + _text);
     1537                        //return;
    15331538                }
    15341539
     
    19731978                        if (frameWidth - getX() > ADJUST_WIDTH_THRESHOLD) {
    19741979                                justify(false);
    1975                                 //setRightMargin(frameWidth, false);
    1976                         }
    1977                 }
    1978         }
    1979        
     1980                                // setRightMargin(frameWidth, false);
     1981                        }
     1982                }
     1983        }
     1984
    19801985        public void justify(boolean fixWidth) {
    19811986                Integer width = FrameGraphics.getMaxFrameSize().width;
     
    19861991                if (enclosure != null) {
    19871992                        Rectangle bounds = enclosure.getBounds();
    1988                         if(bounds.width > 200 && getX() < bounds.width / 3 + bounds.x){
     1993                        if (bounds.width > 200 && getX() < bounds.width / 3 + bounds.x) {
    19891994                                width = bounds.x + bounds.width;
    19901995                        }
Note: See TracChangeset for help on using the changeset viewer.