use of com.ramussoft.core.attribute.simple.SimpleAttributeConverter in project ramus by Vitaliy-Yakovchuk.
the class StatusPlugin method getAttributeConverter.
@Override
public AttributeConverter getAttributeConverter() {
return new SimpleAttributeConverter() {
@Override
protected Object toObject(Persistent persistent) {
StatusPersistent p = (StatusPersistent) persistent;
return new Status(p.getType(), p.getOtherName());
}
@Override
protected Persistent toPersistent(Object value) {
StatusPersistent p = new StatusPersistent();
Status s = (Status) value;
p.setOtherName(s.getAtherName());
p.setType(s.getType());
return p;
}
};
}
use of com.ramussoft.core.attribute.simple.SimpleAttributeConverter in project ramus by Vitaliy-Yakovchuk.
the class FRectanglePlugin method getAttributeConverter.
@Override
public AttributeConverter getAttributeConverter() {
return new SimpleAttributeConverter() {
@Override
protected Object toObject(Persistent persistent) {
FRectanglePersistent fp = (FRectanglePersistent) persistent;
return new FRectangle(fp.getX(), fp.getY(), fp.getWidth(), fp.getHeight());
}
@Override
protected Persistent toPersistent(Object value) {
FRectanglePersistent e = new FRectanglePersistent();
FRectangle rect = (FRectangle) value;
e.setX(rect.getX());
e.setY(rect.getY());
e.setWidth(rect.getWidth());
e.setHeight(rect.getHeight());
return e;
}
};
}
use of com.ramussoft.core.attribute.simple.SimpleAttributeConverter in project ramus by Vitaliy-Yakovchuk.
the class FontPlugin method getAttributeConverter.
@Override
public AttributeConverter getAttributeConverter() {
return new SimpleAttributeConverter() {
@Override
protected Object toObject(Persistent persistent) {
FontPersistent p = (FontPersistent) persistent;
return new Font(p.getName(), p.getStyle(), p.getSize());
}
@Override
protected Persistent toPersistent(Object value) {
Font f = (Font) value;
FontPersistent p = new FontPersistent();
p.setName(f.getName());
p.setStyle(f.getStyle());
p.setSize(f.getSize());
return p;
}
};
}
Aggregations