VerticalButtonLayout.java revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* ident "%Z%%M% %I% %E% SMI"
*
* Copyright (c) 1996-1999 by Sun Microsystems, Inc.
* All rights reserved.
*/
/**
* <CODE>VerticalButtonLayout</CODE> is used to layout buttons in a
* <CODE>Panel</CODE>. It will arrange buttons top to bottom
* until no more buttons fit in the same column. Each column is
* centered vertically. All buttons are set to an equal size.<P>
*
* While <CODE>VerticalButtonLayout</CODE> was designed for
* <CODE>Buttons</CODE>, any component can be added to the layout. All
* components are set to an equal size.<P>
*/
public class VerticalButtonLayout implements LayoutManager {
int hgap;
int vgap;
/**
* Constructs a new <CODE>VerticalButtonLayout</CODE> with a centered
* alignment.
*/
public VerticalButtonLayout() {
}
/**
* Constructs a new <CODE>VerticalButtonLayout</CODE> with the specified
* alignment.
* @param align</VAR> The alignment value.
* @see ALIGNMENT
*/
}
/**
* Constructs a new <CODE>VerticalButtonLayout</CODE> with the specified
* alignment and gap values.
* @param align</VAR> The alignment value.
* @param hgap</VAR> The horizontal gap variable.
* @param vgap</VAR> The vertical gap variable.
* @see ALIGNMENT
*/
}
/**
* Adds the specified component to the layout. This is not
* used by this class.
* @param name</VAR> The name of the component.
* @param comp</VAR> The component to be added.
*/
}
/**
* Removes the specified component from the layout. This
* is not used by this class.
* @param comp</VAR> The component to remove.
*/
}
/**
* Returns the preferred dimensions for this layout given
* the components in the specified target container.
* @param target</VAR> The component that needs to be laid out.
* @see java.awt.Container
* @see #minimumLayoutSize
*/
for (int i = 0; i < nmembers; i++) {
if (m.isVisible()) {
Dimension d = m.getPreferredSize();
}
}
return dim;
}
/**
* Returns the minimum dimensions needed to layout the components
* contained in the specified target container.
* @param target</VAR> The component that needs to be laid out
* @see #preferredLayoutSize
*/
for (int i = 0; i < nmembers; i++) {
if (m.isVisible()) {
Dimension d = m.getMinimumSize();
}
}
return dim;
}
/**
* Centers the elements in the specified column, if there is any slack.
* @param target</VAR> The component which needs to be moved.
* @param x</VAR> The x coordinate.
* @param y</VAR> The y coordinate.
* @param width</VAR> The width dimensions.
* @param height</VAR> The height dimensions.
*/
int height) {
// do nothing
y += height / 2;
y += height;
}
if (m.isVisible()) {
}
}
}
/**
* Lays out the container. This method will actually reshape the
* components in the target in order to satisfy the constraints of
* the <CODE>BorderLayout</CODE> object.
* @param target</VAR> The specified component being laid out.
* @see java.awt.Container
*/
int y = 0;
for (int i = 0; i < nmembers; i++) {
if (m.isVisible()) {
Dimension d = m.getMinimumSize();
}
}
for (int i = 0; i < nmembers; i++) {
if (m.isVisible()) {
}
}
}
/**
* Returns the <CODE>String</CODE> representation of this
* <CODE>VerticalButtonLayout</CODE>'s values.
*/
str = ",align=left";
str = ",align=right";
str = ",align=center";
}
}
}