Search in sources :

Example 1 with SpecTabPane

use of com.kyj.fx.voeditor.visual.words.spec.auto.msword.ui.tabs.SpecTabPane in project Gargoyle by callakrsos.

the class SpecExample method start.

@Override
public void start(Stage primaryStage) throws Exception {
    String projectDir = System.getProperty("user.dir");
    File file = new File(projectDir, "src/main/java/com/kyj/fx/voeditor/visual/example/SpecExample.java");
    SpecResource specResource = new SpecResource(new File(projectDir), file);
    SpecTabPane center = new SpecTabPane(specResource);
    Button btnCapture = new Button("SnapShot");
    ImageView ivOrigin = new ImageView();
    btnCapture.setOnAction(ev -> {
        FxUtil.snapShot(center, new File("example.png"));
        FxUtil.printJob(primaryStage, center);
    });
    Text text1 = new Text("Big italic red text");
    text1.setFill(Color.RED);
    text1.setFont(Font.font("Helvetica", FontPosture.ITALIC, 40));
    Text text2 = new Text(" little bold blue text");
    text2.setFill(Color.BLUE);
    text2.setFont(Font.font("Helvetica", FontWeight.BOLD, 10));
    TextFlow textFlow = new TextFlow(text1, text2);
    BorderPane root = new BorderPane(center);
    root.setTop(new HBox(textFlow, btnCapture));
    root.setBottom(ivOrigin);
    root.setPrefSize(800, 600);
    Scene value = new Scene(root, 800, 600);
    primaryStage.setScene(value);
    primaryStage.show();
}
Also used : BorderPane(javafx.scene.layout.BorderPane) HBox(javafx.scene.layout.HBox) SpecResource(com.kyj.fx.voeditor.visual.words.spec.auto.msword.ui.model.SpecResource) SpecTabPane(com.kyj.fx.voeditor.visual.words.spec.auto.msword.ui.tabs.SpecTabPane) Button(javafx.scene.control.Button) Text(javafx.scene.text.Text) TextFlow(javafx.scene.text.TextFlow) ImageView(javafx.scene.image.ImageView) Scene(javafx.scene.Scene) File(java.io.File)

Example 2 with SpecTabPane

use of com.kyj.fx.voeditor.visual.words.spec.auto.msword.ui.tabs.SpecTabPane in project Gargoyle by callakrsos.

the class SystemLayoutViewController method menuItemCodeAnalysisMenuItemOnAction.

/********************************
	 * 작성일 : 2016. 5. 29. 작성자 : KYJ
	 *
	 * TODO 자바 코드 분석기 테스트단계.
	 *
	 * @param e
	 ********************************/
public void menuItemCodeAnalysisMenuItemOnAction(ActionEvent e) {
    TreeItem<FileWrapper> selectedItem = treeProjectFile.getSelectionModel().getSelectedItem();
    if (selectedItem != null) {
        FileWrapper value = selectedItem.getValue();
        File sourceFile = value.getFile();
        // if(selectedItem instanceof JavaProjectMemberFileTreeItem)
        {
            if (value.isSVNConnected()) {
                File wcDbFile = value.getWcDbFile();
                if (wcDbFile != null && wcDbFile.exists()) {
                    SVNWcDbClient client;
                    try {
                        client = new SVNWcDbClient(wcDbFile);
                    // TODO 코드 완성시키기.
                    // new SVNFileHistoryComposite(
                    // JavaSVNManager.createNewInstance(client.getUrl())
                    // , sourceFile);
                    // new JavaSVNManager(new Properties(defaults))
                    } catch (Exception e1) {
                        LOGGER.error(ValueUtil.toString(e1));
                    }
                }
            }
        }
        if (sourceFile != null && sourceFile.exists()) {
            try {
                if (FileUtil.isJavaFile(sourceFile)) {
                    JavaProjectFileTreeItem javaProjectFileTreeItem = FileUtil.toJavaProjectFileTreeItem(selectedItem);
                    if (javaProjectFileTreeItem != null) {
                        Tab tab = new Tab(sourceFile.getName(), new CodeAnalysisJavaTextArea(sourceFile));
                        SpecResource resource = new SpecResource(javaProjectFileTreeItem.getValue().getFile(), sourceFile);
                        SpecTabPane newInstance = new SpecTabPane(resource, tab);
                        loadNewSystemTab(sourceFile.getName(), newInstance);
                    }
                } else {
                    DialogUtil.showMessageDialog("자바 파일이 아닙니다.");
                }
            } catch (Exception ex) {
                DialogUtil.showExceptionDailog(ex);
            }
        }
    }
}
Also used : Tab(javafx.scene.control.Tab) DockTab(com.kyj.fx.voeditor.visual.component.dock.tab.DockTab) SpecResource(com.kyj.fx.voeditor.visual.words.spec.auto.msword.ui.model.SpecResource) SpecTabPane(com.kyj.fx.voeditor.visual.words.spec.auto.msword.ui.tabs.SpecTabPane) FileWrapper(com.kyj.fx.voeditor.visual.component.FileWrapper) JavaProjectFileTreeItem(com.kyj.fx.voeditor.visual.component.JavaProjectFileTreeItem) CodeAnalysisJavaTextArea(com.kyj.fx.voeditor.visual.component.text.CodeAnalysisJavaTextArea) File(java.io.File) SVNWcDbClient(com.kyj.scm.manager.svn.java.SVNWcDbClient) IOException(java.io.IOException) GargoyleException(com.kyj.fx.voeditor.visual.exceptions.GargoyleException)

Aggregations

SpecResource (com.kyj.fx.voeditor.visual.words.spec.auto.msword.ui.model.SpecResource)2 SpecTabPane (com.kyj.fx.voeditor.visual.words.spec.auto.msword.ui.tabs.SpecTabPane)2 File (java.io.File)2 FileWrapper (com.kyj.fx.voeditor.visual.component.FileWrapper)1 JavaProjectFileTreeItem (com.kyj.fx.voeditor.visual.component.JavaProjectFileTreeItem)1 DockTab (com.kyj.fx.voeditor.visual.component.dock.tab.DockTab)1 CodeAnalysisJavaTextArea (com.kyj.fx.voeditor.visual.component.text.CodeAnalysisJavaTextArea)1 GargoyleException (com.kyj.fx.voeditor.visual.exceptions.GargoyleException)1 SVNWcDbClient (com.kyj.scm.manager.svn.java.SVNWcDbClient)1 IOException (java.io.IOException)1 Scene (javafx.scene.Scene)1 Button (javafx.scene.control.Button)1 Tab (javafx.scene.control.Tab)1 ImageView (javafx.scene.image.ImageView)1 BorderPane (javafx.scene.layout.BorderPane)1 HBox (javafx.scene.layout.HBox)1 Text (javafx.scene.text.Text)1 TextFlow (javafx.scene.text.TextFlow)1