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