Search in sources :

Example 56 with ImageView

use of javafx.scene.image.ImageView in project Gargoyle by callakrsos.

the class JavaProjectFileTreeItem method createGraphcis.

@Override
protected Node createGraphcis(FileWrapper fileWrapper) {
    InputStream imageStream = ClassLoader.getSystemClassLoader().getResourceAsStream("META-INF/images/eclipse/project.gif");
    ImageView createImageView = FxUtil.createImageView(imageStream);
    //		String meta = String.format("[%b][%b]", fileWrapper.isJavaProjectFile(), fileWrapper.isSVNConnected());
    return new HBox(createImageView, new Label(fileWrapper.getFile().getName()), new Label(getMetadata()));
}
Also used : HBox(javafx.scene.layout.HBox) InputStream(java.io.InputStream) Label(javafx.scene.control.Label) ImageView(javafx.scene.image.ImageView)

Example 57 with ImageView

use of javafx.scene.image.ImageView in project Gargoyle by callakrsos.

the class DaoWizardYnImageCell method ncreateImageField.

/********************************
	 * 작성일 : 2016. 8. 27. 작성자 : KYJ
	 *
	 * 이미지생성2
	 *
	 * @throws IOException
	 ********************************/
private void ncreateImageField() throws IOException {
    if (n != null) {
        nimage = new Image(n.openStream(), WIDTH, HEIGHT, true, true);
        nimageView = new ImageView(nimage);
    }
}
Also used : ImageView(javafx.scene.image.ImageView) Image(javafx.scene.image.Image)

Example 58 with ImageView

use of javafx.scene.image.ImageView in project Gargoyle by callakrsos.

the class FileBaseDiffAppController method initialize.

@FXML
public void initialize() {
    /* initControls */
    ivReviced = new ImageView();
    ivpReviced = new ImageViewPane(ivReviced);
    ivpReviced.setPrefWidth(200);
    ivpReviced.setPrefHeight(150);
    ivOrigin = new ImageView();
    ivpOrigin = new ImageViewPane(ivOrigin);
    ivpOrigin.setPrefWidth(200);
    ivpOrigin.setPrefHeight(150);
    gpSnap.add(ivpReviced, 0, 0);
    gpSnap.add(ivpOrigin, 1, 0);
    lvOrinal.setCellFactory(param -> new DefaultTextFieldListCell(ORIGINAL));
    lvRevice.setCellFactory(param -> new DefaultTextFieldListCell(REVICED));
    fileCompareResultProperty.addListener((oba, oldresult, newresult) -> {
        if (newresult == null)
            return;
        List<ChunkWrapper> wrapperedOrigin = extractedWrapperedChunk(DeltaType.ORIGINAL, newresult);
        List<ChunkWrapper> wrapperedReviced = extractedWrapperedChunk(DeltaType.REVICED, newresult);
        lvOrinal.getItems().addAll(wrapperedOrigin);
        lvRevice.getItems().addAll(wrapperedReviced);
    });
    lvRevice.setOnMouseClicked(event -> {
        if (event.getClickCount() == 2) {
            int movePosition = -1;
            ChunkWrapper selectedItem = lvRevice.getSelectionModel().getSelectedItem();
            Delta delta = selectedItem.getDelta();
            if (delta != null && delta.getOriginal() != null) {
                movePosition = selectedItem.getPosition();
                lvOrinal.scrollTo(movePosition - 1);
                lvOrinal.getSelectionModel().select(movePosition);
            }
        }
    });
    lvOrinal.setOnMouseClicked(event -> {
        if (event.getClickCount() == 2) {
            int movePosition = -1;
            ChunkWrapper selectedItem = lvOrinal.getSelectionModel().getSelectedItem();
            Delta delta = selectedItem.getDelta();
            if (delta != null && delta.getRevised() != null) {
                movePosition = delta.getRevised().getPosition();
                lvRevice.scrollTo(movePosition - 1);
                lvRevice.getSelectionModel().select(movePosition);
            }
        }
    });
    lvOrinal.addEventFilter(ScrollEvent.SCROLL, event -> {
        snappOriginShot();
    });
    lvRevice.addEventFilter(ScrollEvent.SCROLL, event -> {
        snappReviceShot();
    });
    snappOriginShot();
    snappReviceShot();
}
Also used : Delta(difflib.Delta) ChunkWrapper(com.kyj.fx.voeditor.visual.diff.ChunkWrapper) ImageView(javafx.scene.image.ImageView) FXML(javafx.fxml.FXML)

Example 59 with ImageView

use of javafx.scene.image.ImageView in project Gargoyle by callakrsos.

the class FileTreeItem method createGraphcis.

/********************************
	 * 작성일 : 2016. 7. 11. 작성자 : KYJ
	 *
	 *이 함수에서 리턴되는 노드가 트리를 구성하는 주 Node가 된다.
	 *
	 * @param fileWrapper
	 * @return
	 ********************************/
protected Node createGraphcis(FileWrapper fileWrapper) {
    String meta = getMetadata();
    ImageView createImageView = getImage(fileWrapper);
    HBox value = new HBox(createImageView, new Label(fileWrapper.getFile().getName()), new Label(meta));
    List<Node> createAttachLabels = createAttachNodes();
    if (createAttachLabels != null && !createAttachLabels.isEmpty())
        value.getChildren().addAll(createAttachLabels);
    return value;
}
Also used : HBox(javafx.scene.layout.HBox) Node(javafx.scene.Node) Label(javafx.scene.control.Label) ImageView(javafx.scene.image.ImageView)

Example 60 with ImageView

use of javafx.scene.image.ImageView in project Gargoyle by callakrsos.

the class TextBaseDiffAppController method initialize.

@FXML
public void initialize() {
    /* initControls */
    ivReviced = new ImageView();
    ivpReviced = new ImageViewPane(ivReviced);
    ivpReviced.setPrefWidth(200);
    ivpReviced.setPrefHeight(150);
    ivOrigin = new ImageView();
    ivpOrigin = new ImageViewPane(ivOrigin);
    ivpOrigin.setPrefWidth(200);
    ivpOrigin.setPrefHeight(150);
    gpSnap.add(ivpReviced, 0, 0);
    gpSnap.add(ivpOrigin, 1, 0);
    lvOrinal.setCellFactory(param -> new DefaultTextFieldListCell(ORIGINAL));
    lvRevice.setCellFactory(param -> new DefaultTextFieldListCell(REVICED));
    fileCompareResultProperty.addListener(compareResultListener);
    lvRevice.setOnMouseClicked(event -> {
        if (event.getClickCount() == 2) {
            int movePosition = -1;
            ChunkWrapper selectedItem = lvRevice.getSelectionModel().getSelectedItem();
            Delta delta = selectedItem.getDelta();
            if (delta != null && delta.getOriginal() != null) {
                movePosition = selectedItem.getPosition();
                lvOrinal.scrollTo(movePosition - 1);
                lvOrinal.getSelectionModel().select(movePosition);
            }
        }
    });
    lvOrinal.setOnMouseClicked(event -> {
        if (event.getClickCount() == 2) {
            int movePosition = -1;
            ChunkWrapper selectedItem = lvOrinal.getSelectionModel().getSelectedItem();
            if (selectedItem != null) {
                Delta delta = selectedItem.getDelta();
                if (delta != null && delta.getRevised() != null) {
                    movePosition = delta.getRevised().getPosition();
                    lvRevice.scrollTo(movePosition - 1);
                    lvRevice.getSelectionModel().select(movePosition);
                }
            }
        }
    });
    lvOrinal.addEventFilter(ScrollEvent.SCROLL, event -> {
        snappOriginShot();
    });
    lvRevice.addEventFilter(ScrollEvent.SCROLL, event -> {
        snappReviceShot();
    });
    btnCompare.setOnMouseClicked(event -> {
        String ori = txtOrigin.getText();
        String rev = txtRevice.getText();
        if (!(ori.isEmpty() && rev.isEmpty())) {
            clear();
            try {
                this.compare.setOriginal(ori);
                this.compare.setRevised(rev);
                CompareResult chunkResult = this.compare.getChunkResult();
                this.fileCompareResultProperty.set(chunkResult);
                snappOriginShot();
                snappReviceShot();
            } catch (Exception e) {
                LOGGER.error(ValueUtil.toString(e));
            }
        }
    });
    colStatus.setCellValueFactory(new Callback<CellDataFeatures<ChunkWrapper, String>, ObservableValue<String>>() {

        @Override
        public ObservableValue<String> call(CellDataFeatures<ChunkWrapper, String> param) {
            TYPE type = param.getValue().getType();
            StringProperty prop = new SimpleStringProperty();
            if (type != null)
                prop.set(type.name());
            return prop;
        }
    });
    colPosition.setCellValueFactory(param -> new SimpleIntegerProperty(new Integer(param.getValue().getPosition() + 1)));
    colRevice.setCellValueFactory(param -> {
        Delta delta = param.getValue().getDelta();
        SimpleStringProperty prop = new SimpleStringProperty();
        if (delta != null) {
            Chunk c = delta.getRevised();
            prop.setValue(c.getLines().toString());
        }
        return prop;
    });
    colOrigin.setCellValueFactory(param -> {
        Delta delta = param.getValue().getDelta();
        SimpleStringProperty prop = new SimpleStringProperty();
        if (delta != null) {
            Chunk c = delta.getOriginal();
            prop.setValue(c.getLines().toString());
        }
        return prop;
    });
}
Also used : CellDataFeatures(javafx.scene.control.TableColumn.CellDataFeatures) ObservableValue(javafx.beans.value.ObservableValue) ChunkWrapper(com.kyj.fx.voeditor.visual.diff.ChunkWrapper) SimpleStringProperty(javafx.beans.property.SimpleStringProperty) StringProperty(javafx.beans.property.StringProperty) SimpleStringProperty(javafx.beans.property.SimpleStringProperty) Chunk(difflib.Chunk) CompareResult(com.kyj.fx.voeditor.visual.diff.CompareResult) IOException(java.io.IOException) Delta(difflib.Delta) ImageView(javafx.scene.image.ImageView) TYPE(difflib.Delta.TYPE) SimpleIntegerProperty(javafx.beans.property.SimpleIntegerProperty) FXML(javafx.fxml.FXML)

Aggregations

ImageView (javafx.scene.image.ImageView)72 Image (javafx.scene.image.Image)32 Popup (io.bitsquare.gui.main.overlays.popups.Popup)13 Label (javafx.scene.control.Label)13 Insets (javafx.geometry.Insets)12 Callback (javafx.util.Callback)11 ChangeListener (javafx.beans.value.ChangeListener)10 File (java.io.File)9 IOException (java.io.IOException)9 Button (javafx.scene.control.Button)9 AnchorPane (javafx.scene.layout.AnchorPane)9 FxmlView (io.bitsquare.gui.common.view.FxmlView)8 FXML (javafx.fxml.FXML)8 Inject (javax.inject.Inject)8 ActivatableViewAndModel (io.bitsquare.gui.common.view.ActivatableViewAndModel)7 ObservableValue (javafx.beans.value.ObservableValue)7 javafx.scene.control (javafx.scene.control)7 GridPane (javafx.scene.layout.GridPane)7 VBox (javafx.scene.layout.VBox)7 UserThread (io.bitsquare.common.UserThread)6