2362N/A * Copyright (c) 1997, 2010, 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 * A class which implements an arbitrary border 0N/A * with the addition of a String title in a 0N/A * specified position and justification. 0N/A * If the border, font, or color property values are not 0N/A * specified in the constuctor or by invoking the appropriate 0N/A * set methods, the property values will be defined by the current 0N/A * look and feel, using the following property names in the 0N/A * <li>"TitledBorder.border" 0N/A * <li>"TitledBorder.font" 0N/A * <li>"TitledBorder.titleColor" 0N/A * <strong>Warning:</strong> 0N/A * Serialized objects of this class will not be compatible with 0N/A * future Swing releases. The current serialization support is 0N/A * appropriate for short term storage or RMI between applications running 0N/A * the same version of Swing. As of 1.4, support for long term storage 0N/A * of all JavaBeans<sup><font size="-2">TM</font></sup> 0N/A * has been added to the <code>java.beans</code> package. 0N/A * @author David Kloba 0N/A * @author Amy Fowler 0N/A * Use the default vertical orientation for the title text. 0N/A /** Position the title above the border's top line. */ 0N/A /** Position the title in the middle of the border's top line. */ 0N/A static public final int TOP =
2;
0N/A /** Position the title below the border's top line. */ 0N/A /** Position the title above the border's bottom line. */ 0N/A /** Position the title in the middle of the border's bottom line. */ 0N/A /** Position the title below the border's bottom line. */ 0N/A * Use the default justification for the title text. 0N/A /** Position title text at the left side of the border line. */ 0N/A /** Position title text in the center of the border line. */ 0N/A /** Position title text at the right side of the border line. */ 0N/A /** Position title text at the left side of the border line 0N/A * for left to right orientation, at the right side of the 0N/A * border line for right to left orientation. 0N/A /** Position title text at the right side of the border line 0N/A * for left to right orientation, at the left side of the 0N/A * border line for right to left orientation. 0N/A // Space between the border and the component's edge 0N/A // Space between the border and text 0N/A // Horizontal inset of text that is left or right justified 0N/A * Creates a TitledBorder instance. 0N/A * @param title the title the border should display 0N/A * Creates a TitledBorder instance with the specified border 0N/A * and an empty title. 0N/A * @param border the border 0N/A * Creates a TitledBorder instance with the specified border 0N/A * @param border the border 0N/A * @param title the title the border should display 0N/A * Creates a TitledBorder instance with the specified border, 0N/A * title, title-justification, and title-position. 0N/A * @param border the border 0N/A * @param title the title the border should display 0N/A * @param titleJustification the justification for the title 0N/A * @param titlePosition the position for the title 0N/A * Creates a TitledBorder instance with the specified border, 0N/A * title, title-justification, title-position, and title-font. 0N/A * @param border the border 0N/A * @param title the title the border should display 0N/A * @param titleJustification the justification for the title 0N/A * @param titlePosition the position for the title 0N/A * @param titleFont the font for rendering the title 0N/A * Creates a TitledBorder instance with the specified border, 0N/A * title, title-justification, title-position, title-font, and 0N/A * @param border the border 0N/A * @param title the title the border should display 0N/A * @param titleJustification the justification for the title 0N/A * @param titlePosition the position for the title 0N/A * @param titleFont the font of the title 0N/A * @param titleColor the color of the title 0N/A * Paints the border for the specified component with the 0N/A * specified position and size. 0N/A * @param c the component for which this border is being painted 0N/A * @param g the paint graphics 0N/A * @param x the x position of the painted border 0N/A * @param y the y position of the painted border 0N/A * @param width the width of the painted border 0N/A * @param height the height of the painted border 0N/A * Reinitialize the insets parameter with this Border's current Insets. 0N/A * @param c the component for which this border insets value applies 0N/A * @param insets the object to be reinitialized 0N/A * Returns whether or not the border is opaque. 0N/A * Returns the title of the titled border. 0N/A * @return the title of the titled border 0N/A * Returns the border of the titled border. 0N/A * @return the border of the titled border 0N/A * Returns the title-position of the titled border. 0N/A * @return the title-position of the titled border 0N/A * Returns the title-justification of the titled border. 0N/A * @return the title-justification of the titled border 0N/A * Returns the title-font of the titled border. 0N/A * @return the title-font of the titled border 0N/A * Returns the title-color of the titled border. 0N/A * @return the title-color of the titled border 0N/A // REMIND(aim): remove all or some of these set methods? 0N/A * Sets the title of the titled border. 0N/A * @param title the title for the border 0N/A * Sets the border of the titled border. 0N/A * @param border the border 0N/A * Sets the title-position of the titled border. 0N/A * @param titlePosition the position for the border 0N/A " is not a valid title position.");
0N/A * Sets the title-justification of the titled border. 0N/A * @param titleJustification the justification for the border 0N/A " is not a valid title justification.");
0N/A * Sets the title-font of the titled border. 0N/A * @param titleFont the font for the border title 0N/A * Sets the title-color of the titled border. 0N/A * @param titleColor the color for the border title 0N/A * Returns the minimum dimensions this border requires 0N/A * in order to fully display the border and title. 0N/A * @param c the component where this border will be drawn 0N/A * @return the {@code Dimension} object 0N/A * Returns the baseline. 0N/A * @throws NullPointerException {@inheritDoc} 0N/A * @throws IllegalArgumentException {@inheritDoc} 0N/A * @see javax.swing.JComponent#getBaseline(int, int) 0N/A * Returns an enum indicating how the baseline of the border 0N/A * changes as the size changes. 0N/A * @throws NullPointerException {@inheritDoc} 0N/A * @see javax.swing.JComponent#getBaseline(int, int) 0N/A if ((
0 < i) && (i <=
6)) {