本文整理汇总了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);
}
}