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

📄 pointkey.java

📁 geotools的源码
💻 JAVA
字号:
package uk.ac.leeds.ccg.geotools;

import java.lang.*;
import java.awt.*;
import java.awt.image.*;
import uk.ac.leeds.ccg.geotools.*;

/**
 * The abstract base class used by all keys.<br>
 * A key is a small panel which represents the information needed
 * to interprit the colours provided by a shader.<br>
 * Each shader type should provide an implementation of this class
 * so that it can be displayed.
 */
public abstract class PointKey extends Panel implements ShaderChangedListener
{

 /**
  * The shader from which this key should draw information from.<br>
  * By including a ref to it in the key, any changes to the shader,
  * such as a different choice of colours can be updated automaticaly.
  **/
 Shader shader;
 
 protected PointKey(){
 }
 
 /**
  * The basic constructor for a line key
  * @param The shader to optain colour information from
  */
 public PointKey(Shader s){
    setShader(s);
    s.addShaderChangedListener(this);
 }
 
 /**
  * Used to change the shader that this key is attached to.
  * Probably not a wise operation, better to grab a new key from 
  * that shader instead.
  * @param s The new shader to assosciate with
  **/
 public void setShader(Shader s){
    if(shader != null)shader.removeShaderChangedListener(this);
    shader = s;
    shader.addShaderChangedListener(this);
    //updatePointKey();
 }

 /**
  * updates the pointkey to reflect any changes in the shader which it
  * is attached to.
  **/
  public void updatePointKey(){
    updateLabels();
    repaint();
  }
  /**
   * Called when the shader which created this key changes in some way.
   **/
  public void shaderChanged(ShaderChangedEvent scl){
    updatePointKey();
  }
 
 /**
  * updates the keys labels to reflect any changes in the shader which
  * is attached to.
  * called automaticaly by updatePointKey();
  **/
  public void updateLabels(){
    //do nothing
  }
}

⌨️ 快捷键说明

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