Package com.jgoodies.forms.factories

Examples of com.jgoodies.forms.factories.DefaultComponentFactory$TitledSeparatorLayout


     *
     * @return the factory that is used as default for new builder instances
     */
    public static ComponentFactory2 getDefaultComponentFactory() {
        if (defaultComponentFactory == null) {
            defaultComponentFactory = new DefaultComponentFactory();
        }
        return defaultComponentFactory;
    }
View Full Code Here


  private void updateLoginFields() {
    completeHandler.update();
  }

  private void initComponents() {
    DefaultComponentFactory compFactory = DefaultComponentFactory.getInstance();
    separator1 = compFactory.createSeparator("Database Connection Properties");
    label1 = new JLabel();
    urlField = new JTextField();
    label2 = new JLabel();
    driverField = new JTextField();
    separator2 = compFactory.createSeparator("Database User Properties");
    label3 = new JLabel();
    userNameField = new JTextField();
    label4 = new JLabel();
    passwordField = new JPasswordField();
    label8 = new JLabel();
View Full Code Here

    super("Data Info", "Enter the database outputter's name, data source, and choose the columns to be output.");
    initComponents();
  }

  private void initComponents() {
    DefaultComponentFactory compFactory = DefaultComponentFactory.getInstance();

    // 1st section (data properties):
    separator1 = compFactory.createSeparator("Data Properties");
    nameField = new JTextField();
    nameLabel = new JLabel();

    dataSetIdLabel = new JLabel();

    // 2nd section (table columns):
    dataSetCombo = new JComboBox();
    separator2 = compFactory.createSeparator("Table Columns");
    addRunID = new JCheckBox("Add run ID", DEFAULT_ADD_RUNID);
    listSelector = new ListSelector<String>();
    runInfoTableLabel = new JLabel();
    runInfoTableName = new JTextField(DEFAULT_RUN_INFO_TABLE);

    // 3rd section: table name
    separator3 = compFactory.createSeparator("Data Base Properties");
    JLabel tableLabel = new JLabel();
    tableName = new JTextField(DEFAULT_TABLE);

    // 4th section: caching:
    separator4 = compFactory.createSeparator("Caching Settings");
    writeCacheInterval = new JTextField(DEFAULT_WRITE_CACHE);
    writeCacheIntervalLabel = new JLabel();

    CellConstraints cc = new CellConstraints();

    setLayout(new FormLayout(new ColumnSpec[] { FormFactory.DEFAULT_COLSPEC,
        FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
        new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW) }, new RowSpec[] {
        FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC,
        FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC,
        FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC,
        FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC,
        FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC,
        FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC,
        FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC,
        FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC }));
    add(separator1, cc.xywh(1, 1, 3, 1));

    // 1st section (data properties):
    // ---- dataSetIdLabel ----
    dataSetIdLabel.setText("Name");
    add(dataSetIdLabel, cc.xy(1, 3));

    // ---- nameField ----
    nameField.setText("Database Outputter");
    add(nameField, cc.xy(3, 3));

    // ---- nameLabel ----
    nameLabel.setText("Data Set ID");
    add(nameLabel, cc.xy(1, 5));
    add(dataSetCombo, cc.xy(3, 5));
    dataSetModel = new DefaultComboBoxModel();
    dataSetCombo.setModel(dataSetModel);
    dataSetCombo.addItemListener(new ItemListener() {
      @Override
      public void itemStateChanged(ItemEvent e) {
        setupColumnNames();
        updateComplete();
      }
    });

    nameField.getDocument().addDocumentListener(new DocumentListener() {
      @Override
      public void changedUpdate(DocumentEvent e) {
        updateComplete();
      }

      @Override
      public void insertUpdate(DocumentEvent e) {
        updateComplete();
      }

      @Override
      public void removeUpdate(DocumentEvent e) {
        updateComplete();
      }
    });

    // 2nd section (table columns):
    add(separator2, cc.xywh(1, 9, 3, 1));
    add(addRunID, cc.xy(3, 11));
    runInfoTableLabel.setText("Run-Info Table Name");
    add(runInfoTableLabel, cc.xy(1, 13));
    add(runInfoTableName, cc.xy(3, 13));
    add(listSelector, cc.xywh(1, 15, 3, 1));
    listSelector.addActionListeners(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        updateComplete();     
      }
    });

    // 3rd section: table name
    separator3 = compFactory.createSeparator("Database Properties");
    add(separator3, cc.xywh(1, 17, 3, 1));
    tableLabel.setText("Table name");
    add(tableLabel, cc.xy(1, 19));
    add(tableName, cc.xy(3, 19));
View Full Code Here

        contentPane.setLayout(new GridBagLayout());
        ((GridBagLayout)contentPane.getLayout()).columnWidths = new int[] {0, 0};
        ((GridBagLayout)contentPane.getLayout()).rowHeights = new int[] {0, 0, 0, 0, 0, 0};
        ((GridBagLayout)contentPane.getLayout()).columnWeights = new double[] {1.0, 1.0E-4};
        ((GridBagLayout)contentPane.getLayout()).rowWeights = new double[] {0.0, 0.0, 0.0, 1.0, 0.0, 1.0E-4};
        DefaultComponentFactory compFactory = DefaultComponentFactory.getInstance();
        JComponent titleText = compFactory.createSeparator(TxtManager.getTxt("VIEW.OBJECTEDIT.PROPERTIESTITLE"));
        contentPane.add(titleText, new GridBagConstraints(0, currentLocation, 1, 1, 0.0, 0.0,
                GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL,
                new Insets(10, 10, 15, 10), 0, 0));
        currentLocation++;
View Full Code Here

    ((GridBagLayout)contentPane.getLayout()).columnWidths = new int[] {0, 0};
    ((GridBagLayout)contentPane.getLayout()).rowHeights = new int[] {0, 0, 0, 0};
    ((GridBagLayout)contentPane.getLayout()).columnWeights = new double[] {1.0, 1.0E-4};
    ((GridBagLayout)contentPane.getLayout()).rowWeights = new double[] {0.0, 1.0, 0.0, 1.0E-4};
               
                DefaultComponentFactory compFactory = DefaultComponentFactory.getInstance();
    JComponent titleText = compFactory.createSeparator(TxtManager.getTxt("ITEM.PROPERTIES.TITLE"));
    contentPane.add(titleText, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0,
      GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL,
      new Insets(10, 10, 15, 10), 0, 0));

    //======== propertyPane ========
View Full Code Here

                               
        }                
       
        private void initialViews() {
           
                DefaultComponentFactory compFactory = DefaultComponentFactory.getInstance();
               
                //======== columnVisiblePanel ========
     
                        JPanel columnVisiblePanel = new JPanel();
                        columnVisiblePanel.setLayout(new GridBagLayout());
                        ((GridBagLayout)columnVisiblePanel.getLayout()).columnWidths = new int[] {0, 0, 0, 0};
                        ((GridBagLayout)columnVisiblePanel.getLayout()).rowHeights = new int[] {0, 0};
                        ((GridBagLayout)columnVisiblePanel.getLayout()).columnWeights = new double[] {0.0, 0.0, 1.0, 1.0E-4};
                        ((GridBagLayout)columnVisiblePanel.getLayout()).rowWeights = new double[] {1.0, 1.0E-4};

                        //======== left_columnVisiblePanel ========

                                JPanel left_columnVisiblePanel = new JPanel();
                                left_columnVisiblePanel.setPreferredSize(new Dimension(250, 300));
                                left_columnVisiblePanel.setBorder(LineBorder.createBlackLineBorder());
                                left_columnVisiblePanel.setLayout(new GridBagLayout());
                                ((GridBagLayout)left_columnVisiblePanel.getLayout()).columnWidths = new int[] {0, 0};
                                ((GridBagLayout)left_columnVisiblePanel.getLayout()).rowHeights = new int[] {0, 0, 0, 0};
                                ((GridBagLayout)left_columnVisiblePanel.getLayout()).columnWeights = new double[] {1.0, 1.0E-4};
                                ((GridBagLayout)left_columnVisiblePanel.getLayout()).rowWeights = new double[] {0.0, 0.0, 1.0, 1.0E-4};


                                JComponent separator = compFactory.createSeparator(TxtManager.getTxt("LAYOUT.COLUMNTODISPLAY"));
                                left_columnVisiblePanel.add(separator, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0,
                                        GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                                        new Insets(5, 5, 10, 5), 0, 0));

                                //======== toolBar ========

                                        JToolBar toolBar = new JToolBar();
                                        JPanel toolPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));

                                        //---- upButton ----
                                        JButton upButton = new JButton();
                                        upButton.setIcon(ImageManager.getImage(ImageManager.ARROW_UP_IMAGE));
                                        upButton.setActionCommand("Display Item up");
                                        upButton.addActionListener(listener);
                                        toolPanel.add(upButton);

                                        //---- downButton ----
                                        JButton downButton = new JButton();
                                        downButton.setIcon(ImageManager.getImage(ImageManager.ARROW_DOWN_IMAGE));
                                        downButton.setActionCommand("Display Item down");
                                        downButton.addActionListener(listener);
                                        toolPanel.add(downButton);

                                left_columnVisiblePanel.add(toolPanel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0,
                                        GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                                        new Insets(0, 0, 5, 0), 0, 0));

                                //======== scrollPane1 ========

                                        JScrollPane scrollPane1 = new JScrollPane();

                                        //---- columnDisplayTable ----
                                        columnDisplayTable = new JTableX();
                                        getColumnDisplayTable().setHorizontalScrollEnabled(true);                                                                          
                                        getColumnDisplayTable().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
                                        getColumnDisplayTable().setSortable(false);
                                        scrollPane1.setViewportView(getColumnDisplayTable());
                                        scrollPane1.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);

                                left_columnVisiblePanel.add(scrollPane1, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0,
                                        GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                                        new Insets(0, 0, 0, 0), 0, 0));

                        columnVisiblePanel.add(left_columnVisiblePanel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0,
                                GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                                new Insets(10, 10, 30, 15), 0, 0));

                        //======== middle_columnVisiblePanel ========

                                JPanel middle_columnVisiblePanel = new JPanel();
                                middle_columnVisiblePanel.setLayout(new GridBagLayout());

                                ((GridBagLayout)middle_columnVisiblePanel.getLayout()).columnWidths = new int[] {0, 0};
                                ((GridBagLayout)middle_columnVisiblePanel.getLayout()).rowHeights = new int[] {0, 0, 0};
                                ((GridBagLayout)middle_columnVisiblePanel.getLayout()).columnWeights = new double[] {0.0, 1.0E-4};
                                ((GridBagLayout)middle_columnVisiblePanel.getLayout()).rowWeights = new double[] {1.0, 1.0, 1.0E-4};

                                //---- leftButton ----
                                JButton leftButton = new JButton();
                                leftButton.setActionCommand("Display Item Left");
                                leftButton.addActionListener(listener);
                                leftButton.setIcon(ImageManager.getImage(ImageManager.ARROW_LEFT_IMAGE));
                                middle_columnVisiblePanel.add(leftButton, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0,
                                        GridBagConstraints.SOUTH, GridBagConstraints.NONE,
                                        new Insets(0, 0, 5, 0), 0, 0));

                                //---- rightButton ----
                                JButton rightButton = new JButton();
                                rightButton.setActionCommand("Display Item Right");
                                rightButton.addActionListener(listener);
                                rightButton.setIcon(ImageManager.getImage(ImageManager.ARROW_RIGHT_IMAGE));
                                middle_columnVisiblePanel.add(rightButton, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0,
                                        GridBagConstraints.NORTH, GridBagConstraints.NONE,
                                        new Insets(0, 0, 0, 0), 0, 0));

                        columnVisiblePanel.add(middle_columnVisiblePanel, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0,
                                GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                                new Insets(0, 0, 0, 5), 0, 0));

                        //======== right_columnVisiblePanel ========

                                JPanel right_columnVisiblePanel = new JPanel();
                                right_columnVisiblePanel.setPreferredSize(new Dimension(250, 300));
                                right_columnVisiblePanel.setBorder(LineBorder.createBlackLineBorder());
                                right_columnVisiblePanel.setLayout(new GridBagLayout());                                       

                                ((GridBagLayout)right_columnVisiblePanel.getLayout()).columnWidths = new int[] {0, 0};
                                ((GridBagLayout)right_columnVisiblePanel.getLayout()).rowHeights = new int[] {0, 0, 0, 0};
                                ((GridBagLayout)right_columnVisiblePanel.getLayout()).columnWeights = new double[] {1.0, 1.0E-4};
                                ((GridBagLayout)right_columnVisiblePanel.getLayout()).rowWeights = new double[] {0.0, 0.0, 1.0, 1.0E-4};

                                separator = compFactory.createSeparator(TxtManager.getTxt("LAYOUT.COLUMN"));
                                right_columnVisiblePanel.add(separator, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0,
                                        GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                                        new Insets(5, 5, 10, 5), 0, 0));

                                //======== scrollPane ========

                                        JScrollPane scrollPane = new JScrollPane();

                                        //---- columnTable ----
                                        columnTable = new JXTable();
                                        getColumnTable().setHorizontalScrollEnabled(true);                                                                          
                                        getColumnTable().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
                                        getColumnTable().setSortable(false);
                                        getColumnTable().setEditable(false);
                                        scrollPane.setViewportView(getColumnTable());
                                        scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);

                                right_columnVisiblePanel.add(scrollPane, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0,
                                        GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                                        new Insets(0, 0, 0, 0), 0, 0));

                        columnVisiblePanel.add(right_columnVisiblePanel, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0,
                                GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                                new Insets(10, 10, 30, 10), 0, 0));

                tabbedPane.addTab(TxtManager.getTxt("LAYOUT.DISPLAY.TITLE"), columnVisiblePanel);


                //======== columnOrderPanel ========

                        JPanel columnOrderPanel = new JPanel();

                        columnOrderPanel.setPreferredSize(new Dimension(300, 200));
                        columnOrderPanel.setLayout(new GridBagLayout());
                        ((GridBagLayout)columnOrderPanel.getLayout()).columnWidths = new int[] {0, 0, 0};
                        ((GridBagLayout)columnOrderPanel.getLayout()).rowHeights = new int[] {0, 0, 0, 0};
                        ((GridBagLayout)columnOrderPanel.getLayout()).columnWeights = new double[] {0.0, 0.0, 1.0E-4};
                        ((GridBagLayout)columnOrderPanel.getLayout()).rowWeights = new double[] {0.0, 0.0, 0.0, 1.0E-4};

                        //======== left_columnOrderPanel ========

                                JPanel left_columnOrderPanel = new JPanel();
                                left_columnOrderPanel.setPreferredSize(new Dimension(250, 300));
                                left_columnOrderPanel.setBorder(LineBorder.createBlackLineBorder());
                                left_columnOrderPanel.setLayout(new GridBagLayout());
                                ((GridBagLayout)left_columnOrderPanel.getLayout()).columnWidths = new int[] {0, 0};
                                ((GridBagLayout)left_columnOrderPanel.getLayout()).rowHeights = new int[] {0, 0, 0, 0};
                                ((GridBagLayout)left_columnOrderPanel.getLayout()).columnWeights = new double[] {1.0, 1.0E-4};
                                ((GridBagLayout)left_columnOrderPanel.getLayout()).rowWeights = new double[] {0.0, 0.0, 1.0, 1.0E-4};


                                separator = compFactory.createSeparator(TxtManager.getTxt("LAYOUT.COLUMN.ORDER"));
                                left_columnOrderPanel.add(separator, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0,
                                        GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                                        new Insets(5, 5, 10, 5), 0, 0));

                                //======== toolBar ========

                                        toolBar = new JToolBar();
                                        toolPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
                                        toolBar.setFloatable(false);
                                        toolBar.setBorderPainted(false);

                                        //---- upButton ----
                                        upButton = new JButton();
                                        upButton.setIcon(ImageManager.getImage(ImageManager.ARROW_UP_IMAGE));
                                        upButton.setActionCommand("Order Item up");
                                        upButton.addActionListener(listener);
                                        toolPanel.add(upButton);

                                        //---- downButton ----
                                        downButton = new JButton();
                                        downButton.setIcon(ImageManager.getImage(ImageManager.ARROW_DOWN_IMAGE));
                                        downButton.setActionCommand("Order Item down");
                                        downButton.addActionListener(listener);
                                        toolPanel.add(downButton);

                                left_columnOrderPanel.add(toolPanel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0,
                                        GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                                        new Insets(0, 0, 5, 0), 0, 0));

                                //======== scrollPane ========

                                        scrollPane = new JScrollPane();

                                        //---- columnOrderTable ----
                                        columnOrderTable = new JXTable();
                                        getColumnOrderTable().setHorizontalScrollEnabled(true);                                                                          
                                        getColumnOrderTable().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
                                        getColumnOrderTable().setSortable(false);                                       
                                        scrollPane.setViewportView(getColumnOrderTable());
                                        scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);

                                left_columnOrderPanel.add(scrollPane, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0,
                                        GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                                        new Insets(0, 0, 0, 0), 0, 0));

                        columnOrderPanel.add(left_columnOrderPanel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0,
                                GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                                new Insets(10, 10, 30, 15), 0, 0));

                        //======== middle_columnOrderPanel ========

                                JPanel middle_columnOrderPanel = new JPanel();
                                middle_columnOrderPanel.setLayout(new GridBagLayout());

                                ((GridBagLayout)middle_columnOrderPanel.getLayout()).columnWidths = new int[] {0, 0};
                                ((GridBagLayout)middle_columnOrderPanel.getLayout()).rowHeights = new int[] {0, 0, 0};
                                ((GridBagLayout)middle_columnOrderPanel.getLayout()).columnWeights = new double[] {0.0, 1.0E-4};
                                ((GridBagLayout)middle_columnOrderPanel.getLayout()).rowWeights = new double[] {1.0, 1.0, 1.0E-4};

                                //---- leftButton ----
                                leftButton = new JButton();
                                leftButton.setActionCommand("Order Item Left");
                                leftButton.addActionListener(listener);
                                leftButton.setIcon(ImageManager.getImage(ImageManager.ARROW_LEFT_IMAGE));
                                middle_columnOrderPanel.add(leftButton, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0,
                                        GridBagConstraints.SOUTH, GridBagConstraints.NONE,
                                        new Insets(0, 0, 5, 0), 0, 0));

                                //---- rightButton ----
                                rightButton = new JButton();
                                rightButton.setActionCommand("Order Item Right");
                                rightButton.addActionListener(listener);
                                rightButton.setIcon(ImageManager.getImage(ImageManager.ARROW_RIGHT_IMAGE));
                                middle_columnOrderPanel.add(rightButton, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0,
                                        GridBagConstraints.NORTH, GridBagConstraints.NONE,
                                        new Insets(0, 0, 0, 0), 0, 0));

                        columnOrderPanel.add(middle_columnOrderPanel, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0,
                                GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                                new Insets(0, 0, 0, 5), 0, 0));

                        //======== right_columnOrderPanel ========

                                JPanel right_columnOrderPanel = new JPanel();
                                right_columnOrderPanel.setPreferredSize(new Dimension(250, 300));
                                right_columnOrderPanel.setBorder(LineBorder.createBlackLineBorder());
                                right_columnOrderPanel.setLayout(new GridBagLayout());                                       

                                ((GridBagLayout)right_columnOrderPanel.getLayout()).columnWidths = new int[] {0, 0};
                                ((GridBagLayout)right_columnOrderPanel.getLayout()).rowHeights = new int[] {0, 0, 0, 0};
                                ((GridBagLayout)right_columnOrderPanel.getLayout()).columnWeights = new double[] {1.0, 1.0E-4};
                                ((GridBagLayout)right_columnOrderPanel.getLayout()).rowWeights = new double[] {0.0, 0.0, 1.0, 1.0E-4};

                                separator = compFactory.createSeparator(TxtManager.getTxt("LAYOUT.COLUMN"));
                                right_columnOrderPanel.add(separator, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0,
                                        GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                                        new Insets(5, 5, 10, 5), 0, 0));

                                //======== scrollPane ========

                                        scrollPane = new JScrollPane();

                                        //---- columnOrderSourceTable ----
                                        columnOrderSourceTable = new JXTable();
                                        getColumnOrderSourceTable().setHorizontalScrollEnabled(true);                                                                          
                                        getColumnOrderSourceTable().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
                                        getColumnOrderSourceTable().setSortable(false);
                                        scrollPane.setViewportView(getColumnOrderSourceTable());
                                        scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);

                                right_columnOrderPanel.add(scrollPane, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0,
                                        GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                                        new Insets(0, 0, 0, 0), 0, 0));

                        columnOrderPanel.add(right_columnOrderPanel, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0,
                                GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                                new Insets(10, 10, 30, 10), 0, 0));

                tabbedPane.addTab(TxtManager.getTxt("LAYOUT.SORT.TITLE"), columnOrderPanel);               

                //======== columnFilterPanel ========

                        JPanel columnFilterPanel = new JPanel();
                        columnFilterPanel.setLayout(new GridBagLayout());
                        ((GridBagLayout)columnFilterPanel.getLayout()).columnWidths = new int[] {0, 0, 0, 0};
                        ((GridBagLayout)columnFilterPanel.getLayout()).rowHeights = new int[] {0, 0};
                        ((GridBagLayout)columnFilterPanel.getLayout()).columnWeights = new double[] {0.0, 0.0, 1.0, 1.0E-4};
                        ((GridBagLayout)columnFilterPanel.getLayout()).rowWeights = new double[] {1.0, 1.0E-4};

                        //======== left_columnFilterPanel ========

                                JPanel left_columnFilterPanel = new JPanel();
                                left_columnFilterPanel.setPreferredSize(new Dimension(550, 300));
                                left_columnFilterPanel.setBorder(LineBorder.createBlackLineBorder());
                                left_columnFilterPanel.setLayout(new GridBagLayout());
                                ((GridBagLayout)left_columnFilterPanel.getLayout()).columnWidths = new int[] {0, 0};
                                ((GridBagLayout)left_columnFilterPanel.getLayout()).rowHeights = new int[] {0, 0, 0, 0};
                                ((GridBagLayout)left_columnFilterPanel.getLayout()).columnWeights = new double[] {1.0, 1.0E-4};
                                ((GridBagLayout)left_columnFilterPanel.getLayout()).rowWeights = new double[] {0.0, 0.0, 1.0, 1.0E-4};


                                separator = compFactory.createSeparator(TxtManager.getTxt("LAYOUT.COLUMNTODISPLAY"));
                                left_columnFilterPanel.add(separator, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0,
                                        GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                                        new Insets(5, 5, 10, 5), 0, 0));

View Full Code Here

                  setTitle(TxtManager.getTxt("LAYOUT.EDIT.TITLE"));
                }           
        }
               
  private void initComponents() {                        
    DefaultComponentFactory compFactory = DefaultComponentFactory.getInstance();
   
    //======== this ========
                addWindowListener(
                        new WindowAdapter() {
                   
View Full Code Here

    ((GridBagLayout)contentPane.getLayout()).columnWidths = new int[] {0, 0};
    ((GridBagLayout)contentPane.getLayout()).rowHeights = new int[] {0, 0, 0, 0, 0, 0};
    ((GridBagLayout)contentPane.getLayout()).columnWeights = new double[] {1.0, 1.0E-4};
    ((GridBagLayout)contentPane.getLayout()).rowWeights = new double[] {0.0, 0.0, 0.0, 1.0, 0.0, 1.0E-4};
               
                DefaultComponentFactory compFactory = DefaultComponentFactory.getInstance();
    JComponent titleText = compFactory.createSeparator(TxtManager.getTxt("VIEW.OBJECTEDIT.PROPERTIESTITLE"));
    contentPane.add(titleText, new GridBagConstraints(0, currentLocation, 1, 1, 0.0, 0.0,
      GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL,
      new Insets(10, 10, 15, 10), 0, 0));
                currentLocation++;
               
                //specify,BudgetClass
                if (object instanceof BudgetClass) {
                    budgetLabel = new JLabel();
                    setCurrentBudgetTotal();
                    contentPane.add(budgetLabel, new GridBagConstraints(0, currentLocation, 1, 1, 0.0, 0.0,
                            GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                            new Insets(0, 10, 0, 5), 0, 0));
                    currentLocation++;
                }               

    //======== propertyPane ========
    {
                        propertyPane = new JTabbedPane();
      getPropertyPane().setPreferredSize(new Dimension(600, 300));
     
                        Iterator headComponentExtIter = headComponentExts.iterator()
                        headAlertLabels = new Vector();
                        Iterator headGroupNameIter = object.getHeadGroupnames().iterator();
                                        
                        int n = 0;
                        while (headGroupNameIter.hasNext()) {                                                       
                            int groupName = ((Integer)headGroupNameIter.next()).intValue();                           
                            //======== groupPanel ========
                            {                                   
                                    JPanel groupPanel = new JPanel();
                                    JScrollPane groupScrollPane = new JScrollPane();
                                    groupScrollPane.setViewportView(groupPanel);
                                   
                                    //layout    
                                    //columnSpec
//                                    ColumnSpec[] columnSpec = new ColumnSpec[] {
//                                            new ColumnSpec("10px"),
//                                            FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
//                                            new ColumnSpec("150px"),
//                                            FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
//                                            new ColumnSpec("150px"),
//                                            FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
//                                            new ColumnSpec("150px")
//                                    };
//                                   
//                                    //rowSpec
//                                    //get rowCount                                   
//                                    int rowCount = getObject().getGroupHeadFieldCount(groupName);
//                                    RowSpec[] rowSpec = new RowSpec[rowCount * 2 + 1];
//                                    rowSpec[0] = new RowSpec("10px");
//                                    rowSpec[1] = FormFactory.LINE_GAP_ROWSPEC;
//                                    for (int i = 1; i <= rowCount - 1; i++) {
//                                        rowSpec[i * 2] = new RowSpec("20px");
//                                        rowSpec[i * 2 + 1] = FormFactory.LINE_GAP_ROWSPEC;
//                                    }
//                                    rowSpec[rowCount * 2] = new RowSpec("20px");
//                                   
//                                    groupPanel.setLayout(new FormLayout(columnSpec, rowSpec));
                                    //fix ʹ�ö����ı�detailText
                                    double size[][] = {
                                    { 10,150,150,150,10 },
                                    { 10} };
                                    TableLayout tableLayout=new TableLayout(size);
                  groupPanel.setLayout(tableLayout);
                  tableLayout.setVGap(10);
                  tableLayout.setHGap(10);                 
                                   
                                    //add components to groupPanel
                                    int currentComponentNumber = 1;
                                    Iterator columnIter = getObject().getColumns().iterator();                                   
                                    while (columnIter.hasNext()) {
                                       
                                        Column column = (Column)columnIter.next();
                                        if ( (column.isHeadField()) && (column.getGroupName() == groupName) ) {
                                           
                                          tableLayout.insertRow(currentComponentNumber,TableLayout.PREFERRED);
                                         
                                            //add label
                                            JLabel label = new JLabel(column.toString());                                           
//                                            groupPanel.add(label, cc.xy(3, currentComponentNumber * 2 + 1));
                                            groupPanel.add(label,"1,"+currentComponentNumber+",f,t");
                                                                                       
                                            //add component
                                            ComponentExt componentExt = (ComponentExt)headComponentExtIter.next();
                                            JComponent component = componentExt.getComponent();                                                                                       
                                           
                                            //specify, for edit action, the primarykey Component is not allowed to modify
                                            if (action.equals("Edit")) {
                                                if ( (column.isPrimaryKey()) && (column.getTableName().equals(object.getMainTableName())) ) {
                                                    component.setEnabled(false);
                                                }
                                            }
                                           
//                                            groupPanel.add(component, cc.xy(5, currentComponentNumber * 2 + 1));
                                            groupPanel.add(component,"2,"+currentComponentNumber+",f,f");
                                           
                                            //add alert label
                                            JLabel alertLabel = new JLabel();
                                            componentExt.setAlertLabel(alertLabel);
                                            alertLabel.setForeground(Color.RED);
                                            if (column.isPrimaryKey()) {
                                                alertLabel.setIcon(ImageManager.getImage(ImageManager.HELP_IMAGE));
                                            } else {
                                                alertLabel.setVisible(false);
                                            }                                          
//                                            groupPanel.add(alertLabel, cc.xy(7, currentComponentNumber * 2 + 1));
                                            groupPanel.add(alertLabel,"3,"+currentComponentNumber+",f,f");
                                            getHeadAlertLabels().add(alertLabel);     
                                            headGroups.add(n);
                                           
                                            currentComponentNumber++;
                                           
                                        }
                                       
                                    }
                                   
                                    tableLayout.insertRow(currentComponentNumber,10);
                                                                                                                                                              
                                    //set groupPanel Title & add groupPanel to propertyPane
                                    String groupNameString = "GRP." + new Integer(groupName).toString();
                                    getPropertyPane().addTab(TxtManager.getTxt(groupNameString), groupScrollPane);                                   
                                    n++;                                   
                                                     
                            }
                           
                        }                                                                                                                                             
                                   
    }
    contentPane.add(getPropertyPane(), new GridBagConstraints(0, currentLocation, 1, 1, 0.0, 0.0,
      GridBagConstraints.CENTER, GridBagConstraints.BOTH,
      new Insets(10, 10, 10, 10), 0, 0));
                currentLocation++;
               
               
                if (getObject().isSlayerMaster()) {
                                       
                    JComponent childText = compFactory.createSeparator(TxtManager.getTxt("VIEW.OBJECTEDIT.ITEMSTITLE"));                   
                    contentPane.add(childText, new GridBagConstraints(0, currentLocation, 1, 1, 0.0, 0.0,
                            GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL,
                            new Insets(10, 10, 15, 10), 0, 0));
                    currentLocation++;
                   
View Full Code Here

TOP

Related Classes of com.jgoodies.forms.factories.DefaultComponentFactory$TitledSeparatorLayout

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.