use of javafx.stage.Window in project JFoenix by jfoenixadmin.
the class JFXPopup method show.
/**
* show the popup according to the specified position with a certain offset
*
* @param vAlign can be TOP/BOTTOM
* @param hAlign can be LEFT/RIGHT
* @param initOffsetX on the x axis
* @param initOffsetY on the y axis
*/
public void show(Node node, PopupVPosition vAlign, PopupHPosition hAlign, double initOffsetX, double initOffsetY) {
if (!isShowing()) {
if (node.getScene() == null || node.getScene().getWindow() == null)
throw new IllegalStateException("Can not show popup. The node must be attached to a scene/window.");
Window parent = node.getScene().getWindow();
this.show(parent, parent.getX() + node.localToScene(0, 0).getX() + node.getScene().getX() + (PopupHPosition.RIGHT.equals(hAlign) ? ((Region) node).getWidth() : 0), parent.getY() + node.localToScene(0, 0).getY() + node.getScene().getY() + (PopupVPosition.BOTTOM.equals(vAlign) ? ((Region) node).getHeight() : 0));
((JFXPopupSkin) getSkin()).reset(vAlign, hAlign, initOffsetX, initOffsetY);
Platform.runLater(() -> ((JFXPopupSkin) getSkin()).animate());
}
}
use of javafx.stage.Window in project bitsquare by bitsquare.
the class PasswordTextField method getErrorPopupPosition.
private Point2D getErrorPopupPosition() {
Window window = getScene().getWindow();
Point2D point;
point = layoutReference.localToScene(0, 0);
double x = Math.floor(point.getX() + window.getX() + layoutReference.getWidth() + 20 - getPadding().getLeft() - getPadding().getRight());
double y = Math.floor(point.getY() + window.getY() + getHeight() / 2 - getPadding().getTop() - getPadding().getBottom());
return new Point2D(x, y);
}
use of javafx.stage.Window in project bitsquare by bitsquare.
the class Notification method layout.
@Override
protected void layout() {
Window window = owner.getScene().getWindow();
double titleBarHeight = window.getHeight() - owner.getScene().getHeight();
stage.setX(Math.round(window.getX() + window.getWidth() - stage.getWidth()));
stage.setY(Math.round(window.getY() + titleBarHeight));
}
use of javafx.stage.Window in project Gargoyle by callakrsos.
the class ExceptionDialogComposite method show.
/**
* 다이얼로그 OPEN.
*
* @작성자 : KYJ
* @작성일 : 2016. 8. 23.
* @param node
*/
public void show(Node node) {
Window _root = null;
if (node != null) {
Scene _scene = node.getScene();
if (_scene != null) {
_root = _scene.getWindow();
}
}
show(_root);
}
use of javafx.stage.Window in project Gargoyle by callakrsos.
the class SkinPreviewViewComposite method previewTabInit.
@FxPostInitialize
public void previewTabInit() {
Task<Void> task = new Task<Void>() {
@Override
protected Void call() throws Exception {
Thread.sleep(5000L);
Platform.runLater(() -> {
//메뉴바 배경.
{
Background background = mbSample.getBackground();
Color fill = (Color) background.getFills().get(0).getFill();
colorMbSample.setValue(fill);
//메뉴바 텍스트
{
Label lookup = (Label) mbSample.lookup(".label");
Color textFill = (Color) lookup.getTextFill();
colorMbLabelSample.setValue(textFill);
}
}
//Hbox 배경.
{
Background background = hboxSample.getBackground();
Color fill = (Color) background.getFills().get(0).getFill();
colorHboxSample.setValue(fill);
}
{
//선택디지않는 탭 색상 처리.
Set<Node> lookupAll = tabpaneSample.lookupAll(".tab:top");
lookupAll.forEach(lookup -> {
Optional<PseudoClass> findFirst = lookup.getPseudoClassStates().stream().filter(v -> {
return "selected".equals(v.getPseudoClassName());
}).findFirst();
if (findFirst.isPresent()) {
Label selectedTabLabel = (Label) lookup.lookup(".tab-label");
Color textFill = (Color) selectedTabLabel.getTextFill();
colorSelectedTabText.setValue(textFill);
} else {
Label selectedTabLabel = (Label) lookup.lookup(".tab-label");
Color textFill = (Color) selectedTabLabel.getTextFill();
colorUnSelectedTabText.setValue(textFill);
}
});
{
lookupAll.stream().findFirst().ifPresent(n -> {
Pane p = (Pane) n;
Background background = p.getBackground();
Color fill = (Color) background.getFills().get(0).getFill();
colorTabSample1Selected.setValue(fill);
});
}
}
});
return null;
}
};
Window window = this.getScene().getWindow();
if (window != null) {
FxUtil.showLoading(window, task);
} else
FxUtil.showLoading(task);
}
Aggregations