Search in sources :

Example 66 with BorderPane

use of javafx.scene.layout.BorderPane in project Gargoyle by callakrsos.

the class ColumnExample2 method start.

@Override
public void start(Stage primaryStage) {
    primaryStage.setTitle("DockFX");
    TableView<Map<String, String>> tableView = new TableView<Map<String, String>>();
    tableView.setEditable(true);
    {
        Map<String, String> hashMap = new HashMap<String, String>();
        hashMap.put("commCode", "코드1");
        hashMap.put("commCodeNm", "데이터 1");
        tableView.getItems().add(hashMap);
    }
    {
        Map<String, String> hashMap = new HashMap<String, String>();
        hashMap.put("commCode", "코드1");
        hashMap.put("commCodeNm", "데이터 2");
        tableView.getItems().add(hashMap);
    }
    {
        Map<String, String> hashMap = new HashMap<String, String>();
        hashMap.put("commCode", "코드3");
        hashMap.put("commCodeNm", "데이터 3");
        tableView.getItems().add(hashMap);
    }
    {
        Map<String, String> hashMap = new HashMap<String, String>();
        hashMap.put("commCode", "코드4");
        hashMap.put("commCodeNm", "데이터 4");
        tableView.getItems().add(hashMap);
    }
    ObservableList<CodeDVO> observableArrayList = FXCollections.observableArrayList(Arrays.asList(new CodeDVO("출력용 코드명1", "코드1"), new CodeDVO("출력용코드명2", "코드2"), new CodeDVO("출력용코드명3", "코드3")));
    tableView.getColumns().add(new ComboBoxTableColumn<>("commCode", observableArrayList, "code", "codeNm"));
    TableColumn<Map<String, String>, Object> e = new TableColumn<>("SAMPLE");
    e.setCellValueFactory(new MapValueFactory("commCodeNm"));
    tableView.getColumns().add(e);
    tableView.setOnMouseClicked(event -> {
        Map<String, String> selectedItem = tableView.getSelectionModel().getSelectedItem();
        System.out.println("유효성 체크입니다.");
        System.out.println("코드 : 데이터 형태로 출력되야합니다.");
        System.out.println(selectedItem.get("commCode") + " : " + selectedItem.get("commCodeNm"));
    });
    primaryStage.setScene(new Scene(new BorderPane(tableView), 1100, 700));
    // primaryStage.setScene(new Scene(new BorderPane(new
    // MysqlPane("sample")), 1100, 700));
    primaryStage.sizeToScene();
    primaryStage.show();
    Application.setUserAgentStylesheet(Application.STYLESHEET_MODENA);
    DockPane.initializeDefaultUserAgentStylesheet();
}
Also used : BorderPane(javafx.scene.layout.BorderPane) Scene(javafx.scene.Scene) TableColumn(javafx.scene.control.TableColumn) ComboBoxTableColumn(com.kyj.fx.voeditor.visual.component.ComboBoxTableColumn) MapValueFactory(javafx.scene.control.cell.MapValueFactory) HashMap(java.util.HashMap) Map(java.util.Map) TableView(javafx.scene.control.TableView)

Example 67 with BorderPane

use of javafx.scene.layout.BorderPane in project Gargoyle by callakrsos.

the class MapValueFactoryExam method start.

/*
	 * (non-Javadoc)
	 * 
	 * @see javafx.application.Application#start(javafx.stage.Stage)
	 */
@Override
public void start(Stage primaryStage) throws Exception {
    VariableMappingView controller = new VariableMappingView();
    controller.extractVariableFromSql("select * from tbm_sm_user where user_id = :userId");
    //controller.setVariableItems(extractVariableFromSql);
    primaryStage.setScene(new Scene(new BorderPane(controller)));
    primaryStage.show();
}
Also used : BorderPane(javafx.scene.layout.BorderPane) VariableMappingView(com.kyj.fx.voeditor.visual.component.popup.VariableMappingView) Scene(javafx.scene.Scene)

Example 68 with BorderPane

use of javafx.scene.layout.BorderPane in project Gargoyle by callakrsos.

the class MimeViewerExam method start.

@Override
public void start(Stage primaryStage) throws Exception {
    WebView center = new WebView();
    WebEngine engine = center.getEngine();
    URL resource = MimeViewerExam.class.getResource("Sample.html");
    // String externalForm = resource.toExternalForm();
    String readToString = FileUtil.readToString(resource.openStream());
    System.out.println("##########################################");
    System.out.println("mime string");
    System.out.println(readToString);
    System.out.println("##########################################");
    final MessageBuilder builder = new DefaultMessageBuilder();
    final Message message = builder.parseMessage(resource.openStream());
    Body body = ((Entity) message).getBody();
    StringBuilder sb = new StringBuilder();
    extracted(sb, body);
    Document parse = Jsoup.parse(sb.toString());
    Elements select = parse.select("img");
    select.forEach(e -> {
        String attr = e.attr("src");
        if (attr.startsWith("cid:")) {
            String cid = attr.replace("cid:", "");
            String string = meta.get(cid);
            e.attr("src", "data:image/jpg;base64,".concat(string));
        }
    });
    System.out.println("##########################################");
    System.out.println("html string");
    System.out.println(sb.toString());
    System.out.println("##########################################");
    System.out.println(parse.toString());
    engine.loadContent(sb.toString(), "text/html");
    primaryStage.setScene(new Scene(new BorderPane(center)));
    primaryStage.show();
}
Also used : Entity(org.apache.james.mime4j.dom.Entity) BorderPane(javafx.scene.layout.BorderPane) Message(org.apache.james.mime4j.dom.Message) DefaultMessageBuilder(org.apache.james.mime4j.message.DefaultMessageBuilder) Document(org.jsoup.nodes.Document) Elements(org.jsoup.select.Elements) Scene(javafx.scene.Scene) WebEngine(javafx.scene.web.WebEngine) URL(java.net.URL) MessageBuilder(org.apache.james.mime4j.dom.MessageBuilder) DefaultMessageBuilder(org.apache.james.mime4j.message.DefaultMessageBuilder) WebView(javafx.scene.web.WebView) Body(org.apache.james.mime4j.dom.Body) TextBody(org.apache.james.mime4j.dom.TextBody) BinaryBody(org.apache.james.mime4j.dom.BinaryBody)

Example 69 with BorderPane

use of javafx.scene.layout.BorderPane in project Gargoyle by callakrsos.

the class CommonsGridExample method start.

/*
	 * (non-Javadoc)
	 *
	 * @see javafx.application.Application#start(javafx.stage.Stage) KYJ
	 */
@Override
public void start(Stage primaryStage) throws Exception {
    try {
        primaryStage.setWidth(1100);
        primaryStage.setHeight(800);
        BorderPane root = new BorderPane();
        Person person1 = new Person();
        person1.setName("김영준");
        person1.setAge("28");
        person1.setAddress("광주 광역시 북구 운암동");
        person1.setMarrayYn("N");
        Person person2 = new Person();
        person2.setName("박종광");
        person2.setAge("33");
        person2.setAddress("경기도 용인시 수지구 상현동");
        person2.setPhoneNumber("123342342");
        person2.setMarrayYn("Y");
        Person person3 = new Person();
        person3.setName("홍정호");
        person3.setAge("33");
        person3.setAddress("경기도 용인시 수지구 상현동    ㅁㄴㅇㅁㄴㅇㅁㄴㅇ");
        person3.setPhoneNumber("23423423423");
        person3.setMarrayYn("N");
        // 컬럼명이 name인경우 이름으로 alias를 준다.
        AnnotationOptions<Person> options = new AnnotationOptions<Person>(Person.class) {

            @Override
            public String convert(String columnName) {
                String name = columnName;
                if ("name".equals(columnName)) {
                    name = "이름";
                } else if ("address".equals(columnName)) {
                    name = "주소";
                }
                return name;
            }

            @Override
            public boolean editable(String columnName) {
                if ("address".equals(columnName)) {
                    return false;
                }
                return true;
            }

            @Override
            public CommboInfo<?> comboBox(String columnName) {
                if ("marrayYn".equals(columnName)) {
                    CodeDVO y = new CodeDVO("Y", "Y");
                    CodeDVO n = new CodeDVO("N", "N");
                    return new CommboInfo<>(FXCollections.observableArrayList(y, n), "code", "codeNm");
                }
                return null;
            }
        };
        CrudBaseGridView<Person> grid = new CrudBaseGridView<Person>(Person.class, /*
																						 * 사용하지고
																						 * 하는
																						 * 데이터셋
																						 * 객체
																						 */
        FXCollections.emptyObservableList(), /*
													 * 컬럼정렬순서 혹은 사용하고자하는 특정컬럼만
													 * 사용하고자하는경우
													 */
        options);
        // 저장버튼을 클릭한경우 처리할 콜백 등록
        grid.setSaveClickCallback(list -> {
            list.forEach(vo -> System.out.println("status : [" + vo.get_status() + "]  item : " + vo));
        });
        // 그리드에 데이터 바인드
        ObservableList<Person> asList = FXCollections.observableArrayList(Arrays.asList(person1, person2, person3));
        grid.addItems(asList);
        root.setCenter(grid);
        Scene scene = new Scene(root, 400, 400);
        primaryStage.setScene(scene);
        primaryStage.show();
    } catch (Exception e) {
        e.printStackTrace();
    }
}
Also used : CommboInfo(com.kyj.fx.voeditor.visual.component.grid.CommboInfo) BorderPane(javafx.scene.layout.BorderPane) AnnotationOptions(com.kyj.fx.voeditor.visual.component.grid.AnnotationOptions) CrudBaseGridView(com.kyj.fx.voeditor.visual.component.grid.CrudBaseGridView) Scene(javafx.scene.Scene)

Example 70 with BorderPane

use of javafx.scene.layout.BorderPane in project Gargoyle by callakrsos.

the class ComponentClassifier method start.

@Override
public void start(Stage primaryStage) throws Exception {
    FXMLLoader loader = new FXMLLoader();
    loader.setLocation(SystemLayoutViewController.class.getResource("VoEditorView.fxml"));
    try {
        Node node = loader.load();
        // {
        //
        // ObservableList<Node> recursive = recursive(node);
        // print(recursive);
        //
        // }
        // {
        // Group group = new Group();
        //
        // // Text는 Shape클래스의 하위클래스
        // group.getChildren().add(new Text());
        // group.getChildren().add(new Button());
        // group.getChildren().add(new Button());
        // group.getChildren().add(new Label());
        // ObservableList<Node> recursive = recursive(group);
        // print(recursive);
        //
        // }
        // {
        // ScrollPane scrollPane = new ScrollPane();
        // ScrollPane scrollPane2 = new ScrollPane();
        // scrollPane2.setContent(new TextArea());
        // scrollPane.setContent(new BorderPane(scrollPane2));
        // ObservableList<Node> recursive = recursive(scrollPane);
        // print(recursive);
        // }
        {
            BorderPane borderPane = new BorderPane();
            ScrollPane scrollPane2 = new ScrollPane();
            scrollPane2.setContent(new TextArea());
            borderPane.setTop(new HBox(new Button(), new Button(), new HTMLEditor()));
            borderPane.setCenter(new BorderPane(scrollPane2));
            FxControlTreeView tv = new FxControlTreeView(borderPane);
            tv.setOnMouseClicked(event -> {
                System.out.println(tv.getSelectionModel().getSelectedItem());
            });
            Scene scene = new Scene(tv);
            primaryStage.setScene(scene);
            primaryStage.show();
        // List<Node> recursive = recursive(borderPane);
        // print(recursive);
        }
    //
    // Scene scene = new Scene((Parent) node);
    // primaryStage.setScene(scene);
    // primaryStage.show();
    } catch (IOException e) {
        e.printStackTrace();
    }
}
Also used : Button(javafx.scene.control.Button) SystemLayoutViewController(com.kyj.fx.voeditor.visual.main.layout.SystemLayoutViewController) Scene(javafx.scene.Scene) TextArea(javafx.scene.control.TextArea) Control(javafx.scene.control.Control) FXCollections(javafx.collections.FXCollections) Skin(javafx.scene.control.Skin) Function(java.util.function.Function) ArrayList(java.util.ArrayList) Application(javafx.application.Application) Parent(javafx.scene.Parent) ScrollPane(javafx.scene.control.ScrollPane) FXMLLoader(javafx.fxml.FXMLLoader) ReadOnlyProperty(javafx.beans.property.ReadOnlyProperty) Method(java.lang.reflect.Method) HBox(javafx.scene.layout.HBox) Node(javafx.scene.Node) IOException(java.io.IOException) List(java.util.List) Stream(java.util.stream.Stream) Stage(javafx.stage.Stage) FxControlTreeView(com.kyj.fx.voeditor.visual.component.FxControlTreeView) DefaultProperty(javafx.beans.DefaultProperty) HTMLEditor(javafx.scene.web.HTMLEditor) ObservableList(javafx.collections.ObservableList) BorderPane(javafx.scene.layout.BorderPane) SystemLayoutViewController(com.kyj.fx.voeditor.visual.main.layout.SystemLayoutViewController) BorderPane(javafx.scene.layout.BorderPane) HBox(javafx.scene.layout.HBox) TextArea(javafx.scene.control.TextArea) Node(javafx.scene.Node) IOException(java.io.IOException) Scene(javafx.scene.Scene) FXMLLoader(javafx.fxml.FXMLLoader) FxControlTreeView(com.kyj.fx.voeditor.visual.component.FxControlTreeView) Button(javafx.scene.control.Button) ScrollPane(javafx.scene.control.ScrollPane) HTMLEditor(javafx.scene.web.HTMLEditor)

Aggregations

BorderPane (javafx.scene.layout.BorderPane)95 Scene (javafx.scene.Scene)58 Button (javafx.scene.control.Button)19 Label (javafx.scene.control.Label)17 FXMLLoader (javafx.fxml.FXMLLoader)14 Stage (javafx.stage.Stage)14 StackPane (javafx.scene.layout.StackPane)12 IOException (java.io.IOException)11 Parameter (aima.gui.fx.framework.Parameter)10 SimulationPaneBuilder (aima.gui.fx.framework.SimulationPaneBuilder)10 File (java.io.File)10 HBox (javafx.scene.layout.HBox)9 HashMap (java.util.HashMap)8 Insets (javafx.geometry.Insets)8 TextField (javafx.scene.control.TextField)8 Map (java.util.Map)6 MenuItem (javafx.scene.control.MenuItem)6 TableColumn (javafx.scene.control.TableColumn)6 TableView (javafx.scene.control.TableView)6 List (java.util.List)5