本文整理匯總了Java中java.awt.CardLayout.first方法的典型用法代碼示例。如果您正苦於以下問題:Java CardLayout.first方法的具體用法?Java CardLayout.first怎麽用?Java CardLayout.first使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.awt.CardLayout
的用法示例。
在下文中一共展示了CardLayout.first方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: 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);
}
}