2362N/A * Copyright (c) 1995, 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 * A <code>CardLayout</code> object is a layout manager for a 0N/A * container. It treats each component in the container as a card. 0N/A * Only one card is visible at a time, and the container acts as 0N/A * a stack of cards. The first component added to a 0N/A * <code>CardLayout</code> object is the visible component when the 0N/A * container is first displayed. 0N/A * The ordering of cards is determined by the container's own internal 0N/A * ordering of its component objects. <code>CardLayout</code> 0N/A * defines a set of methods that allow an application to flip 0N/A * through these cards sequentially, or to show a specified card. 0N/A * The {@link CardLayout#addLayoutComponent} 0N/A * method can be used to associate a string identifier with a given card 0N/A * for fast random access. 0N/A * @author Arthur van Hoff 0N/A * @see java.awt.Container 0N/A * This creates a Vector to store associated 0N/A * pairs of components and their names. 0N/A * @see java.util.Vector 0N/A * A pair of Component and String that represents its name. 0N/A * Index of Component currently displayed by CardLayout. 0N/A * A cards horizontal Layout gap (inset). It specifies 0N/A * the space between the left and right edges of a 0N/A * container and the current component. 0N/A * This should be a non negative Integer. 0N/A * A cards vertical Layout gap (inset). It specifies 0N/A * the space between the top and bottom edges of a 0N/A * container and the current component. 0N/A * This should be a non negative Integer. 0N/A * @serialField tab Hashtable 0N/A * deprectated, for forward compatibility only 0N/A * @serialField hgap int 0N/A * @serialField vgap int 0N/A * @serialField vector Vector 0N/A * @serialField currentCard int 0N/A * Creates a new card layout with gaps of size zero. 0N/A * Creates a new card layout with the specified horizontal and 0N/A * vertical gaps. The horizontal gaps are placed at the left and 0N/A * right edges. The vertical gaps are placed at the top and bottom 0N/A * @param hgap the horizontal gap. 0N/A * @param vgap the vertical gap. 0N/A * Gets the horizontal gap between components. 0N/A * @return the horizontal gap between components. 0N/A * @see java.awt.CardLayout#setHgap(int) 0N/A * @see java.awt.CardLayout#getVgap() 0N/A * Sets the horizontal gap between components. 0N/A * @param hgap the horizontal gap between components. 0N/A * @see java.awt.CardLayout#getHgap() 0N/A * @see java.awt.CardLayout#setVgap(int) 0N/A * Gets the vertical gap between components. 0N/A * @return the vertical gap between components. 0N/A * @see java.awt.CardLayout#setVgap(int) 0N/A * @see java.awt.CardLayout#getHgap() 0N/A * Sets the vertical gap between components. 0N/A * @param vgap the vertical gap between components. 0N/A * @see java.awt.CardLayout#getVgap() 0N/A * @see java.awt.CardLayout#setHgap(int) 0N/A * Adds the specified component to this card layout's internal 0N/A * table of names. The object specified by <code>constraints</code> 0N/A * must be a string. The card layout stores this string as a key-value 0N/A * pair that can be used for random access to a particular card. 0N/A * By calling the <code>show</code> method, an application can 0N/A * display the component with the specified name. 0N/A * @param comp the component to be added. 0N/A * @param constraints a tag that identifies a particular 0N/A * card in the layout. 0N/A * @see java.awt.CardLayout#show(java.awt.Container, java.lang.String) 0N/A * @exception IllegalArgumentException if the constraint is not a string. 0N/A * @deprecated replaced by 0N/A * <code>addLayoutComponent(Component, Object)</code>. 0N/A * Removes the specified component from the layout. 0N/A * If the card was visible on top, the next card underneath it is shown. 0N/A * @param comp the component to be removed. 0N/A * @see java.awt.Container#remove(java.awt.Component) 0N/A * @see java.awt.Container#removeAll() 0N/A // if we remove current component we should show next one 0N/A // correct currentCard if this is necessary 0N/A * Determines the preferred size of the container argument using 0N/A * @param parent the parent container in which to do the layout 0N/A * @return the preferred dimensions to lay out the subcomponents 0N/A * of the specified container 0N/A * @see java.awt.Container#getPreferredSize 0N/A * @see java.awt.CardLayout#minimumLayoutSize 0N/A * Calculates the minimum size for the specified panel. 0N/A * @param parent the parent container in which to do the layout 0N/A * @return the minimum dimensions required to lay out the 0N/A * subcomponents of the specified container 0N/A * @see java.awt.Container#doLayout 0N/A * @see java.awt.CardLayout#preferredLayoutSize 0N/A * Returns the maximum dimensions for this layout given the components 0N/A * in the specified target container. 0N/A * @param target the component which needs to be laid out 0N/A * @see #minimumLayoutSize 0N/A * @see #preferredLayoutSize 0N/A * Returns the alignment along the x axis. This specifies how 0N/A * the component would like to be aligned relative to other 0N/A * components. The value should be a number between 0 and 1 0N/A * where 0 represents alignment along the origin, 1 is aligned 0N/A * the furthest away from the origin, 0.5 is centered, etc. 0N/A * Returns the alignment along the y axis. This specifies how 0N/A * the component would like to be aligned relative to other 0N/A * components. The value should be a number between 0 and 1 0N/A * where 0 represents alignment along the origin, 1 is aligned 0N/A * the furthest away from the origin, 0.5 is centered, etc. 0N/A * Invalidates the layout, indicating that if the layout manager 0N/A * has cached information it should be discarded. 0N/A * Lays out the specified container using this card layout. 0N/A * Each component in the <code>parent</code> container is reshaped 0N/A * to be the size of the container, minus space for surrounding 0N/A * insets, horizontal gaps, and vertical gaps. 0N/A * @param parent the parent container in which to do the layout 0N/A * @see java.awt.Container#doLayout 0N/A * Make sure that the Container really has a CardLayout installed. 0N/A * Otherwise havoc can ensue! 0N/A * Flips to the first card of the container. 0N/A * @param parent the parent container in which to do the layout 0N/A * @see java.awt.CardLayout#last 0N/A * Flips to the next card of the specified container. If the 0N/A * currently visible card is the last one, this method flips to the 0N/A * first card in the layout. 0N/A * @param parent the parent container in which to do the layout 0N/A * @see java.awt.CardLayout#previous 0N/A * Flips to the previous card of the specified container. If the 0N/A * currently visible card is the first one, this method flips to the 0N/A * last card in the layout. 0N/A * @param parent the parent container in which to do the layout 0N/A * @see java.awt.CardLayout#next 0N/A * Flips to the last card of the container. 0N/A * @param parent the parent container in which to do the layout 0N/A * @see java.awt.CardLayout#first 0N/A * Flips to the component that was added to this layout with the 0N/A * specified <code>name</code>, using <code>addLayoutComponent</code>. 0N/A * If no such component exists, then nothing happens. 0N/A * @param parent the parent container in which to do the layout 0N/A * @param name the component name 0N/A * @see java.awt.CardLayout#addLayoutComponent(java.awt.Component, java.lang.Object) 0N/A * Returns a string representation of the state of this card layout. 0N/A * @return a string representation of this card layout. 0N/A * Reads serializable fields from stream. 0N/A * Writes serializable fields to stream.