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

📄 dsselectaction.java

📁 用JAVA编写的绘图程序 功能简介: 支持存储
💻 JAVA
字号:
package drawsmart.itsv.basic;

import drawsmart.itsv.framework.JDSSelectActionface;
import drawsmart.itsv.framework.JDSComponentface;
import drawsmart.itsv.framework.JDSLineface;
import drawsmart.itsv.framework.JDSDesktopface;

/**
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2004</p>
 * <p>Company: </p>
 * @author not attributable
 * @version 1.0
 */

public abstract class DSSelectAction
    implements JDSSelectActionface {
  public DSSelectAction() {
  }

  /**
   * 删除所选的组件(多个/单个)
   * @param jDSComponentfaceAll JDSComponentface[]
   * @todo Implement this drawsmart.itsv.framework.JDSSelectActionface method
   */
  public void delSelectComponent(JDSComponentface[] jDSComponentfaceAll,JDSDesktopface jDSDesktopface) {
    for (int k = 0; k < jDSComponentfaceAll.length; k++) {
        JDSComponentface jDSComponentface = jDSComponentfaceAll[k];
        //获得所有的组件
        JDSComponentface[] jDSComponentfaces = jDSDesktopface.
            getJDSAllComponent();
        //获得选中组件的所有的连线
        JDSLineface[] jDSLinefaces = jDSComponentface.getJDSLineface();
        //获得所有的连线
        JDSLineface[] jDSLinefacesAll = jDSDesktopface.getJDSAllLineface();
        //删除所选的组件
        if (jDSComponentface != null) {
          for (int i = 0; i < jDSComponentfaces.length; i++) {
            if (jDSComponentface == jDSComponentfaces[i]) {
              //删除环节配置
              String sID=jDSComponentfaces[i].getComponentID();
              jDSDesktopface.delSetupDataModel(sID);
              //删除环节
              jDSComponentfaces[i] = null;
              jDSDesktopface.setJDSAllComponent(jDSComponentfaces);
              break;
            }
          }
        }
        //删除所选的组件的所有连接线
        if (jDSLinefaces != null) {
          for (int i = 0; i < jDSLinefaces.length; i++) {
            for (int j = 0; j < jDSLinefacesAll.length; j++) {
              if (jDSLinefaces[i] == jDSLinefacesAll[j]) {
                jDSLinefacesAll[j] = null;
                break;
              }
            }
          }
          jDSDesktopface.setJDSAllLineface(jDSLinefacesAll);
        }
        //刷新桌面
        jDSDesktopface.repaint();
      }

  }

  /**
   * 删除所选直线
   * @param jDAllSLinefaces JDSLineface[]
   * @todo Implement this drawsmart.itsv.framework.JDSSelectActionface method
   */
  public void delSelectLine(JDSLineface[] jDAllSLinefaces,JDSDesktopface jDSDesktopface) {
    for(int i=0;i<jDAllSLinefaces.length;i++)
      {
        if(jDAllSLinefaces[i].getIsSelect()==true)
        {
          jDAllSLinefaces[i]=null;
          break;
        }
      }
      jDSDesktopface.setJDSAllLineface(jDAllSLinefaces);
      //刷新桌面
      jDSDesktopface.repaint();
  }

}

⌨️ 快捷键说明

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