Return-Path: X-Original-To: apmail-pivot-user-archive@www.apache.org Delivered-To: apmail-pivot-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5E6C11031F for ; Sat, 25 Jan 2014 17:24:09 +0000 (UTC) Received: (qmail 69987 invoked by uid 500); 25 Jan 2014 17:24:08 -0000 Delivered-To: apmail-pivot-user-archive@pivot.apache.org Received: (qmail 69958 invoked by uid 500); 25 Jan 2014 17:24:08 -0000 Mailing-List: contact user-help@pivot.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@pivot.apache.org Delivered-To: mailing list user@pivot.apache.org Received: (qmail 69950 invoked by uid 99); 25 Jan 2014 17:24:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 25 Jan 2014 17:24:07 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy includes SPF record at spf.trusted-forwarder.org) Received: from [75.126.162.27] (HELO server222.serverquality.com) (75.126.162.27) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 25 Jan 2014 17:24:02 +0000 Received: from [222.124.94.213] (port=53545 helo=MoverPC) by server222.serverquality.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.82) (envelope-from ) id 1W76x0-002Tmo-6E for user@pivot.apache.org; Sat, 25 Jan 2014 11:23:23 -0600 From: "Mark R. Chambers" To: References: <001701cf15e9$704a1420$50de3c60$@mrchambers.org> <5878b11f983b4ec4990a287cca53e6c3@BN1PR06MB405.namprd06.prod.outlook.com> <002b01cf1652$75d22770$61767650$@mrchambers.org> <3762664bb99a4f84a6110e5db73d1028@BN1PR06MB405.namprd06.prod.outlook.com> In-Reply-To: <3762664bb99a4f84a6110e5db73d1028@BN1PR06MB405.namprd06.prod.outlook.com> Subject: RE: How to Run Application without DesktopApplicationContext Date: Sun, 26 Jan 2014 00:23:12 +0700 Message-ID: <006001cf19f2$23a3c870$6aeb5950$@mrchambers.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQEAZl5cSE3KwqjQLa9Zb+dvcXuBGgJnfuBnAhsKMbECp2MfPQDFf8e5m+3uirA= Content-Language: en-au X-Antivirus: avast! (VPS 140121-1, 22/01/2014), Outbound message X-Antivirus-Status: Clean X-ServerQuality-MailScanner-Information: Please contact the ISP for more information X-ServerQuality-MailScanner-ID: 1W76x0-002Tmo-6E X-ServerQuality-MailScanner: Not scanned: please contact your Internet E-Mail Service Provider for details X-ServerQuality-MailScanner-SpamCheck: X-ServerQuality-MailScanner-From: mark@mrchambers.org X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - server222.serverquality.com X-AntiAbuse: Original Domain - pivot.apache.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - mrchambers.org X-Get-Message-Sender-Via: server222.serverquality.com: authenticated_id: mark@mrchambers.org X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No Hi All, Thanks Sandros for your feedback I will take a look at the classes. Roger I don't understand how you think you can call DesktopApplicationContect.main after you create a class and still pass variables back and forwards, unless you are talking using super for the constructor, which has the same problems as using Startup. Currently I have changed my code so the main class extends Application and then I change the constructor to the Startup method, it works fine, but does make the application GUI centric... Anyway thanks again both of you for your support. Regards, Mark. -----Original Message----- From: Roger L. Whitcomb [mailto:Roger.Whitcomb@actian.com] Sent: Wednesday, 22 January 2014 12:36 AM To: user@pivot.apache.org Subject: RE: How to Run Application without DesktopApplicationContext So, our application is a desktop app, but there is a considerable amount of work that is done in the "main" method of the application before it ever calls DesktopApplicationContext.main(...), which in turn invokes the "startup" method of the main class, and etc. So, there is no particular reason that you can't create an application class that has all the variables / state that you need, and when you need to display the GUI, at that time, call DesktopApplicationContext.main.... And as Sandro has said, his new classes give you some further help passing state into the Pivot application (in addition to what I just described). HTH, ~Roger -----Original Message----- From: Sandro Martini [mailto:sandro.martini@gmail.com] Sent: Tuesday, January 21, 2014 5:39 AM To: Users - Apache Pivot Subject: Re: How to Run Application without DesktopApplicationContext Hi all, > My application is not GUI centric, and I don't want to make the GUI the main part of the application. > > How can I pass variables back from DesktopApplicationContext or start a pivot application without DesktopApplicationContext? Under trunk (for Pivot-2.1.0, still in development) I put some new classes related to this: ApplicationWithProperties and ApplicationWithPropertiesTest . Take a look and tell us if there is something that should be updated/improved, even for your needs. Note that some month ago I put some test Groovy scripts and classes under Pivot-Stuff ( http://code.google.com/a/apache-extras.org/p/pivot-stuff/ ) in the project pivot-stuff-common-groovy ... under scripts and test you can find some minimal example fro using Pivot in a little different way. As soon as I find some time I should update these examples (or add others) using the new method added in ApplicationWithProperties , so for example I could get GroovyClassLoader from Groovy and set into Pivot application, etc ... I hope this can help you. Bye, Sandro 2014/1/21 Mark R. Chambers : > Hi Roger, > > > > Thanks for your reply. Previously I was using Swing and my own XML > parser to create the GUI. So it was called with for example GUIPanel > mGUIPanel = new GUIPanel() from my main application class that > controlled various devices and the database connections; > > Then I could just access the MGUIPanel.mState information etc... > > The application can be run headless, so sometimes there is not a GUI, > but I guess I can hack around that... > > > > I can probably modify the DesktopApplicationContext.main (to maybe > mainReturn) to return, a reference to the application return type(Just > calls main and then returns the reference....) > > Or I could change the architecture to have it GUI centric... It just > that my diagrams would then need to change... and they would not look > at neat:] > > > > Anyway I think your answer is, that currently it is not supported:] It > would be a nice feature, since probably not everybody wants to use > Pivot from main... > > > > PS-Thanks for the Pivot Framework, I like the code;] Although the > documentation still needs massive amounts of work;] And the Component > Explorer needs to be finished;] > > PS2- If I get some time I will start adding to the Wiki... to try to > minimise the learning cliff;] > > Regards, > > Mark. > > > > From: Roger L. Whitcomb [mailto:Roger.Whitcomb@actian.com] > Sent: Tuesday, 21 January 2014 1:35 AM > To: user@pivot.apache.org > Subject: RE: How to Run Application without DesktopApplicationContext > > > > Hi Mark, > > Welcome to Pivot. I'm sorry that you're having > trouble, but let me see if I can help. To start with, could you tell > me what the original application was written in (i.e., what GUI > framework you were using)? How did you pass information back and > forth between the GUI and the main application before (i.e., was it some kind of RPC, or what)? > > Currently Pivot has just two modes of operation: as a > desktop app, or as a browser applet. These two would use > DesktopApplicationContext and BrowserApplicationContext. There is > probably no real reason we couldn't have a third type of application > (maybe an "EmbeddedApplicationContext" that would act more like the > GUI object that you're talking about). At this moment I wouldn't know > exactly how to go about writing such a class, but I don't know of any > technical reason why it couldn't be done. At some point you have to > hook into AWT and connect to a GUI widget and the event handling > (event loop) for it, but that (I'm pretty > sure) could be wrapped in a slightly different way than > DesktopApplicationContext does it (which pretty much assumes it is the > main program of the application), but maybe more like > BrowserApplicationContext (which obviously is assuming it is wrapped inside a browser as an applet). > > There should be no reason you couldn't pass > application arguments even to a DesktopApplicationContext via the > command line stuff even now. Or if you are using a message bus, or > some other RPC mechanism, why you couldn't use that with Pivot also. > Unless I'm misunderstanding the way your app is architected. So, maybe you could explain a bit more. > > Again, thanks for trying Pivot, and I hope we can get > you going! > > > > ~Roger > > > > From: Mark R. Chambers [mailto:mark@mrchambers.org] > Sent: Monday, January 20, 2014 6:11 AM > To: user@pivot.apache.org > Subject: How to Run Application without DesktopApplicationContext > > > > Hi Pivot, > > > > My application is not GUI centric, and I don't want to make the GUI > the main part of the application. > > How can I pass variables back from DesktopApplicationContext or start > a pivot application without DesktopApplicationContext? > > > > BACKGROUND: > > I have an existing application and I am replacing the GUI component > with Pivot, it is a component of a much larger application. I > previously just had a GUI object that I called and it made the GUI > etc. and I could pass state information and values back to the main > application. Is there any way to do this with pivot? Or do I need to > modify the pivot src? (Or choose another GUI option, although I have > battled with pivot for 3 days. to convert my GUI, and now find out > that I can't seem to be able to get any variables back to the main > program.) > > > > Regards, > > Mark > >