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 />

String dateString = formatter.format(today);<br />

// Create a font.<br />

StdFont font = new StdFont();<br />

font.setName("Arial");<br />

font.setBold(true);<br />

// Create a text symbol.<br />

TextSymbol textSymbol = new TextSymbol();<br />

textSymbol.setFont(font);<br />

textSymbol.setSize(15);<br />

// Create a text element to be added to the graphics container.<br />

TextElement textElement = new TextElement();<br />

textElement.setSymbol(textSymbol);<br />

textElement.setScaleText(false);<br />

textElement.setText(dateString);<br />

// Add the text element to the graphics container.<br />

IActiveView activeView = hookHelper.getActiveView();<br />

IPoint pt =<br />

activeView.getScreenDisplay().getDisplayTransformation().toMapPoint(x,y);<br />

textElement.setGeometry(pt);<br />

activeView.getGraphicsContainer().addElement(textElement, 0);<br />

}<br />

// Refresh the view.<br />

activeView.partialRefresh(esriViewDrawPhase.esriViewGraphics, null, null);<br />

/*<br />

* see com.esri.arcgis.systemUI.ITool#onMouseMove(int, int, int, int)<br />

*/<br />

public void onMouseMove(int arg0, int arg1, int arg2, int arg3)<br />

throws IOException, AutomationException {<br />

// ignore<br />

}<br />

/*<br />

* see com.esri.arcgis.systemUI.ITool#onMouseUp(int, int, int, int)<br />

*/<br />

public void onMouseUp(int arg0, int arg1, int arg2, int arg3)<br />

throws IOException, AutomationException {<br />

// ignore<br />

}<br />

/*<br />

* see com.esri.arcgis.systemUI.ITool#onDblClick()<br />

*/<br />

public void onDblClick() throws IOException, AutomationException {<br />

// ignore<br />

}<br />

324 • <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!