Package nextapp.echo2.app

Examples of nextapp.echo2.app.Insets


        if (launchModals) {
            componentSamplerColumn.setBorder(new Border(new Extent(5, Extent.PX), new Color(0xffafaf), Border.STYLE_INSET));
        } else {
            componentSamplerColumn.setBorder(new Border(new Extent(5, Extent.PX), new Color(0xafafff), Border.STYLE_INSET));
        }
        componentSamplerColumn.setInsets(new Insets(10));
        componentSamplerColumn.setCellSpacing(new Extent(1));
        contentColumn.add(componentSamplerColumn);
       
        for (int i = 1; i <= 3; ++i) {
            Button button = new Button("Button #" + i);
            button.setStyleName("Default");
            componentSamplerColumn.add(button);
            if (launchModals && i == 1) {
                button.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        getApplicationInstance().getDefaultWindow().getContent().add(createComponentSamplerModalTestWindow());
                    }
                });
            }
        }
       
        ButtonGroup buttonGroup = new ButtonGroup();
        for (int i = 1; i <= 3; ++i) {
            RadioButton radioButton = new RadioButton("RadioButton #" + i);
            radioButton.setGroup(buttonGroup);
            radioButton.setStyleName("Default");
            componentSamplerColumn.add(radioButton);
            if (launchModals && i == 1) {
                radioButton.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        getApplicationInstance().getDefaultWindow().getContent().add(createComponentSamplerModalTestWindow());
                    }
                });
            }
        }
       
        for (int i = 1; i <= 3; ++i) {
            CheckBox checkBox = new CheckBox("CheckBox #" + i);
            checkBox.setStyleName("Default");
            componentSamplerColumn.add(checkBox);
            if (launchModals && i == 1) {
                checkBox.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        getApplicationInstance().getDefaultWindow().getContent().add(createComponentSamplerModalTestWindow());
                    }
                });
            }
        }
       
        Table table = new Table(TableTest.createEmployeeTableModel());
        table.setBorder(new Border(new Extent(2), new Color(0xafffcf), Border.STYLE_GROOVE));
        table.setInsets(new Insets(15, 5));
        table.setSelectionEnabled(true);
        table.setSelectionBackground(new Color(0xffcfaf));
        table.setRolloverEnabled(true);
        table.setRolloverBackground(new Color(0xafefff));
        if (launchModals) {
View Full Code Here


   
    private WindowPane createModalWindow(String name) {
        final WindowPane windowPane = new WindowPane();
        positionWindowPane(windowPane);
        windowPane.setTitle(name + " Window #" + windowNumber++);
        windowPane.setTitleInsets(new Insets(10, 5));
        windowPane.setTitleBackground(new Color(0x2f2f4f));
        windowPane.setInsets(new Insets(10));
        windowPane.setWidth(new Extent(500));
        windowPane.setHeight(new Extent(280));
        windowPane.setStyleName("Default");
       
        ButtonColumn column = new ButtonColumn();
View Full Code Here

   
    private WindowPane createSimpleWindow(String name) {
        WindowPane windowPane = new WindowPane();
        positionWindowPane(windowPane);
        windowPane.setTitle(name + " Window #" + windowNumber++);
        windowPane.setTitleInsets(new Insets(10, 5));
        windowPane.setInsets(new Insets(10));
        windowPane.setWidth(new Extent(500));
        windowPane.setHeight(new Extent(280));
        windowPane.setStyleName("Default");
        windowPane.add(new Label(StyleUtil.QUASI_LATIN_TEXT_1));
        return windowPane;
View Full Code Here

     */
    private WindowPane createTestWindow(String name) {
        final WindowPane windowPane = new WindowPane();
        positionWindowPane(windowPane);
        windowPane.setTitle(name + " Window #" + windowNumber++);
        windowPane.setTitleInsets(new Insets(10, 5));
        windowPane.setTitleBackground(new Color(0x2f2f4f));
        windowPane.setInsets(new Insets(10));
        windowPane.setWidth(new Extent(500));
        windowPane.setHeight(new Extent(280));
        windowPane.setStyleName("Default");
       
        ButtonColumn column = new ButtonColumn();
        windowPane.add(column);
       
        column.addButton("Set Icon", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setIcon(Styles.ICON_24_MAIL_COMPOSE);
                windowPane.setIconInsets(new Insets(4, 2));
            }
        });
       
        column.addButton("Clear Icon", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setIcon(null);
                windowPane.setIconInsets(null);
            }
        });
       
        column.addButton("Set Close Icon (and appropriate Icon Insets)", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setCloseIcon(Styles.ICON_24_NO);
                windowPane.setCloseIconInsets(new Insets(4, 2));
            }
        });
       
        column.addButton("Clear Close Icon", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
View Full Code Here

        StringTokenizer st = new StringTokenizer(value, " ");
        int count = st.countTokens();
        switch (count) {
        case 1:
            Extent extent = ExtentPeer.toExtent(st.nextToken());
            return new Insets(extent);
        case 2:
            Extent horizontal = ExtentPeer.toExtent(st.nextToken());
            Extent vertical = ExtentPeer.toExtent(st.nextToken());
            return new Insets(horizontal, vertical);
        case 4:
            Extent left = ExtentPeer.toExtent(st.nextToken());
            Extent top = ExtentPeer.toExtent(st.nextToken());
            Extent right = ExtentPeer.toExtent(st.nextToken());
            Extent bottom = ExtentPeer.toExtent(st.nextToken());
            return new Insets(left, top, right, bottom);
        default:
            throw new InvalidPropertyException("Invalid Insets value: " + value, null);
        }
    }
View Full Code Here

     * Default constructor.
     */
    public PushGhostTest() {
        super();
        SplitPaneLayoutData splitPaneLayoutData = new SplitPaneLayoutData();
        splitPaneLayoutData.setInsets(new Insets(10));
        setLayoutData(splitPaneLayoutData);
       
        setCellSpacing(new Extent(3));
       
        Label label;
View Full Code Here

            }
        });
       
        controlsColumn.addButton("Set Border 1", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setBorder(new FillImageBorder(Color.GREEN, new Insets(20), new Insets(5)));
            }
        });

        controlsColumn.addButton("Set Border 2 (L/R only)", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                FillImageBorder fib = new FillImageBorder(Color.GREEN, new Insets(20), new Insets(5));
                fib.setFillImage(FillImageBorder.LEFT, Styles.BG_SHADOW_DARK_BLUE);
                fib.setFillImage(FillImageBorder.RIGHT, Styles.BG_SHADOW_LIGHT_BLUE);
                windowPane.setBorder(fib);
            }
        });

        controlsColumn.addButton("Clear Border", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setBorder(null);
            }
        });

        controlsColumn.addButton("Set Foreground", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setForeground(StyleUtil.randomColor());
            }
        });
        controlsColumn.addButton("Clear Foreground", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setForeground(null);
            }
        });
        controlsColumn.addButton("Set Background", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setBackground(StyleUtil.randomColor());
            }
        });
        controlsColumn.addButton("Clear Background", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setBackground(null);
            }
        });
        controlsColumn.addButton("Set Font", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setFont(StyleUtil.randomFont());
            }
        });
        controlsColumn.addButton("Clear Font", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setFont(null);
            }
        });
        controlsColumn.addButton("Set Background Image", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setBackgroundImage(Styles.BG_SHADOW_LIGHT_BLUE);
            }
        });
        controlsColumn.addButton("Clear Background Image", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setBackgroundImage(null);
            }
        });
        controlsColumn.addButton("Set Content Insets to 0", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setInsets(new Insets(0));
            }
        });
        controlsColumn.addButton("Set Content Insets to 5", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setInsets(new Insets(5));
            }
        });
        controlsColumn.addButton("Set Content Insets to 10/20/40/80", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setInsets(new Insets(10, 20, 40, 80));
            }
        });
        controlsColumn.addButton("Clear Content Insets", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setInsets(null);
            }
        });

        controlsColumn.addButton("Set Position Random", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setPositionX(new Extent((int) (Math.random() * 600)));
                windowPane.setPositionY(new Extent((int) (Math.random() * 500)));
            }
        });
        controlsColumn.addButton("Set Size Random", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setWidth(new Extent(100 + (int) (Math.random() * 400)));
                windowPane.setHeight(new Extent(100 + (int) (Math.random() * 300)));
            }
        });
        controlsColumn.addButton("Set Position&Size Random", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setPositionX(new Extent((int) (Math.random() * 600)));
                windowPane.setPositionY(new Extent((int) (Math.random() * 500)));
                windowPane.setWidth(new Extent(100 + (int) (Math.random() * 400)));
                windowPane.setHeight(new Extent(100 + (int) (Math.random() * 300)));
            }
        });       
       
        // Title-Related Properties
       
        controlsColumn = new ButtonColumn();
        controlsColumn.add(new Label("Properties"));
        groupContainerColumn.add(controlsColumn);
       
        controlsColumn.addButton("Set Title", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setTitle("Window Title");
            }
        });
        controlsColumn.addButton("Set Title Long", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setTitle("This is a fairly long window title that goes on for a little to long to see if " +
                        "wrapping is handled properly and such.");
            }
        });
        controlsColumn.addButton("Clear Title", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setTitle(null);
            }
        });
        controlsColumn.addButton("Set Title Height", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setTitleHeight(new Extent(((int) (Math.random() * 24)) + 24));
            }
        });
        controlsColumn.addButton("Clear Title Height", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setTitleHeight(null);
            }
        });
        controlsColumn.addButton("Set Title Insets to 0", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setTitleInsets(new Insets(0));
            }
        });
        controlsColumn.addButton("Set Title Insets to 5", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setTitleInsets(new Insets(5));
            }
        });
        controlsColumn.addButton("Set Title Insets to 10/20/40/80", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setTitleInsets(new Insets(10, 20, 40, 80));
            }
        });
        controlsColumn.addButton("Clear Title Insets", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setTitleInsets(null);
View Full Code Here

        });

        testColumn = new Column();
        testColumn.setCellSpacing(new Extent(5));
        SplitPaneLayoutData splitPaneLayoutData = new SplitPaneLayoutData();
        splitPaneLayoutData.setInsets(new Insets(10));
        testColumn.setLayoutData(splitPaneLayoutData);
        add(testColumn);
    }
View Full Code Here

   
    /**
     * Test all-margins equal constructor.
     */
    public void testConstructorEqual() {
        Insets insets = new Insets(PX_1);
        assertEquals(insets.getLeft(), PX_1);
        assertEquals(insets.getTop(), PX_1);
        assertEquals(insets.getRight(), PX_1);
        assertEquals(insets.getBottom(), PX_1);
    }
View Full Code Here

   
    /**
     * Test horizontal = vertical constructor.
     */
    public void testConstructorHV() {
        Insets insets = new Insets(PX_1, PX_2);
        assertEquals(insets.getLeft(), PX_1);
        assertEquals(insets.getTop(), PX_2);
        assertEquals(insets.getRight(), PX_1);
        assertEquals(insets.getBottom(), PX_2);
    }
View Full Code Here

TOP

Related Classes of nextapp.echo2.app.Insets

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.