jdk/src/share/classes/javax/swing/plaf/nimbus/DerivedColor.java
changeset 23697 e556a715949f
parent 5506 202f599c92aa
child 24865 09b1d992ca72
equal deleted inserted replaced
23696:7deff68428ef 23697:e556a715949f
     1 /*
     1 /*
     2  * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    36  * value will update to reflect the new derived color. Property change events
    36  * value will update to reflect the new derived color. Property change events
    37  * are fired for the "rgb" property when the derived color changes.
    37  * are fired for the "rgb" property when the derived color changes.
    38  *
    38  *
    39  * @author Jasper Potts
    39  * @author Jasper Potts
    40  */
    40  */
       
    41 @SuppressWarnings("serial") // Same-version serialization only
    41 class DerivedColor extends Color {
    42 class DerivedColor extends Color {
    42     private final String uiDefaultParentName;
    43     private final String uiDefaultParentName;
    43     private final float hOffset, sOffset, bOffset;
    44     private final float hOffset, sOffset, bOffset;
    44     private final int aOffset;
    45     private final int aOffset;
    45     private int argbValue;
    46     private int argbValue;
   171                 " offsets=" + getHueOffset() + "," + getSaturationOffset() + ","
   172                 " offsets=" + getHueOffset() + "," + getSaturationOffset() + ","
   172                 + getBrightnessOffset() + "," + getAlphaOffset();
   173                 + getBrightnessOffset() + "," + getAlphaOffset();
   173         return src == null ? s : s + " pColor=" + src.getRed() + "," + src.getGreen() + "," + src.getBlue();
   174         return src == null ? s : s + " pColor=" + src.getRed() + "," + src.getGreen() + "," + src.getBlue();
   174     }
   175     }
   175 
   176 
       
   177     @SuppressWarnings("serial") // Same-version serialization only
   176     static class UIResource extends DerivedColor implements javax.swing.plaf.UIResource {
   178     static class UIResource extends DerivedColor implements javax.swing.plaf.UIResource {
   177         UIResource(String uiDefaultParentName, float hOffset, float sOffset,
   179         UIResource(String uiDefaultParentName, float hOffset, float sOffset,
   178                    float bOffset, int aOffset) {
   180                    float bOffset, int aOffset) {
   179             super(uiDefaultParentName, hOffset, sOffset, bOffset, aOffset);
   181             super(uiDefaultParentName, hOffset, sOffset, bOffset, aOffset);
   180         }
   182         }