All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.gv2011.util.swing.imp.builder.Orientation Maven / Gradle / Ivy

There is a newer version: 0.14
Show newest version
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