Package pivot.wtk

Examples of pivot.wtk.MenuBar$Item$ItemListenerList


        menuBar.setFocusTraversalPolicy(new IndexFocusTraversalPolicy(true));
    }

    public void uninstall() {
        MenuBar menuBar = (MenuBar)getComponent();
        menuBar.getMenuBarListeners().remove(this);

        menuBar.setFocusTraversalPolicy(null);

        super.uninstall();
    }
View Full Code Here


    }

    public int getPreferredWidth(int height) {
        int preferredWidth = 0;

        MenuBar menuBar = (MenuBar)getComponent();
        MenuBar.ItemSequence items = menuBar.getItems();

        int j = 0;
        for (int i = 0, n = items.getLength(); i < n; i++) {
            if (j > 0) {
                preferredWidth += spacing;
View Full Code Here

    }

    public int getPreferredHeight(int width) {
        int preferredHeight = 0;

        MenuBar menuBar = (MenuBar)getComponent();
        MenuBar.ItemSequence items = menuBar.getItems();

        for (int i = 0, n = items.getLength(); i < n; i++) {
            MenuBar.Item item = items.get(i);
            if (item.isDisplayable()) {
                preferredHeight = Math.max(item.getPreferredHeight(width), preferredHeight);
View Full Code Here

    public Dimensions getPreferredSize() {
        int preferredWidth = 0;
        int preferredHeight = 0;

        MenuBar menuBar = (MenuBar)getComponent();
        MenuBar.ItemSequence items = menuBar.getItems();

        int j = 0;
        for (int i = 0, n = items.getLength(); i < n; i++) {
            if (j > 0) {
                preferredWidth += spacing;
View Full Code Here

        return new Dimensions(preferredWidth, preferredHeight);
    }

    public void layout() {
        MenuBar menuBar = (MenuBar)getComponent();

        int height = getHeight();
        int itemX = 0;

        for (MenuBar.Item item : menuBar.getItems()) {
            if (item.isDisplayable()) {
                item.setVisible(true);
                item.setSize(item.getPreferredWidth(height), height);
                item.setLocation(itemX, 0);
View Full Code Here

        // No-op
    }

    public void paint(Graphics2D graphics) {
        MenuBar.Item menuBarItem = (MenuBar.Item)getComponent();
        MenuBar menuBar = menuBarItem.getMenuBar();

        int width = getWidth();
        int height = getHeight();

        boolean highlight = menuPopup.isOpen();

        // Paint highlight state
        if (highlight) {
            Color highlightBackgroundColor = (Color)menuBar.getStyles().get("highlightBackgroundColor");
            graphics.setColor(highlightBackgroundColor);
            graphics.fillRect(0, 0, width, height);
        }

        // Paint the content
View Full Code Here

    @Override
    public boolean isOpaque() {
        boolean opaque = false;

        MenuBar.Item menuBarItem = (MenuBar.Item)getComponent();
        MenuBar menuBar = menuBarItem.getMenuBar();

        boolean highlight = menuPopup.isOpen();

        if (highlight) {
            Color highlightBackgroundColor = (Color)menuBar.getStyles().get("highlightBackgroundColor");
            opaque = (highlightBackgroundColor.getTransparency() == Transparency.OPAQUE);
        }

        return opaque;
    }
View Full Code Here

TOP

Related Classes of pivot.wtk.MenuBar$Item$ItemListenerList

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.