Click here to load reader

Cappuccino fundamental

  • View
    2.108

  • Download
    0

Embed Size (px)

Text of Cappuccino fundamental

  • 1. Cappuccino Fundamental 2010.12.07 Outsider

2. 3. Objective-J

    • Objective-C
    • Javascript strict
    • javascript .

Objective-J Preprocessor

    • Preprocessor Javascript
      • ( )
    • Obj-J JS .
    • .
    • Obj-J pre-compile .

4. 5. Application Framework

      • , ,
      • Undo /Redo
      • /

6. Cappuccino

    • Application Framework
    • Cocoa
    • .
    • jQuery DOM .
    • ( )
    • 280North LGPL 2

7. Atlas

    • IDE Graphical interface builder
    • UI .
    • UI
    • UI CIB

8. Back-end send/accept data(JSON) Objective-J(JavaScript) 9. Objective-J Syntax

  • window.orderFront();
  • icon.moveToXY(100, 200);
  • new JFrame();
  • new JFrame("Toolbox");
  • this.setNeedsDisplay(true);

[window orderFront]; [icon moveToX:100 Y:200]; [[CPWindow alloc] init]; [[CPWindow alloc] initWithTitle:"Toolbox"]; [self setNeedsDisplay:YES]; Java Objective-J this -> self true -> YES false -> NO null -> nil moveToX:Y: 10.

  • @import
  • @implementation PageView : CPView
  • {
  • CALayer _rootLayer;
  • }
  • //
  • @end

Base Class Convention: 11.

  • - (id)initWithFrame:(CGRect)aFrame
  • {
  • self = [super initWithFrame:aFrame];
  • if (self)
  • {
  • _rootLayer = [CALayer layer];
  • [self setWantsLayer:YES];
  • [self setLayer:_rootLayer];
  • [_rootLayer setBackgroundColor:[CPColor whiteColor]];
  • [_rootLayer setNeedsDisplay];
  • }
  • return self;
  • }

- + 12.

    • target -> action
    • delegation (subclass )
    • Model - View - Controller

13. Target : Action

  • var searchButton = [CPButton buttonWithTitle:"go"];
  • [searchButton setAction:@selector(performSearch:)];
  • [searchButton setTarget:nil];

@selector() encode target = nil responder chain . // - (void)performSearch:(id)sender { } 14. Delegation

  • [_searchCollectionView setDelegate:self];

"self"delegate . delegate . // CPCollectionView delegate (void)collectionViewDidChangeSelection:(CPCollectionView)collectionView { } 15. MVC

  • @implementation AppController : CPObject
  • {
  • PMSearch currenSearch;
  • CPCollectionView _searchCollectionView;
  • }

Controller Model View 16. Reference

    • CappKiDo
      • http://www.cappkido.eliotis.com/
    • Web
      • http://cappdocs.worldofkrauss.com/

17. capp gen example 18. 19.

    • AppController.j -Application controller (builds initial UI)
    • Frameworks - /usr/local/share/objj/lib/Frameworks
    • index.html -
    • index-debug.html -
    • Info.plist -
    • main.j - main() method
    • Rakefile -Rake
    • Resources - ( )

20. capp config key value user.name user.email organization.name organization.email organization.url organization.identifier ~/.cappconfig : https://github.com/280north/cappuccino/wiki/capp 21. https://github.com/hlship/nfjs-cappuccino . From http://blog.outsider.ne.kr/ myexample/2010/cappuccino/ex.zip 22. Resources

    • http://www.slideshare.net/hlship/brew-up-a-rich-web-application-with-cappuccino
    • http://www.slideshare.net/carsonified/building-desktop-caliber-web-applications-with-objectivej-and-cappuccino-francisco-tolmasky-presentation
    • http://www.slideshare.net/juni0r/cappuccino-a-javascript-application-framework
    • http://www.slideshare.net/chapados/cappuccino-sdruby-20090806
    • http://www.slideshare.net/LukHurych/preparing-cappuccino-in-30-minutes
    • http://www.slideshare.net/jharwig/introduction-to-cappuccino-presentation