Ignore:
Timestamp:
08/04/08 11:00:13 (16 years ago)
Author:
bjn8
Message:

Widgets are now linkable.
Also made some improvements for popups - improved interaction with free items.

File:
1 edited

Legend:

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

    r181 r184  
    3636        // the maximum size that can be used to paint on
    3737        private static Dimension _MaxSize = new Dimension(1000, 1000);
     38       
     39        // Final passes to renderering the current frame
     40        private static LinkedList<FinalFrameRenderPass> _finalPasses = new LinkedList<FinalFrameRenderPass>();
    3841
    3942        // modes
     
    457460                                PaintNonLinesNonPicture(bg, freeItemsToPaint);
    458461
    459                         // Repaint popups / drags...
    460                         if (isActualFrame)
     462                        // Repaint popups / drags... As well as final passes
     463                        if (isActualFrame) {
    461464                                PopupManager.getInstance().paintLayeredPane(bg, clip);
     465                                for (FinalFrameRenderPass pass : _finalPasses) {
     466                                        pass.paint(bg);
     467                                }
     468                        }
    462469
    463470                        bg.dispose();
     
    857864                // Paint frame to window
    858865                Paint(dg, left, right, Item.DEFAULT_BACKGROUND);
    859                
     866
    860867                // Paint any animations
    861868                PopupManager.getInstance().paintAnimations();
     
    905912
    906913        }
     914       
     915        /**
     916         * Adds a FinalFrameRenderPass to the frame-render pipeline...
     917         *
     918         * Note that the last added FinalFrameRenderPass will be rendered at the
     919         * very top.
     920         *
     921         * @param pass
     922         *              The pass to add. If already added then nothing results in the call.
     923         *
     924         * @throws NullPointerException
     925         *              If pass is null.
     926         */
     927        public static void addFinalFrameRenderPass(FinalFrameRenderPass pass) {
     928                if (pass == null) throw new NullPointerException("pass");
     929               
     930                if (!_finalPasses.contains(pass))
     931                        _finalPasses.add(pass);
     932        }
     933       
     934        /**
     935         * Adds a FinalFrameRenderPass to the frame-render pipeline...
     936         *
     937         * Note that the last added FinalFrameRenderPass will be rendered at the
     938         * very top.
     939         *
     940         * @param pass
     941         *              The pass to remove
     942         *
     943         */
     944        public static void removeFinalFrameRenderPass(FinalFrameRenderPass pass) {
     945                _finalPasses.remove(pass);
     946        }
     947       
     948        /**
     949         * A FinalFrameRenderPass is invoked at the very final stages for rendering a frame:
     950         * that is, after the popups are drawn.
     951         * 
     952         * There can be many applications for FinalFrameRenderPass. Such as tool tips, balloons,
     953         * or drawing items at the highest Z-order in special situations.
     954         *
     955         * Although if there are multiples FinalFrameRenderPasses attatach to the
     956         * frame painter then it is not garaunteed to be rendered very last.
     957         *
     958         * @see FrameGraphics#addFinalFrameRenderPass(org.expeditee.gui.FrameGraphics.FinalFrameRenderPass)
     959         * @see FrameGraphics#removeFinalFrameRenderPass(org.expeditee.gui.FrameGraphics.FinalFrameRenderPass)
     960         *
     961         * @author Brook Novak
     962         */
     963        public interface FinalFrameRenderPass {
     964                void paint(Graphics g);
     965        }
    907966
    908967}
Note: See TracChangeset for help on using the changeset viewer.