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
|