/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* A layout manager to arrange components over the top
* of each other. The requested size of the container
* will be the largest requested size of the children,
* taking alignment needs into consideration.
*
* The alignment is based upon what is needed to properly
* fit the children in the allocation area. The children
* will be placed such that their alignment points are all
* on top of each other.
* <p>
* <strong>Warning:</strong>
* Serialized objects of this class will not be compatible with
* future Swing releases. The current serialization support is
* appropriate for short term storage or RMI between applications running
* the same version of Swing. As of 1.4, support for long term storage
* of all JavaBeans<sup><font size="-2">TM</font></sup>
* has been added to the <code>java.beans</code> package.
* Please see {@link java.beans.XMLEncoder}.
*
* @author Timothy Prinzing
*/
/**
* Constructs a layout manager that performs overlay
* arrangement of the children. The layout manager
* created is dedicated to the given container.
*
* @param target the container to do layout against
*/
@ConstructorProperties({"target"})
}
/**
* Returns the container that uses this layout manager.
*
* @return the container that uses this layout manager
*
* @since 1.6
*/
return this.target;
}
/**
* Indicates a child has changed its layout related information,
* which causes any cached calculations to be flushed.
*
* @param target the container
*/
}
/**
* Adds the specified component to the layout. Used by
* this class to know when to invalidate layout.
*
* @param name the name of the component
* @param comp the the component to be added
*/
}
/**
* Removes the specified component from the layout. Used by
* this class to know when to invalidate layout.
*
* @param comp the component to remove
*/
}
/**
* Adds the specified component to the layout, using the specified
* constraint object. Used by this class to know when to invalidate
* layout.
*
* @param comp the component to be added
*/
}
/**
* Returns the preferred dimensions for this layout given the components
* in the specified target container. Recomputes the layout if it
* has been invalidated. Factors in the current inset setting returned
* by getInsets().
*
* @param target the component which needs to be laid out
* @return a Dimension object containing the preferred dimensions
* @see #minimumLayoutSize
*/
return size;
}
/**
* Returns the minimum dimensions needed to lay out the components
* contained in the specified target container. Recomputes the layout
* if it has been invalidated, and factors in the current inset setting.
*
* @param target the component which needs to be laid out
* @return a Dimension object containing the minimum dimensions
* @see #preferredLayoutSize
*/
return size;
}
/**
* Returns the maximum dimensions needed to lay out the components
* contained in the specified target container. Recomputes the
* layout if it has been invalidated, and factors in the inset setting
* returned by <code>getInset</code>.
*
* @param target the component that needs to be laid out
* @return a <code>Dimension</code> object containing the maximum
* dimensions
* @see #preferredLayoutSize
*/
return size;
}
/**
* Returns the alignment along the x axis for the container.
*
* @param target the container
* @return the alignment >= 0.0f && <= 1.0f
*/
}
/**
* Returns the alignment along the y axis for the container.
*
* @param target the container
* @return the alignment >= 0.0f && <= 1.0f
*/
}
/**
* Called by the AWT when the specified container needs to be laid out.
*
* @param target the container to lay out
*
* @exception AWTError if the target isn't the container specified to the
* constructor
*/
// determine the child placements
xSpans);
ySpans);
// flush changes to the container
for (int i = 0; i < nChildren; i++) {
}
}
throw new AWTError("OverlayLayout can't be shared");
}
}
void checkRequests() {
// The requests have been invalidated... recalculate
// the request information.
int n = target.getComponentCount();
xChildren = new SizeRequirements[n];
yChildren = new SizeRequirements[n];
for (int i = 0; i < n; i++) {
c.getAlignmentX());
c.getAlignmentY());
}
}
}
}