2362N/A * Copyright (c) 1997, 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 * Implements a View suitable for use in JPasswordField 0N/A * UI implementations. This is basically a field ui that 0N/A * renders its contents as the echo character specified 0N/A * in the associated component (if it can narrow the 0N/A * component to a JPasswordField). 0N/A * @author Timothy Prinzing 0N/A * Constructs a new view wrapped on an element. 0N/A * @param elem the element 0N/A * Renders the given range in the model as normal unselected 0N/A * text. This sets the foreground color and echos the characters 0N/A * using the value returned by getEchoChar(). 0N/A * @param g the graphics context 0N/A * @param x the starting X coordinate >= 0 0N/A * @param y the starting Y coordinate >= 0 0N/A * @param p0 the starting offset in the model >= 0 0N/A * @param p1 the ending offset in the model >= p0 0N/A * @return the X location of the end of the range >= 0 0N/A * @exception BadLocationException if p0 or p1 are out of range 0N/A for (
int i =
0; i < n; i++) {
0N/A * Renders the given range in the model as selected text. This 0N/A * is implemented to render the text in the color specified in 0N/A * the hosting component. It assumes the highlighter will render 0N/A * the selected background. Uses the result of getEchoChar() to 0N/A * display the characters. 0N/A * @param g the graphics context 0N/A * @param x the starting X coordinate >= 0 0N/A * @param y the starting Y coordinate >= 0 0N/A * @param p0 the starting offset in the model >= 0 0N/A * @param p1 the ending offset in the model >= p0 0N/A * @return the X location of the end of the range >= 0 0N/A * @exception BadLocationException if p0 or p1 are out of range 0N/A for (
int i =
0; i < n; i++) {
0N/A * Renders the echo character, or whatever graphic should be used 0N/A * to display the password characters. The color in the Graphics 0N/A * object is set to the appropriate foreground color for selected 0N/A * or unselected text. 0N/A * @param g the graphics context 0N/A * @param x the starting X coordinate >= 0 0N/A * @param y the starting Y coordinate >= 0 0N/A * @param c the echo character 0N/A * @return the updated X position >= 0 0N/A * Provides a mapping from the document model coordinate space 0N/A * to the coordinate space of the view mapped to it. 0N/A * @param pos the position to convert >= 0 0N/A * @param a the allocated region to render into 0N/A * @return the bounding box of the given position 0N/A * @exception BadLocationException if the given position does not 0N/A * represent a valid location in the associated document 0N/A * @see View#modelToView 0N/A * Provides a mapping from the view coordinate space to the logical 0N/A * coordinate space of the model. 0N/A * @param fx the X coordinate >= 0.0f 0N/A * @param fy the Y coordinate >= 0.0f 0N/A * @param a the allocated region to render into 0N/A * @return the location within the model that best represents the 0N/A * given point in the view 0N/A * @see View#viewToModel 0N/A * Determines the preferred span for this view along an 0N/A * @param axis may be either View.X_AXIS or View.Y_AXIS 0N/A * @return the span the view would like to be rendered into >= 0. 0N/A * Typically the view is told to render into the span 0N/A * that is returned, although there is no guarantee. 0N/A * The parent may choose to resize or break the view. 0N/A static char[]
ONE =
new char[
1];