⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 swingrepaintcollector.java

📁 Java游戏高级编程!!很不错的!!!Java游戏高级编程!!很不错的
💻 JAVA
字号:
     package com.croftsoft.core.animation.collector;

     import java.awt.Rectangle;
     import javax.swing.JComponent;
     import javax.swing.RepaintManager;

     import com.croftsoft.core.animation.RepaintCollector;
     import com.croftsoft.core.lang.NullArgumentException;

     /*********************************************************************
     * Routes repaint requests back to the standard Swing RepaintManager.
     *
     * @version
     *   2002-12-07
     * @since
     *   2002-03-13
     * @author
     *   <a href="http://www.croftsoft.com/">David Wallace Croft</a>
     *********************************************************************/

     public class  SwingRepaintCollector
       implements RepaintCollector
     //////////////////////////////////////////////////////////////////////
     //////////////////////////////////////////////////////////////////////
     {

     private static final Rectangle [ ]  EMPTY_ARRAY = new Rectangle [ 0 ];

     //

     private final JComponent  component;

     //////////////////////////////////////////////////////////////////////
     // constructor method
     //////////////////////////////////////////////////////////////////////

     public  SwingRepaintCollector ( JComponent  jComponent )
     //////////////////////////////////////////////////////////////////////
     {
       NullArgumentException.check ( this.component = jComponent );
     }

     //////////////////////////////////////////////////////////////////////
     // accessor methods
     //////////////////////////////////////////////////////////////////////

     public Rectangle [ ]  getRepaintRegions ( ) { return EMPTY_ARRAY; }

     public int  getCount ( ) { return 0; }

     //////////////////////////////////////////////////////////////////////
     // mutator methods
     //////////////////////////////////////////////////////////////////////

     public void  repaint ( )
     //////////////////////////////////////////////////////////////////////
     {
       RepaintManager.currentManager ( component ).markCompletelyDirty (
         component );
     }

     public void  repaint (
       final int  x,
       final int  y,
       final int  width,
       final int  height )
     //////////////////////////////////////////////////////////////////////
     {
       RepaintManager.currentManager ( component ).addDirtyRegion (
         component, x, y, width, height );
     }

     public void  reset ( )
     //////////////////////////////////////////////////////////////////////
     {
     }

     //////////////////////////////////////////////////////////////////////
     //////////////////////////////////////////////////////////////////////
     }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -