Pattern Observer and Observable

Hi,
I have a class that contains two methods. Can I observer each method from tha same class?
I show you an example:
public class Menu extends Observable implements ActionListener {
public void method1(){
setChanged();
notifyObservers(foo);
public void method2(){
setChanged();
notifyObservers(foo2);
Now I want to observe this methods from another one class.
public class pannelloDX implements Observer{
public void update(Observable obs, Object obj) {
//How can I distinguish the two observed methods?
thanks
}

If you're using the "push" model of the observer pattern, Buddy, you can use the second parameter (is
it cleverly called "arg" in the API?) to indicate how the observable has changed. By the way, Observable
and Observer in java.util aren't exactly God's gift to the observer pattern. Check out PropertyChangeListener
and PropertyChangeSupport, etc... in java.beans.

Similar Messages

  • Observable and Observer

    I am trying to use Java Observable and Observer to notify the change in one object to other.
    So i have to extend Observable class on the object which i want to montior on and
    my observer class implements the observer to listen toupdate.
    I have achieved the basic Observable and observer running.
    Where I am having problem is, I couldn't figure out how to monitor, lets say 100 instance of the same object, with one object? I am not even
    sure whether it is possible or not, if yes, can somebody tell me how
    this can be achieved.
    what i want to do in code
    //The Observable class
    public class Foo extends Observable {
        public void setFoo(String abc){
             //blah blah
             setChanged();
              notifyObservers();
    //Observer class
    public class observeFoo implements Observer{
        public void update(Observable o, Object oo){
            //blah blah
    }Lets say i have 100 threads running each holding one instance of Foo
    class. Is it possible to observe all those Foo instance running on each
    thread by one observeFoo class? If yes how?
    any help will be appreciated.
    thanx in advance.

    Just add the single Observer as an observer to all the observable objects. NotifyObservers() will do the rest.

  • Quick advice needed on Observer and Observable...

    Ok at the moment i have about 10 sorting algorithms in 10 classes. They all extend another class which includes methods like print, randomise, user input etc etc which all sorting classes use. So basically my sorting classes only sort and nothing more is done in those classes.
    Now what i want to do is have some statistics on a GUI. This will include copy coperations, compare operations and total operations. I will obviously need to input where these operations occur for each sorting class. I want the GUI to be updated each time an operation happens. All my sorts run in a thread, i did this so i can choose the speed of the sort with a JSlider.
    My question is, will i need to be using the Observer and Observable interface? If so, can i have some advice into how i would structure this. If not, then how else can i do a statistics class. I tried a way without this approach, but it didn't seem too OO friendly. Any help is appreciated.
    Thanks in advance.

    I'm not a GUI guy and this is definitely not the best way to do it - but you could probably call an update method after each calculation or whatever. Make a static method that has a reference to your GUI form.
    This is definitely not an elegant solution - but I think it's explicit and readable, and that can be more valuable than elegance.

  • Observer and Observable

    hi,
    This is Mohan from India(Chennai). What is the use of Observer interface and Observable class? Sample code for how to implement Observer interface and Obserable Class.
    reg,
    mohan.

    Read here, and do a forum search before you post, please.
    http://forum.java.sun.com/thread.jsp?forum=4&thread=356132

  • Observable and Observer have the wrong name?

    Hi,
    A abjective term like able is used to indicate interface and noun indicate a class.
    For example, printable is interface, Printer is class.
    but java.util.Observer is interface and java.util.Observerable is class.
    It it a java bug?
    Thanks,
    Jie

    Yeah, their point was that you should be able to
    observe any class, therefore observable should be an
    interface. The gist of their argument can be found
    at http://sys-con.com/story/?storyid=35878&DE=1.
    Yes, thank you for reminding me. I have the book at home, and it's been at least two years since I read it last.
    I think Observer/Observable pre-dates JavaBeans by a
    year or two. I never use the JavaBeans
    listener/event model, either. I usually apply the
    observer pattern without abstract types for either
    role.The Spring framework has a nice BeanWrapper that makes it easy to turn any POJO into something that notifies any interested party about changes. I think some care needs to be taken to make sure that events don't propagate outside the layer of the wrapped POJO, though.
    The initial intent had VB-like manipulation environments and UI components in mind. I don't know if it's been applied to middle tier behavior all that much.
    %

  • About Observer and Observable

    I want to know what is the use of Observable class ? where it is used ?
    also the use of Obsever Inteface?

    Read the API and check out this simple example, http://www.devx.com/tips/Tip/22592?trk=DXRSS_JAVA

  • Help please on Observer / Observable and Serial Communications!

    Help!
    I have a project where I need a java application to talk to some test equipment via the serial port. I have studied the java comm api and played around with the SerialDemo example which I used to model my code.
    I have a SeialConnection class which is very similar to the example except I made it to extend Observable and I have it notify observers when data is detected on the serial port.
    I created a second class which extends Obserable which communicates with the SerialConnection and implemented the observer interface. This class process the incomming and outgoing data and provides some higher level methods, like getSerialNumber(), for my application to use. The application frame is an Observer of this class so the GUI can show the status as well.
    An example method from this class:
    private String Get590AROMString() {
    SendString("EZR-V"); //Send a command to the s.p.
    serialConnection.pause(750); //Basically a sleep(750)
    return ROMVersion; //Return the data from update()
    Excerpt from update method:
    // If return from serialConnection starts with VER: parse the RV and SN.
    if(T.startsWith("VER:")) {
    ROMVersion = new String(T.substring(0,T.indexOf('~')));
    SpeciesName = new String(T.substring(T.indexOf('~')+2));
    return;
    This works great when the test equipment sends a message or when the user selects a command from the program interface. My problem is when I try to send a command to the serial port from within the update method of the observer. There are instances where a result from the serial port needs to initiate another request for information.
    Here is a fragment from the update method of the application frame:
    public void update(Observable obs, Object obj) {
    DensTalkStatus DTS;
    if( obs==DT ) {
    DTS = (DensTalkStatus)obj;
    else if(DTS.GetStatus()==DensTalkStatus.NOTIFY_ZEROOK) {
    if(FIRSTCONNECT590A) {
    GDD.GetDensimeterInfo(); // *** This is the Request
    GDD.SetDensID(EDM);
    FIRSTCONNECT590A = false;
    When I make a request for additional information from the serial port within the update method I get nothing returned and the requested data arrives later after the update method has completed.
    I do not know the fine details of how the javax.comm or observer/obserable works but it appears to me that my strategy can only process one command at a time.
    Can anyone think of a way to allow the application's frame update method to request information and wait for the data to be ready?
    Does anybody have an example of how to do this type of communications?
    I am sorry for the length of this question... Thank you for your time.
    Doug

    I have not received any suggestions yet on an alternate method for this problem, but I have come up with a solution I think will work. I am posting it here so others who have the same problem can at least see what path I followed...
    The basic problem seems to be that I am trying to have my observer ask for information that requires the same observer / observable thread to respond.. duh! :) To requst additional information from the serial port I need to move the requests out of the update() method to a different thread.
    I implemented the SerialWorker class to make the request so the observer update() method could return normally without waiting for the result of the new request.
    Doug

  • Can you force ARD to ask permission before control/observing *AND* still be able to push updates/patches?

    Is there a way to force ARD to ask permission before observing/controling a computer AND still be able to push updates/patches to the computer?
    I know we can't be the only ones who have this dilemma so I'm hoping someone has a solution.
    ARD version 3.
    OS 10.6.8 (ARD machine) and 10.6-10.7 client Macs
    Each remotely monitored computer has an admin account that ARD uses to inventory and update the machines. Let's call it ADMIN. Of course each computer also has a local (non-admin) account let's call USER.
    When USER is logged in, we'd like ARD to always ask permission before observing and/or controlling the computer. We found we can replicate this by removing the ADMIN login and password from the info tab of the computer in question as well as turning on the 'Any guest may request permission' setting. Unfortunately we found this also removes the ability of ARD to start a chat session with the computer - even with the chat option checked on in ARD settings (system preferences). To push updates/patches we have to put the ADMIN account information back into computer info tab.
    Basically it boils down to giving the end user the privacy they would like (not being viewed without warning) while they're logged in vs. allowing the IT department to update the computers when necessary.
    With the ADMIN login and password entered into the computer's info tab we're able to observe/control without warning. We changed the client settings for that computer via ARD to always request permission but this didn't work while the ADMIN login and password were still entered in the info tab. Once we removed the information we were prompted to ask permission but that's because we were essentially an unknown guest.
    It appears to be an either/or situation right now. Either you give the user privacy and always ask permission or you give the IT department the rights to observe a machine and push updates. Because once we put the ADMIN information back into the info tab, we can observe without permission again.
    When USER is logged in, always ask permission to control/observe. But still be able to push updates. If ADMIN is logged in or no one is logged in, don't ask to control/observe.
    Has anyone found a workable solution for this question?

    You can take a look at this website and it will give you the command to run that will control the Observe and Control options for the access mode.
    http://support.apple.com/kb/HT2370
    The command is:
    $
    sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -users "THIS IS WHERE YOU PUT THE USERS YOU WANT TO HAVE ACCESS" -access -on -privs -ControlObserve -ObserveOnly -TextMessages

  • ARD showing users offline, but I'm able to control and observe.

    Strange thing/bug happening.
    I updated a user's computer with a static IP address to new hardware, using the same static IP as before. Old machine was taken out of service, but the brand new Thunderbolt iMac is showing up as offline in ARD.
    Observer and Control buttons connect me to the new machine, but ARD has the old machine's info populating the info fields, including MacOS version and ARD version.
    Deleting and adding the machine back in did nothing to fix the problem — only after changing the new Mac to DHCP the updated info showed up in the scanner window.

    Hello I have ran into this issue as well and this is my solution.
    on the left side i have groups by dept, teachers, etc and found that the link from the left side loses connection from the source like you have on your scanner for bonjour or network range, etc.
    So what i do is in my left pane i would select the specific computers - then press delete key on the mac to remove them.  Then i go to that scanner via ip or bonjour how ever it is searched on the network.
    Find those specific computers again and re-add them to the left folder, smart list, group, etc and now the computer is bold in blue and not offline anymore.
    it some how loses its connection but when i perform my process above they are online and working with no issue able to interact or chat where when it was offline i can remote in but not deploy, chat, interact, etc.  but by removing them and adding again it reconnects or clearing it out is like removing the old cache and everything starts working.
    I have been performed this process for 2 years, and i even took my macbook to apple retail store, and stated there is no reason why it should not work, but they wanted me to delete the app and all settings and do it again - i said no not happening.
    Then i called Apple Edu Support and they jumped in and they stated the process i performed seems to work properly and this is why i continue it.  Until i see a fix in an update.
    Thanks
    Dan Fernandez
    Apple.iOSGenius on youtube
    iOSG3nius on twitter

  • Collection of Tips and Observations

    Being quite new to DPS and having just completed a 100 page brochure I wanted to share some observations and hopefully get some back.
    Some of these may not be true as there may be better ways of working that we haven't discovered yet, and some may be blatently obvious but this is what we have found.
    If you have lots of pages that make use of the same interactivity, setting this up on a master page saves a lot of time, but as you make each new page make sure you release from the master straight away otherwise elements like buttons and actions will not be linked to the right element on the page and will cause In Design to crash when uploading the article
    Using layers for different interative elements can really help organise the interacivity, but make sure all layers are active before you upload the article if you have buttons that link to an inactive layer then In Design will probably crash again
    Labelling buttons and MSO clearly saves a lot of time if you need to trouble shoot why something isnt behaving as you expect later on, In Design makes a good job of renaming duplicate buttons by adding a sequencial number, but if you have several duplicated elements on the same page naming them by their position on the page can help you when linking button actions, e.g. Image Slide Left, Image Slide Right. Having buttons with identical names can also cause crashes when uploading articles, but not always.
    Buttons inside MSO can only control elements inside the same MSO, a bit of lateral thinking (and forum help) can probably achieve the intended results
    If Video content is placed inside a frame that hides (crops) part of the video, the whole video is still shown when published (might be doing this wrong)
    Edge animations that rely on custom javascript need to be added as HTML not OAM (unless there is a way to embed the javascript into oam files?)
    anyway those are just my initial observations based on builing a publication that has a lot of identical layout product pages.

    If Video content is placed inside a frame that hides (crops) part of the video, the whole video is still shown when published (might be doing this wrong)
    You can crop the video as long as the mask is set to be an overlay object.

  • Observing and Controlling Outside My Local Network

    I am trying to observe and control my other computer at work from my house using ARD 3. I have done a port scan using the Network Utility program in Macintosh HD>Applications>Utilities>Network Utility. It said that the ports that were open on my network at work were TCP ports 21 and 443. I did the same thing using the network address at home. The ports it said were open at home were TCP ports 1720 and 5060. I also connected to my Linksys router at home and forwarded those 4 ports. I then went back to ARD and added my office IP address and the correct user name and password. Once I did that, it added the computer just fine. I saw that it told me what the current user, application, and status was of that computer. I clicked on control and the control window did open. The only issue is, the control window is black. I HAVE changed the display settings on my monitor at work to never turn off. I'll change it back once I get this issue fixed. Does anyone know why the control window is black when I click on control?
    Thanks!

    you will need to forward ports 5900 , 5988 and 3283 at the remote router to the desired remote computer. No port forwarding should be required at your local router.

  • Threads and Observers and Observables

    Hi, I have 1 class which extends Observable and implemnts Runnable, th thread is decreminting a value, when the value has reached 0 i have called this.notify() and setChanged. I also have another class which is an observer and implements the Observer interface and has the update metjod. I have written a main for this class to create an instance of my Observable and an instance of my observer. i have of course added the observer. The problem occurs when the notify and setchanged gets called; a java.lang.IllegalMonitorStateException: current thread not owner is thrown.
    Any ideas

    Why are you calling notify()?
    You only need to call notify if there is a Thread waiting on the object's monitor - ie, having previously called wait(). In either case the current Thread needs to hold the object's monitor - ie, the call is wrapped in a synchronized block.
    Perhaps you mean to call notifyObservers() instead?
    Hope this helps.

  • How to find out the PATTERN, GRADIENT and BRUSHED objects?

    How to find out the PATTERN, GRADIENT and BRUSHED objects information in illustrator active document file. And also how to find the CMYK and RGB color information in illustrator file through javascript. Could you please provide any examples.

    I tried using the below code. But for both "cmyk" and "grayscale" pattern it gives only CMYK. Kindly check and advise.
    Code:
    var docRef = activeDocument;
    for(var i=docRef.inkList.length-1;i>=0;i--){
      var inkRef=docRef.inkList[i];
      var inkRefName=inkRef.name;
      alert(inkRefName);
      alert(inkRef.inkInfo.kind);
    Thanks for looking into this.

  • Singleton pattern class and static class

    Hi,
    what is difference between the singleton pattern class and static class ?
    in singleton pattern, we declare a static member[which hold one value at a time] ,static method[ which return static member value] and a private constructor[not allow to direct instantiation]. My words are -- as a singleton pattern we implement static class .
    so can we say a singleton pattern is static class it means both are same or is any difference between these two ??

    malcolmmc wrote:
    On several occasions I've had to convert a static (never instanceated) class to a singleton type, for example because I realise I need an instance per thread, or I decide to make a program more modular, with more than one configuration.
    I've never done the opposite.
    So generally I favour the singleton if there any "state" involved, because it's more flexible in unanticipated directions. It also gives extra flexibility when building tests, especially if you program to an interface.Total agreement; if anything it is dead hard to override static method logic with mock code in unit tests (I had to do it by keeping the static methods in place but making them internally use a singleton instance of itself of which the instance variable could be overwritten with a mock implementation for unit testing purposes...).
    'Static classes' and/or methods are great for very simple util functions, but I wouldn't use them for anything other than that.

  • Pages to ePub observations and hints

    I've been experimenting with exporting ePubs. Here are some things I have have found that may help others.
    These observations are based on Pages v4.1 and iBooks v2.0.1
    These truths might be invalidated when new versions of Pages and/or iBooks appear.
    There may be subtle distinctions and/or situations where these observations don't work as described. Or maybe for some of them, I have gotten close to the truth but not fully realized it completely yet. Experiment with them at your will.
    1. Pages does not and will not insert any "page breaks" (or css causing that effect) in an ePub file per se. When exporting to ePub, Pages ignores any and all page breaks or section breaks you insert into a Pages document. Instead, it splits what it considers to be chapters each into separate xhtml files within the created ePub container. It seems that iBooks is hardcoded to automatically display each xhtml file beginning on a new "page."
    2. According to Apple's "ePub Best Practices" document, Pages considers chapters to be delimited by instances of text of the style "Chapter Name". I have found that changing the name of that style does not effect the resulting ePub. Therefore, it is not the style's name that informs pages to use it as the chapter delimiter. Instead, I have found that Pages will look at all the styles you have marked as to be included in the TOC (hereafter called "TOC-included-styles"). Whichever one of these happens to be used first in the document, will be the style that Pages will use to parse chapters, unless the first TOC-included-style used is named "Chapter Number". In this case, that instance of "Chapter Number" is skipped over when considering the style to use as chapter delimiter, and the next TOC-included-style found will be used.
    3. Unlike "Chapter Name", the style named "Chapter Number" is required be to named "Chapter Number". This style further affects the splitting of the xhtml files, and therefore, iBook's rendering of "page breaks". An exported ePub will normally be split into xhtml files at the first character of all instances of "Chapter Name". A document that also includes any "Chapter Number" instances will be split at the first character of those instances. The rule, in plain english, would be: split into xhtml files at instances of 'Chapter Name', but if any particular 'Chapter Name' instance has a 'Chapter Number' instance before it, back up and make the split immediately before that 'Chapter Number'. If a "Chapter Name" instance has more than one instance of "Chapter Number" before it, the split will happen at the earliest instance of "Chapter Number" until a previous "Chapter Name" is found. If the last "Chapter Name" instance in a document has any "Chapter Number" instances after it, there will be no split at those "Chapter Number" instances. Any other styles in between any of these instances are preserved, so you could have a new page in iBooks with a chapter number, followed by some text, then the chapter's name.  If you rename the  "Chapter Number" style to something else, it is then considered like any other style and has no affect on resulting ePub structure.
    4. If you insert a TOC into your Pages document, it is ignored for ePub export. The TOC created in an ePub will include whatever styles are checked in the Document->TOC inspector. The ePub TOCs as generated by Pages seem to have only two levels of indentation. The high level is the chapter level, as described above, whatever TOC-included-style appears first in the document will be the chapter delimiter and be the least indented level of the TOC. All other TOC-included-styles, no matter what they are named or how they are configured in Pages, will be placed at indent level two in the resulting ePub's TOC. So, a style does not need to be named "Heading" to be included in the ePub TOC, it just needs to be a TOC-included-style.
    5. You can add however many images you want to a chapter, but if the combined file size of the images in that chapter add to more than 1Mb, then the resulting ePub will not display any of the images which cause the size of that chapter to surpass 1Mb.
    6. There is talk that a "magic" resolution for images is 600x860 in order to have them occupy a full "page" in the resulting ePub. I have found that any image whose pixel resolution fills the iBooks page viewport will do that, if the image is also set to cause wrap-with-clear-space on the left and/or right. The iBooks viewport seems to be 368x569 pixels when the iPad is held in landscape orientation. So in other words, no matter how large your image is, when viewing on the iPad in landscape mode, it will be at the most 368x569 physical iPad pixels. Therefore it seems to me, if you only wanted to view a book in landscape mode, you could make all your images exactly 368x569, and not larger, making the resultant ePub file as small as possible. But you'd probably want to design the book for portrait mode as well. In portrait mode, the viewport seems to be 547x???. Where I have not taken the time to deduce the exact vertical viewport dimension, but I know it is close to 780px, either way, the image can be smaller than 600x860. iBooks will shrink any image larger than the viewport at hand (portrait or landscape) to fit the viewport. If the aspect ratio of the image differs greatly from the viewport, the image will appear "letterboxed" because the aspect ratio of the image is maintained as it is shrunk to fit the page's viewport.
    7. The margins of your Pages document, whether they be document-wide margins, or margins within a section, don't seem to affect the resulting ePub. The document-wide-margins and the layout-margins (in a section) can be set to zero. The on-the-ruler margins can be at the edges of the "paper." Extranious tabs on the rulers can affect things. I find it is best to drag all tab stops off the rulers.
    8. Tables are problematic. They are not good constructs to put in ePubs. Pages will dimension tables/columns width based on percentages. So if the overall width of your table drawn in Pages happens to be 50% the width of the "paper", then in iBooks on the iPad, the table will be 50% of the width of iPad's page viewport. An 8.5x11 "sheet" of paper shown in Pages is typically defined as 612 pixels wide* (change your Pages ruler units preferences to Points to verify, the Document inspector will show the page size in pixels). So if you draw your table half the width of that sheet, you get a table 306px wide in Pages. That's pretty good, you can fit a bit of text in a table that wide. But now you export to ePub, and since the iPad's (landscape) viewport is only 368 pixels wide, your resulting table is 50% of that, or 184px wide. Since the size of the text hasn't changed much, now everything is wrapping and going crazy. Column widths are also generated as percentages of the table's width, so a column that fits its content nicely in Pages is now too narrow in the ePub. Confusion ensues. Incidentally, the above assumes your document left and right margins are set to zero, if not, the percentage of width is calculated between the margins, not the edges of the page. What you can do is make the table 100% of the width of the page, in that case the resulting table in the ePub will always be 100% of the width of the page viewport on the iPad. For a bit of left and right margin, you can throw in an empty column to the left and an empty column to the right of your table's content, then shut off the border lines for those side columns so they aren't seen. This won't solve your problems, but might take some of the pain away. If a user cranks the font size up as high as it will go on the iPad, no table remains standing.
    * if you do any measuring with on-screen rulers, make sure you set Page's zoom to 100% first, as it defaults to 125%!
    9. If you want to get a clue as to how your book will flow on the iPad (in landscape mode for example), you can temporarily set your document's Page Size to be 368x569 pixels (will all margins set to zero). You set Page Size and Margins in pixels (in inspector) by first changing the ruler units to Points in Page's settings. Be careful though, it's an approximate result, not exact WYSIWYG, the words won't end up exactly where you see them.
    10. If you have read thus far, you probably already know that the first (on-screen) page of a Pages document can be used to automatically create the ePub's cover image upon export. As mentioned elsewhere on the 'net, floating images can be used on this first page (if they are used elsewhere they are ignored). I have found that shapes, specifically floating shapes can be used on the first page as well. You can even use background shapes! This unlocks the door to creating some truly nice covers with a minimum of work. I have here attached an image of a cover I created in just a couple of minutes without using Photoshop or any other image editor, just Pages. I will describe below how it is done
    All the objects on the first page (shown above) is set to floating or background, therefore, you need to move the inline text to the next page. You can do this by inserting a section break. You can see it in the upper left corner. That forces all the text to be shuttled off to next page, out of the way.
    First I created the swirly pattern background. To do so, create a box shape on the page and immediately set its Placement properties to "in background". Keep "background objects selectable" and resize it to cover the entire page. Remove any border or shadow from it. Then set its Fill to any seamless pattern you like. Keep the pattern pixel dimensions small so as not to create a large ePub. This particular swirly pattern I created very quickly for free at patterncooler dot com. Set the fill properties to "Tile" so that your pattern is tiled throughout the whole box shape. Now you can uncheck "background objects selectable" so that you can work on top of it without disturbing it.
    The size of the pattern repeat itself is important to consider. The book cover will be seen in two places: on iBook's bookshelf (small), and opposite the table of contents in the book itself if the iPad is held in landscape mode. If the size of the repeat is too small, then you cant really make out the pattern in the bookshelf icon because the whole cover has been shrunk down, if the repeat is too large, it might look nice on the bookshelf but funny opposite the TOC. You'll have to experiment, but the repeat used in this example is a good compromise.
    Next the brown spine down the left hand side is another box shape. This one's placement is set to "floating". Stretch it to the edges of the page. I filled this one with a subtle gradient to give it a slightly 3 dimensional look. Remember that iBooks will overlay shade an indentation along the left edge to appear as a crease. So dont make it too dark. Remove any border from this box, but give it a shadow on the right, just enought to make it appear affixed on the book. I used shadow settings of Offset 1pt, Blur 6pt, Opacity 75% at an angle of 323. Too much offset or blur ruins the effect. You want it to appear as a very thin layer adhesed to the "book". As for colors, use the eyedropper on the color inspector to pick colors from the background pattern, this will make it "work together" if you are color challenged.
    The stitching on the right edge of the spine shape is a simple line shape 2 pts wide. Properties are: dotted, with a very slight shadow (2,4,85%,315). You can use the "bring forward" or "send backward" commands if the stack order gets mixed up.
    Next add the Title and Author boxes. They are simple floating box shapes with color fill, and simple black border of 3px. Page's pop-up alignment guides will help you center them in the page. There is no shadow for these boxes as they (here) are supposed to mimic a printed and not a physical adhesion. Instead of a line border, you can also apply Page's "picture frame borders. I went crazy with those, but ultimately came back to the simple line border.
    If you want to make these "adhesions" there are lots of nice paper textures on the 'net you can use as fill.
    Finally you see there is a slight highlight on the top edge of the book and slight shadow along the right and bottom edge. These make the cover seem to have rounded edges, they give it a 3D appearance. To create the right hand "round over" draw a line-shape the height of the page. Make it 5px wide, and give it shadow properties of 5,4,50%,142. Next you have to move it so that it is slightly off the paper and thus not seen, but close enough that it's shadow is still seen. To move it, you can use a combination of the mouse, the arrow buttons on the keyboard, and/or the position inspector pane. In my example, the page is 600px wide, and the line sits at the 601px location. Be careful about moving shapes off the page, as you can "lose" them. Oddly enough, there is no way to see and/or find shapes that are "off page" (that I know of anyway). If you lose a shape off the page, you have to draw selection boxes blindly, until you stumble upon the shape again. It seems a way to hide content if one so desired.
    For the bottom edge of the book, do the same thing with a horizontal line. Shadow angle in my example is the same 142 degrees.
    For the top edge, do the same except make the shadow color white. (5,5,50%,270). This shape is hard to select once you have it offscreen. If you want to select it, you might have to move the background and right edge shadow out of the way first. Then draw a small box at the top right corner of the page until you hit it.
    And one last detail, you might notice my page size is 600x860px (8.333in x 11.944in). This is because I think this aspect ratio is shaped more like a novel than than 8.5x11in (612x792px). The latter is squarer, and more the shape of a text book.
    I hope this stuff has been useful to you.
    Dave

    Thank you for sharing such an informative post! I'd like to offer one small correction.
    My company publishes children's picture storybooks in print. These are edge to edge full color pages for those who may not be familiar with this format. Our early ePub's were always disappointing in that we could not duplicate the print format without showing considerable white margins on an e-reader. We have since solved that problem in order to achieve the maximum image size. There will always be some amount of white margin in ePub format, but our image output now nearly fills the screen of any e-reader.
    The 600X860 resolution is correct in order to achieve a wall to wall ePub image. The image must be created at that resolution for insertion into the document, and the page setup must also be set at the same dimension, which in inches is 8.333X11.944. You cannot, for example, use a smaller size image and drag it with constrained proportions to fill the viewport at the 600X860 resolution. The exported ePub file recognizes the portion of the image that is beyond the margins of the viewport and it will show up in an e-reader with a large white bottom margin.
    Dragging a smaller image than the 600X860 resolution to fill the viewport with unconstrained proportions will work, but of course distorts the image. So, create your images at 600X860, insert them into your doc, export to ePub and you will be happy, happy, happy!

Maybe you are looking for

  • The 'Apps' tab in my Creative Cloud Desktop app shows a Download Error

    I have tried uninstalling, downloading, and reinstalling Creative Cloud Desktop and continue to get the Download Error prompt.  It either shows the Download Error prompt or it continues to just think and think and think.  All the other tabs work norm

  • Moving my catalogue from windows to mac with photos on network storage

    Hi I've been using LR for a while and have a catalogue of about 15,000 photos. I import my camera files to the windows vista machine but periodically move them over to my network attached storage (linux host with USB drives) where I have more space a

  • Audio incorrectly translated in XML from FCP7 to Premiere Pro

    Hi, I'm sure others are dealing with this also, XMLs from FCP7 to Premiere 6.0.2 not translating audio levels correctly. I'm working on 10 episodes @ 30 min each and the rough cut of approx. 450 to 500 shots, all the audio is faded to -999db!?! Is th

  • Zen Micro: Bricked or just lame, you dec

    Hi all, I have a zen micro which i flashed to the old .0 non MTP firmware to have support with winamp. Anyway i decided i wanted MTP support so i tried to flash it and it got stuck on a stage "Please reboot device". I decided to switch it off myself

  • CreateTextField and _height: Problem with Placement of Text Fields

    I'm using createTextField to create several text fields dynamically. I'm also using an external XML file and a style sheet to populate the text fields. My problem is that I'm trying to position the various text fields on the page so that they are spa