Example usage for javax.swing JTabbedPane JTabbedPane

List of usage examples for javax.swing JTabbedPane JTabbedPane

Introduction

In this page you can find the example usage for javax.swing JTabbedPane JTabbedPane.

Prototype

public JTabbedPane() 

Source Link

Document

Creates an empty TabbedPane with a default tab placement of JTabbedPane.TOP.

Usage

From source file:de.ailis.xadrian.frames.MainFrame.java

/**
 * Creates the content./*from  www .  j  a v  a 2s.c o m*/
 */
private void createContent() {
    this.tabs = new JTabbedPane();
    this.tabs.setPreferredSize(new Dimension(640, 480));
    this.tabs.addChangeListener(this);
    this.tabs.setTransferHandler(this.transferHandler);

    final JPanel welcomePanel = this.welcomePanel = new JPanel();
    welcomePanel.setTransferHandler(this.transferHandler);

    welcomePanel.setLayout(new GridBagLayout());
    final GridBagConstraints c = new GridBagConstraints();

    welcomePanel.setPreferredSize(new Dimension(640, 480));
    final JPanel buttonPanel = new JPanel();
    buttonPanel.setLayout(new GridBagLayout());
    c.anchor = GridBagConstraints.CENTER;
    welcomePanel.add(buttonPanel, c);

    final JButton newButton = new JButton(this.newAction);
    newButton.setHorizontalAlignment(SwingConstants.LEFT);
    newButton.setIconTextGap(10);
    newButton.setText("<html><body><strong>" + newButton.getText() + "</strong><br />"
            + newButton.getToolTipText() + "</body></html>");
    newButton.setToolTipText(null);
    newButton.setMargin(new Insets(5, 10, 5, 10));
    c.gridy = 0;
    c.fill = GridBagConstraints.BOTH;
    c.insets.set(5, 5, 5, 5);
    buttonPanel.add(newButton, c);

    final JButton openButton = new JButton(this.openAction);
    openButton.setHorizontalAlignment(SwingConstants.LEFT);
    openButton.setIconTextGap(10);
    openButton.setText("<html><body><strong>" + openButton.getText() + "</strong><br />"
            + openButton.getToolTipText() + "</body></html>");
    openButton.setToolTipText(null);
    openButton.setMargin(new Insets(5, 10, 5, 10));
    c.gridy++;
    buttonPanel.add(openButton, c);

    final JPanel separator = new JPanel();
    separator.setPreferredSize(new Dimension(20, 20));
    c.gridy++;
    buttonPanel.add(separator, c);

    final JButton donateButton = new JButton(this.donateAction);
    donateButton.setHorizontalAlignment(SwingConstants.LEFT);
    donateButton.setIconTextGap(10);
    donateButton.setText("<html><body><strong>" + donateButton.getText() + "</strong><br />"
            + donateButton.getToolTipText() + "</body></html>");
    donateButton.setToolTipText(null);
    donateButton.setMargin(new Insets(5, 10, 5, 10));
    c.gridy++;
    buttonPanel.add(donateButton, c);

    final SocialPane socialPane = new SocialPane();
    c.insets.top = 50;
    c.gridy++;
    buttonPanel.add(socialPane, c);
    installStatusHandler(buttonPanel);

    add(welcomePanel, BorderLayout.CENTER);
}

From source file:com.moteiv.trawler.Trawler.java

public Trawler(String[] args) {
    init(args);//from  ww  w.  j  a  v  a 2s  .  c  o m
    // Install a different look and feel; specifically, the Windows look and feel
    try {
        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); //"com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
    } catch (InstantiationException e) {
    } catch (ClassNotFoundException e) {
    } catch (UnsupportedLookAndFeelException e) {
    } catch (IllegalAccessException e) {
    }
    jf = new JFrame("Trawler");
    jf.setJMenuBar(getMainMenuBar());

    g = new SparseGraph();

    layout = new FRLayout(g);
    indexer = Indexer.newIndexer(g, 0);
    //          layout.initialize(new Dimension(100, 100));
    mif = new MoteInterface(g, Trawler.GROUPID, layout);
    uartDetect = new UartDetect(mif.getMoteIF());
    Thread th = new Thread(uartDetect);
    th.start();
    pr = new myPluggableRenderer();
    vv = new VisualizationViewer(layout, pr);

    vv.init();

    vv.setPickSupport(new ShapePickSupport());
    vv.setBackground(Color.white);
    vv.setToolTipListener(new NodeTips(vv));
    myVertexShapeFunction vsf = new myVertexShapeFunction(uartDetect);
    pr.setVertexShapeFunction(vsf);
    pr.setVertexIconFunction(vsf);//new myVertexShapeFunction());
    m_vs = new VertexLabel();
    java.awt.Font f = new java.awt.Font("Arial", Font.PLAIN, 12);
    pr.setEdgeFontFunction(new ConstantEdgeFontFunction(f));
    pr.setVertexStringer(m_vs);
    m_es = new myEdgeLabel();
    pr.setEdgeStringer(m_es);
    ((AbstractEdgeShapeFunction) pr.getEdgeShapeFunction()).setControlOffsetIncrement(-50.f);
    //   pr.setVertexColorFunction(new myVertexColorFunction(Color.RED.darker().darker(), Color.RED, 500l));
    pr.setEdgeStrokeFunction(new EdgeWeightStrokeFunction());
    pr.setEdgeLabelClosenessFunction(new ConstantDirectionalEdgeValue(0.5, 0.5));
    pr.setEdgePaintFunction(new myEdgeColorFunction());

    scrollPane = new GraphZoomScrollPane(vv);
    jf.getContentPane().setLayout(new BoxLayout(jf.getContentPane(), BoxLayout.LINE_AXIS));
    JTabbedPane pane = new JTabbedPane();
    pane.addTab("Network Topology", scrollPane);
    pane.addTab("Sensor readings", createOscopePanel(mif.getMoteIF(), "ADC Readings", -33, -456, 300, 4100,
            "Time (seconds)", "ADC counts"));
    pane.addTab("Link Quality", createOscopePanel(mif.getMoteIF(), "LinkQualityPanel", -33, -15, 300, 135,
            "Time (seconds)", "Link Quality Indicator"));
    ImageIcon trawlerIcon = new ImageIcon(Trawler.class.getResource("images/trawler-icon.gif"));
    Image imageTrawler = trawlerIcon.getImage();
    jf.getContentPane().add(pane);
    controlBoxFrame = new JFrame("Vizualization Control");
    controlBoxFrame.getContentPane().add(getControls());
    controlBoxFrame.setIconImage(imageTrawler);
    controlBoxFrame.pack();
    //   jf.getContentPane().add(getControls());
    jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    layout.initialize(vv.getSize());
    layout.resize(vv.getSize());
    layout.update();

    loadPrefs();
    GraphIO.loadGraph(g, layout, mif, Trawler.NODEFILE);

    // need this mouse model to keep the mouse clicks 
    // aligned with the nodes
    DefaultModalGraphMouse gm = new DefaultModalGraphMouse();
    gm.setMode(ModalGraphMouse.Mode.PICKING);
    vv.setGraphMouse(gm);
    jf.setIconImage(imageTrawler);
    jf.pack();

    jf.show();
    controlBoxFrame.setVisible(true);
    timer = new Timer();
    timer.schedule(new UpdateTask(), 500, 500);

}

From source file:ca.uhn.hl7v2.testpanel.ui.editor.Hl7V2MessageEditorPanel.java

/**
 * Create the panel./*w  ww .ja v a 2 s . co m*/
 */
public Hl7V2MessageEditorPanel(final Controller theController) {
    setBorder(null);
    myController = theController;

    ButtonGroup encGrp = new ButtonGroup();
    setLayout(new BorderLayout(0, 0));

    mysplitPane = new JSplitPane();
    mysplitPane.setResizeWeight(0.5);
    mysplitPane.setOrientation(JSplitPane.VERTICAL_SPLIT);
    add(mysplitPane);

    mysplitPane.addPropertyChangeListener(JSplitPane.DIVIDER_LOCATION_PROPERTY, new PropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent theEvt) {
            double ratio = (double) mysplitPane.getDividerLocation() / mysplitPane.getHeight();
            ourLog.debug("Resizing split to ratio: {}", ratio);
            Prefs.getInstance().setHl7EditorSplit(ratio);
        }
    });

    EventQueue.invokeLater(new Runnable() {
        public void run() {
            mysplitPane.setDividerLocation(Prefs.getInstance().getHl7EditorSplit());
        }
    });

    messageEditorContainerPanel = new JPanel();
    messageEditorContainerPanel.setBorder(null);
    mysplitPane.setRightComponent(messageEditorContainerPanel);
    messageEditorContainerPanel.setLayout(new BorderLayout(0, 0));

    myMessageEditor = new JEditorPane();
    Highlighter h = new UnderlineHighlighter();
    myMessageEditor.setHighlighter(h);
    // myMessageEditor.setFont(Prefs.getHl7EditorFont());
    myMessageEditor.setSelectedTextColor(Color.black);

    myMessageEditor.setCaret(new EditorCaret());

    myMessageScrollPane = new JScrollPane(myMessageEditor);
    messageEditorContainerPanel.add(myMessageScrollPane);

    JToolBar toolBar = new JToolBar();
    messageEditorContainerPanel.add(toolBar, BorderLayout.NORTH);
    toolBar.setFloatable(false);
    toolBar.setRollover(true);

    myFollowToggle = new JToggleButton("Follow");
    myFollowToggle.setToolTipText("Keep the message tree (above) and the message editor (below) in sync");
    myFollowToggle.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            theController.setMessageEditorInFollowMode(myFollowToggle.isSelected());
        }
    });
    myFollowToggle.setIcon(new ImageIcon(
            Hl7V2MessageEditorPanel.class.getResource("/ca/uhn/hl7v2/testpanel/images/updown.png")));
    myFollowToggle.setSelected(theController.isMessageEditorInFollowMode());
    toolBar.add(myFollowToggle);

    myhorizontalStrut = Box.createHorizontalStrut(20);
    toolBar.add(myhorizontalStrut);

    mylabel_4 = new JLabel("Encoding");
    toolBar.add(mylabel_4);

    myRdbtnEr7 = new JRadioButton("ER7");
    myRdbtnEr7.setMargin(new Insets(1, 2, 0, 1));
    toolBar.add(myRdbtnEr7);

    myRdbtnXml = new JRadioButton("XML");
    myRdbtnXml.setMargin(new Insets(1, 5, 0, 1));
    toolBar.add(myRdbtnXml);
    encGrp.add(myRdbtnEr7);
    encGrp.add(myRdbtnXml);

    treeContainerPanel = new JPanel();
    mysplitPane.setLeftComponent(treeContainerPanel);
    treeContainerPanel.setLayout(new BorderLayout(0, 0));

    mySpinnerIconOn = new ImageIcon(
            Hl7V2MessageEditorPanel.class.getResource("/ca/uhn/hl7v2/testpanel/images/spinner.gif"));
    mySpinnerIconOff = new ImageIcon();

    myTreePanel = new Hl7V2MessageTree(theController);
    myTreePanel.setWorkingListener(new IWorkingListener() {

        public void startedWorking() {
            mySpinner.setText("");
            mySpinner.setIcon(mySpinnerIconOn);
            mySpinnerIconOn.setImageObserver(mySpinner);
        }

        public void finishedWorking(String theStatus) {
            mySpinner.setText(theStatus);

            mySpinner.setIcon(mySpinnerIconOff);
            mySpinnerIconOn.setImageObserver(null);
        }
    });
    myTreeScrollPane = new JScrollPane(myTreePanel);

    myTopTabBar = new JTabbedPane();
    treeContainerPanel.add(myTopTabBar);
    myTopTabBar.setBorder(null);

    JPanel treeContainer = new JPanel();
    treeContainer.setLayout(new BorderLayout(0, 0));
    treeContainer.add(myTreeScrollPane);

    myTopTabBar.add("Message Tree", treeContainer);

    mytoolBar_1 = new JToolBar();
    mytoolBar_1.setFloatable(false);
    treeContainer.add(mytoolBar_1, BorderLayout.NORTH);

    mylabel_3 = new JLabel("Show");
    mytoolBar_1.add(mylabel_3);

    myShowCombo = new JComboBox();
    mytoolBar_1.add(myShowCombo);
    myShowCombo.setPreferredSize(new Dimension(130, 27));
    myShowCombo.setMinimumSize(new Dimension(130, 27));
    myShowCombo.setMaximumSize(new Dimension(130, 32767));

    collapseAllButton = new JButton();
    collapseAllButton.setBorderPainted(false);
    collapseAllButton.addMouseListener(new HoverButtonMouseAdapter(collapseAllButton));
    collapseAllButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            myTreePanel.collapseAll();
        }
    });
    collapseAllButton.setToolTipText("Collapse All");
    collapseAllButton.setIcon(new ImageIcon(
            Hl7V2MessageEditorPanel.class.getResource("/ca/uhn/hl7v2/testpanel/images/collapse_all.png")));
    mytoolBar_1.add(collapseAllButton);

    expandAllButton = new JButton();
    expandAllButton.setBorderPainted(false);
    expandAllButton.addMouseListener(new HoverButtonMouseAdapter(expandAllButton));
    expandAllButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            myTreePanel.expandAll();
        }
    });
    expandAllButton.setToolTipText("Expand All");
    expandAllButton.setIcon(new ImageIcon(
            Hl7V2MessageEditorPanel.class.getResource("/ca/uhn/hl7v2/testpanel/images/expand_all.png")));
    mytoolBar_1.add(expandAllButton);

    myhorizontalGlue = Box.createHorizontalGlue();
    mytoolBar_1.add(myhorizontalGlue);

    mySpinner = new JButton("");
    mySpinner.setForeground(Color.DARK_GRAY);
    mySpinner.setHorizontalAlignment(SwingConstants.RIGHT);
    mySpinner.setMaximumSize(new Dimension(200, 15));
    mySpinner.setPreferredSize(new Dimension(200, 15));
    mySpinner.setMinimumSize(new Dimension(200, 15));
    mySpinner.setBorderPainted(false);
    mySpinner.setSize(new Dimension(16, 16));
    mytoolBar_1.add(mySpinner);
    myProfileComboboxModel = new ProfileComboModel();

    myTablesComboModel = new TablesComboModel(myController);

    mytoolBar = new JToolBar();
    mytoolBar.setFloatable(false);
    mytoolBar.setRollover(true);
    treeContainerPanel.add(mytoolBar, BorderLayout.NORTH);

    myOutboundInterfaceCombo = new JComboBox();
    myOutboundInterfaceComboModel = new DefaultComboBoxModel();

    mylabel_1 = new JLabel("Send");
    mytoolBar.add(mylabel_1);
    myOutboundInterfaceCombo.setModel(myOutboundInterfaceComboModel);
    myOutboundInterfaceCombo.setMaximumSize(new Dimension(200, 32767));
    mytoolBar.add(myOutboundInterfaceCombo);

    mySendButton = new JButton("Send");
    mySendButton.addMouseListener(new HoverButtonMouseAdapter(mySendButton));
    mySendButton.setBorderPainted(false);
    mySendButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            // int selectedIndex =
            // myOutboundInterfaceComboModel.getIndexOf(myOutboundInterfaceComboModel.getSelectedItem());
            int selectedIndex = myOutboundInterfaceCombo.getSelectedIndex();
            OutboundConnection connection = myController.getOutboundConnectionList().getConnections()
                    .get(selectedIndex);
            activateSendingActivityTabForConnection(connection);
            myController.sendMessages(connection, myMessage,
                    mySendingActivityTable.provideTransmissionCallback());
        }
    });

    myhorizontalStrut_2 = Box.createHorizontalStrut(20);
    myhorizontalStrut_2.setPreferredSize(new Dimension(2, 0));
    myhorizontalStrut_2.setMinimumSize(new Dimension(2, 0));
    myhorizontalStrut_2.setMaximumSize(new Dimension(2, 32767));
    mytoolBar.add(myhorizontalStrut_2);

    mySendOptionsButton = new JButton("Options");
    mySendOptionsButton.setBorderPainted(false);
    final HoverButtonMouseAdapter sendOptionsHoverAdaptor = new HoverButtonMouseAdapter(mySendOptionsButton);
    mySendOptionsButton.addMouseListener(sendOptionsHoverAdaptor);
    mySendOptionsButton.setIcon(new ImageIcon(
            Hl7V2MessageEditorPanel.class.getResource("/ca/uhn/hl7v2/testpanel/images/sendoptions.png")));
    mytoolBar.add(mySendOptionsButton);
    mySendOptionsButton.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent theE) {
            if (mySendOptionsPopupDialog != null) {
                mySendOptionsPopupDialog.doHide();
                mySendOptionsPopupDialog = null;
                return;
            }
            mySendOptionsPopupDialog = new SendOptionsPopupDialog(Hl7V2MessageEditorPanel.this, myMessage,
                    mySendOptionsButton, sendOptionsHoverAdaptor);
            Point los = mySendOptionsButton.getLocationOnScreen();
            mySendOptionsPopupDialog.setLocation(los.x, los.y + mySendOptionsButton.getHeight());
            mySendOptionsPopupDialog.setVisible(true);
        }
    });

    mySendButton.setIcon(new ImageIcon(
            Hl7V2MessageEditorPanel.class.getResource("/ca/uhn/hl7v2/testpanel/images/button_execute.png")));
    mytoolBar.add(mySendButton);

    myhorizontalStrut_1 = Box.createHorizontalStrut(20);
    mytoolBar.add(myhorizontalStrut_1);

    mylabel_2 = new JLabel("Validate");
    mytoolBar.add(mylabel_2);

    myProfileCombobox = new JComboBox();
    mytoolBar.add(myProfileCombobox);
    myProfileCombobox.setPreferredSize(new Dimension(200, 27));
    myProfileCombobox.setMinimumSize(new Dimension(200, 27));
    myProfileCombobox.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            if (myHandlingProfileComboboxChange) {
                return;
            }

            myHandlingProfileComboboxChange = true;
            try {
                if (myProfileCombobox.getSelectedIndex() == 0) {
                    myMessage.setValidationContext(null);
                } else if (myProfileCombobox.getSelectedIndex() == 1) {
                    myMessage.setValidationContext(new DefaultValidation());
                } else if (myProfileCombobox.getSelectedIndex() > 0) {
                    ProfileGroup profile = myProfileComboboxModel.myProfileGroups
                            .get(myProfileCombobox.getSelectedIndex());
                    myMessage.setRuntimeProfile(profile);

                    // } else if (myProfileCombobox.getSelectedItem() ==
                    // ProfileComboModel.APPLY_CONFORMANCE_PROFILE) {
                    // IOkCancelCallback<Void> callback = new
                    // IOkCancelCallback<Void>() {
                    // public void ok(Void theArg) {
                    // myProfileComboboxModel.update();
                    // }
                    //
                    // public void cancel(Void theArg) {
                    // myProfileCombobox.setSelectedIndex(0);
                    // }
                    // };
                    // myController.chooseAndLoadConformanceProfileForMessage(myMessage,
                    // callback);
                }
            } catch (ProfileException e2) {
                ourLog.error("Failed to load profile", e2);
            } finally {
                myHandlingProfileComboboxChange = false;
            }
        }
    });
    myProfileCombobox.setMaximumSize(new Dimension(300, 32767));
    myProfileCombobox.setModel(myProfileComboboxModel);

    myhorizontalStrut_4 = Box.createHorizontalStrut(20);
    myhorizontalStrut_4.setPreferredSize(new Dimension(2, 0));
    myhorizontalStrut_4.setMinimumSize(new Dimension(2, 0));
    myhorizontalStrut_4.setMaximumSize(new Dimension(2, 32767));
    mytoolBar.add(myhorizontalStrut_4);

    // mySendingPanel = new JPanel();
    // mySendingPanel.setBorder(null);
    // myTopTabBar.addTab("Sending", null, mySendingPanel, null);
    // mySendingPanel.setLayout(new BorderLayout(0, 0));

    mySendingActivityTable = new ActivityTable();
    mySendingActivityTable.setController(myController);
    myTopTabBar.addTab("Sending", null, mySendingActivityTable, null);

    // mySendingPanelScrollPanel = new JScrollPane();
    // mySendingPanelScrollPanel.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
    // mySendingPanelScrollPanel.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
    // mySendingPanelScrollPanel.setColumnHeaderView(mySendingActivityTable);
    //
    // mySendingPanel.add(mySendingPanelScrollPanel, BorderLayout.CENTER);

    bottomPanel = new JPanel();
    bottomPanel.setPreferredSize(new Dimension(10, 20));
    bottomPanel.setMinimumSize(new Dimension(10, 20));
    add(bottomPanel, BorderLayout.SOUTH);
    GridBagLayout gbl_bottomPanel = new GridBagLayout();
    gbl_bottomPanel.columnWidths = new int[] { 98, 74, 0 };
    gbl_bottomPanel.rowHeights = new int[] { 16, 0 };
    gbl_bottomPanel.columnWeights = new double[] { 0.0, 1.0, Double.MIN_VALUE };
    gbl_bottomPanel.rowWeights = new double[] { 0.0, Double.MIN_VALUE };
    bottomPanel.setLayout(gbl_bottomPanel);

    mylabel = new JLabel("Terser Path:");
    mylabel.setHorizontalTextPosition(SwingConstants.LEFT);
    mylabel.setHorizontalAlignment(SwingConstants.LEFT);
    GridBagConstraints gbc_label = new GridBagConstraints();
    gbc_label.fill = GridBagConstraints.VERTICAL;
    gbc_label.weighty = 1.0;
    gbc_label.anchor = GridBagConstraints.NORTHWEST;
    gbc_label.gridx = 0;
    gbc_label.gridy = 0;
    bottomPanel.add(mylabel, gbc_label);

    myTerserPathTextField = new JLabel();
    myTerserPathTextField.setForeground(Color.BLUE);
    myTerserPathTextField.setFont(new Font("Lucida Console", Font.PLAIN, 13));
    myTerserPathTextField.setBorder(null);
    myTerserPathTextField.setBackground(SystemColor.control);
    myTerserPathTextField.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseClicked(MouseEvent e) {
            if (StringUtils.isNotEmpty(myTerserPathTextField.getText())) {
                myTerserPathPopupMenu.show(myTerserPathTextField, 0, 0);
            }
        }
    });

    GridBagConstraints gbc_TerserPathTextField = new GridBagConstraints();
    gbc_TerserPathTextField.weightx = 1.0;
    gbc_TerserPathTextField.fill = GridBagConstraints.HORIZONTAL;
    gbc_TerserPathTextField.gridx = 1;
    gbc_TerserPathTextField.gridy = 0;
    bottomPanel.add(myTerserPathTextField, gbc_TerserPathTextField);

    initLocal();

}

From source file:net.sf.firemox.DeckBuilder.java

/**
 * Creates new form DeckBuilder//from w w  w .  j  av  a 2  s.  co  m
 */
private DeckBuilder() {
    super("DeckBuilder");
    form = this;
    timerPanel = new TimerGlassPane();
    cardLoader = new CardLoader(timerPanel);
    timer = new Timer(200, cardLoader);
    setGlassPane(timerPanel);
    try {
        setIconImage(Picture.loadImage(IdConst.IMAGES_DIR + "deckbuilder.gif"));
    } catch (Exception e) {
        // IGNORING
    }

    // Load settings
    loadSettings();

    // Initialize components
    final JMenuItem newItem = UIHelper.buildMenu("menu_db_new", 'n', this);
    newItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, InputEvent.CTRL_MASK));

    final JMenuItem loadItem = UIHelper.buildMenu("menu_db_load", 'o', this);
    loadItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, InputEvent.CTRL_MASK));

    final JMenuItem saveAsItem = UIHelper.buildMenu("menu_db_saveas", 'a', this);
    saveAsItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F12, 0));

    final JMenuItem saveItem = UIHelper.buildMenu("menu_db_save", 's', this);
    saveItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, InputEvent.CTRL_MASK));

    final JMenuItem quitItem = UIHelper.buildMenu("menu_db_exit", this);
    quitItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F4, InputEvent.ALT_MASK));

    final JMenuItem deckConstraintsItem = UIHelper.buildMenu("menu_db_constraints", 'c', this);
    deckConstraintsItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F3, 0));

    final JMenuItem aboutItem = UIHelper.buildMenu("menu_help_about", 'a', this);
    aboutItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F1, InputEvent.SHIFT_MASK));

    final JMenuItem convertDCK = UIHelper.buildMenu("menu_convert_DCK_MP", this);

    final JMenu mainMenu = UIHelper.buildMenu("menu_file");
    mainMenu.add(newItem);
    mainMenu.add(loadItem);
    mainMenu.add(saveAsItem);
    mainMenu.add(saveItem);
    mainMenu.add(new JSeparator());
    mainMenu.add(quitItem);

    super.optionMenu = new JMenu("Options");

    final JMenu convertMenu = UIHelper.buildMenu("menu_convert");
    convertMenu.add(convertDCK);

    final JMenuItem helpItem = UIHelper.buildMenu("menu_help_help", 'h', this);
    helpItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F1, 0));

    final JMenu helpMenu = new JMenu("?");
    helpMenu.add(helpItem);
    helpMenu.add(deckConstraintsItem);
    helpMenu.add(aboutItem);

    final JMenuBar menuBar = new JMenuBar();
    menuBar.add(mainMenu);
    initAbstractMenu();
    menuBar.add(optionMenu);
    menuBar.add(convertMenu);
    menuBar.add(helpMenu);
    setJMenuBar(menuBar);
    addWindowListener(this);

    // Build the panel containing amount of available cards
    final JLabel amountLeft = new JLabel("<html>0/?", SwingConstants.RIGHT);

    // Build the left list
    allListModel = new MListModel<MCardCompare>(amountLeft, false);
    leftList = new ThreadSafeJList(allListModel);
    leftList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    leftList.setLayoutOrientation(JList.VERTICAL);
    leftList.getSelectionModel().addListSelectionListener(this);
    leftList.addMouseListener(this);
    leftList.setVisibleRowCount(10);

    // Initialize the text field containing the amount to add
    addQtyTxt = new JTextField("1");

    // Build the "Add" button
    addButton = new JButton(LanguageManager.getString("db_add"));
    addButton.setMnemonic('a');
    addButton.setEnabled(false);

    // Build the panel containing : "Add" amount and "Add" button
    final Box addPanel = Box.createHorizontalBox();
    addPanel.add(addButton);
    addPanel.add(addQtyTxt);
    addPanel.setMaximumSize(new Dimension(32010, 26));

    // Build the panel containing the selected card name
    cardNameTxt = new JTextField();
    new HireListener(cardNameTxt, addButton, this, leftList);

    final JLabel searchLabel = new JLabel(LanguageManager.getString("db_search") + " : ");
    searchLabel.setLabelFor(cardNameTxt);

    // Build the panel containing search label and card name text field
    final Box searchPanel = Box.createHorizontalBox();
    searchPanel.add(searchLabel);
    searchPanel.add(cardNameTxt);
    searchPanel.setMaximumSize(new Dimension(32010, 26));

    listScrollerLeft = new JScrollPane(leftList);
    MToolKit.addOverlay(listScrollerLeft);

    // Build the left panel containing : list, available amount, "Add" panel
    final JPanel srcPanel = new JPanel(null);
    srcPanel.add(searchPanel);
    srcPanel.add(listScrollerLeft);
    srcPanel.add(amountLeft);
    srcPanel.add(addPanel);
    srcPanel.setMinimumSize(new Dimension(220, 200));
    srcPanel.setLayout(new BoxLayout(srcPanel, BoxLayout.Y_AXIS));

    // Initialize constraints
    constraintsChecker = new ConstraintsChecker();
    constraintsChecker.setBorder(new EtchedBorder());
    final JScrollPane constraintsCheckerScroll = new JScrollPane(constraintsChecker);
    MToolKit.addOverlay(constraintsCheckerScroll);

    // create a pane with the oracle text for the present card
    oracleText = new JLabel();
    oracleText.setPreferredSize(new Dimension(180, 200));
    oracleText.setVerticalAlignment(SwingConstants.TOP);

    final JScrollPane oracle = new JScrollPane(oracleText, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
            ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
    MToolKit.addOverlay(oracle);

    // build some Pie Charts and a panel to display it
    initSets();
    datasets = new ChartSets();
    final JTabbedPane tabbedPane = new JTabbedPane();
    for (ChartFilter filter : ChartFilter.values()) {
        final Dataset dataSet = filter.createDataSet(this);
        final JFreeChart chart = new JFreeChart(null, null,
                filter.createPlot(dataSet, painterMapper.get(filter)), false);
        datasets.addDataSet(filter, dataSet);
        ChartPanel pieChartPanel = new ChartPanel(chart, true);
        tabbedPane.add(pieChartPanel, filter.getTitle());
    }
    // add the Constraints scroll panel and Oracle text Pane to the tabbedPane
    tabbedPane.add(constraintsCheckerScroll, LanguageManager.getString("db_constraints"));
    tabbedPane.add(oracle, LanguageManager.getString("db_text"));
    tabbedPane.setSelectedComponent(oracle);

    // The toollBar for color filtering
    toolBar = new JToolBar();
    toolBar.setFloatable(false);
    final JButton clearButton = UIHelper.buildButton("clear");
    clearButton.addActionListener(this);
    toolBar.add(clearButton);
    final JToggleButton toggleColorlessButton = new JToggleButton(
            UIHelper.getTbsIcon("mana/colorless/small/" + MdbLoader.unknownSmlMana), true);
    toggleColorlessButton.setActionCommand("0");
    toggleColorlessButton.addActionListener(this);
    toolBar.add(toggleColorlessButton);
    for (int index = 1; index < IdCardColors.CARD_COLOR_NAMES.length; index++) {
        final JToggleButton toggleButton = new JToggleButton(
                UIHelper.getTbsIcon("mana/colored/small/" + MdbLoader.coloredSmlManas[index]), true);
        toggleButton.setActionCommand(String.valueOf(index));
        toggleButton.addActionListener(this);
        toolBar.add(toggleButton);
    }

    // sorted card type combobox creation
    final List<String> idCards = new ArrayList<String>(Arrays.asList(CardFactory.exportedIdCardNames));
    Collections.sort(idCards);
    final Object[] cardTypes = ArrayUtils.addAll(new String[] { LanguageManager.getString("db_types.any") },
            idCards.toArray());
    idCardComboBox = new JComboBox(cardTypes);
    idCardComboBox.setSelectedIndex(0);
    idCardComboBox.addActionListener(this);
    idCardComboBox.setActionCommand("cardTypeFilter");

    // sorted card properties combobox creation
    final List<String> properties = new ArrayList<String>(
            CardFactory.getPropertiesName(DeckConstraints.getMinProperty(), DeckConstraints.getMaxProperty()));
    Collections.sort(properties);
    final Object[] cardProperties = ArrayUtils
            .addAll(new String[] { LanguageManager.getString("db_properties.any") }, properties.toArray());
    propertiesComboBox = new JComboBox(cardProperties);
    propertiesComboBox.setSelectedIndex(0);
    propertiesComboBox.addActionListener(this);
    propertiesComboBox.setActionCommand("propertyFilter");

    final JLabel colors = new JLabel(" " + LanguageManager.getString("colors") + " : ");
    final JLabel types = new JLabel(" " + LanguageManager.getString("types") + " : ");
    final JLabel property = new JLabel(" " + LanguageManager.getString("properties") + " : ");

    // filter Panel with colors toolBar and card type combobox
    final Box filterPanel = Box.createHorizontalBox();
    filterPanel.add(colors);
    filterPanel.add(toolBar);
    filterPanel.add(types);
    filterPanel.add(idCardComboBox);
    filterPanel.add(property);
    filterPanel.add(propertiesComboBox);

    getContentPane().add(filterPanel, BorderLayout.NORTH);

    // Destination section :

    // Build the panel containing amount of available cards
    final JLabel rightAmount = new JLabel("0/?", SwingConstants.RIGHT);
    rightAmount.setMaximumSize(new Dimension(220, 26));

    // Build the right list
    rightListModel = new MCardTableModel(new MListModel<MCardCompare>(rightAmount, true));
    rightListModel.addTableModelListener(this);
    rightList = new JTable(rightListModel);
    rightList.setShowGrid(false);
    rightList.setTableHeader(null);
    rightList.getSelectionModel().addListSelectionListener(this);
    rightList.getColumnModel().getColumn(0).setMaxWidth(25);
    rightList.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);

    // Build the panel containing the selected deck
    deckNameTxt = new JTextField("loading...");
    deckNameTxt.setEditable(false);
    deckNameTxt.setBorder(null);
    final JLabel deckLabel = new JLabel(LanguageManager.getString("db_deck") + " : ");
    deckLabel.setLabelFor(deckNameTxt);
    final Box deckNamePanel = Box.createHorizontalBox();
    deckNamePanel.add(deckLabel);
    deckNamePanel.add(deckNameTxt);
    deckNamePanel.setMaximumSize(new Dimension(220, 26));

    // Initialize the text field containing the amount to remove
    removeQtyTxt = new JTextField("1");

    // Build the "Remove" button
    removeButton = new JButton(LanguageManager.getString("db_remove"));
    removeButton.setMnemonic('r');
    removeButton.addMouseListener(this);
    removeButton.setEnabled(false);

    // Build the panel containing : "Remove" amount and "Remove" button
    final Box removePanel = Box.createHorizontalBox();
    removePanel.add(removeButton);
    removePanel.add(removeQtyTxt);
    removePanel.setMaximumSize(new Dimension(220, 26));

    // Build the right panel containing : list, available amount, constraints
    final JScrollPane deskListScroller = new JScrollPane(rightList);
    MToolKit.addOverlay(deskListScroller);
    deskListScroller.setBorder(BorderFactory.createLineBorder(Color.GRAY));
    deskListScroller.setMinimumSize(new Dimension(220, 200));
    deskListScroller.setMaximumSize(new Dimension(220, 32000));

    final Box destPanel = Box.createVerticalBox();
    destPanel.add(deckNamePanel);
    destPanel.add(deskListScroller);
    destPanel.add(rightAmount);
    destPanel.add(removePanel);
    destPanel.setMinimumSize(new Dimension(220, 200));
    destPanel.setMaximumSize(new Dimension(220, 32000));

    // Build the panel containing the name of card in picture
    cardPictureNameTxt = new JLabel("<html><i>no selected card</i>");
    final Box cardPictureNamePanel = Box.createHorizontalBox();
    cardPictureNamePanel.add(cardPictureNameTxt);
    cardPictureNamePanel.setMaximumSize(new Dimension(32010, 26));

    // Group the detail panels
    final JPanel viewCard = new JPanel(null);
    viewCard.add(cardPictureNamePanel);
    viewCard.add(CardView.getInstance());
    viewCard.add(tabbedPane);
    viewCard.setLayout(new BoxLayout(viewCard, BoxLayout.Y_AXIS));

    final Box mainPanel = Box.createHorizontalBox();
    mainPanel.add(destPanel);
    mainPanel.add(viewCard);

    // Add the main panel
    getContentPane().add(srcPanel, BorderLayout.WEST);
    getContentPane().add(mainPanel, BorderLayout.CENTER);

    // Size this frame
    getRootPane().setPreferredSize(new Dimension(WINDOW_WIDTH, WINDOW_HEIGHT));
    getRootPane().setMinimumSize(getRootPane().getPreferredSize());
    pack();
}

From source file:com.mirth.connect.manager.ManagerDialog.java

private void initComponents() {
    initServicePanel();/*ww  w  . j  a  va 2s . c o m*/
    initServerPanel();
    initDatabasePanel();
    initInfoPanel();

    tabPanel = new JTabbedPane();
    tabPanel.setBackground(new Color(255, 255, 255));
    tabPanel.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
    tabPanel.setFocusable(false);
    tabPanel.addTab("Service", servicePanel);
    tabPanel.addTab("Server", serverPanel);
    tabPanel.addTab("Database", databasePanel);
    tabPanel.addTab("Info", infoPanel);

    launchButton = new JButton("Administrator");
    launchButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
            launchButtonActionPerformed(evt);
        }
    });

    heapSizeButton = new JButton();
    heapSizeButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
            heapSizeButtonActionPerformed(evt);
        }
    });

    applyButton = new JButton("Apply");
    applyButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
            applyButtonActionPerformed(evt);
        }
    });

    okButton = new JButton("OK");
    okButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
            okButtonActionPerformed(evt);
        }
    });

    cancelButton = new JButton("Cancel");
    cancelButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
            cancelButtonActionPerformed(evt);
        }
    });
}

From source file:cl.almejo.vsim.gui.SimWindow.java

public SimWindow(Circuit circuit) {
    _circuit = circuit;//from   w ww . ja  v  a  2 s .  c  o  m
    _circuit.addCircuitEventListener(this);
    _canvas = new CircuitCanvas(_circuit);

    setBounds(100, 100, 800, 800);

    _displaysPane = new JTabbedPane();

    CanvasScrollPane scrollPane = new CanvasScrollPane(_canvas);
    CenterCanvasButton panel = new CenterCanvasButton();
    panel.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseClicked(MouseEvent e) {
            SimWindow.this.getCanvas().center();
        }
    });
    scrollPane.addCorner(panel);

    JSplitPane rightSplitpane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, scrollPane, _displaysPane);
    rightSplitpane.setOneTouchExpandable(true);
    rightSplitpane.setDividerLocation(600);

    JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
            new JSplitPane(JSplitPane.VERTICAL_SPLIT, getToolsPane(), new JPanel()), rightSplitpane);

    getContentPane().add(splitPane, BorderLayout.CENTER);

    JPanel statusBar = getStatusBar();
    statusBar.add(new ZoomChanger(_canvas));
    getContentPane().add(statusBar, BorderLayout.SOUTH);

    setVisible(true);

    setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
    addComponentListener(this);
    addWindowListener(this);
    _canvas.addMouseListener(this);
    _canvas.setZoom(1.0);
    _canvas.addMouseMotionListener(this);
    _canvas.resizeViewport();

    addMenu();
    addMainToolbar();
    updateActionStates();
    updateTitle();
}

From source file:com.peterbochs.instrument.InstrumentPanel.java

private void initGUI() {
    try {//ww w .j  av  a 2s  .  com
        {
            BorderLayout thisLayout = new BorderLayout();
            this.setLayout(thisLayout);
            this.setPreferredSize(new java.awt.Dimension(870, 609));
            {
                jTabbedPane1 = new JTabbedPane();
                this.add(jTabbedPane1, BorderLayout.CENTER);
                jTabbedPane1.setTabPlacement(JTabbedPane.LEFT);
                jTabbedPane1.setPreferredSize(new java.awt.Dimension(661, 419));
                {
                    jMemoryPanel = new JPanel();
                    GroupLayout jMemoryPanelLayout = new GroupLayout((JComponent) jMemoryPanel);
                    jMemoryPanel.setLayout(jMemoryPanelLayout);
                    jTabbedPane1.addTab("Memory", null, jMemoryPanel, null);
                    jTabbedPane1.addTab("Profiling", null, getJMemoryProfilingPanel(), null);
                    jTabbedPane1.addTab("Jmp", null, getJmpPanel(), null);
                    jTabbedPane1.addTab("Call graph", null, getJTabbedPane3(), null);
                    jTabbedPane1.addTab("Interrupt", null, getJPanel11(), null);
                    jMemoryPanelLayout.setVerticalGroup(jMemoryPanelLayout.createSequentialGroup()
                            .addContainerGap()
                            .addGroup(jMemoryPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                                    .addComponent(getJFromComboBox(), GroupLayout.Alignment.BASELINE,
                                            GroupLayout.PREFERRED_SIZE, 24, GroupLayout.PREFERRED_SIZE)
                                    .addComponent(getJLabel4x(), GroupLayout.Alignment.BASELINE,
                                            GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addComponent(getJLabel6(), GroupLayout.Alignment.BASELINE,
                                            GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addComponent(getJToComboBox(), GroupLayout.Alignment.BASELINE,
                                            GroupLayout.PREFERRED_SIZE, 24, GroupLayout.PREFERRED_SIZE)
                                    .addComponent(getJLabel5x(), GroupLayout.Alignment.BASELINE,
                                            GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addComponent(getJBlockSizeComboBox(), GroupLayout.Alignment.BASELINE,
                                            GroupLayout.PREFERRED_SIZE, 24, GroupLayout.PREFERRED_SIZE)
                                    .addComponent(getJLabel3(), GroupLayout.Alignment.BASELINE,
                                            GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addComponent(getJSearchTextField(), GroupLayout.Alignment.BASELINE,
                                            GroupLayout.PREFERRED_SIZE, 24, GroupLayout.PREFERRED_SIZE))
                            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(getJTabbedPane2(), 0, 224, Short.MAX_VALUE)
                            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                            .addGroup(jMemoryPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                                    .addComponent(getJLabel1(), GroupLayout.Alignment.BASELINE,
                                            GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addComponent(getJLabel2(), GroupLayout.Alignment.BASELINE,
                                            GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE,
                                            GroupLayout.PREFERRED_SIZE))
                            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                            .addGroup(jMemoryPanelLayout.createParallelGroup()
                                    .addComponent(getJHostestAddressScrollPane(), GroupLayout.Alignment.LEADING,
                                            GroupLayout.PREFERRED_SIZE, 110, GroupLayout.PREFERRED_SIZE)
                                    .addGroup(GroupLayout.Alignment.LEADING, jMemoryPanelLayout
                                            .createSequentialGroup()
                                            .addComponent(getJLabel4(), GroupLayout.PREFERRED_SIZE,
                                                    GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(getJLabel5(), GroupLayout.PREFERRED_SIZE,
                                                    GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
                                            .addGap(74)))
                            .addComponent(getJPanel1(), GroupLayout.PREFERRED_SIZE, 28,
                                    GroupLayout.PREFERRED_SIZE)
                            .addContainerGap());
                    jMemoryPanelLayout.linkSize(SwingConstants.VERTICAL,
                            new Component[] { getJSearchTextField(), getJFromComboBox(), getJToComboBox(),
                                    getJBlockSizeComboBox() });
                    jMemoryPanelLayout
                            .setHorizontalGroup(jMemoryPanelLayout.createSequentialGroup().addContainerGap()
                                    .addGroup(
                                            jMemoryPanelLayout.createParallelGroup().addGroup(jMemoryPanelLayout
                                                    .createSequentialGroup().addGroup(jMemoryPanelLayout
                                                            .createParallelGroup().addGroup(
                                                                    GroupLayout.Alignment.LEADING,
                                                                    jMemoryPanelLayout.createSequentialGroup()
                                                                            .addComponent(getJLabel3(),
                                                                                    GroupLayout.PREFERRED_SIZE,
                                                                                    70,
                                                                                    GroupLayout.PREFERRED_SIZE)
                                                                            .addComponent(getJSearchTextField(),
                                                                                    GroupLayout.PREFERRED_SIZE,
                                                                                    151,
                                                                                    GroupLayout.PREFERRED_SIZE))
                                                            .addGroup(GroupLayout.Alignment.LEADING,
                                                                    jMemoryPanelLayout.createSequentialGroup()
                                                                            .addComponent(getJLabel2(),
                                                                                    GroupLayout.PREFERRED_SIZE,
                                                                                    96,
                                                                                    GroupLayout.PREFERRED_SIZE)
                                                                            .addGap(125))
                                                            .addGroup(
                                                                    GroupLayout.Alignment.LEADING,
                                                                    jMemoryPanelLayout
                                                                            .createSequentialGroup()
                                                                            .addComponent(
                                                                                    getJPanel1(),
                                                                                    GroupLayout.PREFERRED_SIZE,
                                                                                    182,
                                                                                    GroupLayout.PREFERRED_SIZE)
                                                                            .addGap(39))
                                                            .addGroup(jMemoryPanelLayout.createSequentialGroup()
                                                                    .addPreferredGap(getJLabel2(), getJLabel4(),
                                                                            LayoutStyle.ComponentPlacement.INDENT)
                                                                    .addGroup(jMemoryPanelLayout
                                                                            .createParallelGroup()
                                                                            .addComponent(getJLabel4(),
                                                                                    GroupLayout.Alignment.LEADING,
                                                                                    GroupLayout.PREFERRED_SIZE,
                                                                                    160,
                                                                                    GroupLayout.PREFERRED_SIZE)
                                                                            .addComponent(
                                                                                    getJLabel5(),
                                                                                    GroupLayout.Alignment.LEADING,
                                                                                    GroupLayout.PREFERRED_SIZE,
                                                                                    160,
                                                                                    GroupLayout.PREFERRED_SIZE))
                                                                    .addGap(49)))
                                                    .addGroup(jMemoryPanelLayout.createParallelGroup()
                                                            .addComponent(getJHostestAddressScrollPane(),
                                                                    GroupLayout.Alignment.LEADING, 0, 498,
                                                                    Short.MAX_VALUE)
                                                            .addGroup(GroupLayout.Alignment.LEADING,
                                                                    jMemoryPanelLayout.createSequentialGroup()
                                                                            .addGroup(jMemoryPanelLayout
                                                                                    .createParallelGroup()
                                                                                    .addGroup(
                                                                                            GroupLayout.Alignment.LEADING,
                                                                                            jMemoryPanelLayout
                                                                                                    .createSequentialGroup()
                                                                                                    .addPreferredGap(
                                                                                                            getJLabel1(),
                                                                                                            getJLabel4x(),
                                                                                                            LayoutStyle.ComponentPlacement.INDENT)
                                                                                                    .addComponent(
                                                                                                            getJLabel4x(),
                                                                                                            GroupLayout.PREFERRED_SIZE,
                                                                                                            GroupLayout.PREFERRED_SIZE,
                                                                                                            GroupLayout.PREFERRED_SIZE)
                                                                                                    .addPreferredGap(
                                                                                                            LayoutStyle.ComponentPlacement.RELATED)
                                                                                                    .addComponent(
                                                                                                            getJFromComboBox(),
                                                                                                            GroupLayout.PREFERRED_SIZE,
                                                                                                            139,
                                                                                                            GroupLayout.PREFERRED_SIZE))
                                                                                    .addGroup(
                                                                                            GroupLayout.Alignment.LEADING,
                                                                                            jMemoryPanelLayout
                                                                                                    .createSequentialGroup()
                                                                                                    .addComponent(
                                                                                                            getJLabel1(),
                                                                                                            GroupLayout.PREFERRED_SIZE,
                                                                                                            112,
                                                                                                            GroupLayout.PREFERRED_SIZE)
                                                                                                    .addGap(80)))
                                                                            .addComponent(
                                                                                    getJLabel6(),
                                                                                    GroupLayout.PREFERRED_SIZE,
                                                                                    21,
                                                                                    GroupLayout.PREFERRED_SIZE)
                                                                            .addComponent(getJToComboBox(),
                                                                                    GroupLayout.PREFERRED_SIZE,
                                                                                    120,
                                                                                    GroupLayout.PREFERRED_SIZE)
                                                                            .addPreferredGap(
                                                                                    LayoutStyle.ComponentPlacement.RELATED,
                                                                                    0,
                                                                                    GroupLayout.PREFERRED_SIZE)
                                                                            .addComponent(getJLabel5x(),
                                                                                    GroupLayout.PREFERRED_SIZE,
                                                                                    69,
                                                                                    GroupLayout.PREFERRED_SIZE)
                                                                            .addComponent(
                                                                                    getJBlockSizeComboBox(),
                                                                                    GroupLayout.PREFERRED_SIZE,
                                                                                    75,
                                                                                    GroupLayout.PREFERRED_SIZE)
                                                                            .addGap(0, 9, Short.MAX_VALUE))))
                                                    .addComponent(getJTabbedPane2(),
                                                            GroupLayout.Alignment.LEADING, 0, 719,
                                                            Short.MAX_VALUE))
                                    .addContainerGap());
                    jMemoryPanelLayout.linkSize(SwingConstants.HORIZONTAL,
                            new Component[] { getJFromComboBox(), getJToComboBox() });
                }
            }
        }
    } catch (Exception e) {
        e.printStackTrace();
    }

    // ToolTipManager.sharedInstance().setInitialDelay(0);
}

From source file:br.ufrgs.enq.jcosmo.test.VLEdiagrams.java

public void biEq() throws Exception {
    JTabbedPane tabbedPane = new JTabbedPane();
    JPanel aba1 = calcEthTol();//from  w  ww .  j av  a 2s  .  co  m
    JPanel aba2 = calcMethanolMethilAcetate();
    JPanel aba3 = calcEthTolMOPAC();
    JPanel aba4 = calcMethanolMethilAcetateMOPAC();
    tabbedPane.addTab("Ethanol x Toluene, T=60C", aba1);
    tabbedPane.addTab("Ethanol x Toluene, T=60C, MOPAC", aba3);
    tabbedPane.addTab("Methanol x Methil-Acetate, T=25C", aba2);
    tabbedPane.addTab("Methanol x Methil-Acetate, T=25C, MOPAC", aba4);
    add(tabbedPane, BorderLayout.CENTER);
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    setSize(400, 500);
}

From source file:com.microsoft.alm.plugin.idea.git.ui.pullrequest.CreatePullRequestForm.java

/**
 * Method generated by IntelliJ IDEA GUI Designer
 * >>> IMPORTANT!! <<<
 * DO NOT edit this method OR call it in your code!
 *
 * @noinspection ALL/* ww  w.  j  a  v a  2s.c  o m*/
 */
private void $$$setupUI$$$() {
    createUIComponents();
    contentPanel = new JPanel();
    contentPanel.setLayout(new GridLayoutManager(9, 4, new Insets(0, 0, 0, 0), -1, -1));
    sourceBranchLabel = new JLabel();
    this.$$$loadLabelText$$$(sourceBranchLabel,
            ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin")
                    .getString("CreatePullRequestDialog.SourceBranchLabel"));
    contentPanel.add(sourceBranchLabel,
            new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
                    GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0,
                    false));
    titleLabel = new JLabel();
    this.$$$loadLabelText$$$(titleLabel, ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin")
            .getString("CreatePullRequestDialog.TitleLabel"));
    contentPanel.add(titleLabel,
            new GridConstraints(4, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
                    GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0,
                    false));
    descriptionLabel = new JLabel();
    this.$$$loadLabelText$$$(descriptionLabel,
            ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin")
                    .getString("CreatePullRequestDialog.DescriptionLabel"));
    contentPanel.add(descriptionLabel,
            new GridConstraints(6, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
                    GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0,
                    false));
    titleTextField = new JTextField();
    contentPanel.add(titleTextField,
            new GridConstraints(5, 0, 1, 4, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL,
                    GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null,
                    new Dimension(150, -1), null, 0, false));
    targetBranchLabel = new JLabel();
    this.$$$loadLabelText$$$(targetBranchLabel,
            ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin")
                    .getString("CreatePullRequestDialog.TargetBranchLabel"));
    contentPanel.add(targetBranchLabel,
            new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
                    GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0,
                    false));
    contentPanel.add(targetBranchDropdown,
            new GridConstraints(2, 0, 1, 4, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL,
                    GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0,
                    false));
    sourceBranch = new JLabel();
    sourceBranch.setText("");
    contentPanel.add(sourceBranch,
            new GridConstraints(0, 1, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
                    GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0,
                    false));
    splitPane = new JSplitPane();
    splitPane.setOrientation(0);
    contentPanel.add(splitPane,
            new GridConstraints(7, 0, 1, 4, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null,
                    new Dimension(200, 200), null, 0, false));
    descriptionScrollPane = new JScrollPane();
    splitPane.setLeftComponent(descriptionScrollPane);
    descriptionTextArea = new JTextArea();
    descriptionTextArea.setLineWrap(true);
    descriptionTextArea.setWrapStyleWord(true);
    descriptionScrollPane.setViewportView(descriptionTextArea);
    final JPanel panel1 = new JPanel();
    panel1.setLayout(new GridLayoutManager(2, 1, new Insets(0, 0, 0, 0), -1, -1));
    splitPane.setRightComponent(panel1);
    quickDiffPane = new JTabbedPane();
    panel1.add(quickDiffPane,
            new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null,
                    new Dimension(200, 200), null, 0, false));
    spinnerPanel = new JPanel();
    spinnerPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 5));
    panel1.add(spinnerPanel,
            new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, 1, null, null,
                    null, 0, false));
    spinner = new BusySpinnerPanel();
    spinnerPanel.add(spinner);
    loadingLabel = new JLabel();
    this.$$$loadLabelText$$$(loadingLabel, ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin")
            .getString("CreatePullRequestDialog.LoadingDiffLabel"));
    spinnerPanel.add(loadingLabel);
}

From source file:com.mirth.connect.client.ui.editors.filter.FilterPane.java

/**
 * This method is called from within the constructor to initialize the form.
 *///  w  w  w.j a v a 2 s  .co m
public void initComponents() {

    // the available panels (cards)
    rulePanel = new BasePanel();
    blankPanel = new BasePanel();

    scriptTextArea = new MirthRTextScrollPane(null, true, SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT, false);
    scriptTextArea.setBackground(new Color(204, 204, 204));
    scriptTextArea.setBorder(BorderFactory.createEtchedBorder());
    scriptTextArea.getTextArea().setEditable(false);
    scriptTextArea.getTextArea().setDropTarget(null);

    generatedScriptPanel = new JPanel();
    generatedScriptPanel.setBackground(Color.white);
    generatedScriptPanel.setLayout(new CardLayout());
    generatedScriptPanel.add(scriptTextArea, "");

    tabbedPane = new JTabbedPane();
    tabbedPane.addTab("Rule", rulePanel);

    tabbedPane.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseClicked(MouseEvent e) {
            switchTab = (lastSelectedIndex == 0 && tabbedPane.getSelectedIndex() == 1) ? true : false;
            updateCodePanel(null);
        }
    });

    for (FilterRulePlugin filterRulePlugin : LoadedExtensions.getInstance().getFilterRulePlugins().values()) {
        filterRulePlugin.initialize(this);
    }

    // establish the cards to use in the Transformer
    rulePanel.addCard(blankPanel, BLANK_TYPE);
    for (FilterRulePlugin plugin : LoadedExtensions.getInstance().getFilterRulePlugins().values()) {
        rulePanel.addCard(plugin.getPanel(), plugin.getPluginPointName());
    }

    filterTablePane = new JScrollPane();

    viewTasks = new JXTaskPane();
    viewTasks.setTitle("Mirth Views");
    viewTasks.setFocusable(false);

    filterPopupMenu = new JPopupMenu();

    viewTasks.add(initActionCallback("accept", "Return back to channel.",
            ActionFactory.createBoundAction("accept", "Back to Channel", "B"),
            new ImageIcon(Frame.class.getResource("images/resultset_previous.png"))));
    parent.setNonFocusable(viewTasks);
    viewTasks.setVisible(false);
    parent.taskPaneContainer.add(viewTasks, parent.taskPaneContainer.getComponentCount() - 1);

    filterTasks = new JXTaskPane();
    filterTasks.setTitle("Filter Tasks");
    filterTasks.setFocusable(false);

    // add new rule task
    filterTasks.add(initActionCallback("addNewRule", "Add a new filter rule.",
            ActionFactory.createBoundAction("addNewRule", "Add New Rule", "N"),
            new ImageIcon(Frame.class.getResource("images/add.png"))));
    JMenuItem addNewRule = new JMenuItem("Add New Rule");
    addNewRule.setIcon(new ImageIcon(Frame.class.getResource("images/add.png")));
    addNewRule.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            addNewRule();
        }
    });
    filterPopupMenu.add(addNewRule);

    // delete rule task
    filterTasks.add(initActionCallback("deleteRule", "Delete the currently selected filter rule.",
            ActionFactory.createBoundAction("deleteRule", "Delete Rule", "X"),
            new ImageIcon(Frame.class.getResource("images/delete.png"))));
    JMenuItem deleteRule = new JMenuItem("Delete Rule");
    deleteRule.setIcon(new ImageIcon(Frame.class.getResource("images/delete.png")));
    deleteRule.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            deleteRule();
        }
    });
    filterPopupMenu.add(deleteRule);

    filterTasks.add(initActionCallback("doImport", "Import a filter from an XML file.",
            ActionFactory.createBoundAction("doImport", "Import Filter", "I"),
            new ImageIcon(Frame.class.getResource("images/report_go.png"))));
    JMenuItem importFilter = new JMenuItem("Import Filter");
    importFilter.setIcon(new ImageIcon(Frame.class.getResource("images/report_go.png")));
    importFilter.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            doImport();
        }
    });
    filterPopupMenu.add(importFilter);

    filterTasks.add(initActionCallback("doExport", "Export the filter to an XML file.",
            ActionFactory.createBoundAction("doExport", "Export Filter", "E"),
            new ImageIcon(Frame.class.getResource("images/report_disk.png"))));
    JMenuItem exportFilter = new JMenuItem("Export Filter");
    exportFilter.setIcon(new ImageIcon(Frame.class.getResource("images/report_disk.png")));
    exportFilter.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            doExport();
        }
    });
    filterPopupMenu.add(exportFilter);

    filterTasks.add(initActionCallback("doValidate", "Validate the currently viewed script.",
            ActionFactory.createBoundAction("doValidate", "Validate Script", "V"),
            new ImageIcon(Frame.class.getResource("images/accept.png"))));
    JMenuItem validateStep = new JMenuItem("Validate Script");
    validateStep.setIcon(new ImageIcon(Frame.class.getResource("images/accept.png")));
    validateStep.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            doValidate();
        }
    });
    filterPopupMenu.add(validateStep);

    // move rule up task
    filterTasks.add(initActionCallback("moveRuleUp", "Move the currently selected rule up.",
            ActionFactory.createBoundAction("moveRuleUp", "Move Rule Up", "P"),
            new ImageIcon(Frame.class.getResource("images/arrow_up.png"))));
    JMenuItem moveRuleUp = new JMenuItem("Move Rule Up");
    moveRuleUp.setIcon(new ImageIcon(Frame.class.getResource("images/arrow_up.png")));
    moveRuleUp.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            moveRuleUp();
        }
    });
    filterPopupMenu.add(moveRuleUp);

    // move rule down task
    filterTasks.add(initActionCallback("moveRuleDown", "Move the currently selected rule down.",
            ActionFactory.createBoundAction("moveRuleDown", "Move Rule Down", "D"),
            new ImageIcon(Frame.class.getResource("images/arrow_down.png"))));
    JMenuItem moveRuleDown = new JMenuItem("Move Rule Down");
    moveRuleDown.setIcon(new ImageIcon(Frame.class.getResource("images/arrow_down.png")));
    moveRuleDown.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            moveRuleDown();
        }
    });
    filterPopupMenu.add(moveRuleDown);

    // add the tasks to the taskpane, and the taskpane to the mirth client
    parent.setNonFocusable(filterTasks);
    filterTasks.setVisible(false);
    parent.taskPaneContainer.add(filterTasks, parent.taskPaneContainer.getComponentCount() - 1);

    makeFilterTable();

    // BGN LAYOUT
    filterTablePane.setBorder(BorderFactory.createEmptyBorder());
    rulePanel.setBorder(BorderFactory.createEmptyBorder());

    hSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, filterTablePane, tabbedPane);
    hSplitPane.setContinuousLayout(true);
    hSplitPane.setOneTouchExpandable(true);
    vSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, hSplitPane, refPanel);
    vSplitPane.setContinuousLayout(true);
    vSplitPane.setOneTouchExpandable(true);

    this.setLayout(new BorderLayout());
    this.add(vSplitPane, BorderLayout.CENTER);
    this.setBorder(BorderFactory.createEmptyBorder());
    vSplitPane.setBorder(BorderFactory.createEmptyBorder());
    hSplitPane.setBorder(BorderFactory.createEmptyBorder());
    resizePanes();
    // END LAYOUT

}