Advertisement
Guest User

Untitled

a guest
May 14th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 4.00 KB | None | 0 0
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package javafxapplication.models;
  7.  
  8. import java.io.Serializable;
  9. import javafx.scene.Node;
  10. import javax.persistence.Entity;
  11. import javax.persistence.GeneratedValue;
  12. import javax.persistence.GenerationType;
  13. import javax.persistence.Id;
  14.  
  15. /**
  16.  *
  17.  * @author Admin
  18.  */
  19. @Entity
  20. public class UserFx implements Serializable {
  21.  
  22.     private static final long serialVersionUID = 1L;
  23.     @Id
  24.     @GeneratedValue(strategy = GenerationType.AUTO)
  25.     private Long id;
  26. private String background;
  27.     public Long getId() {
  28.         return id;
  29.     }
  30.  
  31.     public void setId(Long id) {
  32.         this.id = id;
  33.     }
  34.    
  35.     private String username;
  36.     private String password;
  37.     private String phone;
  38.     private String country;
  39.     private String city;
  40.     private Boolean admin = false;
  41.     private Boolean banned = false;
  42.  
  43.     public Boolean getBanned() {
  44.         return banned;
  45.     }
  46.  
  47.     public void setBanned(Boolean banned) {
  48.         this.banned = banned;
  49.     }
  50.  
  51.  
  52.     @Override
  53.     public int hashCode() {
  54.         int hash = 0;
  55.         hash += (id != null ? id.hashCode() : 0);
  56.         return hash;
  57.     }
  58.  
  59.     @Override
  60.     public boolean equals(Object object) {
  61.         // TODO: Warning - this method won't work in the case the id fields are not set
  62.         if (!(object instanceof UserFx)) {
  63.             return false;
  64.         }
  65.         UserFx other = (UserFx) object;
  66.         if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
  67.             return false;
  68.         }
  69.         return true;
  70.     }
  71.  
  72.     @Override
  73.     public String toString() {
  74.         return "javafxapplication.models.UserFx[ id=" + id + " ]";
  75.     }
  76.  
  77.     public String getUsername() {
  78.         return username;
  79.     }
  80.  
  81.     public void setUsername(String username) {
  82.         this.username = username;
  83.     }
  84.  
  85.     public String getPassword() {
  86.         return password;
  87.     }
  88.  
  89.     public void setPassword(String password) {
  90.         this.password = password;
  91.     }
  92.  
  93.     public String getPhone() {
  94.         return phone;
  95.     }
  96.  
  97.     public void setPhone(String phone) {
  98.         this.phone = phone;
  99.     }
  100.  
  101.     public String getCountry() {
  102.         return country;
  103.     }
  104.  
  105.     public void setCountry(String country) {
  106.         this.country = country;
  107.     }
  108.  
  109.     public String getCity() {
  110.         return city;
  111.     }
  112.  
  113.     public void setCity(String city) {
  114.         this.city = city;
  115.     }
  116.  
  117.     public Boolean getAdmin() {
  118.         return admin;
  119.     }
  120.  
  121.     public void setAdmin(Boolean admin) {
  122.         this.admin = admin;
  123.     }
  124.    
  125.     public void setBackground(String uri){
  126.     this.background = uri;
  127.     }
  128.    
  129.  
  130.     public String getBackground(){
  131.     return this.background;
  132.     }
  133.  
  134.     public UserFx(String username, String password, String phone, String country, String city, Boolean admin, Boolean banned) {
  135.         this.username = username;
  136.         this.password = password;
  137.         this.phone = phone;
  138.         this.country = country;
  139.         this.city = city;
  140.         this.admin = admin;
  141.         this.banned = banned;
  142.     }
  143.  
  144.     public UserFx() {
  145.     }
  146.     private String style;
  147.      private String baseColor;
  148.      
  149.      
  150.     public String getStyle() {
  151.     return style;
  152.     }
  153.  
  154.     public void setStyle(String style) {
  155.     this.style = style;
  156.     }
  157.      
  158.      
  159.     public String getBaseColor() {
  160.         return baseColor;
  161.     }
  162.  
  163.     public void setBaseColor(String baseColor) {
  164.         this.baseColor = baseColor;
  165.     }
  166.  
  167.    
  168.      /*  private void setBackgroundStyle(Node node, String url, String color){
  169.         node.setStyle("-fx-background-image: url('" + url + "');-fx-background-position: center center; -fx-background-repeat: stretch;-fx-background-size: contain;-fx-base: " + color + ";");    
  170.     }*/
  171.  
  172.  
  173.    
  174.    
  175.    
  176.  
  177.  
  178.  
  179.    
  180.    
  181. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement