/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
public class AquaUtilControlSize {
interface Sizeable {
}
protected static final RecyclableSingleton<PropertySizeListener> sizeListener = new RecyclableSingletonFromDefaultConstructor<PropertySizeListener>(PropertySizeListener.class);
return sizeListener.get();
}
}
}
return null;
}
final String sizeProperty = java.security.AccessController.doPrivileged(new sun.security.action.GetPropertyAction(SYSTEM_PROPERTY_KEY));
}
return size;
}
protected static JRSUIConstants.Size applySizeForControl(final JComponent c, final AquaPainter<? extends JRSUIState> painter) {
return size;
}
if (size == JRSUIConstants.Size.MINI) return initialFont.deriveFont(AquaFonts.getMiniControlTextFont().getSize2D());
if (size == JRSUIConstants.Size.SMALL) return initialFont.deriveFont(AquaFonts.getSmallControlTextFont().getSize2D());
}
if (!(border instanceof AquaBorder)) return;
if (derivedBorder == null) return;
}
// call JComponent.getUI() if it exists, then call Sizeable.applySizeFor() if the UI is "Sizeable"
// next best thing to -respondsToSelector: :-P
try {
// see if this component has a "getUI" method
// see if that UI is one of ours that understands sizing
// size it!
} catch (final Throwable e) { return; }
}
if (!(source instanceof JComponent)) return;
}
size = getUserSizeFrom(c);
}
applyBorderForSize(c, size);
applyUISizing(c, size);
if (!(priorFont instanceof FontUIResource)) return;
}
}
public static class SizeDescriptor {
}
return v;
}
return v;
}
return v;
}
return get(getUserSizeFrom(c));
}
return regular;
}
}
}
public static class SizeVariant {
int w = 0;
int h = 0;
// Integer textBaseline;
public SizeVariant() { }
this.w = minWidth;
this.h = minHeight;
}
this.insets = new InsetsUIResource(desc.insets.top, desc.insets.left, desc.insets.bottom, desc.insets.right);
this.margins = new InsetsUIResource(desc.margins.top, desc.margins.left, desc.margins.bottom, desc.margins.right);
this.w = desc.w;
this.h = desc.h;
// this.textBaseline = desc.textBaseline;
}
return this;
}
return this;
}
return this;
}
return this;
}
return this;
}
return this;
}
return this;
}
// public SizeVariant alterTextBaseline(final int baseline) {
// final int oldSize = textBaseline == null ? 0 : textBaseline.intValue();
// textBaseline = new Integer(baseline + oldSize);
// return this;
// }
static Insets generateInsets(final Insets i, final int top, final int left, final int bottom, final int right) {
return i;
}
return "insets:" + insets + ", margins:" + margins + ", fontSize:" + fontSize;// + ", textBaseline:" + textBaseline;
}
}
}