Example usage for java.awt BorderLayout EAST

List of usage examples for java.awt BorderLayout EAST

Introduction

In this page you can find the example usage for java.awt BorderLayout EAST.

Prototype

String EAST

To view the source code for java.awt BorderLayout EAST.

Click Source Link

Document

The east layout constraint (right side of container).

Usage

From source file:pt.lsts.neptus.console.plugins.planning.VerticalFormationWizard.java

/**
 * @param console// w  w  w .ja v a 2 s  .  co m
 */
public VerticalFormationWizard(ConsoleLayout console) {
    super(console);
    setLayout(new BorderLayout());
    btnAdvance = new JButton(I18n.text("Next"));
    btnBack = new JButton(I18n.text("Previous"));
    btnCancel = new JButton(I18n.text("Cancel"));

    btnAdvance.addActionListener(this::advance);
    btnBack.addActionListener(this::back);
    btnCancel.addActionListener(this::cancel);

    JPanel btns = new JPanel(new BorderLayout());
    JPanel flow1 = new JPanel(new FlowLayout());
    flow1.add(btnBack);
    JPanel flow2 = new JPanel(new FlowLayout());
    flow2.add(btnCancel);
    flow2.add(btnAdvance);
    btns.add(flow1, BorderLayout.WEST);
    btns.add(flow2, BorderLayout.EAST);
    add(btns, BorderLayout.SOUTH);

    lblTop.setPreferredSize(new Dimension(60, 60));
    lblTop.setMinimumSize(lblTop.getPreferredSize());
    lblTop.setOpaque(true);
    lblTop.setBackground(Color.white);
    lblTop.setFont(new Font("Helvetica", Font.BOLD, 18));
    add(lblTop, BorderLayout.NORTH);

    planSelection = new PlanSelectionPage(console.getMission(), false);
    vehicleSelection = new VehicleSelectionPage(new ArrayList<VehicleType>(), true);

    pages.add(planSelection);
    pages.add(vehicleSelection);
    pages.add(options);
    main = new JPanel(new CardLayout());
    pages.forEach(p -> main.add(p, p.getTitle()));
    add(main, BorderLayout.CENTER);
    lblTop.setText(pages.get(0).getTitle());
}

From source file:org.datacleaner.panels.fuse.ColumnListMultipleCoalesceUnitPropertyWidget.java

public ColumnListMultipleCoalesceUnitPropertyWidget(final ComponentBuilder componentBuilder,
        final ConfiguredPropertyDescriptor inputProperty, final ConfiguredPropertyDescriptor unitProperty) {
    super(componentBuilder, inputProperty);
    _unitProperty = unitProperty;/* ww w .  j  a v  a  2  s .co m*/
    _pickedInputColumns = new HashSet<>();
    _unitContainerPanel = new DCPanel();
    _unitContainerPanel.setLayout(new VerticalLayout(2));

    getAnalysisJobBuilder().addSourceColumnChangeListener(this);
    getAnalysisJobBuilder().addTransformerChangeListener(this);

    _unitPropertyWidget = createUnitPropertyWidget();

    final JButton addButton = WidgetFactory.createSmallButton(IconUtils.ACTION_ADD_DARK);
    addButton.addActionListener(e -> addCoalesceUnit());

    final JButton removeButton = WidgetFactory.createSmallButton(IconUtils.ACTION_REMOVE_DARK);
    removeButton.addActionListener(e -> removeCoalesceUnit());

    final DCPanel buttonPanel = new DCPanel();
    buttonPanel.setBorder(new EmptyBorder(0, 4, 0, 0));
    buttonPanel.setLayout(new VerticalLayout(2));
    buttonPanel.add(addButton);
    buttonPanel.add(removeButton);

    final DCPanel outerPanel = new DCPanel();
    outerPanel.setLayout(new BorderLayout());

    outerPanel.add(_unitContainerPanel, BorderLayout.CENTER);
    outerPanel.add(buttonPanel, BorderLayout.EAST);

    add(outerPanel);

    final CoalesceUnit[] currentValue = (CoalesceUnit[]) getComponentBuilder()
            .getConfiguredProperty(_unitProperty);
    if (currentValue == null) {
        addCoalesceUnit();
    } else {
        batchUpdateWidget(() -> {
            for (final CoalesceUnit unit : currentValue) {
                addCoalesceUnit(unit);
            }
        });
    }
}

From source file:MenuItemChooser.java

private void initGUI() {
    JPanel itemDetailsPanel = new JPanel();
    itemDetailsPanel.setLayout(new GridLayout(4, 2));
    itemDetailsPanel.setBackground(Color.WHITE);

    JLabel lbl = new JLabel("Item: ");
    itemDetailsPanel.add(lbl);/*ww w  .j a  v  a  2  s . co m*/

    itemName = new JLabel("");
    itemDetailsPanel.add(itemName);

    lbl = new JLabel("Type: ");
    itemDetailsPanel.add(lbl);

    itemType = new JLabel("");
    itemDetailsPanel.add(itemType);

    lbl = new JLabel("Price: $ ");
    itemDetailsPanel.add(lbl);

    price = new JLabel("");
    itemDetailsPanel.add(price);

    lbl = new JLabel("Quantity: ");
    itemDetailsPanel.add(lbl);

    qty = new JTextField("0", 1);
    qty.addActionListener(this);
    qty.addFocusListener(this);
    itemDetailsPanel.add(qty);

    JPanel imgDescPanel = new JPanel(new BorderLayout());
    imgDescPanel.setBackground(Color.WHITE);
    image = new JLabel("");
    image.setHorizontalAlignment(SwingConstants.CENTER);
    image.setVerticalAlignment(SwingConstants.CENTER);

    imgDescPanel.add(image, BorderLayout.NORTH);

    desc = new JLabel("desc");
    imgDescPanel.add(desc, BorderLayout.SOUTH);

    JPanel buttonPanel = new JPanel();
    buttonPanel.setBackground(Color.WHITE);
    next = new JButton("Next");
    next.addActionListener(this);
    buttonPanel.add(next);

    prev = new JButton("Previous");
    prev.addActionListener(this);
    buttonPanel.add(prev);

    order = new JButton("Order");
    order.addActionListener(this);
    buttonPanel.add(order);

    cancel = new JButton("Cancel / New");
    cancel.addActionListener(this);
    buttonPanel.add(cancel);

    close = new JButton("Close");
    close.addActionListener(this);
    close.setEnabled(false);
    buttonPanel.add(close);

    totalLbl = new JLabel("");
    totalLbl.setFont(new Font("Serif", Font.BOLD, 14));
    totalLbl.setForeground((Color.GREEN).darker());
    buttonPanel.add(totalLbl);

    BorderLayout bl = new BorderLayout();
    bl.setHgap(30);
    bl.setVgap(20);
    setLayout(bl);
    setBackground(Color.WHITE);
    add(itemDetailsPanel, BorderLayout.WEST);
    add(imgDescPanel, BorderLayout.EAST);
    add(buttonPanel, BorderLayout.SOUTH);
    TitledBorder title = BorderFactory.createTitledBorder("Choose Menu Items And Place Order");
    setBorder(title);

    loadMenuItem();
}

From source file:gda.gui.oemove.plugins.UndulatorControl.java

private void createDisplayComponent() {
    displayComponent = new JPanel();
    // JTabbedPane jtp = new JTabbedPane();
    JPanel innerDisplayComponent = new JPanel(new BorderLayout());
    JPanel topPanel = new JPanel(new BorderLayout());
    JPanel changes = new JPanel(new GridLayout(4, 0));
    JPanel current = new JPanel(new BorderLayout());
    JPanel currentLabels = new JPanel(new GridLayout(4, 0));
    JPanel currentFields = new JPanel(new GridLayout(4, 0));

    currentEnergyField = new DefaultDOFPositionDisplay(undulator, "UndulatorEnergy", 15, false);
    currentPolarizationField = new PolarizationDOFPositionDisplay(undulator, "UndulatorPolarization", 15,
            false);//from w w w.  j av  a  2  s  .  c  o m
    currentHarmonicField = new HarmonicDOFPositionDisplay(undulator, "UndulatorHarmonic", 15, false);

    currentLabels.add(new JLabel(""));
    currentLabels.add(new JLabel("Energy (eV"));
    currentLabels.add(new JLabel("Polarization"));
    currentLabels.add(new JLabel("Harmonic"));
    current.add(currentLabels, BorderLayout.WEST);

    currentFields.add(new JLabel("Current"));
    currentFields.add(currentEnergyField);
    currentFields.add(currentPolarizationField);
    currentFields.add(currentHarmonicField);
    current.add(currentFields, BorderLayout.EAST);
    topPanel.add(current, BorderLayout.WEST);

    energyField = new JTextField(currentEnergyField.getText(), 10);
    polarizationCombo = new PolarizationDOFInputDisplay();
    polarizationCombo.setBorder(null);
    harmonicCombo = new HarmonicDOFInputDisplay();
    harmonicCombo.setBorder(null);
    changes.add(new JLabel("Move to"));
    changes.add(energyField);
    changes.add(polarizationCombo);
    changes.add(harmonicCombo);
    topPanel.add(changes, BorderLayout.EAST);
    topPanel.setBorder(BorderFactory.createEtchedBorder());

    createButtonPanel();
    innerDisplayComponent.add(topPanel, BorderLayout.NORTH);
    innerDisplayComponent.add(buttonPanel, BorderLayout.SOUTH);

    // jtp.addTab("Move", innerDisplayComponent);

    // createViewPanel();
    // DO NOT REMOVE THIS, it is commented out because the viewPanel is
    // still
    // under test
    // jtp.addTab("View", viewPanel);
    // displayComponent.add(jtp);
    displayComponent.add(innerDisplayComponent);
}

From source file:org.pentaho.reporting.libraries.designtime.swing.date.DateCellEditor.java

/**
 * Constructs a new <code>DatePickerParameterComponent</code>.
 *///from  ww  w  .  j  av  a 2 s.  c o  m
public DateCellEditor(final Class dateType) {
    this.listeners = new EventListenerList();
    this.dateType = dateType;
    if (this.dateType.isArray()) {
        this.dateType = this.dateType.getComponentType();
    }

    setLayout(new BorderLayout());
    dateField = new JFormattedTextField();
    dateField.setColumns(20);
    dateField.setEditable(true);

    pickDateButton = new EllipsisButton(new PickDateListener());

    add(dateField, BorderLayout.CENTER);
    add(pickDateButton, BorderLayout.EAST);
}

From source file:phex.gui.tabs.library.LibraryTab.java

public void initComponent(XJBGUISettings guiSettings) {
    CellConstraints cc = new CellConstraints();
    FormLayout tabLayout = new FormLayout("2dlu, fill:d:grow, 2dlu", // columns
            "2dlu, fill:p:grow, 2dlu"); //rows
    PanelBuilder tabBuilder = new PanelBuilder(tabLayout, this);
    JPanel contentPanel = new JPanel();
    FWElegantPanel elegantPanel = new FWElegantPanel(Localizer.getString("Library"), contentPanel);
    tabBuilder.add(elegantPanel, cc.xy(2, 2));

    FormLayout contentLayout = new FormLayout("fill:d:grow", // columns
            "fill:d:grow"); //rows
    PanelBuilder contentBuilder = new PanelBuilder(contentLayout, contentPanel);

    MouseHandler mouseHandler = new MouseHandler();

    JPanel treePanel = createTreePanel(mouseHandler);
    JPanel tablePanel = createTablePanel(guiSettings, mouseHandler);

    JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, treePanel, tablePanel);
    splitPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
    splitPane.setDividerSize(4);/* w w  w  .  j  a va 2  s. com*/
    splitPane.setOneTouchExpandable(false);
    contentBuilder.add(splitPane, cc.xy(1, 1));

    sharedFilesLabel = new JLabel(" ");
    sharedFilesLabel.setHorizontalAlignment(JLabel.RIGHT);
    elegantPanel.addHeaderPanelComponent(sharedFilesLabel, BorderLayout.EAST);
    ShareManager.getInstance().getSharedFilesService()
            .addSharedFilesChangeListener(new SharedFilesChangeHandler());

    fileTreePopup = new FWPopupMenu();
    fileTablePopup = new FWPopupMenu();

    FWAction action;

    action = getTabAction(ADD_SHARE_FOLDER_ACTION_KEY);
    fileTreePopup.addAction(action);
    action = getTabAction(REMOVE_SHARE_FOLDER_ACTION_KEY);
    fileTreePopup.addAction(action);

    if (SystemUtils.IS_OS_WINDOWS || SystemUtils.IS_OS_MAC_OSX) {
        action = getTabAction(EXPLORE_FOLDER_ACTION_KEY);
        fileTreePopup.addAction(action);
    }

    action = getTabAction(OPEN_FILE_ACTION_KEY);
    fileTablePopup.addAction(action);

    action = getTabAction(VIEW_BITZI_ACTION_KEY);
    fileTablePopup.addAction(action);

    fileTablePopup.addSeparator();
    fileTreePopup.addSeparator();

    action = getTabAction(RESCAN_ACTION_KEY);
    fileTablePopup.addAction(action);
    fileTreePopup.addAction(action);

    action = getTabAction(EXPORT_ACTION_KEY);
    fileTablePopup.addAction(action);
    fileTreePopup.addAction(action);

    action = getTabAction(FILTER_ACTION_KEY);
    fileTablePopup.addAction(action);
    fileTreePopup.addAction(action);
}

From source file:net.nosleep.superanalyzer.panels.HomePanel.java

public JPanel createHeaderPanel(JComboBox comboBox, boolean showTagWarning) {

    JPanel panel = new JPanel(new BorderLayout());
    panel.setBackground(Color.WHITE);
    if (comboBox != null) {
        comboBox.setOpaque(false);/* w w  w .ja v  a2 s . co m*/
        panel.add(comboBox, BorderLayout.WEST);
    }

    if (showTagWarning == true)
        panel.add(createWarningPanel(true), BorderLayout.EAST);

    return panel;
}

From source file:opendial.gui.utils.DistributionViewer.java

/**
 * Constructs or update the current viewer with the distribution.
 * //from  www .j av  a  2  s  .  c  om
 * @param currentState the updated dialogue state
 */
protected void update(DialogueState currentState) {

    if (!currentState.hasChanceNode(queryVar)) {
        return;
    } else if (lastDistrib != null
            && this.lastDistrib.equals(currentState.getChanceNode(queryVar).getDistrib())) {
        return;
    }
    this.lastDistrib = currentState.queryProb(queryVar);

    Container container = new Container();
    container.setLayout(new BorderLayout());
    container.add(new JLabel("        "), BorderLayout.NORTH);
    container.add(new JLabel("        "), BorderLayout.WEST);
    container.add(new JLabel("        "), BorderLayout.EAST);
    container.add(new JLabel("        "), BorderLayout.SOUTH);

    try {
        IndependentDistribution indepDistrib = currentState.queryProb(queryVar);
        if (indepDistrib instanceof ContinuousDistribution) {
            container.add(generatePanel(indepDistrib.toContinuous()), BorderLayout.CENTER);
        } else {
            container.add(generatePanel(indepDistrib.toDiscrete()), BorderLayout.CENTER);
        }
    } catch (RuntimeException e) {
        log.warning("could not generate distribution viewer: " + e);
    }
    setContentPane(container);
    if (getSize().height == 0 || getSize().width == 0) {
        pack();
        setLocation(new Random().nextInt(500), (new Random()).nextInt(500));
        setVisible(true);
    } else {
        validate();
    }
}

From source file:org.objectpocket.viewer.Viewer.java

/**
 * Initialize the contents of the frame.
 *//*from  w  w w  .  j  a  v  a  2  s.c o m*/
private void initialize() {
    viewerFrame = new JFrame();
    viewerFrame.setTitle("ObjectPocketViewer");
    viewerFrame.setBounds(100, 100, 1427, 524);
    viewerFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    splitPane = new JSplitPane();
    splitPane.setResizeWeight(0.2);
    viewerFrame.getContentPane().add(splitPane, BorderLayout.CENTER);

    classTree = new JTree();
    classTree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
    classTree.addTreeSelectionListener(new TreeSelectionListener() {
        public void valueChanged(TreeSelectionEvent e) {
            updateTable();
        }
    });
    splitPane.setLeftComponent(classTree);

    panel = new JPanel();
    splitPane.setRightComponent(panel);
    panel.setLayout(new BorderLayout(0, 0));

    scrollPane = new JScrollPane();
    panel.add(scrollPane);
    objectTable = new JTable();
    objectTable.setAutoCreateRowSorter(true);
    objectTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    scrollPane.setViewportView(objectTable);
    panel.add(scrollPane, BorderLayout.CENTER);

    filterPanel = new JPanel();
    panel.add(filterPanel, BorderLayout.NORTH);
    filterPanel.setLayout(new BorderLayout(0, 0));

    filterTextField = new JTextField();
    filterTextField.addKeyListener(new KeyAdapter() {
        @Override
        public void keyReleased(KeyEvent e) {
            if (e.getKeyChar() == KeyEvent.VK_ENTER) {
                updateTable();
            }
        }
    });
    filterPanel.add(filterTextField, BorderLayout.CENTER);
    filterTextField.setColumns(10);

    filterButton = new JButton("apply filter");
    filterButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            updateTable();
        }
    });
    filterPanel.add(filterButton, BorderLayout.EAST);

    statusLabel = new JLabel("");
    panel.add(statusLabel, BorderLayout.SOUTH);

}

From source file:opendial.gui.stateviewer.DistributionViewer.java

/**
 * Constructs or update the current viewer with the distribution.
 * /* w w  w  .j  a va  2 s.c o m*/
 * @param currentState the updated dialogue state
 */
protected void update(DialogueState currentState) {

    if (!currentState.hasChanceNode(queryVar)) {
        return;
    } else if (lastDistrib != null
            && this.lastDistrib.equals(currentState.getChanceNode(queryVar).getDistrib())) {
        return;
    }
    this.lastDistrib = currentState.queryProb(queryVar);

    Container container = new Container();
    container.setLayout(new BorderLayout());
    container.add(new JLabel("        "), BorderLayout.NORTH);
    container.add(new JLabel("        "), BorderLayout.WEST);
    container.add(new JLabel("        "), BorderLayout.EAST);
    container.add(new JLabel("        "), BorderLayout.SOUTH);

    try {
        IndependentProbDistribution indepDistrib = currentState.queryProb(queryVar);
        if (indepDistrib instanceof ContinuousDistribution) {
            container.add(generatePanel(indepDistrib.toContinuous()), BorderLayout.CENTER);
        } else {
            container.add(generatePanel(indepDistrib.toDiscrete()), BorderLayout.CENTER);
        }
    } catch (DialException e) {
        log.warning("could not generate distribution viewer: " + e);
    }
    setContentPane(container);
    if (getSize().height == 0 || getSize().width == 0) {
        pack();
        setLocation(new Random().nextInt(500), (new Random()).nextInt(500));
        setVisible(true);
    } else {
        validate();
    }
}