MO类说明.docx
《MO类说明.docx》由会员分享,可在线阅读,更多相关《MO类说明.docx(19页珍藏版)》请在冰豆网上搜索。
MO类说明
第一部分MAPBEANS
Beans
Description
BeansaretheprimarycomponentsthatcanbeusedtoaddGISfunctionalitytoaJava2SDKapplication.AllMapObjectsvisualcomponentsworkwithintheJFCframework.Ifyou'rehand-codinganapplication,youcansimplyaddthesecomponentsintotheUI,asyouwouldanyotherJFCcomponent.Alternatively,youcoulduseaJava2SDKcompatibleGUIbuildingIntegratedDevelopmentEnvironment,and,afterloadingtheMapObjectsJARfileintotheIDE'scomponentbar,youcanthendragthecomponentsintotheformusedtobuildyourapplication.
Map
Description
TheMapcomponentprovidesawaytovisualizeyourspatialdata.EachtypeofdataisvisualizedinaseparateLayer.YouusuallyobtainaLayerfromaLayerSource.TheLayerisaddedtotheMapbyaddingittotheMap'sLayerset.TheMap'sDisplayManagerarrangestheLayerstoberenderedtoaDisplayinthecorrect"draworder".
TheprimarywaytodrawthemapisbyusingtheMap'ssetExtentmethod.AllLayersintheMap'sLayersetwillberequestedtodrawtheirspatialdatawithinthegivenEnvelope.AnotherwaytodrawthemapistheMap'sredrawmethod.ThismethodsimplydrawstheLayers;themapextentisnotchanged.UsetheredrawmethodifyourapplicationchangesapropertyofaLayersuchastheRendererorcurrentselection.
Diagram
TableofContents
Description
TheTableofContents(TreeToc)componentprovidesawaytovisualizetheLayersinaMap.EachLayerisrepresentedbyaLegendNodethatcontainsatitleandcheckboxthatcanbeusedtocontroltheLayervisibility.ALegendNodewillnormallyshowadditionalinformation,suchasthecolorsandclassificationschosenfortheLayer.
BeforeusingaTreeToc,youmustassociateitwithaMapbyusingthesetMapmethod.
Itispossibleto"select"oneormoreLegendsbyclickingonthem,inwhichcasetheselectedLegendNodeswillbehighlightedintheTreeToc.TheTreeTochasthreebehaviorstoshowitsLegendNode.ThebehaviorcansetbythesetLegendOutOfScaleBehaviourmethod.ThedefaultisOUT_OF_SCALE_LEGEND_HIDE.
OUT_OF_SCALE_LEGEND_HIDE
LegendNodesbecomeinvisiblewhentheirassociatedLayergoesoutofscale.
OUT_OF_SCALE_LEGEND_DISABLE
LegendNodesbecomedisabledwhentheirassociatedLayergoesoutofscale.
OUT_OF_SCALE_LEGEND_DO_NOTHING
LegendNodesremainvisibleandenabledwhentheirassociatedLayergoesoutofscale.
Diagram
AcetateLayers
Description
Asidefromaddinglayerstoamap'sLayerset,youcanalsovisualizeyourdatabyaddingalayertoanAcetateLayer,thenaddingtheAcetateLayertotheMap.
AnAcetateLayerisatransparentJFCcomponentthatisintendedforusewithanimationeffects,suchasatrackinglayeroreditinglayer.Atrackinglayercanbeusedtomoveobjectsacrossthemap,suchastrucksonahighwaysystem.Aneditinglayercanbeusedtoadd,remove,orchangeshapes,suchasagraphicseditor.
ThebasicdifferencebetweenlayersstoredinanAcetateLayerandinthemapisthatifanychangesaremadetothelayerintheAcetateLayerthenaredrawofthemapisnotrequired.Ifyoumakeachangetotheunderlyingdataofalayerthathasbeenaddedtothemap'sLayerset,youmustredrawthemapinordertoseethechange.
AcetateLayersarenotnormallydouble-buffered,whereasthemapisdouble-buffered.Thismeansthateverytimethemapisrefreshed,allAcetateLayerswithinthemaparere-rendered,eventhoughthemapwillusuallyrefreshfromtheoff-screenimage.
YoucanaddseveralAcetateLayerstoamap.YoucanorderthembyusingtheorderingschemeinherentinaJFCJLayeredPane.Becauseoftheadditionalrenderingoverhead,youshouldkeepthenumberofAcetateLayerstoaminimumforperformancereasons.
Diagram
Tools
Description
YoucanhandleMouseEventswithinthemapintwoways.Withinyourapplication,youcanaddaregularAWTMouseListenerorMouseMotionListenertothemaptoprocessMouseEvents.Alternatively,youcancreateaToolinstanceandaddittotheMap.
Youcanaddasmanytoolsasyouliketothemap,butonlyonetoolcanbeselectedandbeactiveatanyonetime-thisisthemaindifferencebetweenMouseListenersandTools.
TheadvantagesofcreatingaToolinstanceare:
-Yougeteasyaccesstothecontainermapanditsservices.
-YoumakeyourMouseEventhandlermoreself-contained.
-YoucanbeguaranteedthatonlyoneToolisactiveatatime.
InadditiontohandlingMouseEvents,ToolsarealsoJFCcomponents.Whenatoolisselected(usingthemap'ssetSelectedToolmethod)thetoolcanvasbecomesvisibleandisenabledtoreceiveMouseEvents.ThetoolcodecanrenderonthecanvasandisrenderedcompletelyseparatefromLayerswithintheMap'sLayerset.Inthisway,youcanperformanydesiredanimationeffectssuchasrubberbandingashape.
Diagram
RubberBands
Description
RubberBandscanbeassociatedwithaRubberBandTooltoprovide"resizablegeometry".AstheRubberBandToolrespondstomouseclicksinthemap,itpassestheMouseEventstotheRubberBandobject.TheRubberBandrespondstotheseeventsandchangesitsshapeaccordingly.
Forexample,theBaseRubberEnvelopeconstructsarectanglehavingonecornerlocatedattheinitialMouseDownevent,andtheoppositecornerlocatedatthecurrentMousepositionasthemouseisdraggedacrossthemap.
ARubberBandisresponsibleforrenderingthegeometryandusesaRenderertoperformthisfunction.YoucanaddarenderertoeachRubberBandyoucreateorusethedefaultprovided.
Diagram
Toolbars
Description
Severaltoolbarsareprovidedtomakeiteasiertoaddmapfunctionalitytoyourapplication.Eachtoolbarencapsulatesselectedfunctionalitythatisdefinedbyappropriateactions.Belowisatablelistingthefunctionsforeachtoolbar.
ZoomPanToolBar
ZoomIn,ZoomOut,ZoomtoPreviousExtent,ZoomtoNextExtent,ZoomtoActiveLayer,ZoomtoFullExtent,Pan,andIdentify
LayerToolBar
AddLayer,RemoveLayer
ProjectToolBar
OpenProject,SaveProject,SavaProjectAs,CloseProject,ExportMap,andPrintMap
SelectionToolBar
Find,Query,Select(withvariousgeometry),Buffer,ClearSelection,andShowAttributeTable
MeasureGeocodeToolBar
LocateAddress,MapTips,Measure(withvariousunits)
Ineachtoolbaryoucanremoveexistingactionsoraddnewactionstomakecustomizedtoolbars.Youhavetosupplyiconstoeachactionthatyouaddtothetoolbar.ToolbarscaneasilybeconstructedbyaddingsubclassestoBaseToolBar.
Diagram
QueryBuilder
Description
TheQueryBuilderclassesprovideaUIaswellaslower-levelcomponentsforhandlingattributequeries.
TheQueryBuilderLightprovidesapanelforassemblingaSQL"whereclause".WhenconnectedwithaFeatureLayerandMap,samplevaluescanbeobtainedtomakeiteasierforenduserstoconstructaquery.TheQueryBuilderpanelincludestheQueryBuilderLightandalsoprovidesatableforexecutinganddisplayingqueryresults,aswellasawaytodisplaysimplestatistics.SimpleQueryBuilderDialogprovidesacompleteDialogthatcontainsaQueryBuilder.
QueryEnvironmentprovidessimplemethodsforparsingandpreparingSQL"whereclauses"forlateruse.ItispossibletopreparseanexpressionusingthedefaultPreParserorbycreatingyourownPreParser;thedefaultprovidesawaytohandleODBC-likemacrocode.TheresultofparsingisatreestructurecontainingQTreeNodeobjects.YoucancompilethistreetoproduceaWhereClauseExaminer,whichcanbeusedtotestifafeaturepassesthe"whereclause"ornot.
Diagram
Otherquerydialogboxes
Description
ThesedialogboxescanbeusedforvariousfunctionsonceyouhaveassociatedthemwithaMapandaFeatureLayer.
GeocodingUIprovidesanenduserdialogboxforperformingageocodingoperation;theuserentersaddressinformationandreceivesbackalistofcandidateitems.
Identifycanbeusedtodisplaythepropertiesofoneormorefeatures,aswellas(optionally)toeditthepropertiesofafeature.
StoredQueryUIprovidesameansforenduserstoentertheparameterizedvaluesofaStoredQuery.
Findprovidesawayforend-userstoselectoneormoremaplayersandtypeastringtobesearchedforwithinthestringattributesofthoselayers.
BufferUIprovidesawaytoconstructageometricshapethatsurroundsthecurrentlyselectedFeatureswithinaFeatureLayer,and(optionally)toselecttheFeaturesfromanotherFeatureLayerthatintersectwiththatshape.
Diagram
Otherdialogboxes
Description
TheLayerPropertiesdialogboxprovidesawaytomodifythecurrentlyusedrenderersofaFeatureLayer.ItalsoprovidesawaytochangethetransparencyofanImageLayerandaLayer'sname.TheLayerPropertiesdialogboxalsodisplayssimplemetadataaboutthelayer.Forexample,itssource.
TheMapTipsUIprovidesasimpledialogboxforenduserstobeabletosettheMapTipfieldforoneormoreLayersfoundinamap.MapTipsaresmallpopupmenusthatdisplaythevalueofaselectedfieldasyouhoverthemouseoverafeatureonthemap.
TheThreadDialogisatoolthatallowsyoutoviewthecurrentthreadusageofeachthreadduringaJavaapplicationsession.Thisdialogboxdisplaysthreadcharacteristicsintheformofatableview,displayingtheName,ThreadGroup,Priority,Alivestatus,Daemonstatus,andinterruptionstatusofeachthread.
TheAboutBoxisagenericcomponentusedtodisplayinformationabouttheproductinwhichitisused.Itwilldisplayalogo,aproductname,aversionnumber,andabuildnumber.
TheRestrictedLogindialogboxisusedwhenaservicerequiresauthenticationandwillprompttheuserforausernameandpasswordforthespecifiedrealmandservice.
TheFontChooserUIdialogboxisatoolthatdeve