Ignore:
Timestamp:
08/01/08 16:38:58 (16 years ago)
Author:
ra33
Message:

Work on Bridging the Gap between SimpleStatements and Actions/Agents

File:
1 edited

Legend:

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

    r176 r181  
    250250
    251251        private static Image Paint(Frame toPaint, Area clip) {
    252                 return Paint(toPaint, clip, true);
     252                return Paint(toPaint, clip, true, true);
    253253        }
    254254
     
    261261         * @return
    262262         */
    263         private static Image Paint(Frame toPaint, Area clip, boolean isActualFrame) {
     263        private static Image Paint(Frame toPaint, Area clip, boolean isActualFrame, boolean createVolitile) {
    264264                if (toPaint == null)
    265265                        return null;
     
    271271                                GraphicsEnvironment ge = GraphicsEnvironment
    272272                                                .getLocalGraphicsEnvironment();
    273                                 if (!isActualFrame) {
     273                                if (createVolitile) {
     274                                        buffer = ge.getDefaultScreenDevice()
     275                                        .getDefaultConfiguration()
     276                                        .createCompatibleVolatileImage(_MaxSize.width,
     277                                                        _MaxSize.height);
     278                                } else {
    274279                                        buffer = new BufferedImage(_MaxSize.width, _MaxSize.height,
    275280                                                        BufferedImage.TYPE_INT_ARGB);
    276                                 } else {
    277                                         buffer = ge.getDefaultScreenDevice()
    278                                                         .getDefaultConfiguration()
    279                                                         .createCompatibleVolatileImage(_MaxSize.width,
    280                                                                         _MaxSize.height);
    281281                                }
    282282                                toPaint.setBuffer(buffer);
     
    297297                        Color backgroundColor = null;
    298298                        // Need to allow transparency for frameImages
    299                         if (!isActualFrame) {
     299                        if (createVolitile) {
     300                                backgroundColor = toPaint.getPaintBackgroundColor();
     301                        }else{
    300302                                backgroundColor = toPaint.getBackgroundColor();
    301303                                if (backgroundColor == null)
    302304                                        backgroundColor = Item.TRANSPARENT;
    303                         } else {
    304                                 backgroundColor = toPaint.getPaintBackgroundColor();
    305305                        }
    306306
     
    399399                                                paintedFillsAndLines);
    400400                        // TODO if we can get transparency with FreeItems.getInstance()...
    401                         // then text can
    402                         // be done before freeItems
     401                        // then text can be done before freeItems
    403402                        PaintNonLinesNonPicture(bg, paintItems);
    404403
     
    732731         */
    733732
    734         public static void UpdateBuffer(Frame toUpdate, boolean paintOverlays) {
     733        public static void UpdateBuffer(Frame toUpdate, boolean paintOverlays, boolean useVolitile) {
     734                toUpdate.setBuffer(getBuffer(toUpdate, paintOverlays, useVolitile));
     735        }
     736       
     737        public static Image getBuffer(Frame toUpdate, boolean paintOverlays, boolean useVolitile){
    735738                if (toUpdate == null)
    736                         return;
    737 
    738                 Image vi = Paint(toUpdate, null, paintOverlays);
    739                 toUpdate.setBuffer(vi);
     739                        return null;
     740
     741                return Paint(toUpdate, null, paintOverlays, useVolitile);
    740742        }
    741743
Note: See TracChangeset for help on using the changeset viewer.