
net.vectorpublish.desktop.vp.pd.official.ZoomPercent Maven / Gradle / Ivy
The newest version!
/*
* Copyright (c) 2016, Peter Rader. All rights reserved.
* ___ ___ __ ______ __ __ __ __
* | | |.-----..----.| |_ .-----..----.| __ \.--.--.| |--.| ||__|.-----.| |--.
* | | || -__|| __|| _|| _ || _|| __/| | || _ || || ||__ --|| |
* \_____/ |_____||____||____||_____||__| |___| |_____||_____||__||__||_____||__|__|
*
* http://www.gnu.org/licenses/gpl-3.0.html
*/
package net.vectorpublish.desktop.vp.pd.official;
/**
* The zoom in percent(%), at least 1.
*
*
* This class is a readonly-class.
*/
public class ZoomPercent {
public static final ZoomPercent DEFAULT = new ZoomPercent(100);
private final int percent;
/**
* Constructs a new percent by integer value.
*
* @param percent
* The percent value (at least 1).
*/
public ZoomPercent(int percent) {
this.percent = percent;
if (percent < 1) {
throw new IllegalArgumentException("Zoom must at least be 1%");
}
}
/**
* Gives the zoom-percent, at least 1.
*
* @return The zoom in percent, at least 1.
*/
public int getPercent() {
return percent;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy