18.04.2015 Views

ArcGIS Engine Developer Guide

ArcGIS Engine Developer Guide

ArcGIS Engine Developer Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

BUILDING APPLICATIONS WITH VISUAL JAVABEANS<br />

1. To add the prebuilt toolbar commands, add the following imports to<br />

MapViewerFrame.java:<br />

import com.esri.arcgis.controlcommands.ControlsMapFullExtentCommand;<br />

import com.esri.arcgis.controlcommands.ControlsMapPanTool;<br />

import com.esri.arcgis.controlcommands.ControlsMapZoomInTool;<br />

import com.esri.arcgis.controlcommands.ControlsMapZoomOutTool;<br />

import com.esri.arcgis.controlcommands.ControlsOpenDocCommand;<br />

import com.esri.arcgis.controlcommands.ControlsPagePanTool;<br />

import com.esri.arcgis.controlcommands.ControlsPageZoomInTool;<br />

import com.esri.arcgis.controlcommands.ControlsPageZoomOutTool;<br />

import<br />

com.esri.arcgis.controlcommands.ControlsPageZoomPageToLastExtentBackCommand;<br />

import<br />

com.esri.arcgis.controlcommands.ControlsPageZoomPageToLastExtentForwardCommand;<br />

import com.esri.arcgis.controlcommands.ControlsPageZoomWholePageCommand;<br />

import com.esri.arcgis.systemUI.esriCommandStyles;<br />

2. In the buildAndShow() method, add the prebuilt commands to the toolbar<br />

before the addEventListeners() call:<br />

// Add generic commands to the toolbar<br />

toolbar.addItem( new ControlsOpenDocCommand(), 0, -1, false, 0,<br />

esriCommandStyles.esriCommandStyleIconOnly );<br />

toolbar.addItem( new ControlsPageZoomInTool(), 0, -1, false, 0,<br />

esriCommandStyles.esriCommandStyleIconOnly );<br />

toolbar.addItem( new ControlsPageZoomOutTool(), 0, -1, false, 0,<br />

esriCommandStyles.esriCommandStyleIconOnly );<br />

toolbar.addItem( new ControlsPagePanTool(), 0, -1, false, 0,<br />

esriCommandStyles.esriCommandStyleIconOnly );<br />

toolbar.addItem( new ControlsPageZoomWholePageCommand(), 0, -1,<br />

false, 0, esriCommandStyles.esriCommandStyleIconOnly );<br />

toolbar.addItem( new ControlsPageZoomPageToLastExtentBackCommand(),<br />

0, -1, false, 0,<br />

esriCommandStyles.esriCommandStyleIconOnly );<br />

toolbar.addItem( new<br />

ControlsPageZoomPageToLastExtentForwardCommand(), 0,<br />

-1, false, 0,<br />

esriCommandStyles.esriCommandStyleIconOnly );<br />

toolbar.addItem( new ControlsMapZoomInTool(), 0, -1, false, 0,<br />

esriCommandStyles.esriCommandStyleIconOnly );<br />

toolbar.addItem( new ControlsMapZoomOutTool(), 0, -1, false, 0,<br />

esriCommandStyles.esriCommandStyleIconOnly );<br />

toolbar.addItem( new ControlsMapPanTool(), 0, -1, false, 0,<br />

esriCommandStyles.esriCommandStyleIconOnly );<br />

toolbar.addItem( new ControlsMapFullExtentCommand(), 0, -1, false,<br />

0, esriCommandStyles.esriCommandStyleIconOnly );<br />

addEventListeners();<br />

// Load a preauthored map document on the pageLayout component.<br />

312 • <strong>ArcGIS</strong> <strong>Engine</strong> <strong>Developer</strong> <strong>Guide</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!