本文整理匯總了Java中java.awt.CardLayout.last方法的典型用法代碼示例。如果您正苦於以下問題:Java CardLayout.last方法的具體用法?Java CardLayout.last怎麽用?Java CardLayout.last使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.awt.CardLayout
的用法示例。
在下文中一共展示了CardLayout.last方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setArrowButtonVisible
import java.awt.CardLayout; //導入方法依賴的package包/類
public void setArrowButtonVisible(boolean b) {
CardLayout cl = (CardLayout) arrowButtonPanel.getLayout();
if (b) {
cl.first(arrowButtonPanel);
} else {
cl.last(arrowButtonPanel);
}
}
示例2: selectPlatform
import java.awt.CardLayout; //導入方法依賴的package包/類
private void selectPlatform (Node pNode) {
Component active = null;
for (Component c : cards.getComponents()) {
if (c.isVisible() &&
(c == jPanel1 || c == messageArea)) {
active = c;
break;
}
}
final Dimension lastSize = active == null ?
null :
active.getSize();
this.clientArea.removeAll();
this.messageArea.removeAll();
this.removeButton.setEnabled (false);
if (pNode == null) {
((CardLayout)cards.getLayout()).last(cards);
return;
}
JComponent target = messageArea;
JComponent owner = messageArea;
JavaPlatform platform = pNode.getLookup().lookup(JavaPlatform.class);
if (pNode != getExplorerManager().getRootContext()) {
if (platform != null) {
this.removeButton.setEnabled (canRemove(platform, pNode.getLookup().lookup(DataObject.class)));
if (!platform.getInstallFolders().isEmpty()) {
this.platformName.setText(pNode.getDisplayName());
for (FileObject installFolder : platform.getInstallFolders()) {
File file = FileUtil.toFile(installFolder);
if (file != null) {
this.platformHome.setText (file.getAbsolutePath());
}
}
target = clientArea;
owner = jPanel1;
}
}
Component component = null;
if (pNode.hasCustomizer()) {
component = pNode.getCustomizer();
}
if (component == null) {
final PropertySheet sp = new PropertySheet();
sp.setNodes(new Node[] {pNode});
component = sp;
}
addComponent(target, component);
}
if (lastSize != null) {
final Dimension newSize = owner.getPreferredSize();
final Dimension updatedSize = new Dimension(
Math.max(lastSize.width, newSize.width),
Math.max(lastSize.height, newSize.height));
if (!newSize.equals(updatedSize)) {
owner.setPreferredSize(updatedSize);
}
}
target.revalidate();
CardLayout cl = (CardLayout) cards.getLayout();
if (target == clientArea) {
cl.first (cards);
}
else {
cl.last (cards);
}
}
示例3: selectServer
import java.awt.CardLayout; //導入方法依賴的package包/類
private void selectServer(Node aNode) {
clientPanel.removeAll();
ServerInstance serverInstance = null;
if (aNode instanceof ServerNode) {
serverInstance = ((ServerNode)aNode).getServerInstance();
serverName.setText(serverInstance.getDisplayName());
serverType.setText(serverInstance.getServerDisplayName());
if (!serverInstance.isRemovable()) {
removeButton.setEnabled(false);
} else {
removeButton.setEnabled(true);
}
} else {
removeButton.setEnabled(false);
((CardLayout)cardsPanel.getLayout()).first(cardsPanel);
return;
}
Component component = serverInstance.getCustomizer();
if (component != null) {
addComponent(clientPanel, component);
}
// handle the correct window size
int height = getHeight();
int width = getWidth();
// reset the preferred size so that it can be computed during revalidation
setPreferredSize(null);
revalidate();
// now we have the new computed preferred size
Dimension prefSize = getPreferredSize();
int prefWidth = (int)(prefSize.getWidth() > MINIMUM_SIZE.getWidth() ? prefSize.getWidth() : MINIMUM_SIZE.getWidth());
int prefHeight = (int)(prefSize.getHeight() > MINIMUM_SIZE.getHeight() ? prefSize.getHeight() : MINIMUM_SIZE.getHeight());
// do we need to resize the manager window?
if (prefHeight > height || prefWidth > width) {
setPreferredSize(new Dimension(prefWidth > width ? prefWidth : width,
prefHeight > height ? prefHeight : height));
// repack the parent window
for (Container parent = getParent(); parent != null; parent = parent.getParent()) {
if (parent instanceof Window) {
((Window)parent).pack();
break;
}
}
}
CardLayout cl = (CardLayout)cardsPanel.getLayout();
cl.last(cardsPanel);
}
示例4: selectPlatform
import java.awt.CardLayout; //導入方法依賴的package包/類
private void selectPlatform(Node pNode) {
Component active = null;
for (Component c : cards.getComponents()) {
if (c.isVisible()
&& (c == jPanel1 || c == messageArea)) {
active = c;
break;
}
}
final Dimension lastSize = active == null
? null
: active.getSize();
this.clientArea.removeAll();
this.messageArea.removeAll();
this.removeButton.setEnabled(false);
if (pNode == null) {
((CardLayout) cards.getLayout()).last(cards);
return;
}
JComponent target = messageArea;
JComponent owner = messageArea;
selectedPlatform = pNode.getLookup().lookup(AndroidSdk.class);
if (pNode != getExplorerManager().getRootContext()) {
if (selectedPlatform != null) {
mkDefault.setEnabled(!selectedPlatform.isDefaultSdk());
this.removeButton.setEnabled(!selectedPlatform.isDefaultSdk());
if (!selectedPlatform.getInstallFolders().isEmpty()) {
this.platformName.setText(pNode.getDisplayName());
for (FileObject installFolder : selectedPlatform.getInstallFolders()) {
File file = FileUtil.toFile(installFolder);
if (file != null) {
this.platformHome.setText(file.getAbsolutePath());
}
}
target = clientArea;
owner = jPanel1;
}
} else {
removeButton.setEnabled(false);
mkDefault.setEnabled(false);
}
Component component = null;
if (pNode.hasCustomizer()) {
component = pNode.getCustomizer();
}
if (component == null) {
final PropertySheet sp = new PropertySheet();
sp.setNodes(new Node[]{pNode});
component = sp;
}
addComponent(target, component);
}
if (lastSize != null) {
final Dimension newSize = owner.getPreferredSize();
final Dimension updatedSize = new Dimension(
Math.max(lastSize.width, newSize.width),
Math.max(lastSize.height, newSize.height));
if (!newSize.equals(updatedSize)) {
owner.setPreferredSize(updatedSize);
}
}
target.revalidate();
CardLayout cl = (CardLayout) cards.getLayout();
if (target == clientArea) {
cl.first(cards);
} else {
cl.last(cards);
}
}