hi shai! i create a container who shows the image when you activate it (for 
example when you are running a query)

i choose that way because when you call showInfiniteProgress()  and you 
dispose it, the current form may have beheaviors unwanted. because that , i 
dont want to show a dialog, preferring to show a rotating image and 
blocking the UI. 

was i clear? I need to block de UI while the rotating image is running 
without use the dialog method.

my code is:

/**
 *
 * @author roman
 */
public class ContainerExp extends Container
{

    Container pane = new Container();
    Container glass = new Container();

    public ContainerExp()
    {

        pane.setUIID("Container");
        glass.setUIID("InfiniteProgress");
        glass.setLayout(new BorderLayout());
        Container infiniteContainer = new Container();
        TableLayout tl = new TableLayout(1, 1);

        infiniteContainer.setLayout(tl);
        Constraint consTL = tl.createConstraint();
        consTL.setWidthPercentage(100);
        consTL.setHeightPercentage(100);
        consTL.setHorizontalAlign(Component.CENTER);
        consTL.setVerticalAlign(Component.CENTER);
        infiniteContainer.addComponent(consTL, new InfiniteProgress());
        glass.addComponent(BorderLayout.CENTER, infiniteContainer);
        //setUIID("InfiniteProgress");

        super.setLayout(new LayeredLayout());
        super.addComponent(pane);
    }

    public void showInfiniteProgress()
    {

        if (super.contains(glass))
        {
            super.removeComponent(glass);
        }

        super.addComponent(glass);

        Display.getInstance().getCurrent().setLeadComponent(this);
    }

    public void removeInfiniteProgress()
    {
        super.removeComponent(glass);
        Display.getInstance().getCurrent().setLeadComponent(null);
    }

    @Override
    public void forceRevalidate()
    {
        super.forceRevalidate(); //To change body of generated methods, 
choose Tools | Templates.
    }

    public void setLayout(Layout layout)
    {
        pane.setLayout(layout); //To change body of generated methods, 
choose Tools | Templates.
    }

    public Container add(Component cmp)
    {
        return pane.add(cmp); //To change body of generated methods, choose 
Tools | Templates.
    }

    @Override
    public Container add(Object constraint, Component cmp)
    {
        return pane.add(constraint, cmp); //To change body of generated 
methods, choose Tools | Templates.
    }

    public void addComponent(Component cmp)
    {
        pane.addComponent(cmp); //To change body of generated methods, 
choose Tools | Templates.
    }

    @Override
    public void addComponent(Object constraints, Component cmp)
    {
        pane.addComponent(constraints, cmp); //To change body of generated 
methods, choose Tools | Templates.
    }

    @Override
    public void removeAll()
    {
        pane.removeAll(); //To change body of generated methods, choose 
Tools | Templates.
    }

}

On Saturday, September 24, 2016 at 3:00:09 AM UTC-3, Shai Almog wrote:
>
> Hi,
> you mean replace the rotating image or something else? 
> The showInfiniteProgress() method creates a transparent dialog so it 
> blocks the UI.
>

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/5a3df2c7-59f9-489f-9216-4087138bc515%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to