graphicslistener.java

来自「Java source code for the Ant Colony Opti」· Java 代码 · 共 37 行

JAVA
37
字号
package jwo.jpss.ants;      // Part of the ant simulation package.
import jwo.jpss.spatial.*;  // For spatial classes.
import java.util.Vector;

//  *******************************************************
/** Interface for graphical components that need to display
  * dynamic objects that get updated periodically.
  * @author Jo Wood
  * @version  1.4, 21st October, 2001
  */
//  *******************************************************

public interface GraphicsListener 
{
    /** Update graphics.
      */
    public abstract void redrawGraphics();
    
    /** Checks that the given spatial object can be drawn by the listener.
      * @param footprint Spatial object we wish to draw.
      * @return True if the spatial object can be drawn.
      */
    public abstract boolean canDraw(SpatialObject spatialObject);

    /** Reports the list of SpatialObjects associated with the given
      * spatial object (within, matching, overlapping or containing). 
      * @param spatialObject Spatial object with which to compare.
      * @return List of spatial objects in contact with the given one.
      */
    public Vector objectsAt(SpatialObject spatialObject);

    /** Displays the given message in the graphics listener.
      * May be ignored by some graphics listeners.
      * @param Message Message to display.
      */
    public abstract void displayMessage(String message);
}

⌨️ 快捷键说明

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