com.github.gv2011.util.swing.imp.builder.Orientation Maven / Gradle / Ivy
package com.github.gv2011.util.swing.imp.builder;
import java.awt.Dimension;
import java.util.function.ToIntFunction;
enum Orientation {
HORIZONTAL(d->d.width), VERTICAL(d->d.height);
private final ToIntFunction f;
private Orientation(final ToIntFunction f){
this.f = f;
}
int size(final Dimension dimension){
return f.applyAsInt(dimension);
}
Orientation other() {
return this==HORIZONTAL ? VERTICAL : HORIZONTAL;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy