use of java.awt.event.WindowAdapter in project zaproxy by zaproxy.
the class ManualRequestEditorDialog method initialize.
protected void initialize() {
addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
getMessageSender().cleanup();
saveConfig();
}
});
setContentPane(getWindowPanel());
}
use of java.awt.event.WindowAdapter in project zaproxy by zaproxy.
the class MainFrame method initialize.
/**
* This method initializes this
*/
private void initialize() {
this.setJMenuBar(getMainMenuBar());
this.setContentPane(getPaneContent());
this.setPreferredSize(new Dimension(1000, 800));
this.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
this.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
getMainMenuBar().getMenuFileControl().exit();
}
});
this.setVisible(false);
}
use of java.awt.event.WindowAdapter in project ACS by ACS-Community.
the class ScriptFilter method getPropertyAddPanel.
/**
* This method initializes PropertyAddPanel
* @return javax.swing.JPanel
*/
private JPanel getPropertyAddPanel() {
if (PropertyAddPanel == null) {
PropertyAddPanel = new JPanel();
PropertyAddPanel.setMinimumSize(new Dimension(450, 350));
PropertyAddPanel.setLayout(new GridBagLayout());
PropertyAddPanel.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
PropertyAddPanel.setPreferredSize(new Dimension(450, 350));
ComponentPanel = new JPanel();
PropertyPanel = new JPanel();
ComponentPanel.setLayout(new GridBagLayout());
ComponentPanel.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
ComponentPanel.setBorder(new javax.swing.border.TitledBorder("Components"));
PropertyPanel.setLayout(new GridBagLayout());
PropertyPanel.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
PropertyPanel.setBorder(new javax.swing.border.TitledBorder("Properties"));
GridBagConstraints comp = new GridBagConstraints();
comp.gridheight = 1;
comp.gridwidth = 1;
comp.insets = new Insets(15, 5, 5, 5);
comp.anchor = GridBagConstraints.EAST;
comp.gridx = 0;
comp.gridy = 0;
ComponentPanel.add(getFilterComponentLabel(), comp);
comp.gridx = 1;
comp.gridy = 0;
comp.anchor = GridBagConstraints.WEST;
ComponentPanel.add(getFilterComponentTextField(), comp);
comp.anchor = GridBagConstraints.EAST;
comp.gridx = 0;
comp.gridy = 1;
ComponentPanel.add(getComponentLabel(), comp);
comp.gridx = 1;
comp.gridy = 1;
comp.anchor = GridBagConstraints.WEST;
ComponentPanel.add(getComponentComboBox(), comp);
comp.anchor = GridBagConstraints.EAST;
comp.gridx = 0;
comp.gridy = 0;
PropertyPanel.add(getFilterPropertyLabel(), comp);
comp.gridx = 1;
comp.gridy = 0;
comp.anchor = GridBagConstraints.WEST;
PropertyPanel.add(getFilterPropertyTextField(), comp);
comp.anchor = GridBagConstraints.EAST;
comp.gridx = 0;
comp.gridy = 1;
PropertyPanel.add(getPropertyLabel(), comp);
comp.gridx = 1;
comp.gridy = 1;
comp.anchor = GridBagConstraints.WEST;
PropertyPanel.add(getPropertyComboBox(), comp);
comp.gridx = 0;
GridBagConstraints c = new GridBagConstraints();
c.gridheight = 1;
c.gridwidth = 1;
c.insets = new Insets(15, 5, 5, 5);
c.anchor = GridBagConstraints.EAST;
c.gridx = 0;
c.gridy = 0;
c.gridwidth = 2;
PropertyAddPanel.add(ComponentPanel, c);
c.anchor = GridBagConstraints.EAST;
c.gridy = 1;
c.gridx = 0;
c.gridwidth = 2;
PropertyAddPanel.add(PropertyPanel, c);
c.anchor = GridBagConstraints.EAST;
c.gridy = 2;
c.gridx = 0;
c.gridwidth = 1;
PropertyAddPanel.add(getGroupLabel(), c);
c.gridx = 1;
c.gridy = 2;
c.gridwidth = 1;
c.anchor = GridBagConstraints.WEST;
PropertyAddPanel.add(getGroupTextField(), c);
c.anchor = GridBagConstraints.EAST;
c.gridy = 3;
c.gridx = 0;
c.gridwidth = 2;
PropertyAddPanel.add(getAddSampleButton(), c);
PropertyAddPanel.validate();
// This is a new status icon that should reflect the status of the SSG
c.anchor = GridBagConstraints.WEST;
c.gridy = 3;
c.gridx = 0;
PropertyAddPanel.add(getStatusIcon(), c);
this.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
this.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent we) {
askClose();
}
});
}
return PropertyAddPanel;
}
use of java.awt.event.WindowAdapter in project ACS by ACS-Community.
the class BeanGrouper method initialize.
/**
* This method initializes the GUI, setting up the layout.
*/
private void initialize() {
this.setMinimumSize(new Dimension(990, 600));
this.setLayout(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
c.insets = new Insets(5, 5, 5, 5);
/* First row only has the Plot. It is filled
* after the creation of this object, in the addSamp method */
/* Second Row */
c.anchor = GridBagConstraints.WEST;
c.gridy = 1;
c.gridx = 0;
c.weighty = 0;
c.weightx = 0;
c.gridwidth = 1;
c.fill = GridBagConstraints.NONE;
c.anchor = GridBagConstraints.WEST;
this.add(getStartButton(), c);
c.gridx = 1;
c.anchor = GridBagConstraints.WEST;
this.add(getPauseButton(), c);
c.gridx = 2;
c.anchor = GridBagConstraints.WEST;
this.add(getStopButton(), c);
c.gridx = 3;
c.anchor = GridBagConstraints.EAST;
this.add(getFrequencyLabel(), c);
c.gridx = 4;
c.anchor = GridBagConstraints.CENTER;
this.add(getFreqSpinner(), c);
c.gridx = 5;
c.anchor = GridBagConstraints.WEST;
this.add(getResetFrequencyButton(), c);
c.gridx = 6;
c.anchor = GridBagConstraints.WEST;
this.add(getCleanButton(), c);
c.gridx = 7;
c.anchor = GridBagConstraints.WEST;
this.add(getTimeSampLabel(), c);
c.gridx = 8;
c.anchor = GridBagConstraints.WEST;
this.add(getTimeSampSpinner(), c);
c.gridx = 9;
c.anchor = GridBagConstraints.WEST;
this.add(getTimeWindowLabel(), c);
c.gridx = 10;
c.anchor = GridBagConstraints.WEST;
this.add(getTimeWindowSpinner(), c);
/* Third row */
c.anchor = GridBagConstraints.WEST;
c.gridy = 2;
c.gridx = 0;
this.add(getSaveButton(), c);
c.anchor = GridBagConstraints.WEST;
c.gridx = 1;
c.gridwidth = 5;
c.weightx = 1;
this.add(getFileNameLabel(), c);
c.gridx = 6;
c.gridwidth = 4;
c.weightx = 0;
c.fill = 1;
c.anchor = GridBagConstraints.WEST;
this.add(getStatusScrollBar(), c);
c.gridx = 10;
c.gridwidth = 1;
this.add(getStatusIcon(), c);
this.getStopButton().setEnabled(false);
this.getPauseButton().setEnabled(false);
this.setTitle("Sampling Group: " + group);
this.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
//addWindowListener(this);
//add menu
this.setJMenuBar(getBeanGrouperMenuBar());
samplers = new ArrayList<DataPrinter>();
//question about close the graph window
this.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent we) {
askClose();
}
});
}
use of java.awt.event.WindowAdapter in project ACS by ACS-Community.
the class SourcePanel method initializeGUI.
/**
* Init the GUI
*/
private void initializeGUI() {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
sourceClient.close();
try {
acsClient.tearDown();
} catch (Throwable t) {
System.err.println("Exception while closing the ComponentClient: " + t.getMessage());
}
super.windowClosing(e);
}
});
JScrollPane scrollPane = new JScrollPane(table);
setLayout(new BorderLayout());
toolBar.add(clearButton);
clearButton.addActionListener(this);
toolBar.add(compactTB);
compactTB.addActionListener(this);
add(toolBar, BorderLayout.PAGE_START);
add(scrollPane, BorderLayout.CENTER);
setBounds(20, 20, 100, 100);
pack();
}
Aggregations