CardPanelShadow.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) 2000 by Sun Microsystems, Inc.
* All rights reserved.
*/
/*
* Copyright (C) 1996 Active Software, Inc.
* All rights reserved.
*
* @(#) CardPanelShadow.java 1.33 - last change made 07/25/97
*/
/**
* CardPanelShadow - Panel with card layout.
* The attributes available for this
* class are listed below. In the type column, type names beginning
* with "sunsoft.jws.visual.rt" have been abbreviated to begin with
* "rt".
*
* < pre >
name type default value
-----------------------------------------------------------------------
cards [Lrt.shadow.GBPanelShadow initial label
delayedCreation java.lang.Boolean true
currentCard java.lang.String null
* < /pre>
*
* Check the super class for additional attributes. < p>
*
* The "delayedCreation" attribute delays the creation of cards until
* after they are shown. This is good for performance. But it is bad
* because the initial size of the card panel will be determined by the
* first card, and not by the largest card in the panel. So if
* "delayedCreation" is set to true, you need to make sure that the
* initial card is bigger than all the other cards.
*
* @see CardLayout
* @version 1.33, 07/25/97
*/
public class CardPanelShadow extends VJPanelShadow {
private GBPanelShadow cards[];
// Layout mode stuff
private boolean inDesignerRoot;
private GBConstraints cardMenuConstraints;
public CardPanelShadow() {
/* NOI18N */"[Lsunsoft.jws.visual.rt.shadow.GBPanelShadow;",
}
//
// Public methods
//
}
return cards[i];
}
return null;
}
//
// Attributes
//
return getCards();
return getFromTable(key);
return cardPanel.getCurrentCard();
} else {
}
}
create();
} else {
}
}
return;
int i;
break;
}
else
}
}
//
// Private methods
//
if (g != null)
}
}
}
private void updateCards() {
boolean shadowVisible =
/* JSTYLED */
boolean compVisible =
if (shadowVisible != compVisible) {
// Update the card in the option menu
new Boolean(compVisible));
}
}
}
protected synchronized GBPanelShadow[] getCards() {
int i = 0;
Enumeration e = getChildList();
while (e.hasMoreElements())
}
return cards;
}
boolean showFirst = false;
// Remove all cards, and destroy cards that are no longer used.
Enumeration e = getChildList();
while (e.hasMoreElements()) {
remove(s);
if (s == currentCard)
showFirst = true;
s.destroy();
} else {
int i;
if (cards[i] == s)
break;
}
if (s == currentCard)
showFirst = true;
s.destroy();
}
}
}
boolean createFirst = true;
// All new cards start out non-visible
// Make sure the card is created if we
// are not delaying creation.
if (!isDelayed()) {
}
} else if (cards[i] == currentCard) {
createFirst = false;
}
}
}
}
}
resetChoice();
}
private boolean isDelayed() {
return (
}
private void resetChoice() {
if (inDesignerRoot) {
}
}
}
}
}
}
}
}
// Cause the card to be removed, but not the tab
// (if the tab is still there).
if (index != -1) {
}
}
}
public void createChildren() {
if (isDelayed()) {
super.createChildren();
} else {
// Force creation of all the children
Enumeration e = getChildList();
while (e.hasMoreElements()) {
(AttributeManager) e.nextElement();
}
}
}
public void createBody() {
if (inDesignerRoot) {
GBConstraints c = new GBConstraints();
c.gridx = 0;
c.gridy = 0;
c.gridx = 0;
c.gridy = 1;
c.weightx = 1;
c.weighty = 1;
} else {
}
}
public CardPanel getCardPanel() {
return cardPanel;
}
protected void registerBody() {
}
super.registerBody();
}
protected void postCreate() {
super.postCreate();
if (inDesignerRoot)
resetChoice();
}
protected void destroyBody() {
super.destroyBody();
}
//
// Layout and preview modes
//
public void layoutMode() {
super.layoutMode();
if (inDesignerRoot) {
}
}
public void previewMode() {
super.previewMode();
if (inDesignerRoot) {
}
}
//
// Events
//
updateCards();
if (isDelayed())
}
}
}
}
return false;
}
}