
com.guigarage.flatterfx.controls.AvatarView Maven / Gradle / Ivy
The newest version!
package com.guigarage.flatterfx.controls;
import javafx.beans.property.SimpleDoubleProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.scene.control.Control;
import javafx.scene.control.Skin;
import javafx.scene.image.Image;
import com.guigarage.flatterfx.skin.FlatterAvatarViewSkin;
public class AvatarView extends Control {
private SimpleObjectProperty image;
private SimpleDoubleProperty defaultSize;
private SimpleDoubleProperty gap;
public AvatarView() {
}
@Override
protected Skin> createDefaultSkin() {
return new FlatterAvatarViewSkin(this);
}
public SimpleDoubleProperty gapProperty() {
if(gap == null) {
gap = new SimpleDoubleProperty(12.0);
}
return gap;
}
public SimpleDoubleProperty defaultSizeProperty() {
if(defaultSize == null) {
defaultSize = new SimpleDoubleProperty(64.0);
}
return defaultSize;
}
public SimpleObjectProperty imageProperty() {
if(image == null) {
image = new SimpleObjectProperty<>();
}
return image;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy