NimbusIcon.java revision 2362
3261N/A * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * An icon that delegates to a painter. 0N/A //translatex and translatey are additional translations that 0N/A //must occur on the graphics context when rendering a toolbar 524N/A //we only do the +1 hack for UIResource borders, assuming 0N/A //that the border is probably going to be our border 0N/A // use image if we are printing to a Java 1.1 PrintGraphics as 0N/A // it is not a instance of Graphics2D 0N/A * Implements the standard Icon interface's paintIcon method as the standard 0N/A * synth stub passes null for the context and this will cause us to not 0N/A * paint any thing, so we override here so that we can paint the enabled 0N/A * state if no synth context is available 0N/A //we only do the -1 hack for UIResource borders, assuming 0N/A //that the border is probably going to be our border 0N/A //we only do the -1 hack for UIResource borders, assuming 0N/A //that the border is probably going to be our border 2494N/A * Scale a size based on the "JComponent.sizeVariant" client property of the 2494N/A * component that is using this icon 0N/A * @param context The synthContext to get the component from 0N/A * @param size The size to scale 0N/A * @return The scaled size or original if "JComponent.sizeVariant" is not 0N/A // The key "JComponent.sizeVariant" is used to match Apple's LAF 0N/A "JComponent.sizeVariant");
0N/A // mini is not quite as small for icons as full mini is