Search in sources :

Example 86 with JSeparator

use of javax.swing.JSeparator in project ACS by ACS-Community.

the class DeploymentTree method showContextMenu.

/**
	 * @param evt
	 */
protected void showContextMenu(MouseEvent evt) {
    TreePath targetPath = this.getClosestPathForLocation(evt.getX(), evt.getY());
    if (targetPath == null) {
        // clicked into a totally empty tree (no manager shown): ignore click.
        return;
    }
    setSelectionPath(targetPath);
    if (targetPath.getPathCount() == 1) {
        // that has no function besides looking good
        return;
    }
    // the supervisor (which is in the rootnode) for this subtree
    selectedSupervisor = maciSupervisor(((SortingTreeNode) targetPath.getPathComponent(1)));
    // the node the mouse was clicked on
    target = (SortingTreeNode) targetPath.getLastPathComponent();
    Object userObject = target.getUserObject();
    ContextMenu menu;
    if (userObject instanceof IMaciSupervisor) {
        menu = managerContextMenu;
    } else if (userObject instanceof ContainerInfo) {
        menu = containerContextMenu;
    } else if (userObject instanceof ClientInfo) {
        menu = clientContextMenu;
    } else if (userObject instanceof ComponentInfo) {
        menu = componentContextMenu;
    } else if (userObject instanceof FolderInfo) {
        menu = folderContextMenu;
    } else if (userObject instanceof InfoDetail) {
        // msc 2012-06: help user navigate in large datasets (cf. COMP-3684)
        // this menu is built dynamically from rather expensive information.
        menu = new ContextMenu(false);
        int[] selectedHandles = ((SortingTreeNode) target).representedHandles;
        if (selectedHandles.length > 0) {
            menu.add(new JLabel(" Scroll to ..."));
            menu.add(new JSeparator(JSeparator.HORIZONTAL));
            SortingTreeNode mgrNode = (SortingTreeNode) target.getPath()[1];
            List<Object> list = new ArrayList<Object>();
            list.add(mgrNode);
            for (SortingTreeNode top : mgrNode.childrens()) list.addAll(Collections.list(top.children()));
            for (Object obj : list) {
                final SortingTreeNode elem = (SortingTreeNode) obj;
                for (int i = 0; i < selectedHandles.length; i++) {
                    if (elem.represents(selectedHandles[i])) {
                        Object elemUserObject = elem.getUserObject();
                        String elemName = null;
                        if (elemUserObject instanceof ComponentInfo)
                            elemName = ((ComponentInfo) elemUserObject).name;
                        else if (elemUserObject instanceof ContainerInfo)
                            elemName = ((ContainerInfo) elemUserObject).name;
                        else if (elemUserObject instanceof ClientInfo)
                            elemName = ((ClientInfo) elemUserObject).name;
                        else if (elemUserObject instanceof MaciSupervisor)
                            elemName = "Manager";
                        if (elemName != null) {
                            menu.add(new AbstractAction(selectedHandles[i] + " = " + elemName) {

                                @Override
                                public void actionPerformed(ActionEvent evt) {
                                    DeploymentTree.this.scrollPathToVisible(new TreePath(elem.getPath()));
                                }
                            });
                        }
                    }
                }
            }
        }
    } else {
        return;
    }
    menu.show(this, evt.getX(), evt.getY());
}
Also used : GuiMaciSupervisor(alma.acs.commandcenter.meta.GuiMaciSupervisor) MaciSupervisor(alma.acs.commandcenter.meta.MaciSupervisor) IMaciSupervisor(alma.acs.commandcenter.meta.IMaciSupervisor) SortingTreeNode(alma.acs.commandcenter.meta.MaciInfo.SortingTreeNode) ActionEvent(java.awt.event.ActionEvent) JLabel(javax.swing.JLabel) InfoDetail(alma.acs.commandcenter.meta.MaciInfo.InfoDetail) FolderInfo(alma.acs.commandcenter.meta.MaciInfo.FolderInfo) JSeparator(javax.swing.JSeparator) TreePath(javax.swing.tree.TreePath) ContainerInfo(si.ijs.maci.ContainerInfo) List(java.util.List) ArrayList(java.util.ArrayList) ClientInfo(si.ijs.maci.ClientInfo) ComponentInfo(si.ijs.maci.ComponentInfo) AbstractAction(javax.swing.AbstractAction) IMaciSupervisor(alma.acs.commandcenter.meta.IMaciSupervisor)

Example 87 with JSeparator

use of javax.swing.JSeparator in project DistributedFractalNetwork by Budder21.

the class NetworkElement method placeNameAndXButton.

private void placeNameAndXButton() {
    GridBagConstraints c = new GridBagConstraints();
    JPanel container = new JPanel();
    container.add(xButton);
    container.add(displayName);
    container.setBackground(Color.WHITE);
    c.gridx = 0;
    c.gridy = 0;
    c.gridheight = 1;
    c.gridwidth = 1;
    this.add(container, c);
    c.gridx = 1;
    c.ipadx = 120;
    c.gridwidth = 2;
    JPanel temp = new JPanel();
    temp.setBackground(Color.WHITE);
    this.add(temp, c);
    c.gridx = 3;
    c.gridwidth = 1;
    c.ipadx = 0;
    JButton log = new JButton("LOG");
    log.setFocusPainted(false);
    log.setBorderPainted(false);
    log.setBackground(new Color(230, 230, 230));
    log.setFont(Constants.smallFont);
    this.add(log, c);
    /*c.gridx = 0;
		c.gridy = 1;
		c.gridheight = 1;
		c.gridwidth = 4;
		//c.ipadx = 200;
		//c.ipady = 30;
		this.add(jobPane, c); */
    c.gridx = 0;
    c.gridy = 2;
    c.gridwidth = 4;
    c.fill = GridBagConstraints.HORIZONTAL;
    this.add(new JSeparator(), c);
//TODO: add JSeparator
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) Color(java.awt.Color) JButton(javax.swing.JButton) JSeparator(javax.swing.JSeparator)

Example 88 with JSeparator

use of javax.swing.JSeparator in project adempiere by adempiere.

the class ConfigurationPanel method jbInit.

/**
	 * 	Static Layout Init
	 *  @throws Exception
	 */
private void jbInit() throws Exception {
    this.setLayout(gridBagLayout);
    Insets bInsets = new Insets(0, 5, 0, 5);
    TitledBorder titledBorder = new TitledBorder("dummy");
    //	Java
    lJavaHome.setToolTipText(res.getString("JavaHomeInfo"));
    lJavaHome.setText(res.getString("JavaHome"));
    fJavaHome.setText(".");
    okJavaHome.setEnabled(false);
    bJavaHome.setMargin(bInsets);
    bJavaHome.setToolTipText(res.getString("JavaHomeInfo"));
    lJavaType.setToolTipText(res.getString("JavaTypeInfo"));
    lJavaType.setText(res.getString("JavaType"));
    fJavaType.setPreferredSize(fJavaHome.getPreferredSize());
    JLabel sectionLabel = new JLabel("Java");
    sectionLabel.setForeground(titledBorder.getTitleColor());
    JSeparator separator = new JSeparator();
    this.add(sectionLabel, new GridBagConstraints(0, 0, 7, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(15, 5, 0, 10), 0, 0));
    this.add(separator, new GridBagConstraints(0, 1, 7, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 5, 0, 10), 0, 0));
    this.add(lJavaHome, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 2, 5), 0, 0));
    this.add(fJavaHome, new GridBagConstraints(1, 2, 1, 1, 0.5, 0.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(5, 5, 5, 0), 0, 0));
    this.add(okJavaHome, new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 0, 2, 5), 0, 0));
    this.add(bJavaHome, new GridBagConstraints(3, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
    this.add(lJavaType, new GridBagConstraints(4, 2, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 2, 5), 0, 0));
    this.add(fJavaType, new GridBagConstraints(5, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 2, 0), 0, 0));
    //	AdempiereHome - KeyStore
    lAdempiereHome.setToolTipText(res.getString("AdempiereHomeInfo"));
    lAdempiereHome.setText(res.getString("AdempiereHome"));
    fAdempiereHome.setText(".");
    okAdempiereHome.setEnabled(false);
    bAdempiereHome.setMargin(bInsets);
    bAdempiereHome.setToolTipText(res.getString("AdempiereHomeInfo"));
    lKeyStore.setText(res.getString("KeyStorePassword"));
    lKeyStore.setToolTipText(res.getString("KeyStorePasswordInfo"));
    fKeyStore.setText("");
    okKeyStore.setEnabled(false);
    sectionLabel = new JLabel("Adempiere");
    sectionLabel.setForeground(titledBorder.getTitleColor());
    separator = new JSeparator();
    this.add(sectionLabel, new GridBagConstraints(0, 3, 7, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(15, 5, 0, 0), 0, 0));
    this.add(separator, new GridBagConstraints(0, 4, 7, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 5, 0, 10), 0, 0));
    this.add(lAdempiereHome, new GridBagConstraints(0, 5, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 2, 5), 0, 0));
    this.add(fAdempiereHome, new GridBagConstraints(1, 5, 1, 1, 0.5, 0.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(5, 5, 2, 0), 0, 0));
    this.add(okAdempiereHome, new GridBagConstraints(2, 5, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 0, 2, 5), 0, 0));
    this.add(bAdempiereHome, new GridBagConstraints(3, 5, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
    this.add(lKeyStore, new GridBagConstraints(4, 5, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
    this.add(fKeyStore, new GridBagConstraints(5, 5, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 2, 0), 0, 0));
    this.add(okKeyStore, new GridBagConstraints(6, 5, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 2, 5), 0, 0));
    //	Apps Server - Type
    lAppsServer.setToolTipText(res.getString("AppsServerInfo"));
    lAppsServer.setText(res.getString("AppsServer"));
    lAppsServer.setFont(lAppsServer.getFont().deriveFont(Font.BOLD));
    fAppsServer.setText(".");
    okAppsServer.setEnabled(false);
    lAppsType.setToolTipText(res.getString("AppsTypeInfo"));
    lAppsType.setText(res.getString("AppsType"));
    fAppsType.setPreferredSize(fAppsServer.getPreferredSize());
    sectionLabel = new JLabel(res.getString("AppsServer"));
    sectionLabel.setForeground(titledBorder.getTitleColor());
    separator = new JSeparator();
    this.add(sectionLabel, new GridBagConstraints(0, 6, 6, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(15, 5, 0, 0), 0, 0));
    this.add(separator, new GridBagConstraints(0, 7, 7, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 5, 0, 10), 0, 0));
    this.add(lAppsServer, new GridBagConstraints(0, 8, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 2, 5), 0, 0));
    this.add(fAppsServer, new GridBagConstraints(1, 8, 1, 1, 0.5, 0.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(5, 5, 2, 0), 0, 0));
    this.add(okAppsServer, new GridBagConstraints(2, 8, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 0, 2, 5), 0, 0));
    this.add(lAppsType, new GridBagConstraints(4, 8, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 2, 5), 0, 0));
    this.add(fAppsType, new GridBagConstraints(5, 8, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 2, 0), 0, 0));
    // 	Deployment - JNP
    lDeployDir.setToolTipText(res.getString("DeployDirInfo"));
    lDeployDir.setText(res.getString("DeployDir"));
    fDeployDir.setText(".");
    okDeployDir.setEnabled(false);
    bDeployDir.setMargin(bInsets);
    bDeployDir.setToolTipText(res.getString("DeployDirInfo"));
    lJNPPort.setToolTipText(res.getString("JNPPortInfo"));
    lJNPPort.setText(res.getString("JNPPort"));
    fJNPPort.setText(".");
    okJNPPort.setEnabled(false);
    this.add(lDeployDir, new GridBagConstraints(0, 9, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 5, 2, 5), 0, 0));
    this.add(fDeployDir, new GridBagConstraints(1, 9, 1, 1, 0.5, 0.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(2, 5, 2, 0), 0, 0));
    this.add(okDeployDir, new GridBagConstraints(2, 9, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 0, 2, 5), 0, 0));
    this.add(bDeployDir, new GridBagConstraints(3, 9, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
    this.add(lJNPPort, new GridBagConstraints(4, 9, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 5, 2, 5), 0, 0));
    this.add(fJNPPort, new GridBagConstraints(5, 9, 1, 1, 0.5, 0.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(2, 5, 2, 0), 0, 0));
    this.add(okJNPPort, new GridBagConstraints(6, 9, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 0, 2, 5), 0, 0));
    //	Web Ports
    lWebPort.setToolTipText(res.getString("WebPortInfo"));
    lWebPort.setText(res.getString("WebPort"));
    fWebPort.setText(".");
    okWebPort.setEnabled(false);
    lSSLPort.setText("SSL");
    fSSLPort.setText(".");
    okSSLPort.setEnabled(false);
    this.add(lWebPort, new GridBagConstraints(0, 10, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 5, 2, 5), 0, 0));
    this.add(fWebPort, new GridBagConstraints(1, 10, 1, 1, 0.5, 0.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(2, 5, 2, 0), 0, 0));
    this.add(okWebPort, new GridBagConstraints(2, 10, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 0, 2, 5), 0, 0));
    this.add(lSSLPort, new GridBagConstraints(4, 10, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 5, 2, 5), 0, 0));
    this.add(fSSLPort, new GridBagConstraints(5, 10, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(2, 5, 2, 0), 0, 0));
    this.add(okSSLPort, new GridBagConstraints(6, 10, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 0, 2, 5), 0, 0));
    //	Database Server - Type
    lDatabaseServer.setToolTipText(res.getString("DatabaseServerInfo"));
    lDatabaseServer.setText(res.getString("DatabaseServer"));
    lDatabaseServer.setFont(lDatabaseServer.getFont().deriveFont(Font.BOLD));
    okDatabaseServer.setEnabled(false);
    lDatabaseType.setToolTipText(res.getString("DatabaseTypeInfo"));
    lDatabaseType.setText(res.getString("DatabaseType"));
    fDatabaseType.setPreferredSize(fDatabaseServer.getPreferredSize());
    sectionLabel = new JLabel(res.getString("DatabaseServer"));
    sectionLabel.setForeground(titledBorder.getTitleColor());
    separator = new JSeparator();
    this.add(sectionLabel, new GridBagConstraints(0, 11, 6, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(15, 5, 0, 0), 0, 0));
    this.add(separator, new GridBagConstraints(0, 12, 7, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 5, 0, 10), 0, 0));
    this.add(lDatabaseServer, new GridBagConstraints(0, 13, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 2, 5), 0, 0));
    this.add(fDatabaseServer, new GridBagConstraints(1, 13, 1, 1, 0.5, 0.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(5, 5, 2, 0), 0, 0));
    this.add(okDatabaseServer, new GridBagConstraints(2, 13, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 0, 2, 5), 0, 0));
    this.add(lDatabaseType, new GridBagConstraints(4, 13, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 2, 5), 0, 0));
    this.add(fDatabaseType, new GridBagConstraints(5, 13, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 2, 0), 0, 0));
    //Database/Service Name
    lDatabaseName.setToolTipText(res.getString("DatabaseNameInfo"));
    lDatabaseName.setText(res.getString("DatabaseName"));
    fDatabaseName.setText(".");
    //TNS/Native connection
    lDatabaseDiscovered.setToolTipText(res.getString("TNSNameInfo"));
    lDatabaseDiscovered.setText(res.getString("TNSName"));
    fDatabaseDiscovered.setEditable(true);
    fDatabaseDiscovered.setPreferredSize(fDatabaseName.getPreferredSize());
    okDatabaseSQL.setEnabled(false);
    this.add(lDatabaseName, new GridBagConstraints(0, 14, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 5, 2, 5), 0, 0));
    this.add(fDatabaseName, new GridBagConstraints(1, 14, 1, 1, 0.5, 0.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(2, 5, 2, 0), 0, 0));
    this.add(okDatabaseSQL, new GridBagConstraints(2, 14, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 0, 2, 5), 0, 0));
    this.add(lDatabaseDiscovered, new GridBagConstraints(4, 14, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 0, 2, 5), 0, 0));
    this.add(fDatabaseDiscovered, new GridBagConstraints(5, 14, 1, 1, 0.5, 0.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(2, 5, 2, 0), 0, 0));
    //	Port - System
    lDatabasePort.setToolTipText(res.getString("DatabasePortInfo"));
    lDatabasePort.setText(res.getString("DatabasePort"));
    fDatabasePort.setText(".");
    lSystemPassword.setToolTipText(res.getString("SystemPasswordInfo"));
    lSystemPassword.setText(res.getString("SystemPassword"));
    fSystemPassword.setText(".");
    okDatabaseSystem.setEnabled(false);
    this.add(lDatabasePort, new GridBagConstraints(0, 15, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 5, 2, 5), 0, 0));
    this.add(fDatabasePort, new GridBagConstraints(1, 15, 1, 1, 0.5, 0.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(2, 5, 2, 0), 0, 0));
    this.add(lSystemPassword, new GridBagConstraints(4, 15, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 5, 2, 5), 0, 0));
    this.add(fSystemPassword, new GridBagConstraints(5, 15, 1, 1, 0.5, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(2, 5, 2, 0), 0, 0));
    this.add(okDatabaseSystem, new GridBagConstraints(6, 15, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 0, 2, 5), 0, 0));
    //	User - Password
    lDatabaseUser.setToolTipText(res.getString("DatabaseUserInfo"));
    lDatabaseUser.setText(res.getString("DatabaseUser"));
    fDatabaseUser.setText(".");
    lDatabasePassword.setToolTipText(res.getString("DatabasePasswordInfo"));
    lDatabasePassword.setText(res.getString("DatabasePassword"));
    fDatabasePassword.setText(".");
    okDatabaseUser.setEnabled(false);
    this.add(lDatabaseUser, new GridBagConstraints(0, 16, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 5, 2, 5), 0, 0));
    this.add(fDatabaseUser, new GridBagConstraints(1, 16, 1, 1, 0.5, 0.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(2, 5, 2, 0), 0, 0));
    this.add(lDatabasePassword, new GridBagConstraints(4, 16, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 5, 2, 5), 0, 0));
    this.add(fDatabasePassword, new GridBagConstraints(5, 16, 1, 1, 0.5, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(2, 5, 2, 0), 0, 0));
    this.add(okDatabaseUser, new GridBagConstraints(6, 16, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 0, 2, 5), 0, 0));
    sectionLabel = new JLabel(res.getString("MailServer"));
    sectionLabel.setForeground(titledBorder.getTitleColor());
    separator = new JSeparator();
    this.add(sectionLabel, new GridBagConstraints(0, 17, 6, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(15, 5, 0, 0), 0, 0));
    this.add(separator, new GridBagConstraints(0, 18, 7, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 5, 0, 10), 0, 0));
    //	Mail Server - Email
    lMailServer.setToolTipText(res.getString("MailServerInfo"));
    lMailServer.setText(res.getString("MailServer"));
    lMailServer.setFont(lMailServer.getFont().deriveFont(Font.BOLD));
    fMailServer.setText(".");
    lAdminEMail.setToolTipText(res.getString("AdminEMailInfo"));
    lAdminEMail.setText(res.getString("AdminEMail"));
    fAdminEMail.setText(".");
    okMailServer.setEnabled(false);
    //	Mail User = Password
    lMailUser.setToolTipText(res.getString("MailUserInfo"));
    lMailUser.setText(res.getString("MailUser"));
    fMailUser.setText(".");
    lMailPassword.setToolTipText(res.getString("MailPasswordInfo"));
    lMailPassword.setText(res.getString("MailPassword"));
    fMailPassword.setText(".");
    //	FR [ 402 ]
    lMailProtocol.setToolTipText(res.getString("MailProtocolInfo"));
    lMailProtocol.setText(res.getString("MailProtocol"));
    fMailProtocol.setPreferredSize(fMailProtocol.getPreferredSize());
    lEncryptionType.setToolTipText(res.getString("MailEncryptionTypeInfo"));
    lEncryptionType.setText(res.getString("MailEncryptionType"));
    fEncryptionType.setPreferredSize(fEncryptionType.getPreferredSize());
    lAuthMechanism.setToolTipText(res.getString("MailAuthMechanismInfo"));
    lAuthMechanism.setText(res.getString("MailAuthMechanism"));
    fAuthMechanism.setPreferredSize(fAuthMechanism.getPreferredSize());
    lMailPort.setToolTipText(res.getString("MailPortInfo"));
    lMailPort.setText(res.getString("MailPort"));
    fMailPort.setText("25");
    okMailUser.setEnabled(false);
    this.add(lMailServer, new GridBagConstraints(0, 19, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 2, 5), 0, 0));
    this.add(fMailServer, new GridBagConstraints(1, 19, 1, 1, 0.5, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 2, 0), 0, 0));
    this.add(lMailPort, new GridBagConstraints(4, 19, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 5, 2, 5), 0, 0));
    this.add(fMailPort, new GridBagConstraints(5, 19, 1, 1, 0.5, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(2, 5, 2, 0), 0, 0));
    this.add(okMailServer, new GridBagConstraints(6, 19, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 0, 2, 5), 0, 0));
    this.add(lMailProtocol, new GridBagConstraints(0, 20, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 2, 5), 0, 0));
    this.add(fMailProtocol, new GridBagConstraints(1, 20, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 2, 5), 0, 0));
    this.add(lAdminEMail, new GridBagConstraints(4, 20, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 2, 5), 0, 0));
    this.add(fAdminEMail, new GridBagConstraints(5, 20, 1, 1, 0.5, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 2, 0), 0, 0));
    //	FR [ 402 ]
    this.add(lEncryptionType, new GridBagConstraints(0, 21, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 5, 2, 5), 0, 0));
    this.add(fEncryptionType, new GridBagConstraints(1, 21, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(2, 5, 2, 5), 0, 0));
    this.add(lAuthMechanism, new GridBagConstraints(4, 21, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 5, 2, 5), 0, 0));
    this.add(fAuthMechanism, new GridBagConstraints(5, 21, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(2, 5, 2, 5), 0, 0));
    //	
    this.add(lMailUser, new GridBagConstraints(0, 22, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 5, 2, 5), 0, 0));
    this.add(fMailUser, new GridBagConstraints(1, 22, 1, 1, 0.5, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(2, 5, 2, 0), 0, 0));
    this.add(lMailPassword, new GridBagConstraints(4, 22, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 5, 2, 5), 0, 0));
    this.add(fMailPassword, new GridBagConstraints(5, 22, 1, 1, 0.5, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(2, 5, 2, 0), 0, 0));
    this.add(okMailUser, new GridBagConstraints(6, 22, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 0, 2, 5), 0, 0));
    //grap extra space when window is maximized
    CPanel filler = new CPanel();
    filler.setOpaque(false);
    filler.setBorder(null);
    this.add(filler, new GridBagConstraints(0, 23, 1, 1, 0.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.VERTICAL, new Insets(0, 0, 0, 0), 0, 0));
    //	End
    bTest.setToolTipText(res.getString("TestInfo"));
    bTest.setText(res.getString("Test"));
    bSave.setToolTipText(res.getString("SaveInfo"));
    bSave.setText(res.getString("Save"));
    bHelp.setToolTipText(res.getString("HelpInfo"));
    this.add(bTest, new GridBagConstraints(0, 24, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(15, 5, 10, 5), 0, 0));
    this.add(bHelp, new GridBagConstraints(3, 24, 2, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(15, 5, 10, 5), 0, 0));
    this.add(bSave, new GridBagConstraints(5, 24, 2, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(15, 5, 10, 5), 0, 0));
    //
    bAdempiereHome.addActionListener(this);
    bJavaHome.addActionListener(this);
    bDeployDir.addActionListener(this);
    fJavaType.addActionListener(this);
    fAppsType.addActionListener(this);
    fDatabaseType.addActionListener(this);
    fDatabaseDiscovered.addActionListener(this);
    bHelp.addActionListener(this);
    bTest.addActionListener(this);
    bSave.addActionListener(this);
}
Also used : GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) CPanel(org.compiere.swing.CPanel) JLabel(javax.swing.JLabel) TitledBorder(javax.swing.border.TitledBorder) JSeparator(javax.swing.JSeparator)

Example 89 with JSeparator

use of javax.swing.JSeparator in project pcgen by PCGen.

the class NameGenPanel method initComponents.

//GEN-LAST:event_generateButtonActionPerformed
/**
	 * This method is called from within the constructor to
	 * initialize the form.
	 */
private void initComponents() {
    genCtrlPanel = new JPanel();
    jPanel4 = new JPanel();
    jPanel13 = new JPanel();
    jPanel10 = new JPanel();
    jLabel4 = new JLabel();
    cbCatalog = new JComboBox();
    jPanel8 = new JPanel();
    jLabel1 = new JLabel();
    cbCategory = new JComboBox();
    jPanel14 = new JPanel();
    jPanel11 = new JPanel();
    generateButton = new JButton();
    jPanel9 = new JPanel();
    jLabel5 = new JLabel();
    cbSex = new JComboBox();
    jPanel7 = new JPanel();
    jSeparator4 = new JSeparator();
    jPanel12 = new JPanel();
    jLabel6 = new JLabel();
    cbStructure = new JComboBox();
    chkStructure = new JCheckBox();
    buttonPanel = new JPanel();
    nameDisplayPanel = new JPanel();
    nameSubInfoPanel = new JPanel();
    jSeparator2 = new JSeparator();
    jLabel2 = new JLabel();
    meaning = new JLabel();
    jSeparator1 = new JSeparator();
    jLabel3 = new JLabel();
    pronounciation = new JLabel();
    jSeparator3 = new JSeparator();
    namePanel = new JPanel();
    name = new JTextField();
    nameActionPanel = new JPanel();
    jButton1 = new JButton();
    setLayout(new BorderLayout(0, 5));
    genCtrlPanel.setLayout(new BorderLayout());
    jPanel4.setLayout(new BoxLayout(jPanel4, BoxLayout.X_AXIS));
    jPanel13.setLayout(new BorderLayout());
    jPanel10.setLayout(new FlowLayout(FlowLayout.LEFT));
    //$NON-NLS-1$
    jLabel4.setText(LanguageBundle.getString("in_rndNameCatalog"));
    jPanel10.add(jLabel4);
    cbCatalog.addActionListener(this::cbCatalogActionPerformed);
    jPanel10.add(cbCatalog);
    jPanel13.add(jPanel10, BorderLayout.CENTER);
    jPanel8.setLayout(new FlowLayout(FlowLayout.LEFT));
    //$NON-NLS-1$
    jLabel1.setText(LanguageBundle.getString("in_rndNameCategory"));
    jPanel8.add(jLabel1);
    cbCategory.addActionListener(this::cbCategoryActionPerformed);
    jPanel8.add(cbCategory);
    jPanel13.add(jPanel8, BorderLayout.NORTH);
    jPanel4.add(jPanel13);
    jPanel14.setLayout(new BorderLayout());
    jPanel11.setLayout(new FlowLayout(FlowLayout.LEFT));
    //$NON-NLS-1$
    generateButton.setText(LanguageBundle.getString("in_rndNameGenerate"));
    generateButton.addActionListener(this::generateButtonActionPerformed);
    jPanel11.add(generateButton);
    jPanel14.add(jPanel11, BorderLayout.CENTER);
    jPanel9.setLayout(new FlowLayout(FlowLayout.LEFT));
    //$NON-NLS-1$
    jLabel5.setText(LanguageBundle.getString("in_rndNameSex"));
    jPanel9.add(jLabel5);
    cbSex.addActionListener(this::cbSexActionPerformed);
    jPanel9.add(cbSex);
    jPanel14.add(jPanel9, BorderLayout.NORTH);
    jPanel4.add(jPanel14);
    genCtrlPanel.add(jPanel4, BorderLayout.NORTH);
    jPanel7.setLayout(new BorderLayout());
    jPanel7.add(jSeparator4, BorderLayout.NORTH);
    jPanel12.setLayout(new FlowLayout(FlowLayout.LEFT));
    //$NON-NLS-1$
    jLabel6.setText(LanguageBundle.getString("in_rndNameStructure"));
    jPanel12.add(jLabel6);
    cbStructure.setEnabled(false);
    cbStructure.addActionListener(this::cbStructureActionPerformed);
    jPanel12.add(cbStructure);
    chkStructure.setSelected(true);
    //$NON-NLS-1$
    chkStructure.setText(LanguageBundle.getString("in_randomButton"));
    chkStructure.addActionListener(this::chkStructureActionPerformed);
    jPanel12.add(chkStructure);
    jPanel7.add(jPanel12, BorderLayout.CENTER);
    jPanel7.add(new JSeparator(), BorderLayout.SOUTH);
    JPanel adjustNamePanel = new JPanel();
    adjustNamePanel.setLayout(new BorderLayout());
    //$NON-NLS-1$
    JLabel adjNameLabel = new JLabel(LanguageBundle.getString("in_rndNameAdjust"));
    adjustNamePanel.add(adjNameLabel, BorderLayout.NORTH);
    buttonPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
    // CODE-2099 Component needed to have correct vertical space available.
    //$NON-NLS-1$
    JLabel nb = new JLabel(" ");
    buttonPanel.add(nb);
    adjustNamePanel.add(buttonPanel, BorderLayout.CENTER);
    add(adjustNamePanel, BorderLayout.SOUTH);
    genCtrlPanel.add(jPanel7, BorderLayout.CENTER);
    // Name display
    nameDisplayPanel.setLayout(new BorderLayout());
    nameSubInfoPanel.setLayout(new BoxLayout(nameSubInfoPanel, BoxLayout.Y_AXIS));
    nameSubInfoPanel.add(jSeparator2);
    //$NON-NLS-1$
    jLabel2.setText(LanguageBundle.getString("in_rndNameMeaning"));
    nameSubInfoPanel.add(jLabel2);
    //$NON-NLS-1$
    meaning.setText(LanguageBundle.getString("in_rndNmDefault"));
    nameSubInfoPanel.add(meaning);
    nameSubInfoPanel.add(jSeparator1);
    //$NON-NLS-1$
    jLabel3.setText(LanguageBundle.getString("in_rndNmPronounciation"));
    nameSubInfoPanel.add(jLabel3);
    pronounciation.setText("nAm");
    nameSubInfoPanel.add(pronounciation);
    nameSubInfoPanel.add(jSeparator3);
    nameDisplayPanel.add(nameSubInfoPanel, BorderLayout.SOUTH);
    //$NON-NLS-1$
    JLabel nameTitleLabel = new JLabel(LanguageBundle.getString("in_sumName"));
    JPanel nameTitlePanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
    nameTitlePanel.add(nameTitleLabel);
    JPanel topPanel = new JPanel();
    topPanel.setLayout(new BoxLayout(topPanel, BoxLayout.Y_AXIS));
    namePanel.setLayout(new BoxLayout(namePanel, BoxLayout.X_AXIS));
    FontManipulation.xxlarge(name);
    //$NON-NLS-1$
    name.setText(LanguageBundle.getString("in_nameLabel"));
    namePanel.add(name);
    nameActionPanel.setLayout(new FlowLayout(FlowLayout.RIGHT));
    jButton1.setIcon(Icons.Copy16.getImageIcon());
    jButton1.setAlignmentY(0.0F);
    jButton1.setIconTextGap(0);
    jButton1.setMargin(new Insets(2, 2, 2, 2));
    jButton1.addActionListener(this::jButton1ActionPerformed);
    nameActionPanel.add(jButton1);
    namePanel.add(nameActionPanel);
    topPanel.add(genCtrlPanel);
    topPanel.add(nameTitlePanel);
    topPanel.add(namePanel);
    topPanel.add(nameDisplayPanel);
    add(topPanel, BorderLayout.NORTH);
}
Also used : JCheckBox(javax.swing.JCheckBox) JPanel(javax.swing.JPanel) FlowLayout(java.awt.FlowLayout) Insets(java.awt.Insets) JComboBox(javax.swing.JComboBox) BorderLayout(java.awt.BorderLayout) BoxLayout(javax.swing.BoxLayout) JButton(javax.swing.JButton) JLabel(javax.swing.JLabel) JTextField(javax.swing.JTextField) JSeparator(javax.swing.JSeparator)

Example 90 with JSeparator

use of javax.swing.JSeparator in project pcgen by PCGen.

the class GMGenSystem method createFileMenu.

// Create the file menu
private void createFileMenu() {
    fileMenu = new JMenu();
    newFileItem = new JMenuItem();
    openFileItem = new JMenuItem();
    fileSeparator1 = new JSeparator();
    saveFileItem = new JMenuItem();
    fileSeparator2 = new JSeparator();
    exitFileItem = new JMenuItem();
    CommonMenuText.name(fileMenu, PCGenActionMap.MNU_FILE);
    fileMenu.addMenuListener(this);
    createFileNewMenuItem();
    createFileOpenMenuItem();
    fileMenu.add(fileSeparator1);
    createFileSaveMenuItem();
    // Exit is quit on the Macintosh is in the application menu. See macOSXRegistration()
    if (!SystemUtils.IS_OS_MAC_OSX) {
        exitForMacOSX();
    }
    systemMenuBar.add(fileMenu);
}
Also used : JMenuItem(javax.swing.JMenuItem) JMenu(javax.swing.JMenu) JSeparator(javax.swing.JSeparator)

Aggregations

JSeparator (javax.swing.JSeparator)147 JPanel (javax.swing.JPanel)74 JLabel (javax.swing.JLabel)65 ActionEvent (java.awt.event.ActionEvent)44 BoxLayout (javax.swing.BoxLayout)44 JButton (javax.swing.JButton)44 JMenuItem (javax.swing.JMenuItem)38 JMenu (javax.swing.JMenu)32 GridBagConstraints (java.awt.GridBagConstraints)31 Insets (java.awt.Insets)30 ActionListener (java.awt.event.ActionListener)30 Dimension (java.awt.Dimension)24 FlowLayout (java.awt.FlowLayout)24 JScrollPane (javax.swing.JScrollPane)24 GridBagLayout (java.awt.GridBagLayout)22 JPopupMenu (javax.swing.JPopupMenu)19 BorderLayout (java.awt.BorderLayout)16 JTextField (javax.swing.JTextField)16 JCheckBox (javax.swing.JCheckBox)13 AbstractAction (javax.swing.AbstractAction)12