当前位置: 首页>>代码示例>>Java>>正文


Java CardLayout.last方法代码示例

本文整理汇总了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);
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:9,代码来源:FancyDropDownButton.java

示例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);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:67,代码来源:PlatformsCustomizer.java

示例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);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:50,代码来源:ServerManagerPanel.java

示例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);
    }
}
 
开发者ID:NBANDROIDTEAM,项目名称:NBANDROID-V2,代码行数:70,代码来源:SdksCustomizer.java


注:本文中的java.awt.CardLayout.last方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。