001package com.hfg.graphics.units; 002 003//------------------------------------------------------------------------------ 004/** 005 * Represents the pixels per inch (PPI) value of a display device. 006 * 007 * @author J. Alex Taylor, hairyfatguy.com 008 */ 009//------------------------------------------------------------------------------ 010// com.hfg XML/HTML Coding Library 011// 012// This library is free software; you can redistribute it and/or 013// modify it under the terms of the GNU Lesser General Public 014// License as published by the Free Software Foundation; either 015// version 2.1 of the License, or (at your option) any later version. 016// 017// This library is distributed in the hope that it will be useful, 018// but WITHOUT ANY WARRANTY; without even the implied warranty of 019// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 020// Lesser General Public License for more details. 021// 022// You should have received a copy of the GNU Lesser General Public 023// License along with this library; if not, write to the Free Software 024// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 025// 026// J. Alex Taylor, President, Founder, CEO, COO, CFO, OOPS hairyfatguy.com 027// jataylor@hairyfatguy.com 028//------------------------------------------------------------------------------ 029 030public class DisplayPPI 031{ 032 private int mValue; 033 034 035 public static final DisplayPPI _72 = new DisplayPPI(72); 036 public static final DisplayPPI _96 = new DisplayPPI(96); 037 038 //########################################################################### 039 // CONSTRUCTORS 040 //########################################################################### 041 042 //--------------------------------------------------------------------------- 043 public DisplayPPI(int inValue) 044 { 045 mValue = inValue; 046 } 047 048 //########################################################################### 049 // PUBLIC METHODS 050 //########################################################################### 051 052 //--------------------------------------------------------------------------- 053 @Override 054 public String toString() 055 { 056 return intValue() + " ppi"; 057 } 058 059 //--------------------------------------------------------------------------- 060 public int intValue() 061 { 062 return mValue; 063 } 064}