Custom layout manager: question sublayout

Trying to implement a border layout manager (see the code), I'm having problem with the sublayout method. When the method is called, the value for the parameter "width" is 240, but the value for the parameter "size" is "1073741823' that really confuses me. I expect the value of "260" that I have tested on a simulator of Pearl.

Can someone shed some light on this subject?

JDE: 4.3

Simulator: 8130

Here is the code:

class BorderLayoutManager extends Manager {

    public BorderLayoutManager() {
        super(Manager.NO_VERTICAL_SCROLL);
    }

    //overwrite the nextFocus method for custom navigation
    protected int nextFocus(int direction, boolean alt)
    {
        // Find the next field to be focused
    }

    protected void sublayout(int width, int height) {
    // calculate the position of each field, then call
    // setPositionChild() and layoutChild() for each field
    }   

   public int getPreferredWidth(){
    // calculate preferred width
   }

   public int getPreferredHeight(){
    // calculate preferred height
   }
}

public class MyScreen extends MainScreen{
    public MyScreen(){
        super();
        BorderLayoutManager manager = new BorderLayoutManager();
        manager.add(BorderLayoutManager.NORTH, new LabelField("North"));
        manager.add(BorderLayoutManager.SOUTH, new LabelField("South"));
        manager.add(BorderLayoutManager.WEST, new ButtonField("WEST"));
        manager.add(BorderLayoutManager.EAST, new ButtonField("EAST"));
        manager.add(BorderLayoutManager.CENTER, new RichTextField("center"));
        add(manager);
    }
}

If your custom Manager Manager has vertical scrolling enabled, then the height will show that this large number.

Tags: BlackBerry Developers

Similar Questions

  • Custom layout manager

    Hi all

    I can't create a custom presentation Manager. I extended the class Manager and set the getPreferredWidth() implement, the getPreferredHeight() and methods sublayout (int width, int height) but I have two LabelFields are not displayed.

    I would like to first of all fields of both label as shown in the image below, but I do not understand creation of custom models. I understand getPreferredWidth() and getPreferredHeight() sets the width and height of the Manager, but I'm confused with the method sublauout (int width, int height) and layoutChild and setPositionchild (field, int, int).

    I'd appreciate it if someone could point out tutorials, examples and notes for custom understanding models.

    Thank you

    Praveen Singh

    Hi arkadyz

    Thank you very much for the help.  I solved the problem I had, I tried to extend the class Manager and setPreferredWidth() to Display.getWidth () and setPreferredHeight() to return the height of the first field.  My problem is that I have added two LabelFields at my personal Manager and tried to keep them on the same line, which meant my int y variable has been created under the zero and my int variable x changed but these two variables x and is also used in setExtent(x,y); If I was getting setExtent (x, 0); which caused my labelfields does not show.

    protected void sublayout (int width, int height) {}
    int x = 0;
    int y = 0;

    for (int i = 0; i)< getfieldcount();="" i++)="">
    Field field = getField (i);
    layoutChild (field, width, height);
    setPositionChild (field, x, y);
    x += field.getWidth () + 90;
    y += 0;
    }
    setExtent (x, y + getField (0) .getHeight ());
    }

  • Big client - vCenter 5.5 response time of the customer Web U1c / questions of Performance and Navigation

    So we're all aware of the issues with vCenter 5.5U1 WebClient and how we are forced to use it to make use of all the features of the v10, vDS 5.5 vHardware (config switch changes the synchronization problems if an emergency change is done on c# client vDS) VSAN only available via the web client, flash, sluggish to questions do not respond the questions and the list goes with the presentation of the menus and hard to navigate, issues SSO (always after 5.5 upgrades)

    So @ VMware vCenter Architecture Team is going to make an effort to hear and give due to the much needed performance improvements and improvements to the user interface before adding more features and SSO type services which majority of clients don't use not and not force it's customers continue to loose faith its vCenter product?

    Looking for answers with options to remove vCenter 5.5 U1c installation as well as a promise to answer to these in vCenter 6.0 version!

    Here is your answer. First of all, to use Chrome as your browser, then you need to go with at least 4vCPU * 32 GB of RAM & adjust the segment size of java for SSO, Tomcat, (TC) Management Server, inventory server and profile based storage to "refine" vCenter device with DB Oracle embedded or external memory. I did, and performance gains went 10 X. This includes the vSAN enabled running clusters. My recommendation that works very well based on design documents:

    vCenter Server inventory

    VMware VirtualCenter Management Webservices (tc Server)

    The inventory service

    (Sps) profile-based storage service

    Large (more than 400 guests or 4000 VMS) stock

    4 GB

    12 GB

    4 GB

    Setting on the vCenter server 5.5 of the memory unit

    • Connect the unit to vCenter server using SSH
    • VI /usr/lib/vmware-vsphere-client/server/wrapper/conf/wrapper.conf configuration file, locate the JVM memory section and change maxmemory to 4096
    Line 66 # Memory #wrapper.java.initmemory = 512wrapper.java.maxmemory = 4096 JVM
    • /usr/lib/vmware-vpx/inventoryservice/wrapper/conf/wrapper.conf VI configuration file, find the setting. MaxMemory and replace it with 12288
    Line 116 # Size (in MB) maximum Java heap wrapper.java.maxmemory = 12288
    • VI /usr/lib/vmware-vpx/sps/wrapper/conf/wrapper.conf find the setting. MaxMemory and change from 1024 to 4096
    On line 154 # Size (in MB) maximum Java heap wrapper.java.maxmemory = 4096
    • Restart the vCenter device w / DB (1000 hosts) external /embedded for lab (100 guests)

    http://KB.VMware.com/selfservice/microsites/search.do?cmd=displayKC&docType=kc&externalId=2005086&sliceId=1&docTypeID=DT_KB_1_1&dialogID=294472825&StateID=1%200%20294492358

    Documentation Centre of vSphere 5.5

    PS: vCenter 6.0 has much better performance based on my beta test... so don't lose hope yet. Many improvements to come...

    PS: I've also broken down on this here until I figured this out just recently: Re: big client - vCenter 5.5 response time of the customer Web U1c / questions of Performance and Navigation

  • Which layout manager to use

    Hello everyone, I drove to the development of my application, I realized that the way in which I developed my application makes ony eyes straight on "BOLD" size screens. My footer is set to use all the way up, but what I really want, it of so he can "stick" to the lower part of the screen and let the section between the header and the footer to expand to fit the screen of the phone.

    The following example illustrates what I would do (arrow indicates there area I'd like to expand). Achieve will require that I write my own layout manager, or is there already a that I could use for this?

    Screen offers setTitle and setStatus. See http://supportforums.blackberry.com/t5/Java-Development/MainScreen-explained/ta-p/606644

  • Background with custom layout error

    Hello

    I have a screen that I put to use a background image, and I created a custom presentation of HFM

    but when I use my layout on the screen I get an 104 error not caught illegal argument exception.

    When I delete the code for the background image, the screen will display properly with my custom layout,

    How can I use my custom with a background image layout.

    Thank you

    Hello

    I ran my application with debugging and here is a screenshot of the debug window when my application crashes.

    He seemed to have solved the problem now my custom layout and and background displays correctly, I changed my background don't not to scale, can someone help explain this that when wrong when using Background.REPEAT_SCALE_TO_FIT

    Bitmap VO = Bitmap.getBitmapResource ("splashscreen.png");
    Background _bg = BackgroundFactory.createBitmapBackground (VO,
    Background.POSITION_X_LEFT, Background.POSITION_Y_TOP,
    ( Background.REPEAT_SCALE_TO_FIT) ;
    VerticalFieldManager _scrMngr = (VerticalFieldManager) getMainManager();
    _scrMngr.setbackground (_bg);

    Bitmap VO = Bitmap.getBitmapResource ("splashscreen.png");
    Background _bg = BackgroundFactory.createBitmapBackground (VO,
    Background.POSITION_X_LEFT, Background.POSITION_Y_TOP,
    ( Background.REPEAT_NONE) ;
    VerticalFieldManager _scrMngr = (VerticalFieldManager) getMainManager();
    _scrMngr.setbackground (_bg);

  • Custom subscription management page

    We had to create a custom subscription management page that publishes on Eloqua to several languages. The position works very well, but what does not work is to know who the visitor is when they click on the link on the email subscription management page. Almost all of our recipients will not have a cookie to the visitor, so how can I tell me the address of e-mail for the contact search when I only have the elq variable that is passed on to the subscription management page?

    Hi Will,

    You can use a simple method for these pages of hosted subscription that would be adding email address to contacts to your URL and then this aid to search for data, or, if you want a method to test more, you could search for visitor when the email recipient lands on the page, extract the e-mail address and then use it to fill your contact database search and make the pre-population of. This method is more complex and requires some knowledge of javascript, but it can avoid the confusion of profile if emails are being sent on etc.

    For a brief explanation of the work of the more complex method, take a look at this thread:

    http://topliners.Eloqua.com/thread/2305

    You can even define searches for information to run only under certain conditions, to stop all data is pre-populated for organic visitors, that this has been discussed on LinkedIn recently in one groups Eloqua where forms are pre-filled with the wrong information.

  • Custom layout of JavaFX nodes

    I'm developing an application for which it is necessary to nodes available in addition to the other (or on top of the other etc..). However, this provision is only an IPO and the user is able to move these nodes arbitrarily. How does correctly in JavaFX? I'll explain my problem with a simplified example:

    Guess I have 2 rectangles and want to place rect2 right of rect1.

    // create first rectangle at position x= 5, y=5 
    rect1
    = rectangle(5,5);
    // create second rectangle to the right of rect1
    rect2
    = rectangle(5+rect1.width(), 5);

    In this scenario JavaFX has not yet determined the width of rect1, and there will be zero. Intuitively, I would make a call that allows JavaFX rect1 and thus determine its width and then add rect2. See the following example:

    // create first rectangle at position x= 5, y=5 
    rect1
    = rectangle(5,5);
    // let JavaFX draw rect1 (width will be calculated and set)
    draw
    ();
    // create second rectangle to the right of rect1
    rect2
    = rectangle(5+rect1.width(), 5);

    Unfortunately, I have not found a method that does what I want. My current solution appealed to the Platform.runLater (), but this does not work properly all the time. If my interpretation of the links is correct, the links also are not appropriate for this problem. I want only to provision initially nodes, so I have to remove the link after the initial layout (or do rect2 would move if rect1 is moved).

    Thanks in advance for any help.

    Custom presentations are generally made subclassing region, the substitution of layoutChildren() and calculations of page layout based on the prefWidth and the prefHeight of the child nodes.  Best place to understand this for example is by examining the source code of JavaFX , as I've never seen a tutorial on the subject.

    A round, you can use that may or may not be suitable for you, is to use the layout panels for the default page layout, then use translate the properties to allow the user to the default layout components, the translation in this way you can avoid the creation of a custom layout component.

    Another way to do is to use a base pane as the layout container that is not automatic on her children, add children to the pane in the constructor of the component.  Layout() and applyCss() use children to measure children if necessary in order to determine the appropriate size.

  • Several custom layout Page?

    So it's a little hard to imagine a thread title that sets out succinctly what I have wrong here.

    Basically, I'm wondering if it is possible to display a * SINGLE * page of a * MULTIPLE * custom layout in the print module. It is quite possible, I'm just retarded and I'm missing something simple, but when I add a page to the page layout, he appears in what is basically a grid view, with all the pages visible at a time. Addition of pages just makes each smaller page. Of course, it is not an ideal situation to make layouts.

    So, am I missing sort of totally obvious to solve this problem? The print module makes page views when making contact sheets and so on, so I know it is theoretically possible. Or is it not feasible in custom mode?

    There is a zoom button of the page on the top left preview pane

  • Why not the customer answer my questions

    I sent support of services and the client twice today.  The first time last Thursday, but no response despite their promise of a response within hours.

    My organization will not open port 80, so I need to know where Captivate 4 reviews before loading when on the network.  If Captivate 4 is not on a network by default to download from the internet at the beginning upward.  However if you are on a network there a good 5 min delay why Captivate 4 trying to access a site through port 80.  I asked a technical support and service to the customer but no response.  When I know where Captivate tries to go to that my business will allow me to filter on port 80.

    Why not the customer answer my questions

    Hello

    I am at a total loss to explain why the customer is not answering your question.

    Have you tried to ask your IT people perhaps judicial investigations? I think that if Captivate attempts to communicate on port 80 that is sort of "calling home" to an Adobe web address any.

    I hope that get you it sorted! Rick

  • OPM does not have the custom function Manager

    1. I have manually created an 'include' file in the 'Development' folder and add it to the project in the OPM.
    2. I put the program manager JAR in the "include" folder
    3. I created "" MyProject - config.xml "and place it in the"include"folder."
    4 OPM charge MyProject - config.XML when I generate the project. I found this by making the XML invalid, and OPM has complained about this.
    5. When you debug the project, OPM says:
    A custom function "isValidSPId" has been called and there is no custom function Manager. Choose a DLL and a class to provide a custom functions for this one.


    And I chose "Java" as a platform for the project properties.

    5. When you debug the project, OPM says:
    A custom function "isValidSPId" has been called and there is no custom function Manager. Choose a DLL and a class to provide a custom functions for this one.

    The debugger expects a function custom .NET, not a custom Java function

    And I chose "Java" as a platform for the project properties.

    I'm not sure what you mean - there is no such thing as a platform of modules - all rulebases are platform independent. Do you mean the setting of "Regression Tester - platform properties? If so, these effects only the platform used to run regression tests - not for compiling, debugging, or running with or without screens.

  • Custom auto layout predefined question...

    I am in the book module and try to use "layout auto preset editor'... when I go to save all the special pre-defined it does not save the predefined area remains empty. I have only four presets comes with lightroom and impossible to create my own.

    I use LR 4.1 on Mac OS 10.8 mountain lion... Is this a bug?

    This is FIXED now, but here's what I had to do...

    I tried to repair permissions before all this, but it did not work... I even tried to use 'get info' and change the permissions & sharing settings... it does not either.

    1. COMPLETELY uninstalled LR doing the following:

    -Drag the icon of the Lightroom application in the trash...

    -in the user account, drag the following to the trash...

    ~/Library/application support/Adobe/Lightroom

    ~/Library/preferences/com.Adobe.Lightroom3.plist

    ~/Library/preferences/com.Adobe.Lightroom3.LSSharedFileList.plist

    ~/Library/caches/Adobe camera Raw

    ~/Library/Caches/com.Adobe.Lightroom3

    -in the library folder - the system level, drag the following in the trash...

    / Library/Application Support/Adobe/Lightroom

    2 empty the Recycle Bin and Rebooted the computer

    3 repair permissions

    4. download and install 4.1 LR

    5 fix the permissions

    6 launched LR with a new empty catalog

    7 went to the book module and created a custom presentation

    8. open my catalog back and found the new layout and could also create new ones.

    I don't know if I do step 6, but I've been talikng no chance at that time!

  • keep the question sublayout call...

    Hello

    Recently too much question about Torch 9800 peripheral,

    I create a screen with a couple of FieldManager.

    Let me say:

    One is Top, one is average. and we're down.

    Top and bottom can not scroll, a middle ground is scrollable,

    The medium contains two fields, the top is FieldManger, the following is ListField, once the user, click on an element of ListField, this field will be add to the high page one.and then refresh ListField show indicate an added with different colors.

    the question is, once the item is added to the top, it will call sublayout to screen rearrange, everything works fine on the Simulator and machine torch not peripheral. Once I loaded device to torch, it will make a sublayout loop, if I scroll the FieldManager to hide, then loop stops.

    is there any kind of person give me some hint? How to draw that? I worked all day and no idea right now.

    Thanks in advance.

    When you say it will loop, is a recursive call, sublayout where a treatment which is sublayout of calls and so on.  Or is this just keep is called?

    I suspect that it maintains just get called.  In this case, you have to d through the entire treatment do you and are looking for something that could make a field think we should throw himself again.  Looks like that in the middle of the page layout you do something, like a font of domain change, which causes the transformation to program another provision.

  • Rearrange the order of the fields in a custom battery Manager

    I am creating a custom handler where the content fields overlap between them (like the tabs of the file) and I want the field to appear above the other tabs when selected.

    I've been (but not all)

    • Adds an array of fields to the custom handler in their order, but during the sublayout, I put in the position and arrangement of the field first before all other fields
    • also added the index selected the Manager first, but the order of focus change.

    Does anyone know how to rearrange their display order battery? Is it still possible?

    It is only my understanding...  Not done.

    I think knowing that a Manager displays or paint the fields in the order they are added.  It will also move by default in this way.  When the focus moves, the field is painted with focus, but what this really means is that the area of the screen is redrawn.  The Manager will know which fields are displayed in the box that needs repainted and asked to be repainted.

    So if you have two fields, and they overlap, the second field is always painted on the first field, which is not what you want if the first field is in focus.

    In short, using my 'model', if you want something on top, it must be the last thing added to the Manager.

    So when the focus moves, you need to add and remove fields to the Manager.  This is not an operation that I would actually recommend.  Change of field managers in this way is 'expensive' in regard to treatment and could slow down at all, if in fact it works - I don't know how well a manager could face having the field at point removed and re added.  But this is probably the easiest option, at least the simpler I think.  The only other option I can think of involves a fancy paint treatment.

    You want to give this a go and see how you go?

  • Creation of a photo gallery / portfolio for a customer to manage (CMS &amp; Business Catalyst)

    I was asked to create a website for a client, the client is a photographer and want a site to promote her nursery school photography business. She would like to be able to manage the site itself using the BC dashboard, upload pictures as and when necessary. I use Muse to create sites and have informed the customer that for any CMS they need hosting with Business Catalyst.

    My question is to create a relatively unlimited photo gallery / portfolio. I understand a customer can download and edit the images on their site using the dashboard of BC, providing there is a slot available to do so. I believe that Business Catalyst has a module of Gallery of photo on their Web marketing package, it would be what I'm looking for? Otherwise there is no good solution workaround available for my client using only Muse?

    In the future, the customer is looking for secure areas of the site and also a control system online, but right now it's a pretty simple promotional site with a good photo gallery.


    I posted a similar question last week, someone very kindly suggested Smugmug, I looked into a separate (including Smugmug) solution but it is not appropriate in this case and I would stick to the Muse, BC and Adobe.

    Hello

    Yes, you can use the photo gallery module, where your customer would be able to download new images of the backend site and update the module. There are also other settings they can use for image display with photo gallery.

    https://www.YouTube.com/watch?v=x-MuLyhxS5o

    https://www.YouTube.com/watch?v=Hg8pB1cLvnk

    For future preferences, your customer can configure the secure areas, online shop site admin etc.

    Let me know if you have any questions.

    Thank you

    Sanjit

  • Laptop HP 15 t-J000 - HP Recovery Manager question

    Hi guys,.

    I have what should be a simple enough question. The laptop is as above - I am on Windows 8.1.

    My computer people at school asked me to reinstall windows 8 on my computer.  It seems that the best way to do it is through HP Recovery Manager. I have the split of 1 TB drive into two partitions - partition (drive C) system and a partition of a data (drive D). My question is this: Recovery Manager of HP software is to reformat the whole disc or only the system partition (i.e., drive C)?

    If I need to move the data from the drive to complete the resettlement, I can, but I'd much rather not.

    Thank you!

    Please see performing a recovery of HP (Windows 8) system;

    • System Recovery: This option reformats the system disk (usually C, reinstall the original operating system and reinstalls all the original hardware and software drivers.)

Maybe you are looking for