Search in sources :

Example 1 with JLayeredPane

use of javax.swing.JLayeredPane in project jdk8u_jdk by JetBrains.

the class javax_swing_JLayeredPane method getObject.

protected JLayeredPane getObject() {
    JLayeredPane pane = new JLayeredPane();
    init(pane, 0, 25, 25, 50, 50, Color.RED);
    init(pane, 1, 10, 10, 50, 50, Color.BLUE);
    init(pane, 2, 40, 40, 50, 50, Color.YELLOW);
    pane.setSize(200, 200);
    return pane;
}
Also used : JLayeredPane(javax.swing.JLayeredPane)

Example 2 with JLayeredPane

use of javax.swing.JLayeredPane in project jdk8u_jdk by JetBrains.

the class DimensionEncapsulation method run.

@Override
public void run() {
    runTest(new Panel());
    runTest(new Button());
    runTest(new Checkbox());
    runTest(new Canvas());
    runTest(new Choice());
    runTest(new Label());
    runTest(new Scrollbar());
    runTest(new TextArea());
    runTest(new TextField());
    runTest(new Dialog(new JFrame()));
    runTest(new Frame());
    runTest(new Window(new JFrame()));
    runTest(new FileDialog(new JFrame()));
    runTest(new List());
    runTest(new ScrollPane());
    runTest(new JFrame());
    runTest(new JDialog(new JFrame()));
    runTest(new JWindow(new JFrame()));
    runTest(new JLabel("hi"));
    runTest(new JMenu());
    runTest(new JTree());
    runTest(new JTable());
    runTest(new JMenuItem());
    runTest(new JCheckBoxMenuItem());
    runTest(new JToggleButton());
    runTest(new JSpinner());
    runTest(new JSlider());
    runTest(Box.createVerticalBox());
    runTest(Box.createHorizontalBox());
    runTest(new JTextField());
    runTest(new JTextArea());
    runTest(new JTextPane());
    runTest(new JPasswordField());
    runTest(new JFormattedTextField());
    runTest(new JEditorPane());
    runTest(new JButton());
    runTest(new JColorChooser());
    runTest(new JFileChooser());
    runTest(new JCheckBox());
    runTest(new JInternalFrame());
    runTest(new JDesktopPane());
    runTest(new JTableHeader());
    runTest(new JLayeredPane());
    runTest(new JRootPane());
    runTest(new JMenuBar());
    runTest(new JOptionPane());
    runTest(new JRadioButton());
    runTest(new JRadioButtonMenuItem());
    runTest(new JPopupMenu());
    //runTest(new JScrollBar()); --> don't test defines max and min in
    // terms of preferred
    runTest(new JScrollPane());
    runTest(new JViewport());
    runTest(new JSplitPane());
    runTest(new JTabbedPane());
    runTest(new JToolBar());
    runTest(new JSeparator());
    runTest(new JProgressBar());
    if (!failures.isEmpty()) {
        System.out.println("These classes failed");
        for (final Component failure : failures) {
            System.out.println(failure.getClass());
        }
        throw new RuntimeException("Test failed");
    }
}
Also used : JDesktopPane(javax.swing.JDesktopPane) Choice(java.awt.Choice) JTextArea(javax.swing.JTextArea) TextArea(java.awt.TextArea) JTextArea(javax.swing.JTextArea) Label(java.awt.Label) JLabel(javax.swing.JLabel) JTableHeader(javax.swing.table.JTableHeader) JToggleButton(javax.swing.JToggleButton) JToggleButton(javax.swing.JToggleButton) Button(java.awt.Button) JRadioButton(javax.swing.JRadioButton) JButton(javax.swing.JButton) JFrame(javax.swing.JFrame) Checkbox(java.awt.Checkbox) JDialog(javax.swing.JDialog) FileDialog(java.awt.FileDialog) Dialog(java.awt.Dialog) JTextField(javax.swing.JTextField) TextField(java.awt.TextField) JFormattedTextField(javax.swing.JFormattedTextField) JSlider(javax.swing.JSlider) ArrayList(java.util.ArrayList) List(java.awt.List) Canvas(java.awt.Canvas) JWindow(javax.swing.JWindow) JRadioButtonMenuItem(javax.swing.JRadioButtonMenuItem) JOptionPane(javax.swing.JOptionPane) JCheckBoxMenuItem(javax.swing.JCheckBoxMenuItem) JCheckBox(javax.swing.JCheckBox) JTree(javax.swing.JTree) JFileChooser(javax.swing.JFileChooser) JPasswordField(javax.swing.JPasswordField) ScrollPane(java.awt.ScrollPane) JScrollPane(javax.swing.JScrollPane) JTable(javax.swing.JTable) JSpinner(javax.swing.JSpinner) JSplitPane(javax.swing.JSplitPane) JColorChooser(javax.swing.JColorChooser) JInternalFrame(javax.swing.JInternalFrame) JDialog(javax.swing.JDialog) JFrame(javax.swing.JFrame) Frame(java.awt.Frame) JInternalFrame(javax.swing.JInternalFrame) JRadioButton(javax.swing.JRadioButton) JLayeredPane(javax.swing.JLayeredPane) JTabbedPane(javax.swing.JTabbedPane) JButton(javax.swing.JButton) JProgressBar(javax.swing.JProgressBar) JTextField(javax.swing.JTextField) JSeparator(javax.swing.JSeparator) JTextPane(javax.swing.JTextPane) JMenuItem(javax.swing.JMenuItem) Component(java.awt.Component) Scrollbar(java.awt.Scrollbar) Window(java.awt.Window) JWindow(javax.swing.JWindow) JScrollPane(javax.swing.JScrollPane) JViewport(javax.swing.JViewport) JFormattedTextField(javax.swing.JFormattedTextField) JLabel(javax.swing.JLabel) JToolBar(javax.swing.JToolBar) JPopupMenu(javax.swing.JPopupMenu) Panel(java.awt.Panel) JEditorPane(javax.swing.JEditorPane) JRootPane(javax.swing.JRootPane) FileDialog(java.awt.FileDialog) JMenu(javax.swing.JMenu) JMenuBar(javax.swing.JMenuBar)

Example 3 with JLayeredPane

use of javax.swing.JLayeredPane in project jdk8u_jdk by JetBrains.

the class TestDialog method createAndShowGUI.

private static void createAndShowGUI() {
    final JFrame frame = new JFrame("Test");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    JLayeredPane layeredPane = new JLayeredPane();
    layeredPane.setPreferredSize(new Dimension(400, 400));
    JPanel enabledPanel = createPanel(new Point(10, 10), true);
    JPanel disabledPanel = createPanel(new Point(100, 100), false);
    layeredPane.add(disabledPanel, JLayeredPane.PALETTE_LAYER);
    layeredPane.add(enabledPanel, JLayeredPane.DEFAULT_LAYER);
    frame.getContentPane().add(layeredPane);
    frame.pack();
    frame.setVisible(true);
}
Also used : JPanel(javax.swing.JPanel) JFrame(javax.swing.JFrame) JLayeredPane(javax.swing.JLayeredPane)

Example 4 with JLayeredPane

use of javax.swing.JLayeredPane in project cytoscape-impl by cytoscape.

the class SimpleRootPaneContainer method setLayeredPane.

@Override
public void setLayeredPane(JLayeredPane layered) {
    final JLayeredPane oldValue = getLayeredPane();
    getRootPane().setLayeredPane(layered);
    firePropertyChange("layeredPane", oldValue, layered);
}
Also used : JLayeredPane(javax.swing.JLayeredPane)

Example 5 with JLayeredPane

use of javax.swing.JLayeredPane in project blue by kunstmusik.

the class PaletteWindow method main.

public static void main(String[] args) {
    GUI.setBlueLookAndFeel();
    JDialog.setDefaultLookAndFeelDecorated(true);
    JDialog dialog = new JDialog((Frame) null, "Test");
    dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
    dialog.getRootPane().setBorder(new BevelBorder(BevelBorder.RAISED));
    dialog.setSize(400, 300);
    dialog.setVisible(true);
    JDialog dialog2 = new JDialog((Frame) null);
    dialog2.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
    JLayeredPane layeredPane = dialog2.getRootPane().getLayeredPane();
    Component[] comps = layeredPane.getComponentsInLayer(JLayeredPane.FRAME_CONTENT_LAYER.intValue());
    for (int i = 0; i < comps.length; i++) {
        Component component = comps[i];
        if (component != dialog2.getContentPane()) {
            JComponent c = ((JComponent) component);
            c.setPreferredSize(new Dimension(12, 12));
            Component[] subComponents = c.getComponents();
            for (int j = 0; j < subComponents.length; j++) {
                Component component2 = subComponents[j];
                if (component2 instanceof JButton) {
                    JButton b = (JButton) component2;
                    b.setIcon(UIManager.getIcon("InternalFrame.paletteCloseIcon"));
                    b.setPreferredSize(new Dimension(8, 8));
                    b.setMargin(new Insets(1, 1, 1, 1));
                }
            }
        }
    }
    dialog2.getRootPane().setBorder(new BevelBorder(BevelBorder.RAISED));
    dialog2.setSize(400, 300);
    dialog2.setVisible(true);
    JDialog.setDefaultLookAndFeelDecorated(false);
    JDialog dialog3 = new JDialog((Frame) null, "Test3");
    dialog3.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
    dialog3.setSize(400, 300);
    dialog3.setVisible(true);
}
Also used : Insets(java.awt.Insets) BevelBorder(javax.swing.border.BevelBorder) JLayeredPane(javax.swing.JLayeredPane) JComponent(javax.swing.JComponent) JButton(javax.swing.JButton) Dimension(java.awt.Dimension) JComponent(javax.swing.JComponent) Component(java.awt.Component) JDialog(javax.swing.JDialog)

Aggregations

JLayeredPane (javax.swing.JLayeredPane)16 Component (java.awt.Component)6 JButton (javax.swing.JButton)6 JComponent (javax.swing.JComponent)5 Dimension (java.awt.Dimension)4 JPanel (javax.swing.JPanel)4 JEditorPane (javax.swing.JEditorPane)3 JMenuBar (javax.swing.JMenuBar)3 JRootPane (javax.swing.JRootPane)3 Dialog (java.awt.Dialog)2 Frame (java.awt.Frame)2 Insets (java.awt.Insets)2 ArrayList (java.util.ArrayList)2 JCheckBox (javax.swing.JCheckBox)2 JCheckBoxMenuItem (javax.swing.JCheckBoxMenuItem)2 JColorChooser (javax.swing.JColorChooser)2 JDesktopPane (javax.swing.JDesktopPane)2 JDialog (javax.swing.JDialog)2 JFrame (javax.swing.JFrame)2 JLabel (javax.swing.JLabel)2