use of javafx.scene.control.ScrollPane in project bitsquare by bitsquare.
the class MarketView method loadView.
private void loadView(Class<? extends View> viewClass) {
final Tab tab;
View view = viewLoader.load(viewClass);
if (view instanceof OfferBookChartView)
tab = chartsTab;
else if (view instanceof TradesChartsView)
tab = tradesTab;
else if (view instanceof SpreadView)
tab = statisticsTab;
else
throw new IllegalArgumentException("Navigation to " + viewClass + " is not supported");
if (tab.getContent() != null && tab.getContent() instanceof ScrollPane) {
((ScrollPane) tab.getContent()).setContent(view.getRoot());
} else {
tab.setContent(view.getRoot());
}
root.getSelectionModel().select(tab);
}
use of javafx.scene.control.ScrollPane in project Gargoyle by callakrsos.
the class AbsoltePointFocusExam method start.
@Override
public void start(Stage stage) throws Exception {
// 포커스
ScrollPane scrPane = new ScrollPane();
scrPane.setPrefWidth(ScrollPane.USE_COMPUTED_SIZE);
BorderPane borderPane = new BorderPane(scrPane);
Scene scene = new Scene(borderPane, Color.LINEN);
VBox vbox = new VBox();
VBox.setVgrow(vbox, Priority.ALWAYS);
vbox.setPrefWidth(VBox.USE_PREF_SIZE);
vbox.setPrefHeight(VBox.USE_COMPUTED_SIZE);
for (int i = 0; i < 20; i++) {
AnchorPane ancPane = new AnchorPane();
AnchorPane ancPane2 = new AnchorPane();
ancPane2.setLayoutY(500);
TextField text1 = new TextField();
TextField text2 = new TextField();
text2.setLayoutY(800);
Button btn = new Button("Focus" + i);
btn.setOnMouseClicked(event -> {
text2.requestFocus();
double absolteY = FxUtil.getAbsolteY(vbox, text2) + text2.getHeight();
scrPane.setVvalue((absolteY / vbox.getHeight()));
});
btn.setLayoutX(150);
ancPane2.getChildren().add(text2);
ancPane.getChildren().addAll(text1, btn, ancPane2);
vbox.getChildren().add(ancPane);
}
scrPane.setContent(vbox);
stage.setWidth(700);
stage.setHeight(400);
Label status = new Label();
borderPane.setBottom(status);
vbox.addEventFilter(MouseEvent.ANY, event -> {
status.textProperty().set(String.format(" x: %s y : %s scene x : %s scene y : %s screen x :%s screen y : %s", event.getX(), event.getY(), event.getSceneX(), event.getSceneY(), event.getScreenX(), event.getScreenY()));
});
stage.setScene(scene);
stage.show();
}
use of javafx.scene.control.ScrollPane in project arquivoProject by fader-azevedo.
the class ListaDocumentoController method scrollBtnPauta.
public void scrollBtnPauta(String codigoEstante, String codigoPratileira, String codigoPasta) {
GridPane gr = new GridPane();
gr.setHgap(12);
gr.setVgap(16);
gr.setPadding(new Insets(5, 5, 5, 5));
sessao = HibernateUtil.getSessionFactory().openSession();
sessao.beginTransaction();
List<Pauta> dataPauta = null;
List<Exame> dataExame = null;
if (!codigoEstante.equalsIgnoreCase("") && !codigoEstante.equalsIgnoreCase("") && !codigoPasta.equals("")) {
codigoEstanteLb.setText(codigoEstante);
codigoPratileiraLb.setText(codigoPratileira);
codigoPastaLb.setText(codigoPasta);
codigoEstanteLb.getStyleClass().add("lbCamiho");
codigoPratileiraLb.getStyleClass().add("lbCamiho");
codigoPastaLb.getStyleClass().add("lbCamiho");
MaterialDesignIconView iconEstant = new MaterialDesignIconView(MaterialDesignIcon.BOOK, "20");
boxCaminho.getChildren().add(iconEstant);
boxCaminho.getChildren().add(codigoEstanteLb);
OctIconView iconNext = new OctIconView(OctIcon.CHEVRON_RIGHT, "20");
iconNext.setFill(Paint.valueOf("#0078D7"));
boxCaminho.getChildren().add(iconNext);
MaterialDesignIconView iconPrat = new MaterialDesignIconView(MaterialDesignIcon.LIBRARY_BOOKS, "20");
boxCaminho.getChildren().add(iconPrat);
boxCaminho.getChildren().add(codigoPratileiraLb);
OctIconView iconNext2 = new OctIconView(OctIcon.CHEVRON_RIGHT, "20");
iconNext2.setFill(Paint.valueOf("#0078D7"));
boxCaminho.getChildren().add(iconNext2);
MaterialDesignIconView iconPasta = new MaterialDesignIconView(MaterialDesignIcon.FOLDER, "20");
boxCaminho.getChildren().add(iconPasta);
boxCaminho.getChildren().add(codigoPastaLb);
Pasta es = (Pasta) db.getEstOrPratOrPastByCodigo(codigoPasta, Pasta.class);
int idPasta = es.getIdpasta();
SQLQuery query = sessao.createSQLQuery("SELECT * FROM Pauta WHERE idpasta =?").addEntity(Pauta.class);
dataPauta = query.setString(0, idPasta + "%").list();
} else {
verificador = true;
this.lbInfo.setVisible(false);
dataPauta = sessao.createCriteria(Pauta.class).list();
sessao.getTransaction().commit();
}
int numColunas = 0;
int numLinha = 0;
for (Pauta obj : dataPauta) {
JFXButton button = new JFXButton(obj.getScan());
MaterialDesignIconView icon = new MaterialDesignIconView(MaterialDesignIcon.FILE_EXCEL, "40");
icon.setFill(Paint.valueOf("#A17878"));
button.setGraphic(icon);
button.setContentDisplay(ContentDisplay.TOP);
button.setPrefSize(99, 96);
button.setButtonType(JFXButton.ButtonType.RAISED);
button.setDefaultButton(true);
button.setContextMenu(this.rightClik(button));
if (numColunas < 6) {
gr.add(button, numColunas, numLinha);
numColunas += 1;
} else {
numColunas = 0;
numLinha += 1;
gr.add(button, numColunas, numLinha);
numColunas += 1;
}
}
ScrollPane scroll = new ScrollPane(gr);
scroll.setStyle("-fx-background-color:transparent;");
scroll.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
scroll.setPrefSize(680, 331);
scroll.setPadding(new Insets(2, 0, 0, 2));
if (dataPauta.isEmpty()) {
lbInfo.setVisible(true);
} else {
pnButoes.getChildren().add(scroll);
}
}
use of javafx.scene.control.ScrollPane in project arquivoProject by fader-azevedo.
the class ListaPastaController method scrollBtnPasta.
public void scrollBtnPasta(String codigoEstante, String codigoPratileira) {
GridPane gr = new GridPane();
gr.setHgap(12);
gr.setVgap(16);
gr.setPadding(new Insets(5, 5, 5, 5));
sessao = HibernateUtil.getSessionFactory().openSession();
sessao.beginTransaction();
List<Pasta> data = null;
if (!codigoEstante.equalsIgnoreCase("") && !codigoEstante.equalsIgnoreCase("")) {
codigoEstanteLb.setText(codigoEstante);
codigoPratileiraLb.setText(codigoPratileira);
codigoEstanteLb.getStyleClass().add("lbCamiho");
codigoPratileiraLb.getStyleClass().add("lbCamiho");
MaterialDesignIconView iconEstant = new MaterialDesignIconView(MaterialDesignIcon.BOOK, "20");
boxCaminho.getChildren().add(iconEstant);
boxCaminho.getChildren().add(codigoEstanteLb);
OctIconView iconNext = new OctIconView(OctIcon.CHEVRON_RIGHT, "20");
iconNext.setFill(Paint.valueOf("#0078D7"));
boxCaminho.getChildren().add(iconNext);
MaterialDesignIconView iconPrat = new MaterialDesignIconView(MaterialDesignIcon.LIBRARY_BOOKS, "20");
boxCaminho.getChildren().add(iconPrat);
boxCaminho.getChildren().add(codigoPratileiraLb);
Pratileira es = (Pratileira) db.getEstOrPratOrPastByCodigo(codigoPratileira, Pratileira.class);
int idPratileira = es.getIdpratileira();
SQLQuery query = sessao.createSQLQuery("SELECT * FROM Pasta WHERE idpratileira =?").addEntity(Pasta.class);
data = query.setString(0, idPratileira + "%").list();
} else {
b = true;
this.lbInfo.setVisible(false);
data = sessao.createCriteria(Pasta.class).list();
sessao.getTransaction().commit();
}
int numColunas = 0;
int numLinha = 0;
for (Pasta obj : data) {
JFXButton button = new JFXButton(obj.getCodigo());
MaterialDesignIconView icon = new MaterialDesignIconView(MaterialDesignIcon.FOLDER, "40");
icon.setFill(Paint.valueOf("#A17878"));
button.setGraphic(icon);
button.setContentDisplay(ContentDisplay.TOP);
button.setPrefSize(99, 96);
button.setButtonType(JFXButton.ButtonType.RAISED);
button.setDefaultButton(true);
button.setTooltip(db.getPastaInfoToolTip(obj.getCodigo()));
if (numColunas < 6) {
gr.add(button, numColunas, numLinha);
numColunas += 1;
} else {
numColunas = 0;
numLinha += 1;
gr.add(button, numColunas, numLinha);
numColunas += 1;
}
button.setOnAction(bb -> {
playThis(button);
});
}
ScrollPane scroll = new ScrollPane(gr);
scroll.setStyle("-fx-background-color:transparent;");
scroll.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
scroll.setPrefSize(680, 331);
scroll.setPadding(new Insets(2, 0, 0, 2));
if (data.isEmpty()) {
lbInfo.setVisible(true);
} else {
pnButoes.getChildren().add(scroll);
}
}
use of javafx.scene.control.ScrollPane in project arquivoProject by fader-azevedo.
the class ListaPratileiraController method scrollBtnPratileira.
public void scrollBtnPratileira(String codigoEstante) {
GridPane gr = new GridPane();
gr.setHgap(12);
gr.setVgap(16);
gr.setPadding(new Insets(5, 5, 5, 5));
sessao = HibernateUtil.getSessionFactory().openSession();
sessao.beginTransaction();
List<Pratileira> data = null;
if (!codigoEstante.equalsIgnoreCase("")) {
codigoEstanteLb.setText(codigoEstante);
codigoEstanteLb.getStyleClass().add("lbCamiho");
MaterialDesignIconView iconEstante = new MaterialDesignIconView(MaterialDesignIcon.BOOK, "20");
boxCaminho.getChildren().add(iconEstante);
boxCaminho.getChildren().add(codigoEstanteLb);
Estante es = (Estante) db.getEstOrPratOrPastByCodigo(codigoEstante, Estante.class);
int idEstante = es.getIdestante();
SQLQuery query = sessao.createSQLQuery("SELECT * FROM Pratileira WHERE idestante =?").addEntity(Pratileira.class);
data = query.setString(0, idEstante + "%").list();
} else {
// Qunado clica directamente na pratileira
b = true;
this.lbInfo.setVisible(false);
data = sessao.createCriteria(Pratileira.class).list();
sessao.getTransaction().commit();
}
int numColunas = 0;
int numLinha = 0;
for (Pratileira prat : data) {
JFXButton button = new JFXButton(prat.getCodigo());
MaterialDesignIconView icon = new MaterialDesignIconView(MaterialDesignIcon.LIBRARY_BOOKS, "40");
icon.setFill(Paint.valueOf("#A17878"));
button.setGraphic(icon);
button.setContentDisplay(ContentDisplay.TOP);
button.setPrefSize(99, 96);
button.setButtonType(JFXButton.ButtonType.RAISED);
button.setDefaultButton(true);
button.setTooltip(db.tooltipPratileira(prat.getCodigo()));
if (numColunas < 6) {
gr.add(button, numColunas, numLinha);
numColunas += 1;
} else {
numColunas = 0;
numLinha += 1;
gr.add(button, numColunas, numLinha);
numColunas += 1;
}
button.setOnAction(e -> {
playThis(button);
});
}
ScrollPane scroll = new ScrollPane(gr);
scroll.setStyle("-fx-background-color:transparent;");
scroll.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
scroll.setPrefSize(680, 331);
scroll.setPadding(new Insets(2, 0, 0, 2));
if (data.isEmpty()) {
lbInfo.setVisible(true);
} else {
pnButoes.getChildren().add(scroll);
}
}
Aggregations