PageRenderTime 19ms CodeModel.GetById 15ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/Frameworks/AppKit/rhino.platform/_CPCibCustomView.j

http://github.com/jfahrenkrug/MapKit-HelloWorld
Unknown | 66 lines | 66 code | 0 blank | 0 comment | 0 complexity | fe177ae9b669788f2786d47139749265 MD5 | raw file
 1i;8;CPView.jc;2703;
 2var _1=objj_allocateClassPair(CPView,"_CPCibCustomView"),_2=_1.isa;
 3class_addIvars(_1,[new objj_ivar("_className")]);
 4objj_registerClassPair(_1);
 5objj_addClassForBundle(_1,objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
 6class_addMethods(_1,[new objj_method(sel_getUid("customClassName"),function(_3,_4){
 7with(_3){
 8return _className;
 9}
10})]);
11var _5="_CPCibCustomViewClassNameKey";
12var _1=objj_getClass("_CPCibCustomView");
13if(!_1){
14objj_exception_throw(new objj_exception(OBJJClassNotFoundException,"*** Could not find definition for class \"_CPCibCustomView\""));
15}
16var _2=_1.isa;
17class_addMethods(_1,[new objj_method(sel_getUid("initWithCoder:"),function(_6,_7,_8){
18with(_6){
19_6=objj_msgSendSuper({receiver:_6,super_class:objj_getClass("CPView")},"initWithCoder:",_8);
20if(_6){
21_className=objj_msgSend(_8,"decodeObjectForKey:",_5);
22}
23return _6;
24}
25}),new objj_method(sel_getUid("encodeWithCoder:"),function(_9,_a,_b){
26with(_9){
27objj_msgSendSuper({receiver:_9,super_class:objj_getClass("CPView")},"encodeWithCoder:",_b);
28objj_msgSend(_b,"encodeObject:forKey:",_className,_5);
29}
30}),new objj_method(sel_getUid("drawRect:"),function(_c,_d,_e){
31with(_c){
32var _f=objj_msgSend(_c,"bounds"),_10=objj_msgSend(objj_msgSend(CPGraphicsContext,"currentContext"),"graphicsPort");
33CGContextSetLineWidth(_10,1);
34CGContextSetStrokeColor(_10,objj_msgSend(CPColor,"colorWithCalibratedRed:green:blue:alpha:",169/255,173/255,178/255,1));
35CGContextStrokeRect(_10,CGRectInset(CGRectIntegral(_f),0.5,0.5));
36CGContextSetFillColor(_10,objj_msgSend(CPColor,"colorWithCalibratedRed:green:blue:alpha:",224/255,236/255,250/255,1));
37CGContextFillRect(_10,CGRectInset(_f,2,2));
38}
39}),new objj_method(sel_getUid("_cibInstantiate"),function(_11,_12){
40with(_11){
41var _13=CPClassFromString(_className);
42if(!_13){
43_13=objj_msgSend(CPView,"class");
44}
45if(_13===objj_msgSend(_11,"class")){
46_className="CPView";
47return _11;
48}
49var _14=objj_msgSend(objj_msgSend(_13,"alloc"),"initWithFrame:",objj_msgSend(_11,"frame"));
50if(_14){
51objj_msgSend(_14,"setBounds:",objj_msgSend(_11,"bounds"));
52var _15=objj_msgSend(objj_msgSend(_11,"subviews"),"copy"),_16=0,_17=_15.length;
53for(;_16<_17;++_16){
54objj_msgSend(_14,"addSubview:",_15[_16]);
55}
56objj_msgSend(_14,"setAutoresizingMask:",objj_msgSend(_11,"autoresizingMask"));
57objj_msgSend(_14,"setAutoresizesSubviews:",objj_msgSend(_11,"autoresizesSubviews"));
58objj_msgSend(_14,"setHitTests:",objj_msgSend(_11,"hitTests"));
59objj_msgSend(_14,"setHidden:",objj_msgSend(_11,"isHidden"));
60objj_msgSend(_14,"setAlphaValue:",objj_msgSend(_11,"alphaValue"));
61objj_msgSend(_superview,"replaceSubview:with:",_11,_14);
62objj_msgSend(_14,"setBackgroundColor:",objj_msgSend(_11,"backgroundColor"));
63}
64return _14;
65}
66})]);