Profile presenter

mail@pastecode.io avatar
unknown
plain_text
2 years ago
1.7 kB
2
Indexable
Never
package com.gluonhq.samples.comments.views;

import com.gluonhq.charm.glisten.animation.BounceInRightTransition;
import com.gluonhq.charm.glisten.application.AppManager;
import com.gluonhq.charm.glisten.control.AppBar;
import com.gluonhq.charm.glisten.control.ListTile;
import com.gluonhq.charm.glisten.mvc.View;
import com.gluonhq.charm.glisten.visual.MaterialDesignIcon;
import com.gluonhq.samples.comments.model.Comment;
import javafx.beans.binding.Bindings;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.ListCell;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.text.Text;

import java.awt.event.ActionEvent;
import java.awt.event.MouseEvent;


public class ProfilePresenter  {





@FXML
protected View profile;
@FXML
private Label as;

@FXML
private ImageView jembatan;

@FXML
private Button back;

@FXML
private Label bridge;


    private static String data;

    public static void setData(String name) {
       data = name;
    }

    public void initialize() {
        Image img = new Image("jembatan_1.jpeg");
        jembatan.setImage(img);


        bridge.setText(data);
        profile.showingProperty().addListener((obs, oldValue, newValue) -> {
            if (newValue) {
                AppBar appBar = AppManager.getInstance().getAppBar();
                appBar.setNavIcon(MaterialDesignIcon.ARROW_BACK.button(e ->
                        AppViewManager.COMMENTS_VIEW.switchView()));
                appBar.setTitleText("Brigde Profile");
            }
        });

    }

    public void updateData(String content) {
        bridge.setText(content);
    }



}