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();
}
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();
}
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();
}
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();
}
}
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();
}
}
Aggregations