home *** CD-ROM | disk | FTP | other *** search
/ S283 Planetary Science &n…he Search for Life DVD 2 / DVD-ROM.iso / install / jre1_3 / lib / rt.jar / java / awt / ComponentOrientation.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  1.3 KB  |  59 lines

  1. package java.awt;
  2.  
  3. import java.io.Serializable;
  4. import java.util.Locale;
  5. import java.util.ResourceBundle;
  6.  
  7. public final class ComponentOrientation implements Serializable {
  8.    private static final int UNK_BIT = 1;
  9.    private static final int HORIZ_BIT = 2;
  10.    private static final int LTR_BIT = 4;
  11.    public static final ComponentOrientation LEFT_TO_RIGHT = new ComponentOrientation(6);
  12.    public static final ComponentOrientation RIGHT_TO_LEFT = new ComponentOrientation(2);
  13.    public static final ComponentOrientation UNKNOWN = new ComponentOrientation(7);
  14.    private int orientation;
  15.  
  16.    public boolean isHorizontal() {
  17.       return (this.orientation & 2) != 0;
  18.    }
  19.  
  20.    public boolean isLeftToRight() {
  21.       return (this.orientation & 4) != 0;
  22.    }
  23.  
  24.    public static ComponentOrientation getOrientation(Locale var0) {
  25.       ComponentOrientation var1 = UNKNOWN;
  26.  
  27.       try {
  28.          ResourceBundle var2 = ResourceBundle.getBundle("java.text.resources.LocaleElements", var0);
  29.          var1 = (ComponentOrientation)var2.getObject("Orientation");
  30.       } catch (Exception var3) {
  31.       }
  32.  
  33.       return var1;
  34.    }
  35.  
  36.    public static ComponentOrientation getOrientation(ResourceBundle var0) {
  37.       ComponentOrientation var1 = null;
  38.  
  39.       try {
  40.          var1 = (ComponentOrientation)var0.getObject("Orientation");
  41.       } catch (Exception var3) {
  42.       }
  43.  
  44.       if (var1 == null) {
  45.          var1 = getOrientation(var0.getLocale());
  46.       }
  47.  
  48.       if (var1 == null) {
  49.          var1 = getOrientation(Locale.getDefault());
  50.       }
  51.  
  52.       return var1;
  53.    }
  54.  
  55.    private ComponentOrientation(int var1) {
  56.       this.orientation = var1;
  57.    }
  58. }
  59.