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 / javax / swing / text / StyleConstants.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  6.3 KB  |  279 lines

  1. package javax.swing.text;
  2.  
  3. import java.awt.Color;
  4. import java.awt.Component;
  5. import javax.swing.Icon;
  6.  
  7. public class StyleConstants {
  8.    public static final String ComponentElementName = "component";
  9.    public static final String IconElementName = "icon";
  10.    public static final Object NameAttribute = new StyleConstants("name");
  11.    public static final Object ResolveAttribute = new StyleConstants("resolver");
  12.    public static final Object ModelAttribute = new StyleConstants("model");
  13.    public static final Object BidiLevel;
  14.    public static final Object FontFamily;
  15.    public static final Object FontSize;
  16.    public static final Object Bold;
  17.    public static final Object Italic;
  18.    public static final Object Underline;
  19.    public static final Object StrikeThrough;
  20.    public static final Object Superscript;
  21.    public static final Object Subscript;
  22.    public static final Object Foreground;
  23.    public static final Object Background;
  24.    public static final Object ComponentAttribute;
  25.    public static final Object IconAttribute;
  26.    public static final Object ComposedTextAttribute;
  27.    public static final Object FirstLineIndent;
  28.    public static final Object LeftIndent;
  29.    public static final Object RightIndent;
  30.    public static final Object LineSpacing;
  31.    public static final Object SpaceAbove;
  32.    public static final Object SpaceBelow;
  33.    public static final Object Alignment;
  34.    public static final Object TabSet;
  35.    public static final Object Orientation;
  36.    public static final int ALIGN_LEFT = 0;
  37.    public static final int ALIGN_CENTER = 1;
  38.    public static final int ALIGN_RIGHT = 2;
  39.    public static final int ALIGN_JUSTIFIED = 3;
  40.    static Object[] keys;
  41.    private String representation;
  42.  
  43.    public String toString() {
  44.       return this.representation;
  45.    }
  46.  
  47.    public static int getBidiLevel(AttributeSet var0) {
  48.       Integer var1 = (Integer)var0.getAttribute(BidiLevel);
  49.       return var1 != null ? var1 : 0;
  50.    }
  51.  
  52.    public static void setBidiLevel(MutableAttributeSet var0, int var1) {
  53.       var0.addAttribute(BidiLevel, new Integer(var1));
  54.    }
  55.  
  56.    public static Component getComponent(AttributeSet var0) {
  57.       return (Component)var0.getAttribute(ComponentAttribute);
  58.    }
  59.  
  60.    public static void setComponent(MutableAttributeSet var0, Component var1) {
  61.       var0.addAttribute("$ename", "component");
  62.       var0.addAttribute(ComponentAttribute, var1);
  63.    }
  64.  
  65.    public static Icon getIcon(AttributeSet var0) {
  66.       return (Icon)var0.getAttribute(IconAttribute);
  67.    }
  68.  
  69.    public static void setIcon(MutableAttributeSet var0, Icon var1) {
  70.       var0.addAttribute("$ename", "icon");
  71.       var0.addAttribute(IconAttribute, var1);
  72.    }
  73.  
  74.    public static String getFontFamily(AttributeSet var0) {
  75.       String var1 = (String)var0.getAttribute(FontFamily);
  76.       if (var1 == null) {
  77.          var1 = "Monospaced";
  78.       }
  79.  
  80.       return var1;
  81.    }
  82.  
  83.    public static void setFontFamily(MutableAttributeSet var0, String var1) {
  84.       var0.addAttribute(FontFamily, var1);
  85.    }
  86.  
  87.    public static int getFontSize(AttributeSet var0) {
  88.       Integer var1 = (Integer)var0.getAttribute(FontSize);
  89.       return var1 != null ? var1 : 12;
  90.    }
  91.  
  92.    public static void setFontSize(MutableAttributeSet var0, int var1) {
  93.       var0.addAttribute(FontSize, new Integer(var1));
  94.    }
  95.  
  96.    public static boolean isBold(AttributeSet var0) {
  97.       Boolean var1 = (Boolean)var0.getAttribute(Bold);
  98.       return var1 != null ? var1 : false;
  99.    }
  100.  
  101.    public static void setBold(MutableAttributeSet var0, boolean var1) {
  102.       var0.addAttribute(Bold, new Boolean(var1));
  103.    }
  104.  
  105.    public static boolean isItalic(AttributeSet var0) {
  106.       Boolean var1 = (Boolean)var0.getAttribute(Italic);
  107.       return var1 != null ? var1 : false;
  108.    }
  109.  
  110.    public static void setItalic(MutableAttributeSet var0, boolean var1) {
  111.       var0.addAttribute(Italic, new Boolean(var1));
  112.    }
  113.  
  114.    public static boolean isUnderline(AttributeSet var0) {
  115.       Boolean var1 = (Boolean)var0.getAttribute(Underline);
  116.       return var1 != null ? var1 : false;
  117.    }
  118.  
  119.    public static boolean isStrikeThrough(AttributeSet var0) {
  120.       Boolean var1 = (Boolean)var0.getAttribute(StrikeThrough);
  121.       return var1 != null ? var1 : false;
  122.    }
  123.  
  124.    public static boolean isSuperscript(AttributeSet var0) {
  125.       Boolean var1 = (Boolean)var0.getAttribute(Superscript);
  126.       return var1 != null ? var1 : false;
  127.    }
  128.  
  129.    public static boolean isSubscript(AttributeSet var0) {
  130.       Boolean var1 = (Boolean)var0.getAttribute(Subscript);
  131.       return var1 != null ? var1 : false;
  132.    }
  133.  
  134.    public static void setUnderline(MutableAttributeSet var0, boolean var1) {
  135.       var0.addAttribute(Underline, new Boolean(var1));
  136.    }
  137.  
  138.    public static void setStrikeThrough(MutableAttributeSet var0, boolean var1) {
  139.       var0.addAttribute(StrikeThrough, new Boolean(var1));
  140.    }
  141.  
  142.    public static void setSuperscript(MutableAttributeSet var0, boolean var1) {
  143.       var0.addAttribute(Superscript, new Boolean(var1));
  144.    }
  145.  
  146.    public static void setSubscript(MutableAttributeSet var0, boolean var1) {
  147.       var0.addAttribute(Subscript, new Boolean(var1));
  148.    }
  149.  
  150.    public static Color getForeground(AttributeSet var0) {
  151.       Color var1 = (Color)var0.getAttribute(Foreground);
  152.       if (var1 == null) {
  153.          var1 = Color.black;
  154.       }
  155.  
  156.       return var1;
  157.    }
  158.  
  159.    public static void setForeground(MutableAttributeSet var0, Color var1) {
  160.       var0.addAttribute(Foreground, var1);
  161.    }
  162.  
  163.    public static Color getBackground(AttributeSet var0) {
  164.       Color var1 = (Color)var0.getAttribute(Background);
  165.       if (var1 == null) {
  166.          var1 = Color.black;
  167.       }
  168.  
  169.       return var1;
  170.    }
  171.  
  172.    public static void setBackground(MutableAttributeSet var0, Color var1) {
  173.       var0.addAttribute(Background, var1);
  174.    }
  175.  
  176.    public static float getFirstLineIndent(AttributeSet var0) {
  177.       Float var1 = (Float)var0.getAttribute(FirstLineIndent);
  178.       return var1 != null ? var1 : 0.0F;
  179.    }
  180.  
  181.    public static void setFirstLineIndent(MutableAttributeSet var0, float var1) {
  182.       var0.addAttribute(FirstLineIndent, new Float(var1));
  183.    }
  184.  
  185.    public static float getRightIndent(AttributeSet var0) {
  186.       Float var1 = (Float)var0.getAttribute(RightIndent);
  187.       return var1 != null ? var1 : 0.0F;
  188.    }
  189.  
  190.    public static void setRightIndent(MutableAttributeSet var0, float var1) {
  191.       var0.addAttribute(RightIndent, new Float(var1));
  192.    }
  193.  
  194.    public static float getLeftIndent(AttributeSet var0) {
  195.       Float var1 = (Float)var0.getAttribute(LeftIndent);
  196.       return var1 != null ? var1 : 0.0F;
  197.    }
  198.  
  199.    public static void setLeftIndent(MutableAttributeSet var0, float var1) {
  200.       var0.addAttribute(LeftIndent, new Float(var1));
  201.    }
  202.  
  203.    public static float getLineSpacing(AttributeSet var0) {
  204.       Float var1 = (Float)var0.getAttribute(LineSpacing);
  205.       return var1 != null ? var1 : 0.0F;
  206.    }
  207.  
  208.    public static void setLineSpacing(MutableAttributeSet var0, float var1) {
  209.       var0.addAttribute(LineSpacing, new Float(var1));
  210.    }
  211.  
  212.    public static float getSpaceAbove(AttributeSet var0) {
  213.       Float var1 = (Float)var0.getAttribute(SpaceAbove);
  214.       return var1 != null ? var1 : 0.0F;
  215.    }
  216.  
  217.    public static void setSpaceAbove(MutableAttributeSet var0, float var1) {
  218.       var0.addAttribute(SpaceAbove, new Float(var1));
  219.    }
  220.  
  221.    public static float getSpaceBelow(AttributeSet var0) {
  222.       Float var1 = (Float)var0.getAttribute(SpaceBelow);
  223.       return var1 != null ? var1 : 0.0F;
  224.    }
  225.  
  226.    public static void setSpaceBelow(MutableAttributeSet var0, float var1) {
  227.       var0.addAttribute(SpaceBelow, new Float(var1));
  228.    }
  229.  
  230.    public static int getAlignment(AttributeSet var0) {
  231.       Integer var1 = (Integer)var0.getAttribute(Alignment);
  232.       return var1 != null ? var1 : 0;
  233.    }
  234.  
  235.    public static void setAlignment(MutableAttributeSet var0, int var1) {
  236.       var0.addAttribute(Alignment, new Integer(var1));
  237.    }
  238.  
  239.    public static TabSet getTabSet(AttributeSet var0) {
  240.       TabSet var1 = (TabSet)var0.getAttribute(TabSet);
  241.       return var1;
  242.    }
  243.  
  244.    public static void setTabSet(MutableAttributeSet var0, TabSet var1) {
  245.       var0.addAttribute(TabSet, var1);
  246.    }
  247.  
  248.    StyleConstants(String var1) {
  249.       this.representation = var1;
  250.    }
  251.  
  252.    static {
  253.       BidiLevel = javax.swing.text.StyleConstants.CharacterConstants.BidiLevel;
  254.       FontFamily = javax.swing.text.StyleConstants.CharacterConstants.Family;
  255.       FontSize = javax.swing.text.StyleConstants.CharacterConstants.Size;
  256.       Bold = javax.swing.text.StyleConstants.CharacterConstants.Bold;
  257.       Italic = javax.swing.text.StyleConstants.CharacterConstants.Italic;
  258.       Underline = javax.swing.text.StyleConstants.CharacterConstants.Underline;
  259.       StrikeThrough = javax.swing.text.StyleConstants.CharacterConstants.StrikeThrough;
  260.       Superscript = javax.swing.text.StyleConstants.CharacterConstants.Superscript;
  261.       Subscript = javax.swing.text.StyleConstants.CharacterConstants.Subscript;
  262.       Foreground = javax.swing.text.StyleConstants.CharacterConstants.Foreground;
  263.       Background = javax.swing.text.StyleConstants.CharacterConstants.Background;
  264.       ComponentAttribute = javax.swing.text.StyleConstants.CharacterConstants.ComponentAttribute;
  265.       IconAttribute = javax.swing.text.StyleConstants.CharacterConstants.IconAttribute;
  266.       ComposedTextAttribute = new StyleConstants("composed text");
  267.       FirstLineIndent = javax.swing.text.StyleConstants.ParagraphConstants.FirstLineIndent;
  268.       LeftIndent = javax.swing.text.StyleConstants.ParagraphConstants.LeftIndent;
  269.       RightIndent = javax.swing.text.StyleConstants.ParagraphConstants.RightIndent;
  270.       LineSpacing = javax.swing.text.StyleConstants.ParagraphConstants.LineSpacing;
  271.       SpaceAbove = javax.swing.text.StyleConstants.ParagraphConstants.SpaceAbove;
  272.       SpaceBelow = javax.swing.text.StyleConstants.ParagraphConstants.SpaceBelow;
  273.       Alignment = javax.swing.text.StyleConstants.ParagraphConstants.Alignment;
  274.       TabSet = javax.swing.text.StyleConstants.ParagraphConstants.TabSet;
  275.       Orientation = javax.swing.text.StyleConstants.ParagraphConstants.Orientation;
  276.       keys = new Object[]{NameAttribute, ResolveAttribute, BidiLevel, FontFamily, FontSize, Bold, Italic, Underline, StrikeThrough, Superscript, Subscript, Foreground, Background, ComponentAttribute, IconAttribute, FirstLineIndent, LeftIndent, RightIndent, LineSpacing, SpaceAbove, SpaceBelow, Alignment, TabSet, Orientation, ModelAttribute, ComposedTextAttribute};
  277.    }
  278. }
  279.