APL/APL2.1/TP06/Metrique/MetricPaper.java

33 lines
793 B
Java
Raw Normal View History

2022-03-07 17:26:31 +01:00
import java.awt.print.Paper;
public class MetricPaper extends Paper {
private static double toMetric(double inch) {
return inch * 2.54d;
}
private static double toInch(double metric) {
return metric / 2.54d;
}
public double getMetricHeight() {
return toMetric(this.getHeight());
}
public double getMetricWidth() {
return toMetric(this.getWidth());
}
public double getMetricImageableX() {
return toMetric(this.getImageableX());
}
public double getMetricImageableY() {
return toMetric(this.getImageableY());
}
public MetricPaper() {
super();
this.setSize(toInch(210d), toInch(297d));
this.setImageableArea(toInch(15), toInch(15), toInch(180), toInch(267));
}
}