public void pick(DrawContext dc, Point pickPoint)
        {
            if (dc == null)
            {
                String msg = Logging.getMessage("nullValue.DrawContextIsNull");
                Logging.logger().severe(msg);
                throw new ArgumentException(msg);
            }

            if (!this.isEnabled())
            {
                return;
            }

            if (dc.getScreenCredits() == null || dc.getScreenCredits().size() < 1)
            {
                return;
            }

            Set <Map.Entry <ScreenCredit, Long> > credits = dc.getScreenCredits().entrySet();

            int y = dc.getView().getViewport().height - (bottomMargin + creditHeight / 2);
            int x = leftMargin + creditWidth / 2;

            foreach (Map.Entry <ScreenCredit, Long> entry in credits)
            {
                ScreenCredit credit   = entry.getKey();
                Rectangle    viewport = new Rectangle(x, y, creditWidth, creditHeight);

                credit.setViewport(viewport);
                credit.pick(dc, pickPoint);

                x += (separation + creditWidth);
            }
        }
        public void render(DrawContext dc)
        {
            if (dc == null)
            {
                String msg = Logging.getMessage("nullValue.DrawContextIsNull");
                Logging.logger().severe(msg);
                throw new ArgumentException(msg);
            }

            if (dc.getScreenCredits() == null || dc.getScreenCredits().size() < 1)
            {
                return;
            }

            if (!this.isEnabled())
            {
                return;
            }

            Set <Map.Entry <ScreenCredit, Long> > credits = dc.getScreenCredits().entrySet();

            int y = dc.getView().getViewport().height - (bottomMargin + creditHeight / 2);
            int x = leftMargin + creditWidth / 2;

            foreach (Map.Entry <ScreenCredit, Long> entry in credits)
            {
                ScreenCredit credit   = entry.getKey();
                Rectangle    viewport = new Rectangle(x, y, creditWidth, creditHeight);

                credit.setViewport(viewport);
                if (entry.getValue() == dc.getFrameTimeStamp())
                {
                    Object po = dc.getPickedObjects().getTopObject();
                    credit.setOpacity(po != null && po is ScreenCredit ? this.highlightOpacity : this.baseOpacity);
                    credit.render(dc);
                }

                x += (separation + creditWidth);
            }
        }
Пример #3
0
 protected void setScreenCredit(ScreenCredit screenCredit)
 {
     this.screenCredit = screenCredit;
 }