use of javax.swing.JRootPane in project abstools by abstools.
the class ButtonPanel method setDefaultButton.
/*
* This method is called each time a button or an ancestor is added.
* So the root pane that contains this ButtonPanel will be informed
* about the default button (if present) in any case, whether the
* ButtonPanel has already been added to it as a descendant or whether
* it is added later.
*/
private void setDefaultButton() {
if (defaultButton != null) {
Component comp = ButtonPanel.this;
while (comp != null && !(comp instanceof JRootPane)) {
comp = comp.getParent();
}
if (comp != null) {
((JRootPane) comp).setDefaultButton(defaultButton);
// default button has been successfully set, "erase" it now
defaultButton = null;
}
}
}
use of javax.swing.JRootPane in project Course_Generator by patrovite.
the class FrmExportWaypoints method createRootPane.
/**
* Manage low level key strokes ESCAPE : Close the window
*
* @return
*/
protected JRootPane createRootPane() {
JRootPane rootPane = new JRootPane();
KeyStroke strokeEscape = KeyStroke.getKeyStroke("ESCAPE");
KeyStroke strokeEnter = KeyStroke.getKeyStroke("ENTER");
Action actionListener = new AbstractAction() {
public void actionPerformed(ActionEvent actionEvent) {
setVisible(false);
}
};
Action actionListenerEnter = new AbstractAction() {
public void actionPerformed(ActionEvent actionEvent) {
RequestToClose();
}
};
InputMap inputMap = rootPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
inputMap.put(strokeEscape, "ESCAPE");
rootPane.getActionMap().put("ESCAPE", actionListener);
inputMap.put(strokeEnter, "ENTER");
rootPane.getActionMap().put("ENTER", actionListenerEnter);
return rootPane;
}
use of javax.swing.JRootPane in project keystore-explorer by kaikramer.
the class JEscFrame method createRootPane.
@Override
protected JRootPane createRootPane() {
JRootPane rootPane = new JRootPane();
// Escape key closes dialogs
KeyStroke stroke = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0);
rootPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(stroke, "escapeKey");
rootPane.getActionMap().put("escapeKey", new AbstractAction() {
private static final long serialVersionUID = 1L;
@Override
public void actionPerformed(ActionEvent e) {
setVisible(false);
dispose();
}
});
return rootPane;
}
use of javax.swing.JRootPane in project cytoscape-impl by cytoscape.
the class SimpleRootPaneContainer method setRootPane.
protected void setRootPane(JRootPane root) {
if (rootPane != null)
remove(rootPane);
JRootPane oldValue = getRootPane();
rootPane = root;
if (rootPane != null) {
boolean checkingEnabled = isRootPaneCheckingEnabled();
try {
setRootPaneCheckingEnabled(false);
add(rootPane, BorderLayout.CENTER);
} finally {
setRootPaneCheckingEnabled(checkingEnabled);
}
}
firePropertyChange("rootPane", oldValue, root);
}
use of javax.swing.JRootPane in project blue by kunstmusik.
the class TreeHilightDropListener method dragEnter.
@Override
public void dragEnter(DropTargetDragEvent dtde) {
JTree tree = (JTree) dtde.getDropTargetContext().getComponent();
Point location = dtde.getLocation();
JRootPane rootPane = tree.getRootPane();
oldGlassPane = rootPane.getGlassPane();
rootPane.setGlassPane(glassPane);
glassPane.setOpaque(false);
glassPane.setVisible(true);
updateLine(tree, location);
}
Aggregations