use of javafx.animation.KeyFrame in project Gargoyle by callakrsos.
the class LettersPane method createUpperTimeLine.
// private Timeline createCurveTimeLine(Node node) {
// // over 3 seconds move letter to random position and fade it out
// final Timeline timeline = new Timeline();
// timeline.getKeyFrames().add(new KeyFrame(Duration.seconds(3), new EventHandler<ActionEvent>() {
// @Override
// public void handle(ActionEvent event) {
// // we are done remove us from scene
// getChildren().remove(node);
// }
// }, new KeyValue(node.translateXProperty(), node.translateXProperty().get(), INTERPOLATOR),
// new KeyValue(node.translateYProperty(), 100f, INTERPOLATOR), new KeyValue(node.opacityProperty(), 0f)));
//
// new KeyFrame(Duration.millis(0.5), new KeyFrame(time, values))
//
//
//
// return timeline;
//
//
// }
private Timeline createUpperTimeLine(Node node) {
// over 3 seconds move letter to random position and fade it out
final Timeline timeline = new Timeline();
timeline.getKeyFrames().add(new KeyFrame(Duration.seconds(3), new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
// we are done remove us from scene
getChildren().remove(node);
}
}, new KeyValue(node.translateXProperty(), node.translateXProperty().get(), INTERPOLATOR), new KeyValue(node.translateYProperty(), 100f, INTERPOLATOR), new KeyValue(node.opacityProperty(), 0f)));
return timeline;
}
use of javafx.animation.KeyFrame in project arquivoProject by fader-azevedo.
the class CriarEstanteController method salvarEstante.
@FXML
private void salvarEstante() {
if (txtCodigo.getText().isEmpty() || txtDescricao.getText().isEmpty()) {
db.alertInfo("Por Favor, Preenche todos os campos");
return;
}
Calendar cal = Calendar.getInstance();
Estante e = new Estante(1, db.tratamento(txtCodigo.getText().trim()), db.tratamento(txtDescricao.getText().trim()), cal.getTime());
db.salvar(e);
lbMessage.setOpacity(1);
Timeline times = new Timeline(new KeyFrame(Duration.millis(4000), ev -> {
lbMessage.setOpacity(0);
}));
times.play();
txtCodigo.setText("");
txtDescricao.setText("");
lista.setItems(db.listarCogigoEstante());
}
use of javafx.animation.KeyFrame in project arquivoProject by fader-azevedo.
the class ListaEstanteController method playThis.
private void playThis(JFXButton button) {
Timeline timeline = new Timeline(new KeyFrame(Duration.millis(250), ev -> {
clipRectNextPratieira.setHeight(pnCarregaPratileira.getHeight());
if (clipRectNextPratieira.widthProperty().get() != 0) {
Timeline timelineUp = new Timeline();
final KeyValue kvUp1 = new KeyValue(clipRectNextPratieira.widthProperty(), 0);
final KeyValue kvUp2 = new KeyValue(clipRectNextPratieira.translateXProperty(), pnCarregaPratileira.getWidth());
final KeyValue kvUp4 = new KeyValue(pnCarregaPratileira.prefWidthProperty(), 0);
final KeyValue kvUp3 = new KeyValue(pnCarregaPratileira.translateXProperty(), pnCarregaPratileira.getWidth());
final KeyFrame kfUp = new KeyFrame(Duration.millis(1000), kvUp1, kvUp2, kvUp3, kvUp4);
timelineUp.getKeyFrames().add(kfUp);
timelineUp.play();
} else {
try {
pnCarregaPratileira.toFront();
FXMLLoader listPratView = new FXMLLoader();
listPratView.load(getClass().getResource("/view/ListaPratileira.fxml").openStream());
ListaPratileiraController lpController = listPratView.getController();
lpController.removeClass();
lpController.scrollBtnPratileira(button.getText());
Tooltip toot = new Tooltip("Voltar para Estantes");
// acao para volta nesse controller
lpController.btnBack.setOnAction(ic -> {
this.playThis(button);
});
lpController.btnBack.setTooltip(toot);
lpController.btnBack.setVisible(true);
lpController.boxCaminho.setVisible(true);
lpController.btnClosePratileira.setVisible(false);
AnchorPane root = listPratView.getRoot();
pnCarregaPratileira.getChildren().add(root);
btnCloseEstante.toFront();
Timeline timeDireita = new Timeline();
final KeyValue kvDir1 = new KeyValue(clipRectNextPratieira.widthProperty(), pnCarregaPratileira.getWidth());
final KeyValue kvDir2 = new KeyValue(clipRectNextPratieira.translateXProperty(), 0);
final KeyValue kvDir4 = new KeyValue(pnCarregaPratileira.prefWidthProperty(), pnCarregaPratileira.getWidth());
final KeyValue kvDir3 = new KeyValue(pnCarregaPratileira.translateXProperty(), 0);
final KeyFrame kfDwn = new KeyFrame(Duration.millis(600), kvDir1, kvDir2, kvDir3, kvDir4);
timeDireita.getKeyFrames().add(kfDwn);
timeDireita.play();
} catch (IOException ex) {
Logger.getLogger(ListaEstanteController.class.getName()).log(Level.SEVERE, null, ex);
}
}
}));
timeline.play();
}
use of javafx.animation.KeyFrame in project arquivoProject by fader-azevedo.
the class ListaPastaController method playThis.
private void playThis(JFXButton button) {
Timeline timeline = new Timeline(new KeyFrame(Duration.millis(250), ev -> {
clipRectNextDocument.setHeight(pnCarregaDocumentos.getHeight());
if (clipRectNextDocument.widthProperty().get() != 0) {
Timeline timelineUp = new Timeline();
final KeyValue kvUp1 = new KeyValue(clipRectNextDocument.widthProperty(), 0);
final KeyValue kvUp2 = new KeyValue(clipRectNextDocument.translateXProperty(), pnCarregaDocumentos.getWidth());
final KeyValue kvUp4 = new KeyValue(pnCarregaDocumentos.prefWidthProperty(), 0);
final KeyValue kvUp3 = new KeyValue(pnCarregaDocumentos.translateXProperty(), pnCarregaDocumentos.getWidth());
final KeyFrame kfUp = new KeyFrame(Duration.millis(1000), kvUp1, kvUp2, kvUp3, kvUp4);
timelineUp.getKeyFrames().add(kfUp);
timelineUp.play();
} else {
try {
if (b == true) {
Pasta past = (Pasta) db.getEstOrPratOrPastByCodigo(button.getText(), Pasta.class);
Pratileira prat = (Pratileira) db.buscarPorId(Pratileira.class, past.getPratileira());
codigoPratileiraLb.setText(prat.getCodigo());
Estante es = (Estante) db.buscarPorId(Estante.class, prat.getEstante());
codigoEstanteLb.setText(es.getCodigo());
}
clipRectNextDocument.setHeight(pnCarregaDocumentos.getHeight());
pnCarregaDocumentos.toFront();
FXMLLoader fxmlLoader = new FXMLLoader();
fxmlLoader.load(getClass().getResource("/view/ListaDocumento.fxml").openStream());
ListaDocumentoController lDocController = fxmlLoader.getController();
lDocController.btnBack.setOnAction(xs -> {
this.playThis(button);
});
lDocController.scrollBtnPauta(codigoEstanteLb.getText(), codigoPratileiraLb.getText(), button.getText());
lDocController.removeClass();
lDocController.boxCaminho.setVisible(true);
lDocController.btnBack.setVisible(true);
lDocController.btnCloseDoc.setVisible(false);
clipRectNextDocument.toFront();
AnchorPane root = fxmlLoader.getRoot();
pnCarregaDocumentos.getChildren().clear();
pnCarregaDocumentos.getChildren().add(root);
Timeline timeDireita = new Timeline();
final KeyValue kvDwn1 = new KeyValue(clipRectNextDocument.widthProperty(), pnCarregaDocumentos.getWidth());
final KeyValue kvDwn2 = new KeyValue(clipRectNextDocument.translateXProperty(), 0);
final KeyValue kvDwn4 = new KeyValue(pnCarregaDocumentos.prefWidthProperty(), pnCarregaDocumentos.getWidth());
final KeyValue kvDwn3 = new KeyValue(pnCarregaDocumentos.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(ListaDocumentoController.class.getName()).log(Level.SEVERE, null, ex);
}
}
}));
timeline.play();
}
use of javafx.animation.KeyFrame in project arquivoProject by fader-azevedo.
the class MenuController method getPratileirasPane.
public void getPratileirasPane() throws IOException {
Timeline timeline = new Timeline(new KeyFrame(Duration.millis(150), ev -> {
try {
pnCarregador.toFront();
FXMLLoader fxmlLoader = new FXMLLoader();
fxmlLoader.load(getClass().getResource("/view/ListaPratileira.fxml").openStream());
AnchorPane root = fxmlLoader.getRoot();
ListaPratileiraController listaPrat = fxmlLoader.getController();
listaPrat.scrollBtnPratileira("");
pnCarregador.getChildren().clear();
pnCarregador.getChildren().add(root);
} catch (Exception e) {
}
}));
timeline.play();
}
Aggregations