1 / 25

Chapter 11 Navigating Object Model Diagrams

Chapter 11 Navigating Object Model Diagrams. Week 6, 2008 Spring. Getting Layers/Assigning Colors. Which layer/dataframe change will be made? Start from MxDocument class (currently opened .mxd file) Map class (refers to a data frame) FeatureLayer class

Télécharger la présentation

Chapter 11 Navigating Object Model Diagrams

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 11 Navigating Object Model Diagrams Week 6, 2008 Spring

  2. Getting Layers/Assigning Colors • Which layer/dataframe change will be made? • Start from MxDocument class (currently opened .mxd file) • Map class (refers to a data frame) • FeatureLayer class • Renderer class (layer’s legend) • Symbol class • Color class MxDocument is associated with the Map class, but not with Color class. Associated – means that MxDocument’s object has objects in the connected class. Each map document have data frames. Symbols class is connected to Color class, -> symbols have colors.

  3. Association (Class to Class) • * Asterisk means multiplicity – many maps in one map documents (*asterisk not in Mxd to Application) • Properties of Classes • In ILayer, Name returns string and Visible returns boolean values • Some return interfaces, such as FocusMap in IMxDocument returns IMap. FocusMap tells you which dataframe is active. If you want to hop from the MxDocument class to the Map class, you get the FocusMap property. • ThisDocument (predefined object of MxDocument) is an object from IDocument (not IMxDocument), but FocusMap property is with IMxDocument, so that we have to use QI to get to IMxDocument • See next slide for code

  4. From Map to Layer Dim pMxDoc As IMxDocument Set pMxDoc = ThisDocument ‘ QI Dim pMap As IMap Set pMap = pMxDoc.FocusMap ‘hop from MxDocument class to Map class ‘To access Layer ‘Layer class is associated with Map Dim pLayer As ILayer Set pLayer = pMap.Layer(1)

  5. Instantiation (class to class) • Also called “Creates” relationship • Where method in class creates object from another class. • Dashed line with an arrow that points to the created object.

  6. Inheritance (class to class) • When a particular class uses an interface (“Implement”) from a more general class. • Abstract class (Such as Layer) – no objects, once interface is implemented, then objects can be created, (page 176) • Solid lines with triangle:e.g. Layer with ILayer and other connected classes inherit all of layer’s interfaces • To create a new FeatureLayer and set its Name property: • Dim pLayer As ILayer • Set pLayer = New FeatureLayer • pLayer.Name = “USA”

  7. Three different Class Types • Abstract Classes: 2-D gray boxes, no object, parking spots for common interfaces, you need to implement them. • Classes (regular classes): 3-D white boxes. You can’t create from the New keyword, need to use methods/property of other class to get this. • Coclasses: 3-D gray boxes. You can create object with New keyword or from other class’s property or methods.

  8. This only updates TOC, not map. Dim pActiveView As IActiveView Set pActiveView = pMxDoc.ActiveView pActiveView.Refresh

  9. Color Objects • Each color is an object, following diagram show Color abstract and five coclasses: ICmykColor, IRgbColor, IHIsColor, IGrayColor, IHsvColor • Monitor use RGB and printer use CMYK IRgbColor To make a sandy yellow: pRgbColor.Red = 255 pRgbColor.Green= 255 pRgbColor.Blue = 190 RgbColor Blue: Long Green: Long Red: Long

  10. Access Color (p. 189) • Application -- • MxDocument -- • PageLayout -- • Page ---- • Color on the Display diagram

  11. RgbColor in Color

More Related