Example usage for com.jgoodies.binding.list SelectionInList SelectionInList

List of usage examples for com.jgoodies.binding.list SelectionInList SelectionInList

Introduction

In this page you can find the example usage for com.jgoodies.binding.list SelectionInList SelectionInList.

Prototype

public SelectionInList(ValueModel listHolder) 

Source Link

Document

Constructs a SelectionInList on the given list holder using defaults for the selection holder and selection index holder.

Constraints: 1) The listHolder must hold instances of List or ListModel and 2) must report a value change whenever the value's identity changes.

Usage

From source file:ambit2.dbui.QueryFunctionalGroupsEditor.java

License:Open Source License

@Override
protected JComponent createFieldnameComponent() {
    SelectionInList<PropertyTemplateStats> selectionInList = new SelectionInList<PropertyTemplateStats>(
            presentationModel.getModel("fieldname"));

    table = new JTable(new PropertyStatsTableAdapter(selectionInList,
            new String[] { "Select", "Group", "# of structures" }));
    table.setShowHorizontalLines(true);//w w w  .  jav a 2  s .  co  m
    table.setShowVerticalLines(false);
    return new JScrollPane(table);
}

From source file:ambit2.ui.editors.SelectFieldsPanel.java

License:Open Source License

protected void buildPanel(String help) {
    FormLayout layout = new FormLayout(
            "3dlu,fill:40dlu:grow,fill:120dlu:grow,3dlu,32dlu, 3dlu, fill:40dlu:grow,fill:120dlu:grow,3dlu", //columns
            "3dlu,12dlu,3dlu,top:[pref,36dlu], 24dlu,3dlu,24dlu,3dlu,24dlu,3dlu,24dlu,bottom:[pref,72dlu]:grow,1dlu,pref,pref,pref,pref,pref"); //rows
    setLayout(layout);/* w  ww  . ja v  a  2 s .  c  o m*/
    CellConstraints cc = new CellConstraints();

    add(createSeparator("Available"), cc.xywh(2, 2, 2, 1));
    add(createSeparator("Selected"), cc.xywh(7, 2, 2, 1));

    tables = new JList[fieldsModel.length];
    for (int i = 0; i < fieldsModel.length; i++) {
        tables[i] = new JList(fieldsModel[i]);

        SelectionInList<Property> selectionInList = new SelectionInList<Property>(fieldsModel[i]);
        Bindings.bind(tables[i], selectionInList);
        JScrollPane p = new JScrollPane(tables[i]);
        p.setBorder(BorderFactory.createEtchedBorder());
        p.setPreferredSize(new Dimension(160, 280));
        int offset = 2 + i * 5;
        add(p, cc.xywh(offset, 4, 2, 9));

        BeanAdapter beanAdapter = new BeanAdapter(selectionInList);

        String[][] config = { { "name", "Name" }, { "label", "Alias" }, { "units", "Units" },
                { "title", "url" }, { "url", "WWW" } };
        for (int j = 0; j < config.length; j++) {
            String[] c = config[j];
            ValueModel model = beanAdapter.getValueModel(c[0]);
            add(BasicComponentFactory.createLabel(new ValueHolder(c[1])), cc.xywh(offset, j + 14, 1, 1));
            JTextField t = BasicComponentFactory.createTextField(model);
            t.addMouseListener(new MouseAdapter() {
                @Override
                public void mouseEntered(MouseEvent e) {
                    super.mouseEntered(e);
                    ((JTextField) e.getSource()).setToolTipText(((JTextField) e.getSource()).getText());
                }
            });
            add(t, cc.xywh(offset + 1, j + 14, 1, 1));
        }
        /*
        ValueModel nameModel = beanAdapter.getValueModel("name");
        ValueModel commentsModel = beanAdapter.getValueModel("label");
        ValueModel titleModel = beanAdapter.getValueModel("title");
        ValueModel urlModel = beanAdapter.getValueModel("url");           
        //p.add(BasicComponentFactory.createTextField(parentModel));         
        add(BasicComponentFactory.createLabel(new ValueHolder("Name")),cc.xywh(offset,14,1,1));
        add(BasicComponentFactory.createTextField(nameModel),cc.xywh(offset+1,14,1,1));
        add(BasicComponentFactory.createLabel(new ValueHolder("Alias")),cc.xywh(offset,15,1,1));
        add(BasicComponentFactory.createTextField(commentsModel),cc.xywh(offset+1,15,1,1));
        add(BasicComponentFactory.createLabel(new ValueHolder("Reference")),cc.xywh(offset,16,1,1));
        add(BasicComponentFactory.createTextField(titleModel),cc.xywh(offset+1,16,1,1));         
        add(BasicComponentFactory.createLabel(new ValueHolder("WWW")),cc.xywh(offset,17,1,1));
        add(BasicComponentFactory.createTextField(urlModel),cc.xywh(offset+1,17,1,1));     
        */
    }

    buttons = new ArrayList<JButton>();
    int i = 0;
    for (MOVE op : MOVE.values()) {
        JButton button = new JButton(op.display());
        button.setPreferredSize(new Dimension(24, 24));
        button.setMaximumSize(new Dimension(24, 24));
        add(button, cc.xywh(5, 5 + (i * 2), 1, 1));
        button.addActionListener(this);
        button.setActionCommand(op.toString());
        i++;
    }

    /*
    JToolBar toolBar[] = new JToolBar[2];
    toolBar[0] = new JToolBar();
    toolBar[0].add(new JButton("Find"));
    toolBar[0].add(new JToolBar.Separator());
    toolBar[0].add(new JButton("Select all"));
    toolBar[0].add(new JButton("Unselect all"));
    toolBar[0].setFloatable(false);
    add(toolBar[0],cc.xywh(2,14,1,1));
            
    toolBar[1] = new JToolBar();
    toolBar[1].add(new JButton("Move Up"));
    toolBar[1].add(new JButton("Move Down"));
    toolBar[1].add(new JToolBar.Separator());
    toolBar[1].add(new JButton("Select all"));
    toolBar[1].add(new JButton("Unselect all"));
    toolBar[1].setFloatable(false);
    add(toolBar[1],cc.xywh(6,14,1,1));
    */
    /*
    helpArea = new JTextPane();
    helpArea.setText(help);
    helpArea.setEditable(false);
    helpArea.setBackground(new Color(255,255,225));
    helpArea.setPreferredSize(new Dimension(288,48));
    add(new JScrollPane(helpArea),cc.xywh(2,16,5,1));
    */

}

From source file:ch.fork.AdHocRailway.ui.locomotives.configuration.LocomotiveConfigurationDialog.java

License:Open Source License

private void initComponents() {
    locomotiveGroups = new ArrayListModel<LocomotiveGroup>();

    locomotiveGroupModel = new SelectionInList<LocomotiveGroup>((ListModel<LocomotiveGroup>) locomotiveGroups);

    locomotiveGroupList = BasicComponentFactory.createList(locomotiveGroupModel);
    locomotiveGroupList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    locomotiveGroupList.setCellRenderer(new LocomotiveGroupListCellRenderer());

    groupScrollPane = new JScrollPane(locomotiveGroupList);

    locomotiveGroupConfig = new LocomotiveGroupConfigPanel();

    addGroupButton = new JButton(new AddLocomotiveGroupAction());
    editGroupButton = new JButton(new EditLocomotiveGroupAction());
    removeGroupButton = new JButton(new RemoveLocomotiveGroupAction());
    DefaultTableCellRenderer r = new DefaultTableCellRenderer() {

        Border padding = BorderFactory.createEmptyBorder(10, 10, 10, 10);

        @Override// w  ww . j a v a 2 s.  c  om
        public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
                boolean hasFocus, int row, int column) {
            super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
            setBorder(padding);
            return this;
        }

    };

    locomotivesTable = new JTable();
    locomotivesTable.setDefaultRenderer(Object.class, r);

    locomotives = new ArrayListModel<Locomotive>();

    locomotiveModel = new SelectionInList<Locomotive>();
    locomotiveModel.setList(locomotives);

    locomotivesTable.setModel(new LocomotiveTableModel(locomotiveModel));
    locomotivesTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
    locomotivesTable.setRowHeight(50);

    final TableColumn imageColumn = locomotivesTable.getColumnModel().getColumn(1);
    imageColumn.setCellRenderer(new LocomotiveImageTableCellRenderer());

    locomotiveTableScrollPane = new JScrollPane(locomotivesTable, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
            JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);

    locomotivesTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);

    tca = new TableColumnAdjuster(locomotivesTable, 10);

    addLocomotiveButton = new JButton(new AddLocomotiveAction());
    removeLocomotiveButton = new JButton(new RemoveLocomotiveAction());

    okButton = new JButton("OK", ImageTools.createImageIconFromIconSet("dialog-ok-apply.png"));
    okButton.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(final ActionEvent e) {
            okPressed = true;
            setVisible(false);
            locomotiveManager.removeLocomotiveManagerListenerInNextEvent(LocomotiveConfigurationDialog.this);
        }
    });
}

From source file:ch.fork.AdHocRailway.ui.routes.configuration.RoutesConfigurationDialog.java

License:Open Source License

@SuppressWarnings("unchecked")
private void initComponents() {
    routeGroups = new ArrayListModel<RouteGroup>();
    routeGroupModel = new SelectionInList<RouteGroup>((ListModel<?>) routeGroups);

    routeGroupList = BasicComponentFactory.createList(routeGroupModel);
    routeGroupList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    routeGroupList.setCellRenderer(new RouteGroupListCellRenderer());

    routeGroupConfig = new RouteGroupConfigPanel();

    addRouteGroupButton = new JButton(new AddRouteGroupAction());
    editGroupButton = new JButton(new EditRouteGroupAction());
    removeRouteGroupButton = new JButton(new RemoveRouteGroupAction());

    routes = new ArrayListModel<Route>();
    routesModel = new SelectionInList<Route>();
    routesModel.setList(routes);/*from  w  ww. ja v  a  2 s . co m*/
    routesList = new JList<Object>();
    routesList.setModel(routesModel);
    routesList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);

    routesList.setCellRenderer(new RouteListCellRenderer());

    addRouteButton = new JButton(new AddRouteAction());
    duplicateRouteButton = new JButton(new DuplicateRouteAction());
    removeRouteButton = new JButton(new RemoveRouteAction());

    okButton = new JButton("OK", ImageTools.createImageIconFromIconSet("dialog-ok-apply.png"));
    okButton.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(final ActionEvent e) {
            okPressed = true;
            setVisible(false);
            routeManager.removeRouteManagerListenerInNextEvent(RoutesConfigurationDialog.this);
        }

    });
}

From source file:ch.fork.AdHocRailway.ui.turnouts.configuration.TurnoutConfigurationDialog.java

License:Open Source License

private void initComponents() {
    turnoutGroups = new ArrayListModel<TurnoutGroup>();

    turnoutGroupModel = new SelectionInList<TurnoutGroup>((ListModel<?>) turnoutGroups);

    turnoutGroupList = BasicComponentFactory.createList(turnoutGroupModel, new TurnoutGroupListCellRenderer());
    turnoutGroupList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

    turnoutGroupList.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0), "deleteTurnoutGroup");
    turnoutGroupList.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE, 0), "deleteTurnoutGroup");
    turnoutGroupList.getActionMap().put("deleteTurnoutGroup", new RemoveTurnoutGroupAction());

    groupScrollPane = new JScrollPane(turnoutGroupList);

    turnoutGroupConfig = new TurnoutGroupConfigPanel();

    addGroupButton = new JButton(new AddTurnoutGroupAction());
    editGroupButton = new JButton(new EditTurnoutGroupAction());
    removeGroupButton = new JButton(new RemoveTurnoutGroupAction());

    turnouts = new ArrayListModel<Turnout>();
    turnoutModel = new SelectionInList<Turnout>();

    turnoutModel.setList(turnouts);//from ww  w.  j  ava  2  s. c om
    turnoutsTable = new JTable() {

        @Override
        public boolean getScrollableTracksViewportWidth() {
            return getPreferredSize().width < getParent().getWidth();
        }
    };
    turnoutsTable.setModel(new TurnoutTableModel(turnoutModel));

    turnoutsTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);

    turnoutsTable.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0), "deleteTurnout");
    turnoutsTable.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE, 0), "deleteTurnout");
    turnoutsTable.getActionMap().put("deleteTurnout", new RemoveTurnoutAction());

    final TableColumn typeColumn = turnoutsTable.getColumnModel().getColumn(1);
    typeColumn.setCellRenderer(new TurnoutTypeCellRenderer());

    final TableColumn defaultStateColumn = turnoutsTable.getColumnModel().getColumn(8);
    defaultStateColumn.setCellRenderer(new TurnoutDefaultStateCellRenderer());
    turnoutsTable.setRowHeight(30);

    turnoutTableScrollPane = new JScrollPane(turnoutsTable, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
            JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);

    turnoutsTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);

    tca = new TableColumnAdjuster(turnoutsTable, 10);
    addTurnoutButton = new JButton(new AddTurnoutAction());
    removeTurnoutButton = new JButton(new RemoveTurnoutAction());

    okButton = new JButton("OK", ImageTools.createImageIconFromIconSet("dialog-ok-apply.png"));
    okButton.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(final ActionEvent e) {
            okPressed = true;
            setVisible(false);
            turnoutManager.removeTurnoutManagerListenerInNextEvent(TurnoutConfigurationDialog.this);
        }
    });
}

From source file:de.comicdb.comicdbcore.bean.ComicTopComponent.java

License:Open Source License

/** This method is called from within the constructor to
 * initialize the form.//from   www. j ava  2  s. c  om
 * WARNING: Do NOT modify this code. The content of this method is
 * always regenerated by the Form Editor.
 */
// <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
private void initComponents() {
    java.awt.GridBagConstraints gridBagConstraints;

    popupMenu = new javax.swing.JPopupMenu();
    jLabelName = new javax.swing.JLabel();
    jTextFieldName = BasicComponentFactory.createTextField(adapter.getBufferedModel("name"));
    jLabelNr = new javax.swing.JLabel();
    jLabelComicType = new javax.swing.JLabel();
    jComboBoxComicType = new javax.swing.JComboBox();
    jLabelCoverPrice = new javax.swing.JLabel();
    jTextFieldCoverPrice = BasicComponentFactory
            .createFormattedTextField(adapter.getBufferedModel("coverprice"), new DecimalFormat("##0.00"));
    jLabelPrice = new javax.swing.JLabel();
    jTextFieldPrice = BasicComponentFactory.createFormattedTextField(adapter.getBufferedModel("price"),
            new DecimalFormat("##0.00"));
    jLabelCoverDate = new javax.swing.JLabel();
    jTextFieldCoverDate = BasicComponentFactory.createFormattedTextField(adapter.getBufferedModel("coverdate"),
            new SimpleDateFormat(java.util.ResourceBundle.getBundle("de/comicdb/comicdbcore/bean/Bundle")
                    .getString("format.date")));
    jLabelQuantity = new javax.swing.JLabel();
    jButtonCoverDate = new javax.swing.JButton();
    jLabelCost = new javax.swing.JLabel();
    jTextFieldCost = BasicComponentFactory.createFormattedTextField(adapter.getBufferedModel("cost"),
            new DecimalFormat("##0.00"));
    jLabelPayDate = new javax.swing.JLabel();
    jTextFieldPayDate = BasicComponentFactory.createFormattedTextField(adapter.getBufferedModel("paydate"),
            new SimpleDateFormat(java.util.ResourceBundle.getBundle("de/comicdb/comicdbcore/bean/Bundle")
                    .getString("format.date")));
    jButtonPayDate = new javax.swing.JButton();
    jLabelModified = new javax.swing.JLabel();
    jTextFieldModified = BasicComponentFactory.createFormattedTextField(adapter.getBufferedModel("modified"),
            new SimpleDateFormat(java.util.ResourceBundle.getBundle("de/comicdb/comicdbcore/bean/Bundle")
                    .getString("format.date")));
    jPanel2 = new javax.swing.JPanel();
    jLabelCondition = new javax.swing.JLabel();
    jPanelNotes = new javax.swing.JPanel();
    jScrollPaneNotes = new javax.swing.JScrollPane();
    jTextAreaNotes = BasicComponentFactory.createTextArea(adapter.getBufferedModel("notes"));
    jPanelStories = new javax.swing.JPanel();
    jScrollPane1 = new javax.swing.JScrollPane();
    jTableStorys = new javax.swing.JTable();
    jTextFieldNr = BasicComponentFactory.createIntegerField(adapter.getBufferedModel("nr"));
    jTextFieldCondition = jTextFieldCondition = BasicComponentFactory
            .createIntegerField(adapter.getBufferedModel("condition"));
    jTextFieldQuantity = BasicComponentFactory.createIntegerField(adapter.getBufferedModel("quantity"));
    jLabelPageCount = new javax.swing.JLabel();
    jTextFieldPageCount = BasicComponentFactory.createIntegerField(adapter.getBufferedModel("pagecount"));
    jLabelCoverType = new javax.swing.JLabel();
    jComboBoxCoverType = new javax.swing.JComboBox();
    jLabelState = new javax.swing.JLabel();
    jComboBoxState = new javax.swing.JComboBox();
    jScrollPane2 = new javax.swing.JScrollPane();
    jPanelImage = new ImagePanel();
    jPanel1 = new javax.swing.JPanel();
    jButtonAccept = new javax.swing.JButton();
    jButtonCancel = new javax.swing.JButton();
    jPanel3 = new javax.swing.JPanel();
    jButtonChooseImage = new javax.swing.JButton();
    jButtonDeleteImage = new javax.swing.JButton();

    setLayout(new java.awt.GridBagLayout());

    org.openide.awt.Mnemonics.setLocalizedText(jLabelName, java.util.ResourceBundle
            .getBundle("de/comicdb/comicdbcore/bean/Bundle").getString("LBL_COMIC_NAME"));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 0);
    add(jLabelName, gridBagConstraints);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridwidth = 4;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4);
    add(jTextFieldName, gridBagConstraints);

    org.openide.awt.Mnemonics.setLocalizedText(jLabelNr,
            java.util.ResourceBundle.getBundle("de/comicdb/comicdbcore/bean/Bundle").getString("LBL_COMIC_NR"));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 0);
    add(jLabelNr, gridBagConstraints);

    org.openide.awt.Mnemonics.setLocalizedText(jLabelComicType, java.util.ResourceBundle
            .getBundle("de/comicdb/comicdbcore/bean/Bundle").getString("LBL_COMIC_TYPE"));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 4;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 0);
    add(jLabelComicType, gridBagConstraints);

    jComboBoxComicType.setModel(new ComboBoxAdapter(comicTypes, adapter.getBufferedModel("comictype")));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 4;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 0);
    add(jComboBoxComicType, gridBagConstraints);

    org.openide.awt.Mnemonics.setLocalizedText(jLabelCoverPrice, java.util.ResourceBundle
            .getBundle("de/comicdb/comicdbcore/bean/Bundle").getString("LBL_COMIC_COVER_PRICE"));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 5;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 0);
    add(jLabelCoverPrice, gridBagConstraints);

    jTextFieldCoverPrice.setColumns(10);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 5;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 0);
    add(jTextFieldCoverPrice, gridBagConstraints);

    org.openide.awt.Mnemonics.setLocalizedText(jLabelPrice, java.util.ResourceBundle
            .getBundle("de/comicdb/comicdbcore/bean/Bundle").getString("LBL_COMIC_PRICE"));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 6;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 0);
    add(jLabelPrice, gridBagConstraints);

    jTextFieldPrice.setColumns(10);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 6;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 0);
    add(jTextFieldPrice, gridBagConstraints);

    org.openide.awt.Mnemonics.setLocalizedText(jLabelCoverDate, java.util.ResourceBundle
            .getBundle("de/comicdb/comicdbcore/bean/Bundle").getString("LBL_COMIC_COVER_DATE"));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 2;
    gridBagConstraints.gridy = 5;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 0);
    add(jLabelCoverDate, gridBagConstraints);

    jTextFieldCoverDate.setColumns(10);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 3;
    gridBagConstraints.gridy = 5;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 0);
    add(jTextFieldCoverDate, gridBagConstraints);

    org.openide.awt.Mnemonics.setLocalizedText(jLabelQuantity, java.util.ResourceBundle
            .getBundle("de/comicdb/comicdbcore/bean/Bundle").getString("LBL_COMIC_QUANTITY"));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 2;
    gridBagConstraints.gridy = 4;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 0);
    add(jLabelQuantity, gridBagConstraints);

    org.openide.awt.Mnemonics.setLocalizedText(jButtonCoverDate, "...");
    jButtonCoverDate.setEnabled(false);
    jButtonCoverDate.setMaximumSize(new java.awt.Dimension(18, 18));
    jButtonCoverDate.setMinimumSize(new java.awt.Dimension(18, 18));
    jButtonCoverDate.setPreferredSize(new java.awt.Dimension(18, 18));
    jButtonCoverDate.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButtonCoverDateActionPerformed(evt);
        }
    });

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 4;
    gridBagConstraints.gridy = 5;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(0, 0, 4, 4);
    add(jButtonCoverDate, gridBagConstraints);

    org.openide.awt.Mnemonics.setLocalizedText(jLabelCost, java.util.ResourceBundle
            .getBundle("de/comicdb/comicdbcore/bean/Bundle").getString("LBL_COMIC_COST"));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 7;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 0);
    add(jLabelCost, gridBagConstraints);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 7;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 0);
    add(jTextFieldCost, gridBagConstraints);

    org.openide.awt.Mnemonics.setLocalizedText(jLabelPayDate, java.util.ResourceBundle
            .getBundle("de/comicdb/comicdbcore/bean/Bundle").getString("LBL_COMIC_PAYDATE"));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 2;
    gridBagConstraints.gridy = 6;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 0);
    add(jLabelPayDate, gridBagConstraints);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 3;
    gridBagConstraints.gridy = 6;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 0);
    add(jTextFieldPayDate, gridBagConstraints);

    org.openide.awt.Mnemonics.setLocalizedText(jButtonPayDate, "...");
    jButtonPayDate.setEnabled(false);
    jButtonPayDate.setMaximumSize(new java.awt.Dimension(18, 18));
    jButtonPayDate.setMinimumSize(new java.awt.Dimension(18, 18));
    jButtonPayDate.setPreferredSize(new java.awt.Dimension(18, 18));
    jButtonPayDate.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButtonPayDateActionPerformed(evt);
        }
    });

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 4;
    gridBagConstraints.gridy = 6;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(0, 0, 4, 4);
    add(jButtonPayDate, gridBagConstraints);

    org.openide.awt.Mnemonics.setLocalizedText(jLabelModified,
            java.util.ResourceBundle.getBundle("de/comicdb/comicdbcore/bean/Bundle").getString("LBL_MODIFIED"));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 11;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 0);
    add(jLabelModified, gridBagConstraints);

    jTextFieldModified.setEditable(false);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 11;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.weightx = 0.5;
    gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 0);
    add(jTextFieldModified, gridBagConstraints);

    org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2);
    jPanel2.setLayout(jPanel2Layout);
    jPanel2Layout.setHorizontalGroup(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 832, Short.MAX_VALUE));
    jPanel2Layout.setVerticalGroup(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 28, Short.MAX_VALUE));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 10;
    gridBagConstraints.gridwidth = 6;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    add(jPanel2, gridBagConstraints);

    org.openide.awt.Mnemonics.setLocalizedText(jLabelCondition, java.util.ResourceBundle
            .getBundle("de/comicdb/comicdbcore/bean/Bundle").getString("LBL_COMIC_CONDITION"));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 2;
    gridBagConstraints.gridy = 3;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 0);
    add(jLabelCondition, gridBagConstraints);

    jPanelNotes.setLayout(new java.awt.BorderLayout());

    jPanelNotes.setBorder(javax.swing.BorderFactory.createTitledBorder(java.util.ResourceBundle
            .getBundle("de/comicdb/comicdbcore/bean/Bundle").getString("LBL_COMIC_NOTES")));
    jTextAreaNotes.setColumns(20);
    jTextAreaNotes.setRows(5);
    jScrollPaneNotes.setViewportView(jTextAreaNotes);

    jPanelNotes.add(jScrollPaneNotes, java.awt.BorderLayout.CENTER);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 9;
    gridBagConstraints.gridwidth = 5;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4);
    add(jPanelNotes, gridBagConstraints);

    jPanelStories.setLayout(new java.awt.BorderLayout());

    jPanelStories.setBorder(javax.swing.BorderFactory.createTitledBorder(java.util.ResourceBundle
            .getBundle("de/comicdb/comicdbcore/bean/Bundle").getString("LBL_COMIC_STORIES")));
    jScrollPane1.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mousePressed(java.awt.event.MouseEvent evt) {
            jScrollPane1MousePressed(evt);
        }

        public void mouseReleased(java.awt.event.MouseEvent evt) {
            jScrollPane1MouseReleased(evt);
        }
    });

    jTableStorys.setModel(new StoryTableModel(new SelectionInList(adapter.getBufferedModel("storys"))));
    jTableStorys.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mousePressed(java.awt.event.MouseEvent evt) {
            jTableStorysMousePressed(evt);
        }

        public void mouseReleased(java.awt.event.MouseEvent evt) {
            jTableStorysMouseReleased(evt);
        }
    });

    jScrollPane1.setViewportView(jTableStorys);

    jPanelStories.add(jScrollPane1, java.awt.BorderLayout.CENTER);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 8;
    gridBagConstraints.gridwidth = 5;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4);
    add(jPanelStories, gridBagConstraints);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 0);
    add(jTextFieldNr, gridBagConstraints);

    jTextFieldCondition.setColumns(4);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 3;
    gridBagConstraints.gridy = 3;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.weightx = 0.5;
    gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 0);
    add(jTextFieldCondition, gridBagConstraints);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 3;
    gridBagConstraints.gridy = 4;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 0);
    add(jTextFieldQuantity, gridBagConstraints);

    org.openide.awt.Mnemonics.setLocalizedText(jLabelPageCount, java.util.ResourceBundle
            .getBundle("de/comicdb/comicdbcore/bean/Bundle").getString("LBL_COMIC_PAGECOUNT"));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 2;
    gridBagConstraints.gridy = 7;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 0);
    add(jLabelPageCount, gridBagConstraints);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 3;
    gridBagConstraints.gridy = 7;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 0);
    add(jTextFieldPageCount, gridBagConstraints);

    org.openide.awt.Mnemonics.setLocalizedText(jLabelCoverType, java.util.ResourceBundle
            .getBundle("de/comicdb/comicdbcore/bean/Bundle").getString("LBL_COMIC_COVERTYPE"));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 3;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 0);
    add(jLabelCoverType, gridBagConstraints);

    jComboBoxCoverType.setModel(new ComboBoxAdapter(coverTypes, adapter.getBufferedModel("covertype")));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 3;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 0);
    add(jComboBoxCoverType, gridBagConstraints);

    org.openide.awt.Mnemonics.setLocalizedText(jLabelState, java.util.ResourceBundle
            .getBundle("de/comicdb/comicdbcore/bean/Bundle").getString("LBL_COMIC_STATE"));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 2;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 0);
    add(jLabelState, gridBagConstraints);

    jComboBoxState.setModel(new ComboBoxAdapter(State.getStates(), adapter.getBufferedModel("state")));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 2;
    gridBagConstraints.gridwidth = 4;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 4);
    add(jComboBoxState, gridBagConstraints);

    org.jdesktop.layout.GroupLayout jPanelImageLayout = new org.jdesktop.layout.GroupLayout(jPanelImage);
    jPanelImage.setLayout(jPanelImageLayout);
    jPanelImageLayout.setHorizontalGroup(jPanelImageLayout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(0, 372, Short.MAX_VALUE));
    jPanelImageLayout.setVerticalGroup(jPanelImageLayout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(0, 333, Short.MAX_VALUE));
    jScrollPane2.setViewportView(jPanelImage);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 5;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.gridheight = 9;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 0.25;
    gridBagConstraints.insets = new java.awt.Insets(4, 0, 0, 4);
    add(jScrollPane2, gridBagConstraints);

    org.openide.awt.Mnemonics.setLocalizedText(jButtonAccept, java.util.ResourceBundle
            .getBundle("de/comicdb/comicdbcore/bean/Bundle").getString("button.accept"));
    jButtonAccept.setEnabled(false);
    jButtonAccept.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButtonAcceptActionPerformed(evt);
        }
    });

    jPanel1.add(jButtonAccept);

    org.openide.awt.Mnemonics.setLocalizedText(jButtonCancel, java.util.ResourceBundle
            .getBundle("de/comicdb/comicdbcore/bean/Bundle").getString("button.cancel"));
    jButtonCancel.setEnabled(false);
    jButtonCancel.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButtonCancelActionPerformed(evt);
        }
    });

    jPanel1.add(jButtonCancel);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 5;
    gridBagConstraints.gridy = 11;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
    add(jPanel1, gridBagConstraints);

    org.openide.awt.Mnemonics.setLocalizedText(jButtonChooseImage, java.util.ResourceBundle
            .getBundle("de/comicdb/comicdbcore/bean/Bundle").getString("button.choose"));
    jButtonChooseImage.setEnabled(false);
    jButtonChooseImage.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButtonChooseImageActionPerformed(evt);
        }
    });

    jPanel3.add(jButtonChooseImage);

    org.openide.awt.Mnemonics.setLocalizedText(jButtonDeleteImage,
            java.util.ResourceBundle.getBundle("de/comicdb/comicdbcore/Bundle").getString("BTN_DELETE"));
    jButtonDeleteImage.setEnabled(false);
    jButtonDeleteImage.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButtonDeleteImageActionPerformed(evt);
        }
    });

    jPanel3.add(jButtonDeleteImage);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 5;
    gridBagConstraints.gridy = 9;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(4, 0, 0, 4);
    add(jPanel3, gridBagConstraints);

}

From source file:de.comicdb.comicdbcore.bean.PublisherTopComponent.java

License:Open Source License

/** This method is called from within the constructor to
 * initialize the form./*from  ww w . j a v a 2s. co  m*/
 * WARNING: Do NOT modify this code. The content of this method is
 * always regenerated by the Form Editor.
 */
// <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
private void initComponents() {
    java.awt.GridBagConstraints gridBagConstraints;

    jLabelName = new javax.swing.JLabel();
    jTextFieldName = BasicComponentFactory.createTextField(adapter.getBufferedModel("name"));
    jPanel2 = new javax.swing.JPanel();
    jScrollPane1 = new javax.swing.JScrollPane();
    jTableSeries = new javax.swing.JTable();
    jTableSeries.setDefaultRenderer(Object.class, new SerieTableCellRenderer());
    jLabelModified = new javax.swing.JLabel();
    jTextFieldModified = BasicComponentFactory.createFormattedTextField(adapter.getBufferedModel("modified"),
            new SimpleDateFormat(java.util.ResourceBundle.getBundle("de/comicdb/comicdbcore/bean/Bundle")
                    .getString("format.date")));
    jScrollPane2 = new javax.swing.JScrollPane();
    jPanelImage = new ImagePanel();
    jPanel1 = new javax.swing.JPanel();
    jButtonAccept = new javax.swing.JButton();
    jButtonCancel = new javax.swing.JButton();
    jPanel3 = new javax.swing.JPanel();
    jButtonChooseImage = new javax.swing.JButton();
    jButtonDeleteImage = new javax.swing.JButton();

    setLayout(new java.awt.GridBagLayout());

    org.openide.awt.Mnemonics.setLocalizedText(jLabelName, java.util.ResourceBundle
            .getBundle("de/comicdb/comicdbcore/bean/Bundle").getString("LBL_PUBLISHER_NAME"));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
    gridBagConstraints.insets = new java.awt.Insets(4, 4, 0, 4);
    add(jLabelName, gridBagConstraints);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(4, 0, 0, 4);
    add(jTextFieldName, gridBagConstraints);

    jPanel2.setLayout(new java.awt.BorderLayout());

    jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(
            java.util.ResourceBundle.getBundle("de/comicdb/comicdbcore/bean/Bundle").getString("LBL_SERIE")));
    jScrollPane1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0), 0));
    jTableSeries.setBackground(javax.swing.UIManager.getDefaults().getColor("Panel.background"));
    jTableSeries.setModel(new SerieTableModel(new SelectionInList(adapter.getBufferedModel("series"))));
    jTableSeries.setShowHorizontalLines(false);
    jTableSeries.setShowVerticalLines(false);
    jScrollPane1.setViewportView(jTableSeries);

    jPanel2.add(jScrollPane1, java.awt.BorderLayout.CENTER);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 2;
    gridBagConstraints.gridwidth = 3;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4);
    add(jPanel2, gridBagConstraints);

    org.openide.awt.Mnemonics.setLocalizedText(jLabelModified,
            java.util.ResourceBundle.getBundle("de/comicdb/comicdbcore/bean/Bundle").getString("LBL_MODIFIED"));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 3;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 0);
    add(jLabelModified, gridBagConstraints);

    jTextFieldModified.setEditable(false);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 3;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 0);
    add(jTextFieldModified, gridBagConstraints);

    org.jdesktop.layout.GroupLayout jPanelImageLayout = new org.jdesktop.layout.GroupLayout(jPanelImage);
    jPanelImage.setLayout(jPanelImageLayout);
    jPanelImageLayout.setHorizontalGroup(jPanelImageLayout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(0, 282, Short.MAX_VALUE));
    jPanelImageLayout.setVerticalGroup(jPanelImageLayout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(0, 99, Short.MAX_VALUE));
    jScrollPane2.setViewportView(jPanelImage);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.weighty = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(4, 0, 0, 4);
    add(jScrollPane2, gridBagConstraints);

    org.openide.awt.Mnemonics.setLocalizedText(jButtonAccept, java.util.ResourceBundle
            .getBundle("de/comicdb/comicdbcore/bean/Bundle").getString("button.accept"));
    jButtonAccept.setEnabled(false);
    jButtonAccept.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButtonAcceptActionPerformed(evt);
        }
    });

    jPanel1.add(jButtonAccept);

    org.openide.awt.Mnemonics.setLocalizedText(jButtonCancel, java.util.ResourceBundle
            .getBundle("de/comicdb/comicdbcore/bean/Bundle").getString("button.cancel"));
    jButtonCancel.setEnabled(false);
    jButtonCancel.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButtonCancelActionPerformed(evt);
        }
    });

    jPanel1.add(jButtonCancel);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 2;
    gridBagConstraints.gridy = 3;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
    add(jPanel1, gridBagConstraints);

    org.openide.awt.Mnemonics.setLocalizedText(jButtonChooseImage, java.util.ResourceBundle
            .getBundle("de/comicdb/comicdbcore/bean/Bundle").getString("button.choose"));
    jButtonChooseImage.setEnabled(false);
    jButtonChooseImage.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButtonChooseImageActionPerformed(evt);
        }
    });

    jPanel3.add(jButtonChooseImage);

    org.openide.awt.Mnemonics.setLocalizedText(jButtonDeleteImage,
            java.util.ResourceBundle.getBundle("de/comicdb/comicdbcore/Bundle").getString("BTN_DELETE"));
    jButtonDeleteImage.setEnabled(false);
    jButtonDeleteImage.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButtonDeleteImageActionPerformed(evt);
        }
    });

    jPanel3.add(jButtonDeleteImage);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 2;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(4, 0, 0, 4);
    add(jPanel3, gridBagConstraints);

}

From source file:de.comicdb.comicdbcore.bean.SerieTopComponent.java

License:Open Source License

/** This method is called from within the constructor to
 * initialize the form./*from   w ww  .  j  av a  2  s. co  m*/
 * WARNING: Do NOT modify this code. The content of this method is
 * always regenerated by the Form Editor.
 */
// <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
private void initComponents() {
    java.awt.GridBagConstraints gridBagConstraints;

    jLabel1 = new javax.swing.JLabel();
    jTextFieldName = BasicComponentFactory.createTextField(adapter.getBufferedModel("name"));
    jPanel2 = new javax.swing.JPanel();
    jScrollPane1 = new javax.swing.JScrollPane();
    jTableComics = new javax.swing.JTable();
    jTableComics.setDefaultRenderer(Object.class, new ComicTableCellRenderer());
    jLabelModified = new javax.swing.JLabel();
    jTextFieldModified = BasicComponentFactory.createFormattedTextField(adapter.getBufferedModel("modified"),
            new SimpleDateFormat(java.util.ResourceBundle.getBundle("de/comicdb/comicdbcore/bean/Bundle")
                    .getString("format.date")));
    jScrollPane2 = new javax.swing.JScrollPane();
    jPanelImage = new ImagePanel();
    jPanel1 = new javax.swing.JPanel();
    jButtonAccept = new javax.swing.JButton();
    jButtonCancel = new javax.swing.JButton();
    jPanel3 = new javax.swing.JPanel();
    jButtonChooseImage = new javax.swing.JButton();
    jButtonDeleteImage = new javax.swing.JButton();

    setLayout(new java.awt.GridBagLayout());

    org.openide.awt.Mnemonics.setLocalizedText(jLabel1, java.util.ResourceBundle
            .getBundle("de/comicdb/comicdbcore/bean/Bundle").getString("LBL_SERIE_NAME"));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
    gridBagConstraints.insets = new java.awt.Insets(4, 4, 0, 4);
    add(jLabel1, gridBagConstraints);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(4, 0, 0, 4);
    add(jTextFieldName, gridBagConstraints);

    jPanel2.setLayout(new java.awt.BorderLayout());

    jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(
            java.util.ResourceBundle.getBundle("de/comicdb/comicdbcore/bean/Bundle").getString("LBL_COMIC")));
    jScrollPane1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0), 0));
    jTableComics.setBackground(javax.swing.UIManager.getDefaults().getColor("Panel.background"));
    jTableComics.setModel(new ComicTableModel(new SelectionInList(adapter.getBufferedModel("comics"))));
    jTableComics.setShowHorizontalLines(false);
    jTableComics.setShowVerticalLines(false);
    jScrollPane1.setViewportView(jTableComics);

    jPanel2.add(jScrollPane1, java.awt.BorderLayout.CENTER);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 2;
    gridBagConstraints.gridwidth = 3;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4);
    add(jPanel2, gridBagConstraints);

    org.openide.awt.Mnemonics.setLocalizedText(jLabelModified,
            java.util.ResourceBundle.getBundle("de/comicdb/comicdbcore/bean/Bundle").getString("LBL_MODIFIED"));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 3;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 0);
    add(jLabelModified, gridBagConstraints);

    jTextFieldModified.setEditable(false);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 3;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 0);
    add(jTextFieldModified, gridBagConstraints);

    org.jdesktop.layout.GroupLayout jPanelImageLayout = new org.jdesktop.layout.GroupLayout(jPanelImage);
    jPanelImage.setLayout(jPanelImageLayout);
    jPanelImageLayout.setHorizontalGroup(jPanelImageLayout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(0, 282, Short.MAX_VALUE));
    jPanelImageLayout.setVerticalGroup(jPanelImageLayout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(0, 127, Short.MAX_VALUE));
    jScrollPane2.setViewportView(jPanelImage);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.weighty = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(4, 0, 0, 4);
    add(jScrollPane2, gridBagConstraints);

    org.openide.awt.Mnemonics.setLocalizedText(jButtonAccept, java.util.ResourceBundle
            .getBundle("de/comicdb/comicdbcore/bean/Bundle").getString("button.accept"));
    jButtonAccept.setEnabled(false);
    jButtonAccept.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButtonAcceptActionPerformed(evt);
        }
    });

    jPanel1.add(jButtonAccept);

    org.openide.awt.Mnemonics.setLocalizedText(jButtonCancel, java.util.ResourceBundle
            .getBundle("de/comicdb/comicdbcore/bean/Bundle").getString("button.cancel"));
    jButtonCancel.setEnabled(false);
    jButtonCancel.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButtonCancelActionPerformed(evt);
        }
    });

    jPanel1.add(jButtonCancel);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 2;
    gridBagConstraints.gridy = 3;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
    add(jPanel1, gridBagConstraints);

    org.openide.awt.Mnemonics.setLocalizedText(jButtonChooseImage, java.util.ResourceBundle
            .getBundle("de/comicdb/comicdbcore/bean/Bundle").getString("button.choose"));
    jButtonChooseImage.setEnabled(false);
    jButtonChooseImage.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButtonChooseImageActionPerformed(evt);
        }
    });

    jPanel3.add(jButtonChooseImage);

    org.openide.awt.Mnemonics.setLocalizedText(jButtonDeleteImage,
            java.util.ResourceBundle.getBundle("de/comicdb/comicdbcore/Bundle").getString("BTN_DELETE"));
    jButtonDeleteImage.setEnabled(false);
    jButtonDeleteImage.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButtonDeleteImageActionPerformed(evt);
        }
    });

    jPanel3.add(jButtonDeleteImage);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 2;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(4, 0, 0, 4);
    add(jPanel3, gridBagConstraints);

}

From source file:net.sf.housekeeper.swing.FoodItemModel.java

License:Open Source License

/**
 * Creates a new model with the underlying household.
 * /*from  w ww. ja  v  a  2 s  . c o m*/
 * @param household Manager of the StockItems.
 */
public FoodItemModel(final FoodItemManager household) {
    this.itemManager = household;
    itemSelection = new SelectionInList(household.getSupplyListModel());

    newAction = new NewAction();
    editAction = new EditAction();
    deleteAction = new DeleteAction();
    duplicateAction = new DuplicateAction();
    updateActionEnablement();

    itemSelection.addPropertyChangeListener(SelectionInList.PROPERTYNAME_SELECTION_EMPTY,
            new SelectionHandler());
}

From source file:org.archiviststoolkit.swing.ATBasicComponentFactory.java

License:Open Source License

public static JComboBox createComboBox(PresentationModel detailsModel, String fieldName, Class clazz,
        Integer maxLength, boolean buffered) {
    ATFieldInfo fieldInfo = ATFieldInfo.getFieldInfo(clazz.getName() + "." + fieldName);
    Vector<LookupListItems> values = null;
    JComboBox returnCombobox;//  ww  w .j  a  v a2s .  c  o m
    if (fieldInfo != null) {
        values = LookupListUtils.getLookupListValues2(fieldInfo.getLookupList());
    }
    if (values == null) {
        values = new Vector<LookupListItems>();
    } else {

    }
    if (fieldInfo == null) {
        returnCombobox = addListCellRenderer(BasicComponentFactory.createComboBox(new SelectionInList(values)),
                maxLength);
    } else {
        if (buffered) {
            ValueModel valueModel = detailsModel.getBufferedModel(fieldName);
            detailsModel.observeChanged(valueModel);
            returnCombobox = addListCellRenderer(
                    BasicComponentFactory
                            .createComboBox(new SelectionInList(values, ATJgoodiesBindingConverterFactory
                                    .createLookupListConverter(valueModel, fieldInfo.getLookupList()))),
                    maxLength);
        } else {
            ValueModel valueModel = detailsModel.getModel(fieldName);
            detailsModel.observeChanged(valueModel);
            returnCombobox = addListCellRenderer(
                    BasicComponentFactory
                            .createComboBox(new SelectionInList(values, ATJgoodiesBindingConverterFactory
                                    .createLookupListConverter(valueModel, fieldInfo.getLookupList()))),
                    maxLength);
        }
    }
    returnCombobox.addFocusListener(new ATComboBoxListener(returnCombobox));
    return returnCombobox;
}