2362N/A * Copyright (c) 2002, 2007, 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 //The check mark is less common than a plain "depressed" button, 0N/A //so don't use the checkmark. 0N/A // The checkmark shape: 0N/A new int[] {
1,
25,
56,
124,
124,
85,
64},
// X-coords 0N/A new int[] {
59,
35,
67,
0,
12,
66,
123},
// Y-coords 0N/A // Put this here so it is executed before layout() is called from 0N/A // setFont() in XComponent.postInit() 0N/A // TODO: only need to paint the focus bit 0N/A // TODO: only need to paint the focus bit? 0N/A //selected=!selected; 0N/A //repaint(); // Gets the repaint from action() 0N/A // Disabled buttons ignore all input... 0N/A //selected = !selected; 0N/A // send action event 0N/A //action(e.getWhen(),e.getModifiers()); 0N/A * Spacing (number of pixels between check mark and label text) is 0N/A * currently set to 0, but in case it ever changes we have to add 0N/A * it. 8 is a heuristic number. Indicator size depends on font 0N/A * height, so we don't need to include it in checkbox's height 0N/A // the motif way of sizing is a bit inscutible, but this 0N/A // is a fair approximation 0N/A // Note - Motif appears to use an left inset that is slightly 0N/A // FIXME: will need to account for alignment? 0N/A // FIXME: call layout() on alignment changes 0N/A //textRect.width = fm.stringWidth(text); 0N/A // Paint the checkbox or radio button 0N/A // You'll note this looks suspiciously like paintBorder 0N/A int x,
int y,
int w,
int h) {
0N/A // Fix for 5045936. While printing, g is an instance of 0N/A // sun.print.ProxyPrintGraphics which extends Graphics. So 0N/A // we use a separate buffered image and its graphics is 0N/A // always Graphics2D instance 0N/A // then paint the check 0N/A // FIXME: is this the right color? 0N/A /*** paint the text normally */ 0N/A /*** paint the text disabled ***/ 0N/A // TODO: copied directly from XButtonPeer. Should probabaly be shared 0N/A // NOTE: This method is called by privileged threads. 0N/A // DO NOT INVOKE CLIENT CODE ON THIS THREAD! 0N/A // From MCheckboxPeer 0N/A // Bugid 4039594. If this is the current Checkbox in 0N/A // a CheckboxGroup, then return to prevent deselection. 0N/A // Otherwise, it's logical state will be turned off, 0N/A // but it will appear on. 0N/A // All clear - set the new state