use of javax.swing.JRootPane in project gitblit by gitblit.
the class EditRepositoryDialog method createRootPane.
@Override
protected JRootPane createRootPane() {
KeyStroke stroke = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0);
JRootPane rootPane = new JRootPane();
rootPane.registerKeyboardAction(new ActionListener() {
@Override
public void actionPerformed(ActionEvent actionEvent) {
setVisible(false);
}
}, stroke, JComponent.WHEN_IN_FOCUSED_WINDOW);
return rootPane;
}
use of javax.swing.JRootPane in project gitblit by gitblit.
the class EditTeamDialog method createRootPane.
@Override
protected JRootPane createRootPane() {
KeyStroke stroke = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0);
JRootPane rootPane = new JRootPane();
rootPane.registerKeyboardAction(new ActionListener() {
@Override
public void actionPerformed(ActionEvent actionEvent) {
setVisible(false);
}
}, stroke, JComponent.WHEN_IN_FOCUSED_WINDOW);
return rootPane;
}
use of javax.swing.JRootPane in project gitblit by gitblit.
the class SubscriptionsDialog method createRootPane.
@Override
protected JRootPane createRootPane() {
KeyStroke stroke = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0);
JRootPane rootPane = new JRootPane();
rootPane.registerKeyboardAction(new ActionListener() {
@Override
public void actionPerformed(ActionEvent actionEvent) {
setVisible(false);
}
}, stroke, JComponent.WHEN_IN_FOCUSED_WINDOW);
return rootPane;
}
use of javax.swing.JRootPane in project GT by Tencent.
the class PMAPView method createChartPanel.
/**
* 生成饼图
* @param parent
* @param data
*/
private void createChartPanel(Composite parent, Map<String, Integer> data) {
Composite composite = new Composite(parent, SWT.NO_BACKGROUND | SWT.EMBEDDED);
Frame frame = SWT_AWT.new_Frame(composite);
// 据说加入这个Panel可以无闪烁
Panel panel = new Panel(new BorderLayout()) {
private static final long serialVersionUID = 1L;
public void update(java.awt.Graphics g) {
/* Do not erase the background */
paint(g);
}
};
frame.add(panel);
JRootPane root = new JRootPane();
panel.add(root);
java.awt.Container contentPane = root.getContentPane();
PieChart chart = new PieChart();
int showItemNum = 0;
try {
showItemNum = Integer.parseInt(showDataItemCountText.getText());
} catch (NumberFormatException e) {
e.printStackTrace();
showItemNum = 10;
}
chart.setDataset(getPieChartDataFromMap(data, showItemNum));
contentPane.add(chart);
}
Aggregations