FlipBookCMS StudyNote-(5)--Specification of Classes--Package rubenswiering


rubens


Page

INHERATENCE:

Canvas


DEPENDENCE:

rubenswieringa.book.Gradients

SUMMARY:

 

It is a container that holds all contents of a page. GenericPage extends Page, and all other types of page extend GenericPage, such as ImagePage, ProjectDescriptionPage, AboutPage, ContactPage and etc.

 

Beside from that, it has shadow effect graphics for a page. A page might have two type of shadow effect, one for hard page and the other for flexible page. This option is determined by some factors: first of all, the corresponding Book should have hard set true(otherwise this property makes no sense), and then if this page is the first or last page, then it should naturally be hard, otherwise if it is the other side of a hard page, then it should be hard. The _tearable property runs the same logic.

 

It will receive event when its _index changed, this happens when new page instances are inserted into Book instance’s _pages arrayCollection, or some are removed. Its response is to update _index.

 

Key Properties:

 

_index

 

Its index in the _pages of Book.

 

_gradients

 

A Gradients instance, it stores all the logic and data, that can tell how to draw the shadows of a page.

 

_shape

 

Where the shadows will be drawn on.

 

_hard

 

Indicates whether or not this Page should be hard (true) or flexible(false). Defaults to false. Returns true if the flipside Page has is hard, otherwise, determined by this Page explicitHard.

 

explicitHard

 

If hardCover is enabled in the corresponding Book, and this page is either the first or last Page then return true, otherwise just determined by _hard.

 

_tearable

 

Indicates whether or not this Page should be allowed to be torn from its Book, false if not. Defaults to false. Returns true if either this Page or its flipside Page has is tearable, or if the Book associated with this Page has its tearable property set to true.

 

Note that even if a Page has its tearable property set to false, it can still be torn out of its Book with the tear() or tearPage() methods. This property merely indicates whether or not tearing can be achieved by dragging the page-corner manually.

 

explicitTearable

 

If hardCover is enabled in the corresponding Book, and this page is either the first or last Page then return true, otherwise just determined by _hard.

 

Methods:

 

getBitmapData()

 

This method will return a BitmapData object, which has the same content as itself. Should be used as the other side of a being flipped page.

 

drawFoldGradient()

 

Call the _gradients its method-drawFold() to draw shadow on _shape, passing tint and rotate.

 

refreshFoldGradient()

 

To determin if the other side of this page(FlipSide) should be added shadow to. And then call drawFoldGradient() of both this page and its flip page.

 

getFlipSide()

 

Return the other side of this page as a Page object.

 

tear()

 

Call corresponding Book its method tearPage(), passing this object itself.

 

getFlipSide()

 

Return the other side of this page as a Page object.

REFERENCE:

 

http://www.rubenswieringa.com/code/as3/flex/Book/docs/com/rubenswieringa/book/Page.html

 

 

 

 


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值