use of javax.swing.event.ListSelectionListener in project JWildfire by thargor6.
the class TinaInternalFrame method getGradientsList.
private JList getGradientsList() {
if (gradientsList == null) {
gradientsList = new JList();
gradientsList.addListSelectionListener(new ListSelectionListener() {
public void valueChanged(ListSelectionEvent e) {
tinaController.getGradientController().gradientLibraryGradientChanged();
}
});
}
return gradientsList;
}
use of javax.swing.event.ListSelectionListener in project JWildfire by thargor6.
the class TinaInternalFrame method getLayersTable.
private JTable getLayersTable() {
if (layersTable == null) {
layersTable = new JTable();
layersTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
layersTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
@Override
public void valueChanged(ListSelectionEvent e) {
if (!e.getValueIsAdjusting()) {
tinaController.layersTableClicked();
}
}
});
}
return layersTable;
}
use of javax.swing.event.ListSelectionListener in project JWildfire by thargor6.
the class TinaInternalFrame method getTabbedPane.
private JTabbedPane getTabbedPane() {
if (tabbedPane == null) {
tabbedPane = new JTabbedPane(JTabbedPane.TOP);
tabbedPane.addTab("Description", null, getPanel_60(), null);
tabbedPane.addTab("Code preview", null, getPanel_61(), null);
JPanel panel_1 = new JPanel();
tabbedPane.addTab("Macro buttons", null, panel_1, null);
panel_1.setLayout(new BorderLayout(0, 0));
JPanel panel_2 = new JPanel();
panel_2.setPreferredSize(new Dimension(120, 10));
panel_1.add(panel_2, BorderLayout.CENTER);
panel_2.setLayout(new BorderLayout(0, 0));
JScrollPane scrollPane_2 = new JScrollPane();
scrollPane_2.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
scrollPane_2.setBorder(null);
panel_2.add(scrollPane_2, BorderLayout.CENTER);
macroButtonsTable = new JTable();
macroButtonsTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
macroButtonsTable.setFont(Prefs.getPrefs().getFont("Dialog", Font.PLAIN, 10));
macroButtonsTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
@Override
public void valueChanged(ListSelectionEvent e) {
if (!e.getValueIsAdjusting()) {
tinaController.getJwfScriptController().macroButtonsTableClicked();
}
}
});
scrollPane_2.setViewportView(macroButtonsTable);
JPanel panel_3 = new JPanel();
FlowLayout flowLayout = (FlowLayout) panel_3.getLayout();
flowLayout.setHgap(0);
flowLayout.setVgap(1);
panel_3.setPreferredSize(new Dimension(124, 10));
panel_1.add(panel_3, BorderLayout.EAST);
JPanel panel_9 = new JPanel();
panel_9.setPreferredSize(new Dimension(116, 4));
panel_9.setMinimumSize(new Dimension(116, 8));
panel_9.setMaximumSize(new Dimension(32767, 8));
panel_3.add(panel_9);
macroButtonMoveUpBtn = new JButton();
macroButtonMoveUpBtn.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
tinaController.getJwfScriptController().macroButtonMoveUp();
}
});
macroButtonMoveUpBtn.setToolTipText("Move the button one up in the list");
macroButtonMoveUpBtn.setText("Up");
macroButtonMoveUpBtn.setPreferredSize(new Dimension(58, 24));
macroButtonMoveUpBtn.setMinimumSize(new Dimension(58, 12));
macroButtonMoveUpBtn.setMaximumSize(new Dimension(58, 12));
macroButtonMoveUpBtn.setFont(Prefs.getPrefs().getFont("Dialog", Font.BOLD, 10));
macroButtonMoveUpBtn.setBounds(new Rectangle(9, 280, 125, 24));
panel_3.add(macroButtonMoveUpBtn);
macroButtonMoveDownBtn = new JButton();
macroButtonMoveDownBtn.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
tinaController.getJwfScriptController().macroButtonMoveDown();
}
});
macroButtonMoveDownBtn.setToolTipText("Move the button one down in the list");
macroButtonMoveDownBtn.setText("Down");
macroButtonMoveDownBtn.setPreferredSize(new Dimension(58, 24));
macroButtonMoveDownBtn.setMinimumSize(new Dimension(58, 12));
macroButtonMoveDownBtn.setMaximumSize(new Dimension(58, 12));
macroButtonMoveDownBtn.setFont(Prefs.getPrefs().getFont("Dialog", Font.BOLD, 10));
macroButtonMoveDownBtn.setBounds(new Rectangle(9, 280, 125, 24));
panel_3.add(macroButtonMoveDownBtn);
JPanel panel_8 = new JPanel();
panel_8.setPreferredSize(new Dimension(116, 4));
panel_8.setMinimumSize(new Dimension(116, 8));
panel_8.setMaximumSize(new Dimension(32767, 8));
panel_3.add(panel_8);
macroButtonDeleteBtn = new JButton();
macroButtonDeleteBtn.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
tinaController.getJwfScriptController().macroButtonDelete();
}
});
macroButtonDeleteBtn.setToolTipText("Delete the button");
macroButtonDeleteBtn.setText("Delete");
macroButtonDeleteBtn.setPreferredSize(new Dimension(116, 24));
macroButtonDeleteBtn.setFont(Prefs.getPrefs().getFont("Dialog", Font.BOLD, 10));
macroButtonDeleteBtn.setBounds(new Rectangle(9, 280, 125, 24));
panel_3.add(macroButtonDeleteBtn);
}
return tabbedPane;
}
use of javax.swing.event.ListSelectionListener in project JWildfire by thargor6.
the class TinaInternalFrame method getTinaTransformationsTable.
/**
* This method initializes tinaTransformationsTable
*
* @return javax.swing.JTable
*/
private JTable getTinaTransformationsTable() {
if (tinaTransformationsTable == null) {
tinaTransformationsTable = new JTable();
tinaTransformationsTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
tinaTransformationsTable.setFont(Prefs.getPrefs().getFont("Dialog", Font.PLAIN, 10));
tinaTransformationsTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
@Override
public void valueChanged(ListSelectionEvent e) {
if (!e.getValueIsAdjusting()) {
tinaController.transformationTableClicked();
}
}
});
}
return tinaTransformationsTable;
}
use of javax.swing.event.ListSelectionListener in project sldeditor by robward-scisys.
the class DataSourceConfigPanel method createTable.
/**
* Creates the table.
*
* @return the component
*/
private Component createTable() {
final UndoActionInterface parentObj = this;
dataModel = new DataSourceAttributeModel();
dataModel.addTableModelListener(new TableModelListener() {
/**
* Table changed.
*
* @param arg0 the arg0
*/
@Override
public void tableChanged(TableModelEvent arg0) {
if (!isPopulatingTable()) {
dataChanged = true;
updateButtonState();
}
}
});
table = new JTable();
table.setModel(dataModel);
table.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
@Override
public void valueChanged(ListSelectionEvent arg0) {
updateButtonState();
}
});
TableColumn tmpColum = table.getColumnModel().getColumn(1);
JComboBox<String> comboBox = new JComboBox<String>(dataModel.getTypeData());
DefaultCellEditor defaultCellEditor = new DefaultCellEditor(comboBox);
tmpColum.setCellEditor(defaultCellEditor);
tmpColum.setCellRenderer(new ComboBoxCellRenderer(comboBox));
JPanel buttonPanel = new JPanel();
FlowLayout flowLayout = (FlowLayout) buttonPanel.getLayout();
flowLayout.setHgap(1);
flowLayout.setAlignment(FlowLayout.TRAILING);
add(buttonPanel, BorderLayout.SOUTH);
btnDisconnect = new JButton(Localisation.getString(DataSourceConfigPanel.class, "DataSourceConfigPanel.disconnect"));
btnDisconnect.setEnabled(false);
btnDisconnect.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
SLDEditorFile.getInstance().getSLDData().setDataSourceProperties(DataSourceConnectorFactory.getNoDataSource());
applyData(parentObj);
}
});
buttonPanel.add(btnDisconnect);
btnAddField = new JButton(Localisation.getString(DataSourceConfigPanel.class, "DataSourceConfigPanel.add"));
btnAddField.setEnabled(false);
btnAddField.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
addNewField();
}
});
buttonPanel.add(btnAddField);
btnRemoveField = new JButton(Localisation.getString(DataSourceConfigPanel.class, "DataSourceConfigPanel.remove"));
btnRemoveField.setEnabled(false);
btnRemoveField.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
removeField();
}
});
buttonPanel.add(btnRemoveField);
btnApply = new JButton(Localisation.getString(DataSourceConfigPanel.class, "common.apply"));
btnApply.setEnabled(false);
btnApply.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
applyData(parentObj);
}
});
buttonPanel.add(btnApply);
btnCancel = new JButton(Localisation.getString(DataSourceConfigPanel.class, "common.cancel"));
btnCancel.setEnabled(false);
btnCancel.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
cancelData();
}
});
buttonPanel.add(btnCancel);
JScrollPane scrollPane = new JScrollPane(table);
return scrollPane;
}
Aggregations