Package nextapp.echo2.app

Examples of nextapp.echo2.app.Extent


       
        ContentPane content = new ContentPane();
        mainWindow.setContent(content);
       
        Column mainColumn = new Column();
        mainColumn.setBorder(new Border(new Extent(4), Color.BLUE, Border.STYLE_OUTSET));
        mainColumn.setInsets(new Insets(40));
        mainColumn.setCellSpacing(new Extent(20));
        content.add(mainColumn);
       
        Column serializeColumn = new Column();
        mainColumn.add(serializeColumn);
       
        Button button;

        serializeColumn.add(new Label("Available Applications:"));
       
        listBox = new ListBox();
        listBox.setWidth(new Extent(100, Extent.PERCENT));
        serializeColumn.add(listBox);
       
        button = new Button("[ Refresh ]");
        button.addActionListener(new ActionListener() {
           
View Full Code Here


     * Creates a new <code>MailScreen</code>.
     */
    public MailScreen() {
        super();
       
        SplitPane mainSplitPane = new SplitPane(SplitPane.ORIENTATION_HORIZONTAL, new Extent(175));
        mainSplitPane.setSeparatorWidth(new Extent(1, Extent.PX));
        add(mainSplitPane);
       
        SplitPane titleOptionSplitPane = new SplitPane(SplitPane.ORIENTATION_VERTICAL, new Extent(70));
        titleOptionSplitPane.setSeparatorHeight(new Extent(1, Extent.PX));
        mainSplitPane.add(titleOptionSplitPane);
       
        Column titleColumn = new Column();
        titleColumn.setStyleName("MailScreen.TitleColumn");
        titleOptionSplitPane.add(titleColumn);
        Label label;
       
        label = new Label(Messages.getString("Application.Title.Main"));
        label.setStyleName("Title.Main");
        titleColumn.add(label);
       
        label = new Label(Messages.getString("Application.Title.Sub"));
        label.setStyleName("Title.Sub");
        titleColumn.add(label);
       
        titleOptionSplitPane.add(createOptionPane());
       
        SplitPane mailSplitPane = new SplitPane(SplitPane.ORIENTATION_VERTICAL, new Extent(320));
        mailSplitPane.setResizable(true);
        mainSplitPane.add(mailSplitPane);
       
        SplitPane messageListSplitPane = new SplitPane(SplitPane.ORIENTATION_VERTICAL, new Extent(32));
        messageListSplitPane.setSeparatorHeight(new Extent(1, Extent.PX));
        mailSplitPane.add(messageListSplitPane);
       
        Row controlPane = new Row();
        controlPane.setStyleName("ControlPane");
        messageListSplitPane.add(controlPane);
View Full Code Here

     * @param message the message to reply to, or null to a compose a new
     *        message.
     */
    private void processCompose(Message message) {
        ComposeWindow composeWindow = new ComposeWindow(message);
        Extent dialogPositionExtent = new Extent(dialogPosition);
        composeWindow.setPositionX(dialogPositionExtent);
        composeWindow.setPositionY(dialogPositionExtent);
        dialogPosition += DIALOG_POSITION_INCREMENT;
        if (dialogPosition > DIALOG_POSITION_MAXIMUM) {
            dialogPosition = DIALOG_POSITION_INITIAL;
View Full Code Here

   
    /**
     * Test constructor.
     */
    public void testConstructor() {
        Border border = new Border(new Extent(5, Extent.PX), Color.BLUE, Border.STYLE_OUTSET);
        assertEquals(new Extent(5, Extent.PX), border.getSize());
        assertEquals(Color.BLUE, border.getColor());
        assertEquals(Border.STYLE_OUTSET, border.getStyle());
    }
View Full Code Here

   
    /**
     * Test equality.
     */
    public void testEquals() {
        Border border1 = new Border(new Extent(5, Extent.PX), Color.BLUE, Border.STYLE_OUTSET);
        Border border2 = new Border(new Extent(5, Extent.PX), Color.BLUE, Border.STYLE_OUTSET);
        Border border3 = new Border(new Extent(5, Extent.PX), Color.GREEN, Border.STYLE_OUTSET);
        Border border4 = new Border(new Extent(5, Extent.PX), Color.BLUE, Border.STYLE_INSET);
        Border border5 = new Border(new Extent(4, Extent.PX), Color.BLUE, Border.STYLE_OUTSET);
        Border border6 = new Border(new Extent(5, Extent.PX), null, Border.STYLE_OUTSET);
        Border border7 = new Border(null, Color.BLUE, Border.STYLE_INSET);
        assertTrue(border1.equals(border1));
        assertTrue(border1.equals(border2));
        assertFalse(border1.equals(border3));
        assertFalse(border1.equals(border4));
View Full Code Here

        loginWindow.setTitle(Messages.getString("LoginScreen.LoginWindowTitle"));
        loginWindow.setStyleName("LoginScreen.LoginWindow");
        loginWindow.setDefaultCloseOperation(WindowPane.DO_NOTHING_ON_CLOSE);
        add(loginWindow);
       
        SplitPane splitPane = new SplitPane(SplitPane.ORIENTATION_VERTICAL_BOTTOM_TOP, new Extent(32));
        loginWindow.add(splitPane);
       
        Row controlRow = new Row();
        controlRow.setStyleName("ControlPane");
        splitPane.add(controlRow);
View Full Code Here

* Interactive test for the <code>Container</code> component.
*/
public class CompositeTest extends SplitPane {
   
    public CompositeTest() {
        super(SplitPane.ORIENTATION_HORIZONTAL, new Extent(250, Extent.PX));
        setStyleName("DefaultResizable");
       
        ButtonColumn controlsColumn = new ButtonColumn();
        controlsColumn.setStyleName("TestControlsColumn");
        add(controlsColumn);
View Full Code Here

    }

    private SplitPane testPane;
   
    public SplitPaneTest() {
        super(SplitPane.ORIENTATION_HORIZONTAL, new Extent(250, Extent.PX));
        setStyleName("DefaultResizable");
       
        Column groupContainerColumn = new Column();
        groupContainerColumn.setCellSpacing(new Extent(5));
        groupContainerColumn.setStyleName("TestControlsColumn");
        add(groupContainerColumn);

        ButtonColumn controlsColumn;
       
        controlsColumn = new ButtonColumn();
        controlsColumn.add(new Label("Add / Remove Panes"));
        groupContainerColumn.add(controlsColumn);
       
        controlsColumn.addButton("Remove Pane 0", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                if (testPane.getComponentCount() >= 1) {
                    testPane.remove(0);
                }
            }
        });
        controlsColumn.addButton("Remove Pane 1", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                if (testPane.getComponentCount() >= 2) {
                    testPane.remove(1);
                }
            }
        });
        controlsColumn.addButton("Replace Pane 0", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                if (testPane.getComponentCount() >= 1) {
                    testPane.remove(0);
                }
                testPane.add(createPaneLabel("Replacement for Pane 0"), 0);
            }
        });
        controlsColumn.addButton("Replace Pane 1", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                if (testPane.getComponentCount() >= 2) {
                    testPane.remove(1);
                }
                testPane.add(createPaneLabel("Replacement for Pane 1"));
            }
        });
        controlsColumn.addButton("Add at Beginning", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                if (testPane.getComponentCount() < 2) {
                    testPane.add(createPaneLabel("Added at Beginning"), 0);
                }
            }
        });
        controlsColumn.addButton("Add at End", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                if (testPane.getComponentCount() < 2) {
                    testPane.add(createPaneLabel("Added at End"));
                }
            }
        });
        controlsColumn.addButton("Add Row", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                if (testPane.getComponentCount() < 2) {
                    Row row = new Row();
                    row.setBorder(new Border(new Extent(1), Color.BLACK, Border.STYLE_SOLID));
                    row.setCellSpacing(new Extent(5));
                    row.setInsets(new Insets(10, 5));
                    row.add(new Label("Alpha"));
                    row.add(new Label("Bravo"));
                    row.add(new Label("Charlie"));
                    testPane.add(row);
                }
            }
        });
        controlsColumn.addButton("Add-Remove-Add", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                if (testPane.getComponentCount() < 2) {
                    Label label = createPaneLabel("Added at End, Removed, Re-Added");
                    testPane.add(label);
                    testPane.remove(label);
                    testPane.add(label);
                }
            }
        });
        controlsColumn.addButton("Add Button", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                if (testPane.getComponentCount() < 2) {
                    Button testButton = new Button("Test Button");
                    SplitPaneLayoutData layoutData = new SplitPaneLayoutData();
                    layoutData.setInsets(new Insets(10));
                    testButton.setLayoutData(layoutData);
                    testButton.setStyleName("Default");
                    testPane.add(testButton);
                }
            }
        });
       
        controlsColumn = new ButtonColumn();
        controlsColumn.add(new Label("Configure SplitPane"));
        groupContainerColumn.add(controlsColumn);
       
        controlsColumn.addButton("Set Separator Position = null", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testPane.setSeparatorPosition(null);
            }
        });
        controlsColumn.addButton("Set Separator Position = 300px", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testPane.setSeparatorPosition(new Extent(300));
            }
        });
        controlsColumn.addButton("Set Orientation = Leading/Trailing", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testPane.setOrientation(SplitPane.ORIENTATION_HORIZONTAL_LEADING_TRAILING);
            }
        });
        controlsColumn.addButton("Set Orientation = Trailing/Leading", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testPane.setOrientation(SplitPane.ORIENTATION_HORIZONTAL_TRAILING_LEADING);
            }
        });
        controlsColumn.addButton("Set Orientation = Left/Right", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testPane.setOrientation(SplitPane.ORIENTATION_HORIZONTAL_LEFT_RIGHT);
            }
        });
        controlsColumn.addButton("Set Orientation = Right/Left", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testPane.setOrientation(SplitPane.ORIENTATION_HORIZONTAL_RIGHT_LEFT);
            }
        });
        controlsColumn.addButton("Set Orientation = Top/Bottom", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testPane.setOrientation(SplitPane.ORIENTATION_VERTICAL_TOP_BOTTOM);
            }
        });
        controlsColumn.addButton("Set Orientation = Bottom/Top", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testPane.setOrientation(SplitPane.ORIENTATION_VERTICAL_BOTTOM_TOP);
            }
        });
        controlsColumn.addButton("Disable Resize", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testPane.setResizable(!testPane.isResizable());
                ((Button) e.getSource()).setText(testPane.isResizable() ? "Disable Resize" : "Enable Resize");
            }
        });
       
        groupContainerColumn.add(new PaneControlsColumn(0));
        groupContainerColumn.add(new PaneControlsColumn(1));

        testPane = new SplitPane(ORIENTATION_VERTICAL, new Extent(200, Extent.PX));
        testPane.setStyleName("DefaultResizable");
        add(testPane);
    }
View Full Code Here

    GamePane() {
        super();
       
        Column layoutColumn = new Column();
        layoutColumn.setInsets(new Insets(30));
        layoutColumn.setCellSpacing(new Extent(10));
        add(layoutColumn);
       
        layoutColumn.add(new Label(new ResourceImageReference("/echo2tutorial/numberguess/TitleBanner.png")));
        layoutColumn.add(statusLabel);
        layoutColumn.add(countLabel);
        layoutColumn.add(promptLabel);
       
        guessEntryField = new TextField();
       
        guessEntryField.setForeground(Color.WHITE);
        guessEntryField.setBackground(Color.BLUE);
        ColumnLayoutData columnLayoutData = new ColumnLayoutData();
        columnLayoutData.setInsets(new Insets(20, 0));
        guessEntryField.setLayoutData(columnLayoutData);
        layoutColumn.add(guessEntryField);
       
        Button submitButton = new Button("Submit Your Guess");
        submitButton.setActionCommand("submit guess");
        submitButton.setForeground(Color.BLACK);
        submitButton.setBackground(Color.GREEN);
        submitButton.setWidth(new Extent(200));
        submitButton.addActionListener(this);
        layoutColumn.add(submitButton);
       
        Button newGameButton  = new Button("Start a New Game");
        newGameButton.setActionCommand("new game");
        newGameButton.setForeground(Color.WHITE);
        newGameButton.setBackground(Color.RED);
        newGameButton.setWidth(new Extent(200));
        newGameButton.addActionListener(this);
        layoutColumn.add(newGameButton);
    }
View Full Code Here

     *        correct answer.
     */
    CongratulationsPane(int numberOfTries) {
        Column layoutColumn = new Column();
        layoutColumn.setInsets(new Insets(30));
        layoutColumn.setCellSpacing(new Extent(30));
        add(layoutColumn);
       
        layoutColumn.add(new Label(new ResourceImageReference("/echo2tutorial/numberguess/CongratulationsBanner.png")));
        layoutColumn.add(new Label("You got the correct answer in " + numberOfTries + (numberOfTries == 1 ? " try." : " tries.")));

        Button button = new Button("Play Again");
        button.setForeground(Color.WHITE);
        button.setBackground(Color.RED);
        button.setWidth(new Extent(200));
        button.addActionListener(this);
        layoutColumn.add(button);
    }
View Full Code Here

TOP

Related Classes of nextapp.echo2.app.Extent

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.