1 22 package org.gjt.sp.jedit.textarea; 23 24 31 public class AntiAlias extends Object 32 { 33 public static final Object NONE = "none"; 34 35 public static final Object STANDARD = "standard"; 36 37 public static final Object SUBPIXEL = "subpixel"; 38 39 public static final Object comboChoices[] = new Object [] { NONE, STANDARD, SUBPIXEL }; 40 41 public void set(int newValue) 42 { 43 m_val = newValue; 44 } 45 46 public AntiAlias(boolean isEnabled) 47 { 48 m_val = isEnabled ? 1 : 0; 49 } 50 51 public AntiAlias(int val) 52 { 53 m_val = val; 54 } 55 56 public AntiAlias(String v) 57 { 58 fromString(v); 59 } 60 61 public boolean equals(Object other) 62 { 63 return toString().equals(other.toString()); 64 65 } 66 67 public void fromString(String v) 68 { 69 for (int i = 0; i < comboChoices.length; ++i) 70 { 71 if (comboChoices[i].equals(v)) 72 { 73 m_val = i; 74 } 75 } 76 } 77 78 public String toString() 79 { 80 return comboChoices[m_val].toString(); 81 } 82 83 public int val() 84 { 85 return m_val; 86 } 87 88 private int m_val = 0; 89 } 90 | Popular Tags |