Positioning a Sublayer
Layer coordinate systems and positioning are similar to those of views. A layer’s own internal coordinate system is expressed by itsbounds, just like a view; its size is its bounds size, and its bounds origin is the internal coordinate at its top left.However, a sublayer’s position within its superlayer is not described by its center, like a view; a layer does not have a center. Instead, a sublayer’s position within its superlayer is defined by a combination of two properties, its position and its anchorPoint. Think of the sublayer as pinned to its superlayer; then you have to say both where the pin passes through the sublayer and where it passes through the superlayer. (I didn’t make up that analogy, but it’s pretty apt.)positionA point expressed in the superlayer’s coordinate system.anchorPointWhere the position point is located, with respect to the layer’s own bounds. It is a pair of floating-point numbers (a CGPoint) describing a fraction (or multiple) of the layer’s own bounds width and bounds height. Thus, for example, {0,0} is the top left of the layer’s bounds, and {1,1} is the bottom right of the layer’s bounds.If the anchorPoint is {0.5,0.5} (the default), the position property works like a view’s center property. A view’s center is thus a special case of a layer’s position. This is quite typical of the relationship between view properties and layer properties; the view prop‐ erties are often a simpler, more convenient, and less powerful version of the layer prop‐ erties.A layer’s position and anchorPoint are orthogonal (independent); changing one does not change the other. Therefore, changing either of them without changing the other changes where the layer is drawn within its superlayer.For example, in Figure 3-1, the most important point in the circle is its center; all the other objects need to be positioned with respect to it. Therefore they all have the same position: the center of the circle. But they differ in their anchorPoint. For example, the arrow’s anchorPoint is {0.5,0.8}, the middle of the shaft, near the end. On the other hand, the anchorPoint of a cardinal point letter is more like {0.5,3}, well outside the letter’s bounds, so as to place the letter near the edge of the circle.A layer’s frame is a purely derived property. When you get the frame, it is calculated from the bounds size along with the position and anchorPoint. When you set the frame, you set the bounds size and position. In general, you should regard the frame as a convenient fac?ade and no more. Nevertheless, it is convenient! For example, to position a sublayer so that it exactly overlaps its superlayer, you can just set the sublayer’s frame to the superlayer’s bounds.A layer created in code (as opposed to a view’s underlying layer) has a frame and bounds of {{0,0},{0,0}} and will not be visible on the screen even when you add it to a superlayer that is on the screen. Be sure to give your layer a nonzero width and height if you want to be able to see it. Creating a layer and adding it to a superlayer and then wondering why it isn’t appearing in the interface is a common begin‐ ner error.
翻译layer的坐标系统和放置类似于Views。一个layer自身内的坐标系通过他们的bounds表现出来。他的size就是bounds的size,他的bounds的origin是它内部的左上角的点。然而,一个子layer的在父layer的Center是不被描述的,就像一个View;layer没有Center。取而代之的是,一个子layer的坐标在其父类中被定义为两个属性的组合,他的位置和他的锚点。想一下把子layer定位在父layer;然后你必须说所有定位穿过子layer的位置和它穿过父layer的位置。
Position: 在父layer坐标系的点。anchorPoint:关于layer自己bounds 的点。这是一对浮点数(CGPoint)描述layer自身的bounds的Width或者Height的一个分数(或多个分数)。因此,例如,{0,0}是layer的左上角,{1,1}是右下角。一个layer的坐标和描点是各自独立的;改变其中一个不会影响到另一个。因此,改变其中任何一个不会影响到已经绘制好的layer。例如,在Figure 3-1,最重要的点是圆的中心点;其他所有的对象需要依靠他被安置。因此,他们都有一个共同的Position:圆心。但是他们的anchorPoint(锚点)不同。例如,箭头的anchroPoint是{0.5,0.8},中间的轴,靠近圆心。另一方面,一个字母的主要点更像{0.5,3},在轴的bounds外面,以便轴靠近圆的边缘。layer的frame是纯衍生的属性。当你获得frame,他是通过bounds的size和Position、anchorPoint计算出来的。当你给frame赋值的时候,你是给bounds的size和Position赋值了。通常,你只需要留意frame作为一个设置界面外观的就行了。通过代码创建一个layer(相对于View的基本layer)有一个frame和bo'un'ds{{0,0},{0,0}},他将不会显示在屏幕上即使当你把它添加到一个显示在屏幕的父layer上。确定给你的layer设置一个非零的Width和Height,如果你想看到他。创建一个layer,将他添加到父layer,好奇他为什么不显示是每一个初学者共同的错误。A
ADM(Add Drop Multiplexer):上/下复用器,插/分复用器
ADM(ADD-Drop Multiplexer):分插复用器
AGC(Automatic Gain Control):自动增益控制
AOLS(All Optical Label Switching):全光标签交换
AON (Active Optical Network):有源光网络
APD(Avalanche Photo Diode):雪崩光电二极管
APON(ATM PON):ATM无源光网络
APS(Automatic Protection Switched):自动保护倒换
ASE(Amplified Spontaneous Emission):自发辐射噪声
ASON(Automatic Switched Optical Network):自动交换光网络
ASTN(Switch Transport Network):自动交换传送网络
ATC(Automatic Temperature Control):自动温度控制
ATM(Asynchronous Transfer Mode):异步转移模式
AU(Administrative Unit):管理单元
AWG(Array Waveguide Grating):阵列波导式
B
BBER(Background Bit Error Ratio):背景误块秒比
BCP(Burst Control Packet):突发包控制分组
BER(Bit Error Ratio):误码率
B-ISDN(Broadband Integrated Services Digital Network):宽带综合数字信息网
C
C(Container):容器
CATV(Cable Antenna Television):有线电视
CC(Connection Controller):连接控制器
Cos(Class of Service):业务等级
CRC(Cyclic Redundancy Code):循环冗余编码
CSMA(Carrier Sense Multiple Access):载波检测多址
CSMA/CD(Carrier Sense Multiple Access/Collision Detected):载波侦听多路访问/冲突检测
CWDM(Coarse Wavelength Division Multiplexing):粗波分复用
D
DBA(Dynamic Bandwidth Assignment):动态带宽分配
DBR(Distributed Bragg Reflector):分布布喇格反射
DCF(Dispersion Compensation Fiber):色散补偿光纤
DD(Direct-Detection):直接检波
DDN(Digit Data Network):数字数据网
DFB(Distributed Feedback):分布式反馈
DFF(Dispersion-Flat Fiber):色散平坦光纤
Diff-Serv(Differentiated Service):区分服务体系结构
DLC(Digital Loop Carrier):数字环路载波系统
DSF(Dispersion-Shifted Fiber):色散位移光纤
DWDM(Dense Wavelength-Division Multiplexing):密集波分复用
DXC(Digital Cross Connect Equipment):数字交叉连接设备
E
EAM(Electro-Absorption Modulator):电吸收调制器
EB(Errored Block):误块
EBFA(Extended Band Fiber Amplifier):扩展波段光纤放大器
EDC(Electronic Dispersion Conpensation)电域色散补偿
EDFA(Erbium-Doped Optical Fiber Amplifier):掺铒光纤放大器
EDSL(Ethernet Digital Subscriber Line):以太数字用户线
EPON(Ethernet Passive Optical Network):以太网无源光网络
ESCON(Enterprise Systems Connection):企业系统连接接口
ESR(Errored Second Ratio):误块秒比
F
FGB(Fiber Bragg Grating)光纤布鲁格光栅
FDL(Fiber Delay Line):光纤延迟线
FEC(Forward Error Correction):前向纠错编码
FET(Field Effect Transistor):场效应管
FRR(Fast ReRoute):快速重路由
FICON(Fiber Connector):光纤连接器
FSR(Free Spectrum Region):自由谱域
FTTB(Fiber To The Building):光纤到大楼
FTTC(Fiber To The Curb):光纤到路边
FTTH(Fiber To The Home):光纤到户
FWM(Four Wave Mixing):四波混频
G
GE(Gigabit Ethernet):吉比特以太网
GFP(Generic Framing Procedure):通用成帧
GFP-F(Frame mapped GFP):成帧映射GFP
GFP-T(Transparent GFP):透明通用成帧规程
GMPLS(Generalized MPLS):通用多协议标签交换
GPON(Gigabit-Capable PON):吉比特无源光网络
GPS(Global Positioning System):全球定位系统
GUI(Graphical User Interface):图形用户接口
H
HEC(Hybrid Error Control):混合差错控制
HFC(Hybrid Fiber Coaxial):混合光纤同轴电缆网
HPA(Higher Order Path Adaptation):高阶通道适配功能
HPC(Higher Order Path Connection):高阶通道连接功能
HPT(Higher Order Path Termination):高阶通道终端
I
IETF(Internet Engineering Task Force):因特网工程部
IGP(Interior Gateway Protocol):内部网关协议
IM(Intensity Modulation):强度调制
IP(Internet Protocol):网络之间互连的协议
L
LAG(Link Aggregation):链路聚合
LAN(Local Area Network):局域网
LCAS(Link Capacity Adjustment Scheme):链路容量调整方案
LD(Laser Diode):半导体激光器
LED(Light Emitting Diode):发光二极管
LER(Label Edge Router):边缘路由器
LLC(Logical Link Control):逻辑链路控制
LMDS(Local Multipoint Distribution Services):本地多点分配业务
LMSP(Linear Multiplex Section Protection):线性复用段保护
LPA(Lower Order Path Adaptation):低阶通道适配功能
LPC(Lower Order Path Connection):低阶通道连接功能
LPT(Lower Order Path Termination):低阶通道终端
LRM(Link Resource Manager)链路资源管理器
LSP(Label Switched Path):标签交换路径
LSR(Label Switch Router):波长交换路由器
M
MAC(Medium Access Control):媒质接入控制层
MAN(Metropolitan Area Network):城域网
MEMS(Micro-Electro-Mechanical System):微机电系统
MFI(Multiple Frame Indicator):复帧指示符
MII(Media Independent Interface):媒体无关接口
MLM(Multi-Longitudinal Mode laser):多纵模激光器
MPCP(Multi-Point Control Protocol):多点控制协议
MPEG(Moving Picture Expert Group):活动图像专家组
MPLmS(Multiprotocol Lambda/Label Switching):多协议波长标签交换
MPLS(Multiprotocol Label Switching):多协议标签交换
MRU(Maximum Receive Unit):最大接收单元
MSA(Multiplex Section Adaptation):复用段适配功能
MSOH(Multiplex Section OverHead):复用段开销
MSP(Multiplex Section Protection):复用段保护
MST(Multiplex Section Termination):复用段终端
MSTP(Multi-Service Transmission Platform):多业务传输平台
N
NAS(Network-Attached Storage):网络存储服务器
NE(Network Element):网元
NFV(Network Function Virtualization)网络功能虚拟化
NGN(Next Generation Network):下一代网络
NNI(Network Node Interface):网络节点接口
NRZ(None- Return-to-Zero):不归零
NZDF(Non Zero Dispersion Fiber):非零色散光纤
O
OADM(Optical Add and Drop Multiplexer):光分插复用器
OAM(Operation, Administration and Maintenance):功能和操作管理与维护
OAN(Optical Access Network):光接入网
OBD(Optical Branching Device):光分路器
OCDMA(Optical CDMA):光码分多址
OCh(Optical Channel):光通道
OCS(Optical Connection Supervise):光连接监控
ODN(Optical Distribution Network):光配线网
ODUk(Optical channel Data Unit):光通道数据单元
OFDM(Orthogonal Frequency Division Multiplexing)正交频分复用
OFS(Optical packet Flow Switching):光分组流交换
OLT(Optical Line Termination):光线路终端
OMSA(Optical Multiplex Section Adaptation):光复用段适配功能
OMSOH(Optical Multiplex Section OverHead):光复用段开销
OMSP(Optical Multiplex Section Protection):光复用段保护功能块
OMST(Optical Multiplex Section Termination):光复用段终端功能块
ONN(Optical Network Node)光网络节点
ONU(Optical Network Unit):光网络单元
OPA(Optical Path Adaptation):光通道适配
OPC(Optical Path Connection):光通道连接
OPOH(Optical POH):光通道开销
OPT(Optical Path Termination):光通道终端
OPU(Optical Pickup Unit):光学读取头
OSNR(Optical SNR):光信噪比
OSPF(Open Shortest Path First Protocol):开放式最短路径优先协议
OTDM(Optical Time Division Multiplexing)光时分复用
OTDMA(Optical TDMA):光时分多址
OTH(Optical Transmission Hierarchy):光传送体系
OTN(Optical Transport Network):光传送网
OTM(Optical Termination Module)光终端复用器
OTU(Optical Channel Transport Unit):光波长转换器
OVPN(Optical VPN):光虚拟专用网
OWDMA(Optical WDMA):光波分多址
OXC(Optical Cross Connect Equipment):光交叉连接器
P
PBB-TE(Provider Backbone Bridge-Traffic Engineering):运营商骨干桥接-流量工程
PBT(Provider Backbone Transport):运营商骨干传输
PEC(Path Computation Element)路由计算单元
PCM(Pulse Code Modulation):脉冲编码调制
PDH(Plesiochronous Digital Hierarchy):准同步数字系列
PDU(Protocol Data Unit):协议数据单元
PHP(Penultimate Hop Popping):最后一跳弹出
PIN(Photo junction Diode):光电二极管
PDL(Polarization Dependent Loss)偏振相关损耗
PLC(Planar Lightwave Circuit)平面光回路
PLSB(Provider Link State Bridging):运营商链路状态桥接
PMD(Polarization Mode Dispersion):偏振模色散
POH(Path Overhead):通道开销
PON(Passive Optical Network):无源光网络
POS(Passive Optical Splitter):无源分光器
PSTN(Public Switch Telephone Network):公共交换电话网
Q
QoS(Quality of Service):服务质量
R
RAN(Radio Access Network)无线接入网
RAPD(Reach-through Avalanche Photo Diode):拉通型雪崩光电二极管
REG(Regenerative Repeater):再生中继器
RFA(Raman Fiber Amplifier):拉曼放大器
RNC(Radio Network Controller):无线网络控制器
ROADM(Reconfigurable Optical Add-Drop Multiplexer):可重构光分插复用器
RPR(Resilient Packet Ring):弹性分组环
RS(Reconciliation Sublayer):协调子层
RSOH(Regenerator Section OverHead):再生段开销
RST (Regenerator Section Termination):再生段终端
RSVP(Resource Reservation Protocol):资源预留协议
RWA(Routing and Wavelength Assignment):路由波长分配
RZ(Return-to-Zero):归零
S
SAN(Storage-Area Network):存储域网
SBS(Stimulated Brillouin Scattering):受激布里渊散射
SC(Switched Connection):交换式连接
SCP(Supply Chain Planning):供应链计划
SDN(Software Defined Network)软件定义网络
SDH(Synchronous Digital Hierarchy):同步数字体系
SDXC(Synchronous Digital Cross-Connection Equipment):同步数字交叉连接设备
SESR(Severely Errored Second Ratio):严重差错秒比
SLA(Service Level Agreement):服务等级协议
SLA(Service Level Agreement):客户业务等级协议
SLM(Single Longitudinal Mode Laser):单纵模激光器
SMF(Single-Mode Fiber):单模光纤
SNI(Service Node Interface):业务节点接口
SNP(Subnetwork Termination Point):子网端点
SNPP(Subnetwork Termination Point Pool):子网端点库
SNR(Signal Noise Ratio):信噪比
SOA(Semiconductor Optical Amplifier):半导体光放大器
SPC(Soft Permanent Connection):软永久连接
SPM(Self-Phase Modulation):自相位调制
SRS(Stimulated Raman Scattering):受激拉曼散射
STM(Synchronous Transport Module):同步传输模块
STP(Spanning Tree Protocol):生成树协议
T
TDM(Time Division Multiplex):时分复用
TD-SCDMA(Time Division-Synchronous Code Division Multiple Access):时分同步码分多址接入
TM(Terminal Multiplexer):终端复用器
TMC(T-MPLS Channel):T-MPLS通路
TMN(Telecommunication Management Network):电信管理网络
T-MPLS(Transport MPLS):传送多协议标签交换
TU(Tributary Unit):支路单元
TMP(T-MPLS Path):T-MPLS通路
TMS(T-MPLS Section):T-MPLS段层
TPS(Tributary Protect Switch):支路保护倒换
TUG(Tributary Unit Group):支路单元组
U
UPI(User Payload Identifier):用户净荷标识
UTRAN(UMTS Terrestrial Radio Access Network):UMTS陆地无线接入网
V
VC(Virtual Container):虚容器
VDSL(Very-high-bit-rate Digital Subscriber Loop):高速数字用户环路
VPN(Virtual Private Network):虚拟专用网
VWP (Virtual Wavelength path):虚波长远道
W
WAN(Wide Area Network):广域网
WAP(Wireless Application Protocol):无线应用协议
WB(Wavelength Blocker)波长阻断器
WDM(Wavelength-division Multiplexing):波分复用
WiMax(Worldwide Interoperability for Microwave Access):全球微波互联接入
WP(Wavelength Path):波长通道
WSS(Wavelength Selection Switch)波长选择开关
X
XPM(Cross Phase Modulation):交叉相位调制
#光纤通信# #光通信# #光纤#
发表评论