use of model.Pratileira in project arquivoProject by fader-azevedo.
the class ListaPratileiraController method playThis.
private void playThis(JFXButton button) {
Timeline timeline = new Timeline(new KeyFrame(Duration.millis(250), ev -> {
clipRectNextPasta.setHeight(pnCarregaPasta.getHeight());
if (clipRectNextPasta.widthProperty().get() != 0) {
Timeline timelineUp = new Timeline();
final KeyValue kvUp1 = new KeyValue(clipRectNextPasta.widthProperty(), 0);
final KeyValue kvUp2 = new KeyValue(clipRectNextPasta.translateXProperty(), pnCarregaPasta.getWidth());
final KeyValue kvUp4 = new KeyValue(pnCarregaPasta.prefWidthProperty(), 0);
final KeyValue kvUp3 = new KeyValue(pnCarregaPasta.translateXProperty(), pnCarregaPasta.getWidth());
final KeyFrame kfUp = new KeyFrame(Duration.millis(1000), kvUp1, kvUp2, kvUp3, kvUp4);
timelineUp.getKeyFrames().add(kfUp);
timelineUp.play();
} else {
try {
if (b == true) {
// quando e clicado a pratileira sem estante
Pratileira prt = (Pratileira) db.getEstOrPratOrPastByCodigo(button.getText(), Pratileira.class);
Estante es = (Estante) db.buscarPorId(Estante.class, prt.getEstante());
codigoEstanteLb.setText(es.getCodigo());
}
clipRectNextPasta.setHeight(pnCarregaPasta.getHeight());
pnCarregaPasta.toFront();
FXMLLoader fxmlLoader = new FXMLLoader();
fxmlLoader.load(getClass().getResource("/view/ListaPasta.fxml").openStream());
ListaPastaController lpastaController = fxmlLoader.getController();
lpastaController.btnBack.setOnAction(xs -> {
this.playThis(button);
});
lpastaController.scrollBtnPasta(codigoEstanteLb.getText(), button.getText());
lpastaController.removeClass();
lpastaController.boxCaminho.setVisible(true);
lpastaController.btnBack.setVisible(true);
lpastaController.btnClosePasta.setVisible(false);
btnClosePratileira.toFront();
AnchorPane root = fxmlLoader.getRoot();
pnCarregaPasta.getChildren().clear();
pnCarregaPasta.getChildren().add(root);
Timeline timeDireita = new Timeline();
final KeyValue kvDwn1 = new KeyValue(clipRectNextPasta.widthProperty(), pnCarregaPasta.getWidth());
final KeyValue kvDwn2 = new KeyValue(clipRectNextPasta.translateXProperty(), 0);
final KeyValue kvDwn4 = new KeyValue(pnCarregaPasta.prefWidthProperty(), pnCarregaPasta.getWidth());
final KeyValue kvDwn3 = new KeyValue(pnCarregaPasta.translateXProperty(), 0);
final KeyFrame kfDwn = new KeyFrame(Duration.millis(600), kvDwn1, kvDwn2, kvDwn3, kvDwn4);
timeDireita.getKeyFrames().add(kfDwn);
timeDireita.play();
} catch (Exception ex) {
Logger.getLogger(ListaPratileiraController.class.getName()).log(Level.SEVERE, null, ex);
}
}
}));
timeline.play();
}
Aggregations