Ignore:
Timestamp:
09/13/18 12:26:00 (6 years ago)
Author:
bln4
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/core/Font.java

    r1097 r1124  
    3838       
    3939        /** Standard constructor. */
    40         public Font(String familyName, Style style, int size, float spacing)
    41         {
     40        public Font(String familyName, Style style, int size, float spacing) {
    4241                if (familyName == null) familyName = DEFAULT_FAMILY_NAME;
    4342                if (style == null) style = DEFAULT_STYLE;
     
    5049       
    5150        /** Convenience constructor. */
    52         public Font(String familyName, Style style, int size)
    53         {
     51        public Font(String familyName, Style style, int size) {
    5452                this(familyName, style, size, DEFAULT_SPACING);
    5553        }
    5654
    5755        /** Convenience constructor. */
    58         public Font(String familyName, Style style)
    59         {
     56        public Font(String familyName, Style style) {
    6057                this(familyName, style, DEFAULT_SIZE);
    6158        }
    6259
    6360        /** Convenience constructor. */
    64         public Font(String familyName)
    65         {
     61        public Font(String familyName) {
    6662                this(familyName, DEFAULT_STYLE);
    6763        }
    6864
    6965        /** Convenience constructor. */
    70         public Font()
    71         {
     66        public Font() {
    7267                this(DEFAULT_FAMILY_NAME);
    7368        }
    7469       
    7570        /** Copy constructor. */
    76         public Font(Font other)
    77         {
     71        public Font(Font other) {
    7872                _familyName = other._familyName;
    7973                _style = other._style;
     
    8377       
    8478        /** Gets the family name of this font. */
    85         public String getFamilyName()
    86         {
     79        public String getFamilyName() {
    8780                return _familyName;
    8881        }
    8982       
    9083        /** Sets the style of this font. */
    91         public Font setStyle(Style style)
    92         {
     84        public Font setStyle(Style style) {
    9385                _style = style;
    94                
    9586                return this;
    9687        }
    9788
    9889        /** Gets the style of this font. */
    99         public Style getStyle()
    100         {
     90        public Style getStyle() {
    10191                return _style;
    10292        }
    10393       
    10494        /** Returns true if this font has bold styling. */
    105         public boolean isBold()
    106         {
     95        public boolean isBold() {
    10796                return _style == Style.BOLD || _style == Style.BOLD_ITALIC;
    10897        }
    10998
    11099        /** Returns true if this font has italic styling. */
    111         public boolean isItalic()
    112         {
     100        public boolean isItalic() {
    113101                return _style == Style.ITALIC || _style == Style.BOLD_ITALIC;
    114102        }
    115103
    116104        /** Returns true if this font has no bold/italic styling. */
    117         public boolean isPlain()
    118         {
     105        public boolean isPlain() {
    119106                return _style == Style.PLAIN;
    120107        }
    121108       
    122109        /** Removes bold styling if this font has it, or adds if if not. */
    123         public void toggleBold()
    124         {
     110        public void toggleBold() {
    125111                switch (_style) {
    126112                case PLAIN:
     
    140126
    141127        /** Removes italic styling if this font has it, or adds if if not. */
    142         public void toggleItalic()
    143         {
     128        public void toggleItalic() {
    144129                switch (_style) {
    145130                case PLAIN:
     
    159144       
    160145        /** Sets the size of this font. */
    161         public void setSize(int size)
    162         {
     146        public void setSize(int size) {
    163147                _size = size;
    164148        }
    165149
    166150        /** Gets the size of this font. */
    167         public int getSize()
    168         {
     151        public int getSize() {
    169152                return _size;
    170153        }
    171154
    172155        /** Sets the spacing of this font. */
    173         public void setSpacing(float spacing)
    174         {
     156        public void setSpacing(float spacing) {
    175157                _spacing = spacing;
    176158        }
    177159
    178160        /** Gets the spacing of this font. */
    179         public float getSpacing()
    180         {
     161        public float getSpacing() {
    181162                return _spacing;
    182163        }
    183164       
    184165        @Override
    185         public Font clone()
    186         {
     166        public Font clone()     {
    187167                return new Font(this);
    188168        }
Note: See TracChangeset for help on using the changeset viewer.