Search in sources :

Example 11 with DefaultTableModel

use of javax.swing.table.DefaultTableModel in project gephi by gephi.

the class PaletteGeneratorPanel method generate.

private void generate() {
    int colorCount = Integer.parseInt(colorCountLabel.getText());
    int paletteCount = colorCount;
    if (limitColorsCheckbox.isSelected()) {
        paletteCount = ((Number) limitColorSpinner.getValue()).intValue();
    }
    selectedPalette = PaletteManager.getInstance().generatePalette(paletteCount, selectedPreset);
    if (paletteCount < colorCount) {
        Color[] cols = Arrays.copyOf(selectedPalette.getColors(), colorCount);
        for (int i = paletteCount; i < cols.length; i++) {
            cols[i] = Color.LIGHT_GRAY;
        }
        selectedPalette = new Palette(cols);
    }
    String[] columnNames = new String[] { "Color" };
    DefaultTableModel model = new DefaultTableModel(columnNames, colorCount) {

        @Override
        public boolean isCellEditable(int row, int column) {
            return false;
        }
    };
    colorTable.setModel(model);
    TableColumn colorCol = colorTable.getColumnModel().getColumn(0);
    colorCol.setCellRenderer(new ColorCellRenderer());
    int row = 0;
    for (Color c : selectedPalette.getColors()) {
        model.setValueAt(c, row++, 0);
    }
}
Also used : Palette(org.gephi.appearance.plugin.palette.Palette) Color(java.awt.Color) DefaultTableModel(javax.swing.table.DefaultTableModel) TableColumn(javax.swing.table.TableColumn)

Example 12 with DefaultTableModel

use of javax.swing.table.DefaultTableModel in project nhin-d by DirectProject.

the class PKCS11SecretKeyManager method initUI.

private void initUI() {
    this.getContentPane().setLayout(new BorderLayout(5, 5));
    // Top Panel
    JPanel topPanel = new JPanel();
    topPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
    addAESKeyButton = new JButton("Add AES Key");
    addAESKeyButton.setSize(new Dimension(30, 100));
    addGenericKeyButton = new JButton("Add Text Key");
    addGenericKeyButton.setSize(new Dimension(30, 100));
    removeKeyButton = new JButton("Remove Key(s)");
    removeKeyButton.setSize(new Dimension(30, 100));
    topPanel.add(addAESKeyButton);
    topPanel.add(addGenericKeyButton);
    topPanel.add(removeKeyButton);
    this.getContentPane().add(topPanel, BorderLayout.NORTH);
    // Middle and list panel
    JPanel midPanel = new JPanel();
    midPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
    midPanel.setLayout(new BorderLayout(5, 5));
    JLabel keyListLabel = new JLabel("Secret Keys:");
    Object[][] data = {};
    String[] columnNames = { "Key Alias", "Key Type", "Key Value" };
    keyDataModel = new DefaultTableModel(data, columnNames);
    keyDataTable = new JTable(keyDataModel);
    JScrollPane scrollPane = new JScrollPane(keyDataTable);
    keyDataTable.setFillsViewportHeight(true);
    midPanel.add(keyListLabel, BorderLayout.NORTH);
    midPanel.add(scrollPane, BorderLayout.CENTER);
    this.getContentPane().add(midPanel, BorderLayout.CENTER);
    // Bottom Panel
    JPanel bottomPanel = new JPanel();
    bottomPanel.setLayout(new FlowLayout(FlowLayout.RIGHT));
    quitButton = new JButton("Quit");
    quitButton.setSize(new Dimension(30, 100));
    bottomPanel.add(quitButton);
    this.getContentPane().add(bottomPanel, BorderLayout.SOUTH);
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) FlowLayout(java.awt.FlowLayout) BorderLayout(java.awt.BorderLayout) DefaultTableModel(javax.swing.table.DefaultTableModel) JTable(javax.swing.JTable) JButton(javax.swing.JButton) JLabel(javax.swing.JLabel) Dimension(java.awt.Dimension)

Example 13 with DefaultTableModel

use of javax.swing.table.DefaultTableModel in project nhin-d by DirectProject.

the class PKCS11SecretKeyManagerUI method initUI.

private void initUI() {
    this.getContentPane().setLayout(new BorderLayout(5, 5));
    // Top Panel
    JPanel topPanel = new JPanel();
    topPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
    addAESKeyButton = new JButton("Add AES Key");
    addAESKeyButton.setSize(new Dimension(30, 100));
    addGenericKeyButton = new JButton("Add Text Key");
    addGenericKeyButton.setSize(new Dimension(30, 100));
    removeKeyButton = new JButton("Remove Key(s)");
    removeKeyButton.setSize(new Dimension(30, 100));
    topPanel.add(addAESKeyButton);
    topPanel.add(addGenericKeyButton);
    topPanel.add(removeKeyButton);
    this.getContentPane().add(topPanel, BorderLayout.NORTH);
    // Middle and list panel
    JPanel midPanel = new JPanel();
    midPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
    midPanel.setLayout(new BorderLayout(5, 5));
    JLabel keyListLabel = new JLabel("Secret Keys:");
    Object[][] data = {};
    String[] columnNames = { "Key Alias", "Key Type", "Key Value" };
    keyDataModel = new DefaultTableModel(data, columnNames);
    keyDataTable = new JTable(keyDataModel);
    JScrollPane scrollPane = new JScrollPane(keyDataTable);
    keyDataTable.setFillsViewportHeight(true);
    midPanel.add(keyListLabel, BorderLayout.NORTH);
    midPanel.add(scrollPane, BorderLayout.CENTER);
    this.getContentPane().add(midPanel, BorderLayout.CENTER);
    // Bottom Panel
    JPanel bottomPanel = new JPanel();
    bottomPanel.setLayout(new FlowLayout(FlowLayout.RIGHT));
    quitButton = new JButton("Quit");
    quitButton.setSize(new Dimension(30, 100));
    bottomPanel.add(quitButton);
    this.getContentPane().add(bottomPanel, BorderLayout.SOUTH);
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) FlowLayout(java.awt.FlowLayout) BorderLayout(java.awt.BorderLayout) DefaultTableModel(javax.swing.table.DefaultTableModel) JTable(javax.swing.JTable) JButton(javax.swing.JButton) JLabel(javax.swing.JLabel) Dimension(java.awt.Dimension)

Example 14 with DefaultTableModel

use of javax.swing.table.DefaultTableModel in project azure-tools-for-java by Microsoft.

the class SubscriptionsDialog method setSubscriptions.

private void setSubscriptions() {
    DefaultTableModel model = (DefaultTableModel) table.getModel();
    for (SubscriptionDetail sd : sdl) {
        model.addRow(new Object[] { sd.isSelected(), sd.getSubscriptionName(), sd.getSubscriptionId() });
    }
    model.fireTableDataChanged();
}
Also used : DefaultTableModel(javax.swing.table.DefaultTableModel) SubscriptionDetail(com.microsoft.azuretools.authmanage.models.SubscriptionDetail)

Example 15 with DefaultTableModel

use of javax.swing.table.DefaultTableModel in project azure-tools-for-java by Microsoft.

the class WarSelectDialog method doOKAction.

@Override
protected void doOKAction() {
    DefaultTableModel tableModel = (DefaultTableModel) table.getModel();
    int i = table.getSelectedRow();
    if (i < 0) {
        JOptionPane.showMessageDialog(contentPane, "Please select an artifact", "Select Artifact Status", JOptionPane.INFORMATION_MESSAGE);
        return;
    }
    selectedArtifact = artifactList.get(i);
    super.doOKAction();
}
Also used : DefaultTableModel(javax.swing.table.DefaultTableModel)

Aggregations

DefaultTableModel (javax.swing.table.DefaultTableModel)119 Vector (java.util.Vector)12 JTable (javax.swing.JTable)12 JBTable (com.intellij.ui.table.JBTable)10 Dimension (java.awt.Dimension)9 JScrollPane (javax.swing.JScrollPane)9 TableColumn (javax.swing.table.TableColumn)9 ActionEvent (java.awt.event.ActionEvent)7 JButton (javax.swing.JButton)7 JPanel (javax.swing.JPanel)7 ListSelectionEvent (javax.swing.event.ListSelectionEvent)7 ListSelectionListener (javax.swing.event.ListSelectionListener)7 WebAppDetails (com.microsoft.azuretools.utils.WebAppUtils.WebAppDetails)6 AnActionEvent (com.intellij.openapi.actionSystem.AnActionEvent)5 ProgressIndicator (com.intellij.openapi.progress.ProgressIndicator)5 VirtualFile (com.intellij.openapi.vfs.VirtualFile)5 DockerHost (com.microsoft.azure.docker.model.DockerHost)5 EditableDockerHost (com.microsoft.azure.docker.model.EditableDockerHost)5 Color (java.awt.Color)5 ActionListener (java.awt.event.ActionListener)5