use of javafx.scene.image.ImageView in project trex-stateless-gui by cisco-system-traffic-generator.
the class CustomTreeItem method buildItem.
/**
* build custom tree item
*
* @param title
* @param owner
* @param assignedText
* @param addIcon
*/
private void buildItem(String title, String owner, String addIcon) {
GridPane itemContainer = new GridPane();
// additioanl icon
if (addIcon != null) {
Image icon = new Image("/icons/" + addIcon);
ImageView iconContainer = new ImageView(icon);
itemContainer.add(iconContainer, 0, 0);
}
itemTitle.setText(title);
itemTitle.getStyleClass().add("treeItemTitle");
itemContainer.add(itemTitle, 1, 0);
if (owner != null && !"".equals(owner)) {
this.owner = new Label("(" + owner + ")");
this.owner.getStyleClass().add("treeItemChildText");
itemContainer.add(this.owner, 2, 0);
}
Image itemIcon = new Image("/icons/" + treeItemType.getIcon());
ImageView itemIconContainer = new ImageView(itemIcon);
setValue(itemContainer);
setGraphic(itemIconContainer);
}
use of javafx.scene.image.ImageView in project trex-stateless-gui by cisco-system-traffic-generator.
the class CustomTreeItem method buildDefaultItem.
/**
* build default tree item
*
* @param title
*/
private void buildDefaultItem(String title) {
Image itemIcon = new Image("/icons/" + treeItemType.getIcon());
ImageView itemIconContainer = new ImageView(itemIcon);
setValue(title);
setGraphic(itemIconContainer);
}
use of javafx.scene.image.ImageView in project Gargoyle by callakrsos.
the class ScmTreeMaker method getFolderImage.
/**
* 파일로부터 이미지를 그리기 위한 뷰를 반환한다.
*
* @Date 2015. 10. 14.
* @param file
* @return
* @User KYJ
*/
private static ImageView getFolderImage() {
ImageView iv = new ImageView();
try {
Image fxImage = new Image(ClassLoader.getSystemClassLoader().getResource("META-INF/images/nodeicons/foler.png").openStream(), 15d, 15d, false, false);
iv.setImage(fxImage);
} catch (IOException e) {
e.printStackTrace();
}
return iv;
}
use of javafx.scene.image.ImageView in project Gargoyle by callakrsos.
the class AbstractTableColumnInformationController method initialize.
@FXML
public void initialize() {
colNumber.setCellValueFactory(new NumberingCellValueFactory<TableColumnMetaVO>(tbColumns));
colKeyType.setCellFactory(param -> new TableCell<TableColumnMetaVO, KEY_TYPE>() {
@Override
protected void updateItem(KEY_TYPE item, boolean empty) {
super.updateItem(item, empty);
if (empty) {
setGraphic(null);
} else {
ImageView image = null;
switch(item) {
case PRI:
image = getImage(PRIMAKRY_KEY_IMAGE_NAME);
image.setFitWidth(getPrefWidth());
setGraphic(image);
break;
case MULTI:
image = getImage(MULTI_KEY_IMAGE_NAME);
image.setFitWidth(getPrefWidth());
setGraphic(image);
break;
case FOREIGN:
image = getImage(FOREIGN_KEY_IMAGE_NAME);
image.setFitWidth(getPrefWidth());
setGraphic(image);
break;
default:
image = new ImageView();
}
setGraphic(image);
}
}
});
colReference.setCellValueFactory(new Callback<TableColumn.CellDataFeatures<TableColumnMetaVO, String>, ObservableValue<String>>() {
@Override
public ObservableValue<String> call(CellDataFeatures<TableColumnMetaVO, String> param) {
TableColumnMetaVO value = param.getValue();
SimpleStringProperty stringProperty = new SimpleStringProperty();
if (value != null && value.getRefs() != null) {
Optional<String> reduce = value.getRefs().stream().map(v -> v.getPkColumnName() + " -> [ " + v.getFkTableName() + "-" + v.getFkColumnName() + " ]").reduce((str1, str2) -> str1.concat("\n").concat(str2));
reduce.ifPresent(stringProperty::setValue);
}
return stringProperty;
}
});
colKeyType.setCellValueFactory(new PropertyValueFactory<>("keyType"));
colKeyType.setStyle("-fx-alignment:center");
this.tbColumns.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
FxUtil.installClipboardKeyEvent(this.tbColumns);
}
use of javafx.scene.image.ImageView in project Gargoyle by callakrsos.
the class AbstractTableColumnInformationController method getImage.
/**
* resources패키지로부터 image를 가져오는 처리
*
* @param name
* @return
*/
static ImageView getImage(String name) {
try {
String name2 = "META-INF/images/keyImages/" + name + ".png";
InputStream is = ClassLoader.getSystemClassLoader().getResourceAsStream(name2);
return new ImageView(new Image(is));
} catch (Exception e) {
// not important...
}
return new ImageView();
}
Aggregations