This project is read-only.

FoxPro Screen -- to Javafx 2.0 source

Topics: General, New Project Idea
Jun 3, 2011 at 1:21 AM

Playing around with code that will create sourcecode from a Visual FoxPro Screen -- to run on the new Javafx 2.0 Beta.

Any thoughts?

Mike

Jun 6, 2011 at 8:06 PM

Can you elaborate on what you are attempting to do? Is there a blog post or something you can point us to? I'm curious what you are up to here?

Jun 6, 2011 at 8:14 PM

Send an SCX file ... to a program.

End up with a Javafx Program that runs, tied to mysql database --- also playing with db4o

With everything working.

Javafx 2.0 is in Public Beta now.

Various controls will happen first. Not everything will work.

Its working right now... but only label, field box, window -- are supported.

Code runs right in Javafx after being fed an SCX file.

Mike

Jun 6, 2011 at 8:19 PM

--- Code it made. --- the tool -- 

package test;

import java.util.HashSet;
import java.util.Set;
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.TextBox;
import javafx.scene.paint.Color;
import javafx.stage.Stage;

public class Test extends Application {

public static void main(String[] args) {
Application.launch(Test.class, args);
}

Override
public void start(Stage primaryStage) {


primaryStage.setTitle("Form1");
Group root = new Group();
Scene scene = new Scene(root, 294, 194, Color.LIGHTGREEN);

TextBox txtDispnum = new TextBox();
txtDispnum.setLayoutX(102);
txtDispnum.setLayoutY(39);
txtDispnum.setPrefWidth(87);
txtDispnum.setPrefHeight(23);
root.getChildren().add(txtDispnum);

Label lblDispnum = new Label();
lblDispnum.setText("Disp#");
lblDispnum.setLayoutX(61);
lblDispnum.setLayoutY(39);
lblDispnum.setPrefWidth(33);
root.getChildren().add(lblDispnum);

TextBox txtTowdate = new TextBox();
txtTowdate.setLayoutX(131);
txtTowdate.setLayoutY(84);
txtTowdate.setPrefWidth(73);
txtTowdate.setPrefHeight(23);
root.getChildren().add(txtTowdate);

Label lblTowdate = new Label();
lblTowdate.setText("Towdate");
lblTowdate.setLayoutX(77);
lblTowdate.setLayoutY(84);
lblTowdate.setPrefWidth(46);
root.getChildren().add(lblTowdate);

TextBox txtYearcar = new TextBox();
txtYearcar.setLayoutX(226);
txtYearcar.setLayoutY(141);
txtYearcar.setPrefWidth(38);
txtYearcar.setPrefHeight(23);
root.getChildren().add(txtYearcar);

Label lblYearcar = new Label();
lblYearcar.setText("Year");
lblYearcar.setLayoutX(194);
lblYearcar.setLayoutY(141);
lblYearcar.setPrefWidth(24);
root.getChildren().add(lblYearcar);

primaryStage.setScene(scene);
primaryStage.setVisible(true);

}

}

Jun 6, 2011 at 8:37 PM

Ok, the code looks as expected. However, I don't see the databinding assignments? Where does that happen? For instance, how does the TextBox know what field it is bound to, and what table?  There are bascially two kinds of FoxPro apps floating around... Those that bind to Tables/Cursors (either native dbf tables, or cursors built from a Sql query, views, cursor adapters, etc.), and those that are more objected oriented, where the controls are bound to business objects, and the business object class handles retrieving and updating the data). Curious which of these paradigms you are planning to cover here.

Jun 6, 2011 at 10:24 PM

Exactly how data will be bound, is being thought out. Not even sure the future of this project, I'm just playing. 

db4o and mysql are involved. 

Thoughts revolve around generating the database on the fly, based on data environment and DBC file

Record locking, buffering, on and on... are all complicated subjects, and I have solutions in mind, I'm just

trying to figure out the proper routes to take, and what database would make the most sense. I have a social

media startup revolving around Javafx, db4o, and other technologies, so the brain pool is already

in full motion.

I'm open to suggestions, what database would you use? How would you handle data binding? There are

some really powerful third party and opensource solutions to this problem, would love to hear other

peoples thoughts and ideas. 

Mike

Jun 6, 2011 at 10:31 PM

Well, one thing I think you should do is create a blog post detailing your early work in this area. Then you'd have something to point the VFP community to in order to follow the development of this.

 

 

Jun 6, 2011 at 10:51 PM

I will blog about it, when I get more information. Its all really new right now. More interested in feedback and direction.

Mike