pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roger L. Whitcomb" <Roger.Whitc...@actian.com>
Subject RE: Process meter presentation problem
Date Thu, 06 Sep 2012 23:59:45 GMT
So, we do something similar.  What works is to have a StackPane that is
the parent of your workspace.  Then you can add a new component that has
the ActivityIndication as a child of the StackPane, then remove that
child when you're done (revealing the original component).  Here's what
our code looks like:

              <StackPane bxml:id="textAreaStack">

                <ScrollPane horizontalScrollBarPolicy="fill"
verticalScrollBarPolicy="fill_to_capacity">

                  <TextArea bxml:id="editArea" styles="{tabWidth:8}"/>

                </ScrollPane>

              </StackPane>

 

 

To start the "working" indicator we do this (using a GridPane just so
the activity indicator isn't so big):

                    final ActivityIndicator indicator = new
ActivityIndicator();

                    GridPane grid = new GridPane(5);

                    GridPane.Row row1 = new GridPane.Row();

                    GridPane.Row row2 = new GridPane.Row();

                    GridPane.Row row3 = new GridPane.Row();

                    for (int i = 0; i < 5; i++) {

                                row1.add(new GridPane.Filler());

                                if (i == 2)

                                    row2.add(indicator);

                                else

                                    row2.add(new GridPane.Filler());

                                row3.add(new GridPane.Filler());

                    }

                    grid.getRows().add(row1);

                    grid.getRows().add(row2);

                    grid.getRows().add(row3);

                    textAreaStack.add(grid);

                    indicator.setActive(true);

 

Then when we're done:

                    indicator.setActive(false);

                    textAreaStack.remove(textAreaStack.getLength() - 1,
1);

 

I think the "trick" is to make sure that the StackPane is the parent of
all your workspace so that the new component that has the activity
indicator on it is at the same level (child of StackPane) as your whole
workspace.  So, you could use a GridPane, TablePane, FillPane, or
CardPane as the parent of your workspace.

 

~Roger Whitcomb

 

From: Camilo Casadiego [mailto:Camilo.Casadiego@adv.co] 
Sent: Thursday, September 06, 2012 4:37 PM
To: user@pivot.apache.org
Subject: RE: Process meter presentation problem

 

Hi there finally I managed to make somethng...but still looks
horrible....so here is the sequence...

 

first i select a company to work with

 

 

 

the the ActivityIndicator is shown as expected

 

the when the process finishes it shows the neede screen

 

but when i get back to select another company it removes the works space
(It does because I remove it manually)

  

What I really want to do is to see the ActivityIndicator OVER the
workspace...Some knows which component should I use???

 

If someone has a similar requirement I can send my code for that part of
the application ;)

 

De: Camilo Casadiego 
Enviado el: Thursday, September 06, 2012 5:11 PM
Para: user@pivot.apache.org
Asunto: RE: Process meter presentation problem

 

I think the info regarding the threads isn't necesary because it works
as expected any wai I have a base class tha implements the
TaskListener<String> and another one that extends Task<String> and the
threads run as I want to...

 

The BaseFrameController.bxml is managed by the class BaseFrameController
which definitio si this one:

 

public class BaseFrameController extends Frame implements
GenericViewController

 

and

 

public abstract interface GenericViewController extends Bindable{

 

So al least I have:

 

<?xml version="1.0" encoding="UTF-8"?>

<menus:BaseFrameController title="ADV. Salarix Modulo de Operaciones"
maximized="true"

    styles="{padding:{top:0, left:4, bottom:4, right:4},
showWindowControls:false}"

    xmlns:bxml="http://pivot.apache.org/bxml"

    xmlns:content="org.apache.pivot.wtk.content"

    xmlns:menus="co.com.adv.salarix.operations.module.controller.base"

    xmlns="org.apache.pivot.wtk">

    <bxml:define>

        <FileBrowserSheet bxml:id="fileBrowserSheet"/>

    </bxml:define>

 

 

    <!-- <actionMappings>

        <Window.ActionMapping action="new" keyStroke="CMD-N"/>

    </actionMappings>

  -->

    <menuBar>

        <MenuBar>

            <MenuBar.Item buttonData="Main">

                <Menu>

                    <Menu.Section>

                        <Menu.Item action="choseCompany">

                            <buttonData>

                                <content:MenuItemData text="Seleccionar
empresa" keyboardShortcut="CMD-N"/>

                            </buttonData>

                        </Menu.Item>

                                 </Menu.Section>

                </Menu>

            </MenuBar.Item>

 

           <MenuBar.Item buttonData="Configuracion">

                <Menu>

                    <Menu.Section>

                        <Menu.Item action="config">

                            <buttonData>

                                <content:MenuItemData text="Configurar
opciones"/>

                            </buttonData>

                        </Menu.Item>

                    </Menu.Section>

                </Menu>

            </MenuBar.Item>

            

            <MenuBar.Item buttonData="Herramientas">

                <Menu>

                    <Menu.Section>

                        <Menu.Item action="genDataBase">

                            <buttonData>

                                <content:MenuItemData text="Exportar
base de datos local"/>

                            </buttonData>

                        </Menu.Item>

                    </Menu.Section>

                </Menu>

            </MenuBar.Item>

            

            <MenuBar.Item buttonData="Ayuda">

                <Menu>

                    <Menu.Section>

                        <Menu.Item action="help">

                            <buttonData>

                                <content:MenuItemData text="Ver ayuda"/>

                            </buttonData>

                        </Menu.Item>

                    </Menu.Section>

                    

                    <Menu.Section>

                        <Menu.Item action="about">

                            <buttonData>

                                <content:MenuItemData text="Acerca de"/>

                            </buttonData>

                        </Menu.Item>

                    </Menu.Section>

                </Menu>

            </MenuBar.Item>

        </MenuBar>

    </menuBar>

<Border bxml:id="borderB" styles="{backgroundColor:null, padding:2}">

       <ActivityIndicator bxml:id="activityIndicator"/>

    </Border>

    <Border bxml:id="borderA" styles="{backgroundColor:null,
padding:2}">

       <TabPane bxml:id="contents"/>

    </Border>

 

</menus:BaseFrameController>

 

On one of my las attemps i changed the las lines to this

 

<Border styles="{backgroundColor:null, padding:2}">

           <BoxPane orientation="horizontal"  styles="{fill:true}">

                           <ActivityIndicator
bxml:id="activityIndicator"/>

                     <TabPane bxml:id="contents"/>

           </BoxPane>

    </Border>

Bu the this is te secuence I got (the seleccition on the first box
launches the background process) ;(

 

   

 

As you can see here It shows first the process monitor the the part it
hsould show...but all the marings...and presentation itself is mess up
:s

 

I just want that it only shows the process monitor and then show the
workspace

 

De: Roger L. Whitcomb [mailto:Roger.Whitcomb@actian.com
<mailto:Roger.Whitcomb@actian.com> ] 
Enviado el: Thursday, September 06, 2012 4:37 PM
Para: user@pivot.apache.org <mailto:user@pivot.apache.org> 
Asunto: RE: Process meter presentation problem

 

Which thread are these methods running in?  And what is the parent
container of these two <Border...> components?  Maybe you could supply a
little more context from your main bxml file .... 

 

~Roger Whitcomb

 

From: Camilo Casadiego [mailto:Camilo.Casadiego@adv.co] 
Sent: Thursday, September 06, 2012 1:58 PM
To: user@pivot.apache.org
Subject: Process meter presentation problem

 

Hi there, I used the process indicator example showed in the example in 
http://pivot.apache.org/tutorials/background-tasks.html and everything
is working as expected...but at the end I want to show the process logo
and when the task finishes I want to show the normal working page...What
I want to achieve is something like this..

 

when the process is running should look like this..

 

and when the process is finished i want it to show the actual real
window

 

 

To try to achieve this I have placed components like this

 

<Border bxml:id="borderB" styles="{backgroundColor:null, padding:2}">

       <ActivityIndicator bxml:id="activityIndicator"/>

    </Border>

    <Border bxml:id="borderA" styles="{backgroundColor:null,
padding:2}">

       <TabPane bxml:id="contents"/>

    </Border>

 

Where this componets are contained into a big Frame class

 

ublic class BaseFrameController extends Frame implements
GenericViewController

 

In order to show one or another this is what im trying to do

 

public void activateWaitAction(){

              baseFrame.getBorderA().setVisible(true);

              baseFrame.getContents().setEnabled(false);

              baseFrame.setEnabled(false);

              baseFrame.getActivityIndicator().setActive(true);

       }

       

       public void releaseWaitAction(){

              baseFrame.getBorderA().setVisible(false);

              baseFrame.getBorderA().setEnabled(false);

              baseFrame.getContents().setEnabled(true);

              baseFrame.setEnabled(true);

              baseFrame.getActivityIndicator().setActive(false);

       }

 

when the process startarts I call the first method and when finished I
call the second one...but nothing happens...I can show one or another
window acording on the order I place the in the bxml file...I know this
should be a simple rendering problem bur rigth now Im really stuck..Any
help'll be really apreciated (The code regarding the task and task
monitors works perfect ;) )


Mime
View raw message