Skip to content
Snippets Groups Projects
Select Git revision
  • 62ec437fd65bbb095c1955a8da0ac8552723cff1
  • main default protected
2 results

AbstractCell.java

  • Forked from TRAVERS Corentin / flooding-template
    48 commits ahead of the upstream repository.
    TRAVERS Corentin's avatar
    TRAVERS Corentin authored
    624828aa
    History
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    AbstractCell.java 957 B
    package model;
    
    import javafx.beans.property.ObjectProperty;
    import javafx.beans.property.SimpleObjectProperty;
    import javafx.scene.paint.Color;
    
    /**
     * This class provides a partial implementation of the {@code Cell} interface.
     *
     */
    public abstract class AbstractCell implements Cell{
    
        static final Color DEFAULT_CELL_COLOR = Color.LIGHTGRAY;
        private final ObjectProperty<Color> colorProperty = new SimpleObjectProperty<>(DEFAULT_CELL_COLOR);
    
    
        public AbstractCell(){}
        /**
         * The constructor of {@code AbstractCell}
         * @param color the color of the cell
         */
        public AbstractCell(Color color){
            setColor(color);
        }
    
    
        @Override
        public void setColor(Color color){
            colorProperty.setValue(color);
        }
    
        @Override
        public Color getColor(){
            return colorProperty.getValue();
        }
    
        @Override
        public ObjectProperty<Color> getColorProperty(){
            return colorProperty;
        }
    
    
    }