亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? attributequery.java

?? ArcObjects GIS應用開發:基于屬性的查詢
?? JAVA
字號:
/*
 * ArcGIS Engine Developer Sample
 * Application Name: AttributeQuery.java
 */
package com.esri.arcgis.samples.beans.mapcontrol;

import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.io.IOException;

import javax.swing.BorderFactory;
import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.UIManager;
import javax.swing.filechooser.FileFilter;

import com.esri.arcgis.beans.map.IMapControlEvents2Adapter;
import com.esri.arcgis.beans.map.IMapControlEvents2OnMouseDownEvent;
import com.esri.arcgis.beans.map.MapBean;
import com.esri.arcgis.carto.FeatureLayer;
import com.esri.arcgis.carto.IActiveView;
import com.esri.arcgis.carto.ILayer;
import com.esri.arcgis.carto.esriSelectionResultEnum;
import com.esri.arcgis.carto.esriViewDrawPhase;
import com.esri.arcgis.geodatabase.QueryFilter;
import com.esri.arcgis.system.AoInitialize;
import com.esri.arcgis.system.EngineInitializer;
import com.esri.arcgis.system.esriLicenseProductCode;



/**
* This sample illustrates how to programatically select features on
* the Map Control using a QueryFilter.
*
*/

public class AttributeQuery extends JFrame implements ActionListener{

    JPanel topPanel = null;
    JPanel mainPanel = null;
    JPanel rightPanel = null;
    JPanel bottomPanel = null;
    JButton addLayerButton = null;
    JLabel queryTextLabel = null;
    JTextField queryTextField = null;
    JButton selectButton = null;
    MapBean mapBean = null;
    JTextArea help = null;
    String helpString ="1.Add a layer using addLayer button."+"\n"+"2. Enter the where clause in the text"+ "\n"+"field provided"+"\n"+"For ex : If you have added States layer,"+"\n"+"then your where clause to select California\n"+ "state will be STATE_NAME='California'.\n" +
  "Use the left hand mouse button to zoom in."+"\n"+"Use the Right mouse button to pan."+"\n";

    public AttributeQuery() {
     super("Attribute Query");
     buildFrame();
     setSize(600, 500);
     setVisible(true);
     initControl();
    }

    /**This method builds 'this' frame as per the following diagram:
    *
    *   /----------------------------------------------------------------------------------
    *   |              BorderLayout.NORTH                                                 |
    *   |                                                                                 |
    *   |  JButton : AddLayerButton                                                       |
    *   |                                                                                 |
    *   |---------------------------------------------------------------------------------|
    *   |                                              |                                  |
    *   |                                              |      BorderLayer:EAST            |
    *   |                    MapBean                |      JTextArea                      |
    *   |                   BorderLayout.CENTER        |                                  |
    *   |                                              |                                  |
    *   |                                              |                                  |
    *   |                                              |                                  |
    *   |                                              |                                  |
    *   |----------------------------------------------|----------------------------------|
    *   |                                                                                 |
    *   |  BorderLayout : SOUTH                                                           |
    *   |  JLabel                    JTextField                     JButton               |
    *   |                                                                                 |
    *   |                                                                                 |
    *   \---------------------------------------------------------------------------------/
    */


   public void buildFrame() {
      topPanel = new JPanel();
      mainPanel = new JPanel();
      rightPanel = new JPanel();
      bottomPanel = new JPanel();

      topPanel.setLayout(new BoxLayout(topPanel, BoxLayout.X_AXIS));
      mainPanel.setLayout(new BorderLayout(10, 10));
      bottomPanel.setLayout(new BoxLayout(bottomPanel, BoxLayout.X_AXIS));

      addLayerButton = new JButton("Add Data Layer");
      addLayerButton.addActionListener(this);
      topPanel.add(addLayerButton);

      queryTextLabel = new JLabel("Where Clause");
      queryTextField = new JTextField();
      selectButton = new JButton("Select Features");
      selectButton.addActionListener(this);
      bottomPanel.add(queryTextLabel);
      bottomPanel.add(Box.createHorizontalStrut(5));
      bottomPanel.add(queryTextField);
      bottomPanel.add(Box.createHorizontalStrut(5));
      bottomPanel.add(selectButton);

      help = new JTextArea();
      help.setText(helpString);
      rightPanel.setLayout(new BoxLayout(rightPanel, BoxLayout.Y_AXIS));
      rightPanel.add(help);
      rightPanel.add(Box.createVerticalGlue());
      rightPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));

      //Create map control add it to the center of the main panel.
      mapBean = new MapBean();
      mainPanel.add(topPanel, BorderLayout.NORTH);
      mainPanel.add(mapBean, BorderLayout.CENTER);
      mainPanel.add(rightPanel, BorderLayout.EAST);
      mainPanel.add(bottomPanel, BorderLayout.SOUTH);
      mainPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));

      getContentPane().add(mainPanel, BorderLayout.CENTER);
   }

   /** Initilizes control
    *  creates and intializes member variables
    * */


   public void initControl() {
    try {
       mapBean.addIMapControlEvents2Listener(new MapControlListener());
    }
    catch (IOException ex) {
       System.out.println("Exception in initControl :" + ex);
       ex.printStackTrace();
    }


   }

   /**@see java.awt.event.ActionListener#actionPerformed(ActionEvent event)
      * @param event
      */

     public void actionPerformed(ActionEvent event) {
        if(event.getSource() == addLayerButton) {
           try {
               if (!loadFile()) return;

            }
            catch (IOException ex) {
               System.out.println(
                   "Exception in addLayerButton#actionPerformed" + ex);
               ex.printStackTrace();
            }
        }

        if(event.getSource() == selectButton) {
            processQuery();
        }


     }

     /** To perform attribute query based on the user input
      *
      */

     void processQuery() {
      try {
         // Make sure that a layer has been added
         int layerCount = mapBean.getLayerCount();
         if (layerCount < 0) {
            JOptionPane.showMessageDialog(this,
                                          "Please add a feature layer first");
         }

         ILayer layer = null;
         FeatureLayer featureLayer = null;

         try {
            // Just use 1st layer, but make sure it's a featurelayer
            layer = mapBean.getLayer(0);
            featureLayer = new FeatureLayer(layer);
            String queryString = queryTextField.getText();
            if (queryString != null || queryString.length() > 0) {
               // Do a query
               QueryFilter queryFilter = new QueryFilter();
               queryFilter.setWhereClause(queryString);
               featureLayer.selectFeatures(queryFilter,
                                           esriSelectionResultEnum.esriSelectionResultNew, false);
               IActiveView activeView = mapBean.getActiveView();
               activeView.partialRefresh(esriViewDrawPhase.esriViewGeoSelection,
                                         layer, null);
            }

         }   catch (IOException ex) {
               JOptionPane.showMessageDialog(this,
                                       "Please add a feature layer first");
         }

      }
      catch (IOException ex1) {
         ex1.printStackTrace();
      }

     }




   /**
      * Method loadFile loads the specified mxd file
      *
      */
    public boolean loadFile() throws IOException {
         //Open a JFileChooser for selecting PMF documents
       JFileChooser chooser = new JFileChooser();
       chooser.setFileFilter(new FileFilter() {
          public boolean accept(File f) {
             return (f.isDirectory() ||
                     f.getAbsolutePath().toUpperCase().endsWith(".LYR"));
          }

          public String getDescription() {
             return "Layer Documents(*.lyr)";
          }
       });

       boolean loaded = false;
       int returnVal = 0;
       returnVal = chooser.showOpenDialog(null);
       if (returnVal == JFileChooser.APPROVE_OPTION) {
            String fileChosen =
                chooser.getCurrentDirectory()
                    + File.separator
                    + chooser.getSelectedFile().getName();
            System.out.println("File picked: [" + fileChosen + "]");
            //check if the selected layer document can be loaded into MapBean
            try {
               mapBean.addLayerFromFile(fileChosen, 0);
            } catch(Exception ex) {

            }
            loaded = true;
            System.out.println("Layer Added");
       }
       return loaded;
    }

    /**
   * Description: Class which extends map control event class IMapControlEvents2Adapter
   * @see com.esri.arcgis.beans.map.IMapControlEvents2Adapter
   * */

  class MapControlListener
      extends IMapControlEvents2Adapter {

     /**
      * @see com.esri.arcgis.beans.map.IMapControlEvents2Adapter#onMouseDown(IMapControlEvents2OnMouseDownEvent theEvent)
      * @param theEvent
      */

     public void onMouseDown(IMapControlEvents2OnMouseDownEvent theEvent) {
        try {
           //If left mouse button then zoom in
           if (theEvent.getButton() == 1) {
              mapBean.setExtent(mapBean.trackRectangle());
           }
           else if(theEvent.getButton() == 2) {
              mapBean.pan();
           }

        }
        catch (Exception ex) {
           System.out.println("Exception in MapControlListener#onMouseDown : " +
                              ex);
           ex.printStackTrace();
        }

     }

  } //End of MapControlListener class


  /**
    * Main program to start the program execution.
    *
    * @param s
    */


   public static void main(String s[]) {
      try {
         //Set the system look and feel
         UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
         EngineInitializer.initializeVisualBeans();

         AoInitialize aoInit = new AoInitialize();
         aoInit.initialize(esriLicenseProductCode.esriLicenseProductCodeEngine);

         AttributeQuery attributeQuery = new AttributeQuery();
         attributeQuery.setDefaultCloseOperation(AttributeQuery.EXIT_ON_CLOSE);
      }
      catch (Exception ex) {
         ex.printStackTrace();
      }
   }



}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美在线观看视频一区二区| 99久精品国产| 亚洲精品国久久99热| 91精品国产色综合久久ai换脸| 日韩高清不卡在线| 中文字幕一区二区5566日韩| 日韩网站在线看片你懂的| 高清不卡在线观看av| 午夜久久久久久久久久一区二区| 久久久99精品久久| 日韩一区二区在线观看视频播放| 91免费版在线| 国产不卡一区视频| 国产综合久久久久久鬼色| 亚洲一区二区四区蜜桃| 一区二区三区四区av| 国产三级欧美三级日产三级99 | 日本美女一区二区三区| 亚洲国产日韩a在线播放性色| 国产精品区一区二区三区| 久久久夜色精品亚洲| 91精品国产91久久久久久一区二区 | 韩国一区二区三区| 男人的天堂亚洲一区| 久久国产乱子精品免费女| 日本欧美肥老太交大片| 久久99精品久久久久久国产越南| 日本vs亚洲vs韩国一区三区二区 | 色婷婷久久一区二区三区麻豆| 成人高清伦理免费影院在线观看| 国产成人精品亚洲午夜麻豆| 成人免费毛片嘿嘿连载视频| 99久久久国产精品| 欧美自拍丝袜亚洲| 欧美大片一区二区| 国产亚洲精品超碰| 日韩一区欧美一区| 亚洲国产视频一区二区| 免费xxxx性欧美18vr| 国产一区二区不卡在线| www.欧美精品一二区| 91成人免费在线| 日韩亚洲欧美在线观看| 国产精品视频yy9299一区| 亚洲乱码精品一二三四区日韩在线| 亚洲另类春色国产| 免费观看30秒视频久久| 成人高清免费观看| 日韩欧美中文字幕一区| 亚洲日本va在线观看| 日韩高清在线不卡| eeuss鲁片一区二区三区在线看| 欧美日产在线观看| 国产精品久久久久久户外露出| 亚洲第一福利视频在线| 韩日欧美一区二区三区| 欧美精品丝袜久久久中文字幕| 日韩欧美的一区二区| 一区二区三区小说| 久久99久久99| 欧美偷拍一区二区| 国产日韩影视精品| 久久国产欧美日韩精品| 欧美午夜精品一区二区三区 | 亚洲高清不卡在线| av一区二区三区| 26uuuu精品一区二区| 国产午夜亚洲精品羞羞网站| 亚洲成人动漫av| av一区二区三区在线| 一区在线中文字幕| 国产成人自拍在线| 91麻豆精品国产91久久久久久久久| 亚洲同性同志一二三专区| 国模少妇一区二区三区| 欧美系列在线观看| 亚洲精品综合在线| 91麻豆精品秘密| 亚洲欧洲国产日本综合| 国产剧情一区二区| 一区二区三区精密机械公司| 欧美日韩午夜在线视频| 日韩你懂的在线播放| 久久久久久**毛片大全| 中文字幕在线观看一区| 亚洲一区二区黄色| jlzzjlzz亚洲日本少妇| 欧美激情中文字幕一区二区| 欧美久久久久久久久久| 久久亚洲私人国产精品va媚药| 日本女优在线视频一区二区| 日韩欧美一区二区免费| 韩国理伦片一区二区三区在线播放| 日韩精品一区二区三区视频在线观看 | 成人ar影院免费观看视频| 欧美zozo另类异族| 成人自拍视频在线| 亚洲色大成网站www久久九九| 色婷婷综合久久久中文一区二区| 亚洲激情图片qvod| 欧美另类一区二区三区| 免费人成黄页网站在线一区二区| 日韩视频不卡中文| 99久久精品免费看国产| 亚洲国产日韩精品| 国产视频亚洲色图| 成人性生交大片免费看中文 | 日韩1区2区日韩1区2区| 精品1区2区在线观看| 色老汉一区二区三区| 日韩精品亚洲专区| 中文字幕在线不卡一区| 91精品福利在线一区二区三区| 国产精品综合一区二区| 五月婷婷综合网| 久久免费电影网| 欧美精三区欧美精三区| 国产传媒欧美日韩成人| 亚洲综合网站在线观看| 久久免费电影网| 日韩情涩欧美日韩视频| 色婷婷综合久久| 99精品偷自拍| 蜜桃视频一区二区| 亚洲一区二区三区四区在线| 欧美激情在线一区二区| 欧美不卡视频一区| 欧美区在线观看| 在线观看三级视频欧美| 国产成人亚洲综合色影视| 蜜臀久久久久久久| 日韩福利电影在线| 日韩精品乱码av一区二区| 国产精品久久三| 欧美激情在线看| 欧美激情一区二区三区不卡 | 三级亚洲高清视频| 国产亚洲福利社区一区| 国产欧美日韩在线观看| 国产精品成人在线观看| 亚洲天堂a在线| 亚洲一卡二卡三卡四卡| 偷窥少妇高潮呻吟av久久免费| 亚洲va欧美va天堂v国产综合| 依依成人精品视频| 日韩有码一区二区三区| 日本欧美加勒比视频| 国模冰冰炮一区二区| 91亚洲精品一区二区乱码| 99精品国产视频| 欧美日韩国产综合视频在线观看| 日韩一区二区三区视频| 欧美韩日一区二区三区| 亚洲一区在线免费观看| 国产精品中文字幕日韩精品| 波多野结衣欧美| 欧美高清一级片在线| 久久久亚洲午夜电影| 一区精品在线播放| 日韩中文字幕麻豆| 国产在线视频一区二区| 在线观看日韩毛片| 精品国产123| 亚洲欧洲日韩女同| 免费的成人av| 在线观看免费成人| 欧美韩国日本一区| 久久99精品久久久久久久久久久久| 精品一区二区三区在线播放视频| 欧美性生活大片视频| 国产调教视频一区| 看片网站欧美日韩| 欧美色窝79yyyycom| 国产精品乱码久久久久久| 偷偷要91色婷婷| 91浏览器在线视频| 欧美精品v国产精品v日韩精品| 一区二区三区在线观看国产| 大白屁股一区二区视频| 久久综合久久综合亚洲| 美女看a上一区| 日韩写真欧美这视频| 奇米一区二区三区| 日韩一区二区三区电影在线观看| 亚洲风情在线资源站| 欧美亚洲国产一区二区三区| 亚洲精品国产无套在线观| 99久久久精品免费观看国产蜜| 综合在线观看色| 国产在线精品一区二区| 欧美激情一区三区| aaa欧美色吧激情视频| 亚洲国产精品av| 国产成人精品一区二区三区四区| 日韩欧美高清dvd碟片| 国产精品一区二区久久不卡| 欧美一级淫片007| 成人激情文学综合网| 亚洲一本大道在线| 欧美一区三区二区|