Search in sources :

Example 1 with BevelBorder

use of javax.swing.border.BevelBorder in project pcgen by PCGen.

the class PurchaseModeFrame method initComponents.

private void initComponents() {
    purchaseScoreMinEdit = new JTextField(3);
    purchaseScoreMaxEdit = new JTextField(3);
    statusBar = new JLabel();
    currentPurchaseMethods = new JComboBoxEx();
    currentPurchaseMethods.setAutoSort(true);
    purchaseMethodPointsEdit = new JTextField(4);
    removeMethodButton = new JButton();
    AbstractButton okButton = new JButton();
    okButton.addActionListener(e -> CustomData.writePurchaseModeConfiguration());
    jScrollPane1 = new JScrollPane();
    getContentPane().setLayout(new GridBagLayout());
    setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
    setTitle(PurchaseModeFrame.TITLE);
    addWindowListener(new WindowAdapter() {

        @Override
        public void windowClosing(WindowEvent evt) {
            exitForm();
        }
    });
    Container jPanel1 = new JPanel();
    jPanel1.setLayout(new FlowLayout(FlowLayout.LEFT, 2, 5));
    JLabel purchaseScoreMinLabel = new JLabel();
    //$NON-NLS-1$
    purchaseScoreMinLabel.setText(LanguageBundle.getString("in_Prefs_purchMin"));
    //$NON-NLS-1$
    purchaseScoreMinLabel.setToolTipText(LanguageBundle.getString("in_Prefs_purchMinTip"));
    purchaseScoreMinLabel.setPreferredSize(new Dimension(140, 15));
    jPanel1.add(purchaseScoreMinLabel);
    purchaseScoreMinEdit.setHorizontalAlignment(SwingConstants.RIGHT);
    purchaseScoreMinEdit.addActionListener(evt -> purchaseScoreMinValueActionPerformed());
    purchaseScoreMinEdit.addFocusListener(new FocusAdapter() {

        @Override
        public void focusLost(FocusEvent e) {
            purchaseScoreMinValueActionPerformed();
        }
    });
    jPanel1.add(purchaseScoreMinEdit);
    AbstractButton purchaseScoreMinIncreaseButton = new JButton();
    //$NON-NLS-1$
    purchaseScoreMinIncreaseButton.setText(LanguageBundle.getString("in_Prefs_plus"));
    //$NON-NLS-1$
    purchaseScoreMinIncreaseButton.setToolTipText(LanguageBundle.getString("in_Prefs_incMin"));
    purchaseScoreMinIncreaseButton.addActionListener(evt -> purchaseScoreMinIncreaseButtonActionPerformed());
    jPanel1.add(purchaseScoreMinIncreaseButton);
    AbstractButton purchaseScoreMinDecreaseButton = new JButton();
    //$NON-NLS-1$
    purchaseScoreMinDecreaseButton.setText(LanguageBundle.getString("in_Prefs_minus"));
    //$NON-NLS-1$
    purchaseScoreMinDecreaseButton.setToolTipText(LanguageBundle.getString("in_Prefs_decMin"));
    purchaseScoreMinDecreaseButton.addActionListener(evt -> purchaseScoreMinDecreaseButtonActionPerformed());
    jPanel1.add(purchaseScoreMinDecreaseButton);
    GridBagConstraints gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = GridBagConstraints.NORTHWEST;
    gridBagConstraints.weightx = 1.0;
    getContentPane().add(jPanel1, gridBagConstraints);
    Container jPanel2 = new JPanel();
    jPanel2.setLayout(new FlowLayout(FlowLayout.LEFT, 2, 5));
    JLabel purchaseScoreMaxLabel = new JLabel();
    //$NON-NLS-1$
    purchaseScoreMaxLabel.setText(LanguageBundle.getString("in_Prefs_purchMax"));
    //$NON-NLS-1$
    purchaseScoreMaxLabel.setToolTipText(LanguageBundle.getString("in_Prefs_purchMaxTip"));
    purchaseScoreMaxLabel.setPreferredSize(new Dimension(140, 15));
    jPanel2.add(purchaseScoreMaxLabel);
    purchaseScoreMaxEdit.setHorizontalAlignment(SwingConstants.RIGHT);
    purchaseScoreMaxEdit.addActionListener(evt -> purchaseScoreMaxValueActionPerformed());
    purchaseScoreMaxEdit.addFocusListener(new FocusAdapter() {

        @Override
        public void focusLost(FocusEvent e) {
            purchaseScoreMaxValueActionPerformed();
        }
    });
    jPanel2.add(purchaseScoreMaxEdit);
    AbstractButton purchaseScoreMaxIncreaseButton = new JButton();
    //$NON-NLS-1$
    purchaseScoreMaxIncreaseButton.setText(LanguageBundle.getString("in_Prefs_plus"));
    //$NON-NLS-1$
    purchaseScoreMaxIncreaseButton.setToolTipText(LanguageBundle.getString("in_Prefs_incMax"));
    purchaseScoreMaxIncreaseButton.addActionListener(evt -> purchaseScoreMaxIncreaseButtonActionPerformed());
    jPanel2.add(purchaseScoreMaxIncreaseButton);
    AbstractButton purchaseScoreMaxDecreaseButton = new JButton();
    //$NON-NLS-1$
    purchaseScoreMaxDecreaseButton.setText(LanguageBundle.getString("in_Prefs_minus"));
    //$NON-NLS-1$
    purchaseScoreMaxDecreaseButton.setToolTipText(LanguageBundle.getString("in_Prefs_decMax"));
    purchaseScoreMaxDecreaseButton.addActionListener(evt -> purchaseScoreMaxDecreaseButtonActionPerformed());
    jPanel2.add(purchaseScoreMaxDecreaseButton);
    GridBagConstraints bagConstraints = new GridBagConstraints();
    bagConstraints.gridx = 0;
    bagConstraints.gridy = 2;
    bagConstraints.fill = GridBagConstraints.HORIZONTAL;
    bagConstraints.anchor = GridBagConstraints.NORTHWEST;
    bagConstraints.weightx = 1.0;
    getContentPane().add(jPanel2, bagConstraints);
    JComponent purchaseMethodPanel = new JPanel();
    purchaseMethodPanel.setLayout(new GridBagLayout());
    purchaseMethodPanel.setBorder(BorderFactory.createTitledBorder(//$NON-NLS-1$
    LanguageBundle.getString("in_Prefs_allowPoints")));
    bagConstraints = new GridBagConstraints();
    bagConstraints.gridx = 0;
    bagConstraints.gridy = 3;
    bagConstraints.fill = GridBagConstraints.HORIZONTAL;
    bagConstraints.anchor = GridBagConstraints.NORTHWEST;
    bagConstraints.weightx = 1.0;
    getContentPane().add(purchaseMethodPanel, bagConstraints);
    Container purchaseMethodNamePanel = new JPanel();
    purchaseMethodNamePanel.setLayout(new FlowLayout(FlowLayout.LEFT, 2, 5));
    JLabel savedMethodLabel = new JLabel();
    //$NON-NLS-1$
    savedMethodLabel.setText(LanguageBundle.getString("in_Prefs_savedMethods"));
    savedMethodLabel.setPreferredSize(new Dimension(140, 15));
    purchaseMethodNamePanel.add(savedMethodLabel);
    purchaseMethodNamePanel.add(currentPurchaseMethods);
    bagConstraints = new GridBagConstraints();
    bagConstraints.gridx = 0;
    bagConstraints.gridy = 0;
    bagConstraints.fill = GridBagConstraints.HORIZONTAL;
    bagConstraints.anchor = GridBagConstraints.NORTHWEST;
    bagConstraints.weightx = 1.0;
    getContentPane().add(purchaseMethodNamePanel, bagConstraints);
    purchaseMethodPanel.add(purchaseMethodNamePanel, bagConstraints);
    Container purchaseMethodPointsPanel = new JPanel();
    purchaseMethodPointsPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 2, 5));
    JLabel methodPointsLabel = new JLabel();
    //$NON-NLS-1$
    methodPointsLabel.setText(LanguageBundle.getString("in_Prefs_points"));
    methodPointsLabel.setPreferredSize(new Dimension(140, 15));
    purchaseMethodPointsPanel.add(methodPointsLabel);
    purchaseMethodPointsEdit.setHorizontalAlignment(SwingConstants.RIGHT);
    purchaseMethodPointsEdit.setEditable(false);
    //purchaseMethodPointsEdit.setText("10");
    purchaseMethodPointsPanel.add(purchaseMethodPointsEdit);
    bagConstraints = new GridBagConstraints();
    bagConstraints.gridx = 0;
    bagConstraints.gridy = 1;
    bagConstraints.fill = GridBagConstraints.HORIZONTAL;
    bagConstraints.anchor = GridBagConstraints.NORTHWEST;
    bagConstraints.weightx = 1.0;
    //		getContentPane().add(purchaseMethodPointsPanel, gridBagConstraints);
    purchaseMethodPanel.add(purchaseMethodPointsPanel, bagConstraints);
    currentPurchaseMethods.setPreferredSize(new Dimension(140, 21));
    currentPurchaseMethods.addItemListener(evt -> currentPurchaseMethodsActionPerformed());
    Container purchaseMethodButtonPanel = new JPanel();
    purchaseMethodButtonPanel.setLayout(new FlowLayout(FlowLayout.RIGHT));
    AbstractButton addMethodButton = new JButton();
    //$NON-NLS-1$
    addMethodButton.setText(LanguageBundle.getString("in_Prefs_new"));
    addMethodButton.addActionListener(evt -> addMethodButtonActionPerformed());
    purchaseMethodButtonPanel.add(addMethodButton);
    //$NON-NLS-1$
    removeMethodButton.setText(LanguageBundle.getString("in_Prefs_remove"));
    removeMethodButton.addActionListener(evt -> removeMethodButtonActionPerformed());
    purchaseMethodButtonPanel.add(removeMethodButton);
    bagConstraints = new GridBagConstraints();
    bagConstraints.gridx = 0;
    bagConstraints.gridy = 2;
    bagConstraints.fill = GridBagConstraints.HORIZONTAL;
    bagConstraints.anchor = GridBagConstraints.NORTHWEST;
    bagConstraints.weightx = 1.0;
    purchaseMethodPanel.add(purchaseMethodButtonPanel, bagConstraints);
    //$NON-NLS-1$
    statusBar.setText(LanguageBundle.getString("in_Prefs_setCost"));
    statusBar.setBorder(new BevelBorder(BevelBorder.LOWERED));
    bagConstraints = new GridBagConstraints();
    bagConstraints.gridx = 0;
    bagConstraints.gridy = 6;
    bagConstraints.fill = GridBagConstraints.HORIZONTAL;
    bagConstraints.ipadx = 1;
    bagConstraints.ipady = 1;
    bagConstraints.insets = new Insets(1, 1, 1, 1);
    bagConstraints.anchor = GridBagConstraints.NORTHWEST;
    bagConstraints.weightx = 1.0;
    getContentPane().add(statusBar, bagConstraints);
    Container jPanel3 = new JPanel();
    jPanel3.setLayout(new FlowLayout(FlowLayout.RIGHT));
    //$NON-NLS-1$
    okButton.setText(LanguageBundle.getString("in_Prefs_OK"));
    //$NON-NLS-1$
    okButton.setToolTipText(LanguageBundle.getString("in_Prefs_OKTip"));
    okButton.addActionListener(evt -> okButtonActionPerformed());
    jPanel3.add(okButton);
    AbstractButton resetButton = new JButton();
    //$NON-NLS-1$
    resetButton.setText(LanguageBundle.getString("in_Prefs_Reset"));
    //$NON-NLS-1$
    resetButton.setToolTipText(LanguageBundle.getString("in_Prefs_ResetTip"));
    resetButton.addActionListener(evt -> resetButtonActionPerformed());
    jPanel3.add(resetButton);
    AbstractButton cancelButton = new JButton();
    //$NON-NLS-1$
    cancelButton.setText(LanguageBundle.getString("in_cancel"));
    //$NON-NLS-1$
    cancelButton.setToolTipText(LanguageBundle.getString("in_Prefs_CancelTip"));
    cancelButton.addActionListener(evt -> cancelButtonActionPerformed());
    jPanel3.add(cancelButton);
    /////////////////////////////////////////////////
    bagConstraints = new GridBagConstraints();
    bagConstraints.gridx = 0;
    bagConstraints.gridy = 5;
    bagConstraints.fill = GridBagConstraints.HORIZONTAL;
    bagConstraints.anchor = GridBagConstraints.EAST;
    bagConstraints.weightx = 1.0;
    getContentPane().add(jPanel3, bagConstraints);
    jScrollPane1.setViewportBorder(new BevelBorder(BevelBorder.LOWERED));
    jScrollPane1.setPreferredSize(new Dimension(100, 200));
    purchaseModel = new PurchaseModel();
    renewAbilityScoreCostTable();
    bagConstraints = new GridBagConstraints();
    bagConstraints.gridx = 0;
    bagConstraints.gridy = 0;
    bagConstraints.fill = GridBagConstraints.BOTH;
    bagConstraints.anchor = GridBagConstraints.NORTHWEST;
    bagConstraints.weightx = 1.0;
    bagConstraints.weighty = 1.0;
    getContentPane().add(jScrollPane1, bagConstraints);
    pack();
    initializeCurrentPurchaseMethods();
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) FocusAdapter(java.awt.event.FocusAdapter) GridBagConstraints(java.awt.GridBagConstraints) AbstractButton(javax.swing.AbstractButton) FlowLayout(java.awt.FlowLayout) Insets(java.awt.Insets) GridBagLayout(java.awt.GridBagLayout) BevelBorder(javax.swing.border.BevelBorder) JButton(javax.swing.JButton) JComponent(javax.swing.JComponent) JLabel(javax.swing.JLabel) WindowAdapter(java.awt.event.WindowAdapter) Dimension(java.awt.Dimension) JTextField(javax.swing.JTextField) FocusEvent(java.awt.event.FocusEvent) Container(java.awt.Container) WindowEvent(java.awt.event.WindowEvent) JComboBoxEx(pcgen.gui2.util.JComboBoxEx)

Example 2 with BevelBorder

use of javax.swing.border.BevelBorder in project JMRI by JMRI.

the class TwoPaneTBWindow method addMainStatusBar.

protected void addMainStatusBar() {
    statusBar.setLayout(new FlowLayout(FlowLayout.LEFT, 2, 0));
    statusBar.setBorder(new BevelBorder(BevelBorder.LOWERED));
    statusBox = Box.createHorizontalBox();
    statusBox.add(Box.createHorizontalGlue());
    statusBar.add(statusBox);
    add(statusBar, BorderLayout.SOUTH);
}
Also used : FlowLayout(java.awt.FlowLayout) BevelBorder(javax.swing.border.BevelBorder)

Example 3 with BevelBorder

use of javax.swing.border.BevelBorder in project pdfbox by apache.

the class PDFDebugger method initComponents.

/**
 * This method is called from within the constructor to initialize the form.
 */
private void initComponents() {
    jSplitPane1 = new javax.swing.JSplitPane();
    jScrollPane1 = new JScrollPane();
    tree = new Tree(this);
    jScrollPane2 = new JScrollPane();
    jTextPane1 = new javax.swing.JTextPane();
    tree.setCellRenderer(new PDFTreeCellRenderer());
    tree.setModel(null);
    setTitle("Apache PDFBox Debugger");
    addWindowListener(new java.awt.event.WindowAdapter() {

        @Override
        public void windowOpened(WindowEvent windowEvent) {
            tree.requestFocusInWindow();
            super.windowOpened(windowEvent);
        }

        @Override
        public void windowClosing(WindowEvent evt) {
            exitForm(evt);
        }
    });
    jScrollPane1.setBorder(new BevelBorder(BevelBorder.RAISED));
    jScrollPane1.setPreferredSize(new Dimension(350, 500));
    tree.addTreeSelectionListener(new TreeSelectionListener() {

        @Override
        public void valueChanged(TreeSelectionEvent evt) {
            jTree1ValueChanged(evt);
        }
    });
    jScrollPane1.setViewportView(tree);
    jSplitPane1.setRightComponent(jScrollPane2);
    jSplitPane1.setDividerSize(3);
    jScrollPane2.setPreferredSize(new Dimension(300, 500));
    jScrollPane2.setViewportView(jTextPane1);
    jSplitPane1.setLeftComponent(jScrollPane1);
    JScrollPane documentScroller = new JScrollPane();
    documentScroller.setViewportView(documentPanel);
    statusPane = new TreeStatusPane(tree);
    statusPane.getPanel().setBorder(new BevelBorder(BevelBorder.RAISED));
    statusPane.getPanel().setPreferredSize(new Dimension(300, 25));
    getContentPane().add(statusPane.getPanel(), BorderLayout.PAGE_START);
    getContentPane().add(jSplitPane1, BorderLayout.CENTER);
    statusBar = new ReaderBottomPanel();
    getContentPane().add(statusBar, BorderLayout.SOUTH);
    // create menus
    JMenuBar menuBar = new JMenuBar();
    menuBar.add(createFileMenu());
    menuBar.add(createEditMenu());
    ViewMenu viewMenu = ViewMenu.getInstance(this);
    menuBar.add(viewMenu.getMenu());
    setJMenuBar(menuBar);
    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    int width = 1000;
    int height = 970;
    setBounds((screenSize.width - width) / 2, (screenSize.height - height) / 2, width, height);
    // drag and drop to open files
    setTransferHandler(new TransferHandler() {

        @Override
        public boolean canImport(TransferSupport transferSupport) {
            return transferSupport.isDataFlavorSupported(DataFlavor.javaFileListFlavor);
        }

        @Override
        @SuppressWarnings("unchecked")
        public boolean importData(TransferSupport transferSupport) {
            try {
                Transferable transferable = transferSupport.getTransferable();
                List<File> files = (List<File>) transferable.getTransferData(DataFlavor.javaFileListFlavor);
                readPDFFile(files.get(0), "");
                return true;
            } catch (IOException e) {
                new ErrorDialog(e).setVisible(true);
                return true;
            } catch (UnsupportedFlavorException e) {
                throw new RuntimeException(e);
            }
        }
    });
    // Mac OS X file open/quit handler
    if (IS_MAC_OS && !isMinJdk9()) {
        // TODO this needs to be rewritten for JDK9, see PDFBOX-4013
        try {
            Method osxOpenFiles = getClass().getDeclaredMethod("osxOpenFiles", String.class);
            osxOpenFiles.setAccessible(true);
            OSXAdapter.setFileHandler(this, osxOpenFiles);
            Method osxQuit = getClass().getDeclaredMethod("osxQuit");
            osxQuit.setAccessible(true);
            OSXAdapter.setQuitHandler(this, osxQuit);
        } catch (NoSuchMethodException e) {
            throw new RuntimeException(e);
        }
    }
}
Also used : BevelBorder(javax.swing.border.BevelBorder) TreeSelectionListener(javax.swing.event.TreeSelectionListener) TreeStatusPane(org.apache.pdfbox.debugger.treestatus.TreeStatusPane) PDFTreeCellRenderer(org.apache.pdfbox.debugger.ui.PDFTreeCellRenderer) Tree(org.apache.pdfbox.debugger.ui.Tree) ViewMenu(org.apache.pdfbox.debugger.ui.ViewMenu) List(java.util.List) JScrollPane(javax.swing.JScrollPane) Transferable(java.awt.datatransfer.Transferable) ErrorDialog(org.apache.pdfbox.debugger.ui.ErrorDialog) Dimension(java.awt.Dimension) IOException(java.io.IOException) Method(java.lang.reflect.Method) UnsupportedFlavorException(java.awt.datatransfer.UnsupportedFlavorException) WindowEvent(java.awt.event.WindowEvent) TransferHandler(javax.swing.TransferHandler) TreeSelectionEvent(javax.swing.event.TreeSelectionEvent) ReaderBottomPanel(org.apache.pdfbox.debugger.ui.ReaderBottomPanel) File(java.io.File) JMenuBar(javax.swing.JMenuBar)

Example 4 with BevelBorder

use of javax.swing.border.BevelBorder in project pdfbox by apache.

the class CSSeparation method setColorBarBorder.

/**
 * Set a little border around colorbar. color of the border is the darkest of the colorant.
 */
private void setColorBarBorder() {
    try {
        float[] rgbValues = separation.toRGB(new float[] { 1 });
        Color darkest = new Color(rgbValues[0], rgbValues[1], rgbValues[2]);
        colorBar.setBorder(new BevelBorder(BevelBorder.LOWERED, darkest, darkest));
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
}
Also used : BevelBorder(javax.swing.border.BevelBorder) Color(java.awt.Color) IOException(java.io.IOException)

Example 5 with BevelBorder

use of javax.swing.border.BevelBorder in project pdfbox by apache.

the class TreeStatusPane method init.

private void init() {
    panel = new JPanel(new BorderLayout());
    statusField = new JTextField();
    statusField.setEditable(false);
    panel.add(statusField);
    defaultBorder = new BevelBorder(BevelBorder.LOWERED);
    errorBorder = new BevelBorder(BevelBorder.LOWERED, Color.RED, Color.RED);
    statusField.setAction(textInputAction);
    tree.addTreeSelectionListener(this);
}
Also used : JPanel(javax.swing.JPanel) BorderLayout(java.awt.BorderLayout) BevelBorder(javax.swing.border.BevelBorder) JTextField(javax.swing.JTextField)

Aggregations

BevelBorder (javax.swing.border.BevelBorder)18 Dimension (java.awt.Dimension)5 JLabel (javax.swing.JLabel)5 JPanel (javax.swing.JPanel)4 FlowLayout (java.awt.FlowLayout)3 JButton (javax.swing.JButton)3 JScrollPane (javax.swing.JScrollPane)3 JTable (javax.swing.JTable)3 BorderLayout (java.awt.BorderLayout)2 Insets (java.awt.Insets)2 ActionEvent (java.awt.event.ActionEvent)2 WindowEvent (java.awt.event.WindowEvent)2 IOException (java.io.IOException)2 JComponent (javax.swing.JComponent)2 JMenuBar (javax.swing.JMenuBar)2 JTextField (javax.swing.JTextField)2 Method (artisynth.core.moviemaker.MovieMaker.Method)1 DruidTableModel (com.alibaba.druid.support.jconsole.model.DruidTableModel)1 GroupableTableHeader (com.alibaba.druid.support.jconsole.model.GroupableTableHeader)1 RowHeaderTable (com.alibaba.druid.support.jconsole.model.RowHeaderTable)1