Search in sources :

Example 56 with BorderPane

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

the class PeriodBoxExam method start.

/* (non-Javadoc)
	 * @see javafx.application.Application#start(javafx.stage.Stage)
	 */
@Override
public void start(Stage primaryStage) throws Exception {
    BorderPane pane = new BorderPane();
    PeriodBoxComposite value = new PeriodBoxComposite();
    JFXDateTimePicker timePicker = new JFXDateTimePicker();
    Button btnGet = new Button("Get");
    pane.setBottom(btnGet);
    pane.setCenter(value);
    pane.setTop(timePicker);
    primaryStage.setScene(new Scene(pane));
    primaryStage.show();
    btnGet.setOnAction(ev -> {
        System.out.println(value.getStartDay());
        System.out.println(value.getStartDate());
        System.out.println(value.getStartTime());
    });
}
Also used : BorderPane(javafx.scene.layout.BorderPane) PeriodBoxComposite(com.kyj.fx.voeditor.visual.component.date.PeriodBoxComposite) Button(javafx.scene.control.Button) Scene(javafx.scene.Scene) JFXDateTimePicker(com.jfoenix.controls.JFXDateTimePicker)

Example 57 with BorderPane

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

the class VelocityDocumentExam method start.

/* (non-Javadoc)
	 * @see javafx.application.Application#start(javafx.stage.Stage)
	 */
@Override
public void start(Stage primaryStage) throws Exception {
    BorderPane pane = new BorderPane();
    TextArea root = new TextArea();
    TextArea btm = new TextArea();
    SplitPane splitPane = new SplitPane(root, btm);
    splitPane.setDividerPosition(0, 0.6d);
    splitPane.setOrientation(Orientation.VERTICAL);
    pane.setCenter(splitPane);
    Button value = new Button("Excute");
    pane.setBottom(value);
    value.setOnAction(ev -> {
        String velocityToText = ValueUtil.getVelocityToText(root.getText(), new HashMap<String, Object>(), false);
        btm.setText(velocityToText);
    });
    primaryStage.setScene(new Scene(pane));
    primaryStage.show();
}
Also used : BorderPane(javafx.scene.layout.BorderPane) TextArea(javafx.scene.control.TextArea) Button(javafx.scene.control.Button) SplitPane(javafx.scene.control.SplitPane) Scene(javafx.scene.Scene)

Example 58 with BorderPane

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

the class SqlTabPanExample method start.

@Override
public void start(Stage primaryStage) throws NotYetSupportException, GargoyleConnectionFailException, InstantiationException, IllegalAccessException, ClassNotFoundException {
    primaryStage.setTitle("Database Exam");
    CommonsSqllPan sqlPane = CommonsSqllPan.getSqlPane();
    sqlPane.getStylesheets().add(SkinManager.getInstance().getSkin());
    BorderPane root = new BorderPane(sqlPane);
    Menu menu = new Menu("Exam");
    MenuItem e = new MenuItem("exam");
    e.setOnAction(System.out::println);
    e.setAccelerator(new KeyCodeCombination(KeyCode.E, KeyCombination.CONTROL_DOWN));
    menu.getItems().add(e);
    root.setTop(new MenuBar(menu));
    primaryStage.setScene(new Scene(root, 1100, 700));
    primaryStage.show();
// Application.setUserAgentStylesheet(Application.STYLESHEET_MODENA);
// DockPane.initializeDefaultUserAgentStylesheet();
}
Also used : BorderPane(javafx.scene.layout.BorderPane) CommonsSqllPan(com.kyj.fx.voeditor.visual.component.sql.view.CommonsSqllPan) MenuBar(javafx.scene.control.MenuBar) MenuItem(javafx.scene.control.MenuItem) KeyCodeCombination(javafx.scene.input.KeyCodeCombination) Menu(javafx.scene.control.Menu) Scene(javafx.scene.Scene)

Example 59 with BorderPane

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

the class JavaCodeAreaHelper method doPmd.

/**
	 * PMD 처리
	 * @작성자 : KYJ
	 * @작성일 : 2016. 10. 12.
	 */
private void doPmd() {
    PMDCheckedListComposite pmdCheckedListComposite = new PMDCheckedListComposite(null) {

        @Override
        public void run() {
            simpleFilePmd(null);
        }

        @Override
        protected void simpleFilePmd(File file) {
            try {
                GargoylePMDParameters params = new GargoylePMDParameters();
                String sourceCode = codeArea.getText();
                params.setSourceFileName("Java");
                params.setSourceText(sourceCode);
                //						if (!FileUtil.isJavaFile(file)) {
                //							String fileExtension = FileUtil.getFileExtension(file);
                //							try {
                //								Field declaredField = PMDParameters.class.getDeclaredField("language");
                //								if (declaredField != null) {
                //									declaredField.setAccessible(true);
                //									declaredField.set(params, fileExtension);
                //								}
                //							} catch (Exception e) {
                //								e.printStackTrace();
                //							}
                //						}
                //			transformParametersIntoConfiguration(params);
                long start = System.nanoTime();
                doPMD.doPMD(transformParametersIntoConfiguration(params), reportListenerPropertyProperty().get(), violationCountingListenerProperty().get());
                long end = System.nanoTime();
                Benchmarker.mark(Benchmark.TotalPMD, end - start, 0);
                TextReport report = new TextReport();
                try (ByteArrayOutputStream out = new ByteArrayOutputStream()) {
                    report.generate(Benchmarker.values(), new PrintStream(out));
                    out.flush();
                    LOGGER.debug(out.toString("UTF-8"));
                }
                updateStatus(sourceCode);
            } catch (IOException e) {
                LOGGER.error(ValueUtil.toString(e));
            }
        }
    };
    pmdCheckedListComposite.run();
    CloseableParent<BorderPane> closa = pmdCheckedListComposite;
    Consumer<Stage> option = stage -> {
        stage.setTitle("PMD Check.");
        stage.initOwner(SharedMemory.getPrimaryStage());
        stage.setWidth(1200d);
        stage.setHeight(800d);
    };
    FxUtil.createStageAndShow(closa, option);
}
Also used : EventHandler(javafx.event.EventHandler) ByteArrayOutputStream(java.io.ByteArrayOutputStream) LoggerFactory(org.slf4j.LoggerFactory) PMDCheckedListComposite(com.kyj.fx.voeditor.visual.component.pmd.PMDCheckedListComposite) Benchmark(net.sourceforge.pmd.benchmark.Benchmark) PrintStream(java.io.PrintStream) Logger(org.slf4j.Logger) MenuItem(javafx.scene.control.MenuItem) CloseableParent(com.kyj.fx.voeditor.visual.main.layout.CloseableParent) GargoylePMDParameters(com.kyj.fx.voeditor.visual.framework.pmd.GargoylePMDParameters) IOException(java.io.IOException) ValueUtil(com.kyj.fx.voeditor.visual.util.ValueUtil) CodeArea(org.fxmisc.richtext.CodeArea) File(java.io.File) TextReport(net.sourceforge.pmd.benchmark.TextReport) Menu(javafx.scene.control.Menu) Consumer(java.util.function.Consumer) SeparatorMenuItem(javafx.scene.control.SeparatorMenuItem) FxUtil(com.kyj.fx.voeditor.visual.util.FxUtil) List(java.util.List) ActionEvent(javafx.event.ActionEvent) Stage(javafx.stage.Stage) Benchmarker(net.sourceforge.pmd.benchmark.Benchmarker) BorderPane(javafx.scene.layout.BorderPane) SharedMemory(com.kyj.fx.voeditor.visual.momory.SharedMemory) PrintStream(java.io.PrintStream) BorderPane(javafx.scene.layout.BorderPane) PMDCheckedListComposite(com.kyj.fx.voeditor.visual.component.pmd.PMDCheckedListComposite) TextReport(net.sourceforge.pmd.benchmark.TextReport) ByteArrayOutputStream(java.io.ByteArrayOutputStream) IOException(java.io.IOException) Stage(javafx.stage.Stage) GargoylePMDParameters(com.kyj.fx.voeditor.visual.framework.pmd.GargoylePMDParameters) File(java.io.File)

Example 60 with BorderPane

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

the class NrchRealtimeSrchFlowComposite method init.

protected void init() {
    lblRequestTime.setMaxHeight(Double.MAX_VALUE);
    choWaitItems = new ChoiceBox<>(FXCollections.observableArrayList("", "5", "10", "15", "20", "25", "30"));
    Button btnReload = new Button("Reload");
    HBox hboxItems = new HBox(5, /* choWaitItems, new Label("단위 (초)"), chkTimer, */
    btnReload, lblRequestTime);
    hboxItems.setAlignment(Pos.CENTER_LEFT);
    hboxItems.setPadding(new Insets(5));
    BorderPane borTop = new BorderPane();
    Button btnStart = new Button("시작");
    Button btnStop = new Button("중지");
    btnStart.setDisable(true);
    btnStop.setDisable(true);
    borTop.setTop(new TitledPane("Timer", new HBox(5, choWaitItems, btnStart, btnStop)));
    borTop.setCenter(hboxItems);
    this.getParent().setTop(borTop);
    btnReload.setOnAction(ev -> {
        reload();
    });
    choWaitItems.valueProperty().addListener((oba, o, n) -> {
        if (ValueUtil.isNotEmpty(n) && !isRecycle.get()) {
            btnStart.setDisable(false);
        } else {
            btnStart.setDisable(true);
        }
    });
    btnStart.setOnAction(e -> {
        isRecycle.set(true);
        service.restart();
        btnStart.setDisable(true);
        btnStop.setDisable(false);
    });
    btnStop.setOnAction(e -> {
        isRecycle.set(false);
        service.cancel();
        btnStart.setDisable(false);
        btnStop.setDisable(true);
    });
    isRecycle.addListener((oba, o, n) -> {
        if (n) {
            choWaitItems.setDisable(true);
        } else {
            choWaitItems.setDisable(false);
        }
    });
    defineService();
    try {
        service.setExecutor(gargoyleThreadExecutors);
        service.start();
    } catch (RejectedExecutionException e) {
        if (gargoyleThreadExecutors.isShutdown() || gargoyleThreadExecutors.isTerminated()) {
            gargoyleThreadExecutors = ExecutorDemons.newFixedThreadExecutor(REALTIME_SRCH_THREAD_POOL_NAME, 1);
            service.setExecutor(gargoyleThreadExecutors);
        }
        LOGGER.error(ValueUtil.toString(e));
        // One more time.
        defineService();
        service.start();
    }
// reload();
}
Also used : TitledPane(javafx.scene.control.TitledPane) HBox(javafx.scene.layout.HBox) BorderPane(javafx.scene.layout.BorderPane) Insets(javafx.geometry.Insets) Button(javafx.scene.control.Button) MouseButton(javafx.scene.input.MouseButton) RejectedExecutionException(java.util.concurrent.RejectedExecutionException)

Aggregations

BorderPane (javafx.scene.layout.BorderPane)93 Scene (javafx.scene.Scene)56 Button (javafx.scene.control.Button)19 Label (javafx.scene.control.Label)16 FXMLLoader (javafx.fxml.FXMLLoader)14 Stage (javafx.stage.Stage)13 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 HashMap (java.util.HashMap)8 TableView (javafx.scene.control.TableView)8 HBox (javafx.scene.layout.HBox)8 Insets (javafx.geometry.Insets)7 TextField (javafx.scene.control.TextField)7 Map (java.util.Map)6 MenuItem (javafx.scene.control.MenuItem)6 TableColumn (javafx.scene.control.TableColumn)6 FXML (javafx.fxml.FXML)5