com.jidesoft.swing.JideBoxLayout Java Examples

The following examples show how to use com.jidesoft.swing.JideBoxLayout. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DeviceSettingDialog.java    From CXTouch with GNU General Public License v3.0 6 votes vote down vote up
private JPanel createWindowPanel() {
    JPanel pane = new JPanel();
    pane.setLayout(new JideBoxLayout(pane, JideBoxLayout.Y_AXIS, 10));
    Border outBorder= BorderFactory.createLineBorder(StyleConstants.borderColor, 1, true);
    Border inBorder = BorderFactory.createEmptyBorder(10, 10,10,10);
    pane.setBorder(BorderFactory.createCompoundBorder(outBorder, inBorder));

    //toolbar
    String toolbarLabel = stringMgr.getString("device.setting.window.toolbar.label");
    toolBarDisplayField = new JCheckBox(toolbarLabel);
    pane.add(toolBarDisplayField, JideBoxLayout.FIX);
    //navi bar
    String navibarLabel = stringMgr.getString("device.setting.window.navibar.label");
    naviBarDisplayField = new JCheckBox(navibarLabel);
    pane.add(naviBarDisplayField, JideBoxLayout.FIX);
    //always top
    String alwaysTopLabel = stringMgr.getString("device.setting.window.alwaystop.label");
    alwaysTopField = new JCheckBox(alwaysTopLabel);
    pane.add(alwaysTopField, JideBoxLayout.FIX);

    return pane;
}
 
Example #2
Source File: JideSplitPaneDemo.java    From marathonv5 with Apache License 2.0 6 votes vote down vote up
private static JideSplitPane createSplitPane() {
    JTree tree = new JTree();
    JTable table = new JTable(new DefaultTableModel(10, 3));
    JList list = new JList(new Object[] { "A", "B", "C", "D", "E", "F", "G", "H", "I", }) {
        /**
         * 
         */
        private static final long serialVersionUID = 1L;

        public Dimension getPreferredScrollableViewportSize() {
            Dimension size = super.getPreferredScrollableViewportSize();
            size.width = 100;
            return size;
        }
    };

    _jideSplitPane = new JideSplitPane(JideSplitPane.HORIZONTAL_SPLIT);
    _jideSplitPane.setProportionalLayout(true);
    _jideSplitPane.add(new JScrollPane(tree), JideBoxLayout.FLEXIBLE);
    _jideSplitPane.add(new JScrollPane(table), JideBoxLayout.VARY);
    _jideSplitPane.add(new JScrollPane(list), JideBoxLayout.FLEXIBLE);
    return _jideSplitPane;
}
 
Example #3
Source File: MainFrame.java    From CXTouch with GNU General Public License v3.0 5 votes vote down vote up
private void initView() {
    JPanel content = new JPanel();
    setContentPane(content);
    content.setBorder(BorderFactory.createEmptyBorder(10, 15,10,15));
    content.setBackground(Color.WHITE);
    content.setLayout(new JideBoxLayout(content, JideBoxLayout.PAGE_AXIS, 6));

    //device list panel
    JLabel label = new JLabel(stringMgr.getString("panel.title.devicelist"));
    content.add(label, JideBoxLayout.FIX);
    Border border = BorderFactory.createLineBorder(StyleConstants.borderColor, 1, true);
    deviceListPane = new JPanel() {
        @Override
        public Dimension getPreferredSize() {
            Dimension dim = super.getPreferredSize();
            if (dim.height < 50) {
                dim.height = 50;
            }

            return dim;
        }
    };
    deviceListPane.setBorder(border);
    deviceListPane.setLayout(new JideBoxLayout(deviceListPane, JideBoxLayout.PAGE_AXIS));
    deviceOverlayable = new DefaultOverlayable(deviceListPane);
    deviceOverlayable.addOverlayComponent(createNoDevicePane());
    deviceOverlayable.setOverlayVisible(false);
    content.add(deviceOverlayable, JideBoxLayout.FIX);

    //separator
    content.add(Box.createVerticalStrut(30), JideBoxLayout.FIX);

    //information
    String infoLabel = stringMgr.getString("panel.title.info");
    content.add(new JLabel(infoLabel), JideBoxLayout.FIX);
    content.add(createInfoPane(), JideBoxLayout.FIX);
}
 
Example #4
Source File: DeviceSettingDialog.java    From CXTouch with GNU General Public License v3.0 5 votes vote down vote up
private void initView() {
    JPanel contentPane = new JPanel();
    setContentPane(new JScrollPane(contentPane));
    contentPane.setLayout(new JideBoxLayout(contentPane, JideBoxLayout.PAGE_AXIS));
    contentPane.setBorder(BorderFactory.createEmptyBorder(10, 14,10,14));
    contentPane.setBackground(Color.WHITE);
    //name panel
    JPanel namePane = new JPanel();
    Border outBorder= BorderFactory.createLineBorder(StyleConstants.borderColor, 1, true);
    Border inBorder = BorderFactory.createEmptyBorder(5, 10,5,10);
    namePane.setBorder(BorderFactory.createCompoundBorder(outBorder, inBorder));
    namePane.setLayout(new JideBoxLayout(namePane, JideBoxLayout.LINE_AXIS));
    String nameLabel = stringMgr.getString("device.setting.name.label");
    namePane.add(new JLabel(nameLabel), JideBoxLayout.FIX);
    nameField = new JTextField();
    namePane.add(nameField, JideBoxLayout.VARY);
    contentPane.add(namePane, JideBoxLayout.FIX);

    contentPane.add(Box.createVerticalStrut(30), JideBoxLayout.FIX);

    //window panel
    String windowPaneLabel = stringMgr.getString("device.setting.window.label");
    contentPane.add(new JLabel(windowPaneLabel), JideBoxLayout.FIX);
    contentPane.add(createWindowPanel(), JideBoxLayout.FIX);

    contentPane.add(Box.createVerticalStrut(30), JideBoxLayout.FIX);

    //Image quality
    String qualityLabel = stringMgr.getString("device.setting.window.quality.label");
    contentPane.add(new JLabel(qualityLabel), JideBoxLayout.FIX);
    contentPane.add(createImageQualityPanel(), JideBoxLayout.FIX);

    contentPane.add(Box.createVerticalStrut(40), JideBoxLayout.FIX);

    //button panel
    contentPane.add(createButtonPane(), JideBoxLayout.VARY);
}
 
Example #5
Source File: DeviceSettingDialog.java    From CXTouch with GNU General Public License v3.0 4 votes vote down vote up
private JPanel createImageQualityPanel() {
    JPanel pane = new JPanel();
    pane.setLayout(new JideBoxLayout(pane, JideBoxLayout.Y_AXIS, 5));
    Border outBorder= BorderFactory.createLineBorder(StyleConstants.borderColor, 1, true);
    Border inBorder = BorderFactory.createEmptyBorder(10, 10,10,10);
    pane.setBorder(BorderFactory.createCompoundBorder(outBorder, inBorder));

    //quality
    String qualityLabel = stringMgr.getString("device.setting.image.quality.label");
    pane.add(new JLabel(qualityLabel), JideBoxLayout.FIX);
    qualityField = new JComboBox<>();
    qualityField.addItem(new ItemMeta<>("20", 20));
    qualityField.addItem(new ItemMeta<>("40", 40));
    qualityField.addItem(new ItemMeta<>("60", 60));
    qualityField.addItem(new ItemMeta<>("80", 80));
    qualityField.addItem(new ItemMeta<>("100", 100));
    qualityField.setSelectedIndex(3);
    pane.add(qualityField, JideBoxLayout.FIX);

    pane.add(Box.createVerticalStrut(20), JideBoxLayout.FIX);

    //Zoom rate
    final String zoomRateLabel = stringMgr.getString("device.setting.image.zoomrate.label");
    final JLabel displaySizeLabel = new JLabel(zoomRateLabel);
    pane.add(displaySizeLabel, JideBoxLayout.FIX);
    zoomRateField = new JComboBox<>();
    zoomRateField.addItem(new ItemMeta<>("20%", 0.2f));
    zoomRateField.addItem(new ItemMeta<>("40%", 0.4f));
    zoomRateField.addItem(new ItemMeta<>("50%", 0.5f));
    zoomRateField.addItem(new ItemMeta<>("60%", 0.6f));
    zoomRateField.addItem(new ItemMeta<>("80%", 0.8f));
    zoomRateField.addItem(new ItemMeta<>("100%", 1.0f));
    zoomRateField.addItemListener(new ItemListener() {
        @Override
        public void itemStateChanged(ItemEvent e) {
            if (e.getStateChange() == ItemEvent.SELECTED) {
                float zoomRate = (Float) ((ItemMeta)zoomRateField.getSelectedItem()).getValue();
                int width = (int) (connection.getScreenHeight() * zoomRate);
                int height = (int) (connection.getScreenWidth() * zoomRate);
                String text = zoomRateLabel + "(" + width + "x" + height + ")";
                displaySizeLabel.setText(text);
            }
        }
    });
    pane.add(zoomRateField, JideBoxLayout.FIX);

    return pane;
}