While layers and the layer-tree are analogous to views and view hierarchies in many ways, a layer's geometry is specified in a different, and often simpler, manner. All of a layer’s geometric properties, including the layer’s transform matrices, can be implicitly and explicitly animated.
Figure 1 shows the properties used to specify a layer's geometry in context.
Figure 1 CALayer geometry properties
The position property is a CGPoint that specifies the position of the layer relative to its superlayer, and is expressed in the superlayer's coordinate system.
The bounds property is a CGRect that provides the size of the layer (bounds.size) and the origin (bounds.origin). The bounds origin is used as the origin of the graphics context when you override a layer's drawing methods.
Layers have an implicit frame that is a function of the position, bounds, anchorPoint, and transform properties. Setting a new frame rectangle changes the layer'sposition and bounds properties appropriately, but the frame itself is not stored. When a new frame rectangle is specified the bounds origin is undisturbed, while the bounds size is set to the size of the frame. The layer's position is set to the proper location relative to the anchor point. When you get the frame property value, it is calculated relative to the position, bounds, and anchorPoint properties.
The anchorPoint property is a CGPoint that specifies a location within the bounds of a layer that corresponds with the position coordinate. The anchor point specifies how the bounds are positioned relative to the position property, as well as serving as the point that transforms are applied around. It is expressed in the unit coordinate system-the (0.0,0.0) value is located closest to the layer’s origin and (1.0,1.0) is located in the opposite corner. Applying a transform to the layer’s parent (if one exists) can alter the anchorPoint orientation, depending on the parent’s coordinate system on the y-axis.
When you specify the frame of a layer, position is set relative to the anchor point. When you specify the position of the layer, bounds is set relative to the anchor point.
Figure 2 shows three example values for an anchor point.
Figure 2 Three anchorPoint values
The default value for anchorPoint is (0.5,0.5) which corresponds to the center of the layer's bounds (shown as point A in Figure 2.) Point B shows the position of an anchor point set to (0.0,0.5). Finally, point C (1.0,0.0) causes specifies that the layer’s position is set to the bottom right corner of the frame. This diagram is specific to layers in Mac OS X. In iOS, layers use a different default coordinate system, where (0.0,0.0) is in the top-left corner and (1.0,1.0) is in the lower-right.
The relationship of the frame, bounds, position, and anchorPoint properties is shown in Figure 3.
Figure 3 Layer Origin of (0.5,0.5)
In this example the anchorPoint is set to the default value of (0.5,0.5), which corresponds to the center of the layer. The position of the layer is set to (100.0,100.0), and the bounds is set to the rectangle (0.0, 0.0, 120.0, 80.0). This causes the frame property to be calculated as (40.0, 60.0, 120.0, 80.0).
If you created a new layer, and set only the layer’s frame property to (40.0, 60.0, 120.0, 80.0), the position property would be automatically set to (100.0,100.0), and the bounds property to (0.0, 0.0, 120.0, 80.0).
Figure 4 shows a layer with the same frame rectangle as the layer in Figure 3. However, in this case the anchorPoint of the layer is set to (0.0,0.0), which corresponds with the bottom left corner of the layer.
Figure 4 Layer Origin of (0.0,0.0)
With the frame set to (40.0, 60.0, 120.0, 80.0), the value of the bounds property is the same, but the value of the position property has changed.
Another aspect of layer geometry that differs from Cocoa views is that you can specify a radius that is used to round the corners of the layer. The cornerRadius property specifies a radius the layer uses when drawing content, clipping sublayers, and drawing the border and shadow.
The zPosition property specifies the z-axis component of the layer's position. The zPosition is intended to be used to set the visual position of the layer relative to its sibling layers. It should not be used to specify the order of layer siblings, instead reorder the layer in the sublayer array.
I just found that its quite a lot of handy work to make Oracle work in Mac OS X Lion. Currently, I have this quite cool machine with good memory anyway, so I decided to step the easy way, than the "too-much-time-to-work way". So, I just decided to use VirtualBox with Oracle's pre-built virtual appliance with Oracle 11g Enterprise Edition. To use this, I use the steps below. 1. Download VirtualBox at http://www.oracle.com/technetwork/database/enterprise-edition/databaseappdev-vm-161299.html 2. Download the virtual appliances at http://www.oracle.com/technetwork/database/enterprise-edition/databaseappdev-vm-161299.html then just follow the steps. 3. I added some specific ports, since I access it thru NAT so whenever I am, it's easier for me just to hook up my virtual appliance and turn it on. So you can issue these command in your terminal, $> VBoxManage modifyvm "OTN Developer Days" --natpf1 "ssh,tcp,,2222,,22" $> VBoxManag...
First, I encountered this error "Can't pvremove physical volume "/dev/sdc1" of volume group "nova-volumes" without -ff" (I'm actually using OpenStack but it's another story). So to remove this, do first, ~# pvscan PV /dev/sdb1 VG nova-volumes lvm2 [1.82 TiB / 1.82 TiB free] PV /dev/sda5 VG cloudmaster lvm2 [297.85 GiB / 12.00 MiB free] PV /dev/sdc1 lvm2 [1.82 TiB] Total: 3 [3.93 TiB] / in use: 2 [2.11 TiB] / in no VG: 1 [1.82 TiB] Then, when I do, ~# pvremove /dev/sdc1 Can't pvremove physical volume "/dev/sdc1" of volume group "nova-volumes" without -ff So I need to, ~# vgreduce nova-volumes /dev/sdc1 Removed "/dev/sdc1" from volume group "nova-volumes" Then do `pvscan` again, ~# pvscan PV /dev/sdb1 VG nova-volumes lvm2 [1.82 TiB / 1.82 TiB free] PV /dev/sda5 VG clou...
I found ShellEd when googling for any shell editor. It was trouble at first because there's no how-to that directs me, where I expect to have a direct link that I can copy-en-paste to my Eclipse for installation. So what I did, I download ShellEd (as of this writing file version ShellEd-Update-2.0.0_M3.zip) from sourceforge.net and install, as required, the Linux Tools . After installing Linux Tools, I then locate thru archive the ShellEd zip file and install it successfully. It works good and I feel satisfied with this cool tool to be embedded in eclipse. The sample attached shell script is from JBoss twiddle. It does supports syntax highlighting, intellisense which is cool. Hope this helps.
Comments