jdk/test/javax/swing/border/Test6978482.java
author hseigel
Wed, 01 Mar 2017 08:00:02 -0500
changeset 46194 5596e6f63072
parent 31448 1066345d2a8a
child 47131 3c5b1a40f573
permissions -rw-r--r--
8172307: Remove ununsed JVM API JVM_GetModuleByPackageName() Summary: Remove get_module_by_package_name() etc., and unneeded test. Reviewed-by: sspitsyn, gtriantafill
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6510
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
     1
/*
31448
1066345d2a8a 8076468: Add @modules to tests in jdk_desktop test group
yan
parents: 8988
diff changeset
     2
 * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
6510
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
     4
 *
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
     7
 * published by the Free Software Foundation.
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
     8
 *
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    13
 * accompanied this code).
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    14
 *
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    18
 *
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    21
 * questions.
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    22
 */
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    23
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    24
/*
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    25
 * @test
8988
a4ce9022541e 7025987: Nimbus L&F increases insets unexpectedly
malenkov
parents: 6510
diff changeset
    26
 * @bug 6978482 7025987
6510
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    27
 * @summary Tests unchecked casts
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    28
 * @author Sergey Malenkov
31448
1066345d2a8a 8076468: Add @modules to tests in jdk_desktop test group
yan
parents: 8988
diff changeset
    29
 * @modules java.desktop/com.sun.java.swing.plaf.motif
1066345d2a8a 8076468: Add @modules to tests in jdk_desktop test group
yan
parents: 8988
diff changeset
    30
 *          java.desktop/com.sun.java.swing.plaf.windows
1066345d2a8a 8076468: Add @modules to tests in jdk_desktop test group
yan
parents: 8988
diff changeset
    31
 *          java.desktop/sun.swing.plaf.synth
6510
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    32
 */
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    33
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    34
import com.sun.java.swing.plaf.motif.MotifBorders;
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    35
import com.sun.java.swing.plaf.windows.WindowsBorders;
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    36
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    37
import java.awt.Color;
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    38
import java.awt.Component;
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    39
import java.awt.Font;
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    40
import java.awt.Graphics;
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    41
import java.awt.image.BufferedImage;
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    42
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    43
import javax.swing.ActionMap;
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    44
import javax.swing.JFileChooser;
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    45
import javax.swing.JLabel;
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    46
import javax.swing.JToggleButton;
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    47
import javax.swing.JToolBar;
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    48
import javax.swing.border.BevelBorder;
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    49
import javax.swing.border.Border;
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    50
import javax.swing.border.CompoundBorder;
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    51
import javax.swing.border.EmptyBorder;
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    52
import javax.swing.border.EtchedBorder;
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    53
import javax.swing.border.LineBorder;
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    54
import javax.swing.border.MatteBorder;
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    55
import javax.swing.border.SoftBevelBorder;
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    56
import javax.swing.border.TitledBorder;
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    57
import javax.swing.plaf.ActionMapUIResource;
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    58
import javax.swing.plaf.BorderUIResource;
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    59
import javax.swing.plaf.synth.SynthLookAndFeel;
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    60
import javax.swing.plaf.basic.BasicBorders;
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    61
import javax.swing.plaf.basic.BasicToolBarUI;
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    62
import javax.swing.plaf.metal.MetalBorders;
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    63
import javax.swing.plaf.metal.MetalComboBoxEditor;
8988
a4ce9022541e 7025987: Nimbus L&F increases insets unexpectedly
malenkov
parents: 6510
diff changeset
    64
import javax.swing.plaf.nimbus.NimbusLookAndFeel;
6510
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    65
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    66
import sun.swing.plaf.synth.SynthFileChooserUI;
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    67
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    68
public class Test6978482 {
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    69
    private static final JLabel LABEL = new JLabel();
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    70
    private static final JToolBar TOOLBAR = new JToolBar(); // init non-rollover border
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    71
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    72
    private static final Border[] BORDERS = {
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    73
            new MotifBorders.BevelBorder(true, Color.BLACK, Color.WHITE),
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    74
            new MotifBorders.ButtonBorder(Color.CYAN, Color.MAGENTA, Color.YELLOW, Color.BLACK),
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    75
            new MotifBorders.FocusBorder(Color.BLACK, Color.WHITE),
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    76
            new MotifBorders.FrameBorder(LABEL),
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    77
            new MotifBorders.MenuBarBorder(Color.CYAN, Color.MAGENTA, Color.YELLOW, Color.BLACK),
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    78
            new MotifBorders.MotifPopupMenuBorder(new Font(null, Font.PLAIN, 10), Color.CYAN, Color.MAGENTA, Color.YELLOW, Color.BLACK),
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    79
            new MotifBorders.ToggleButtonBorder(Color.CYAN, Color.MAGENTA, Color.YELLOW, Color.BLACK),
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    80
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    81
            new WindowsBorders.ProgressBarBorder(Color.BLACK, Color.WHITE),
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    82
            new WindowsBorders.ToolBarBorder(Color.BLACK, Color.WHITE),
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    83
            //- WindowsInternalFrameUI.XPBorder is not accessible: check it visually
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    84
            //? WindowsTableHeaderUI.IconBorder is not accessible: check it visually
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    85
            //- XPStyle.XPEmptyBorder is not accessible: check it visually
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    86
            //- XPStyle.XPFillBorder is not accessible: check it visually
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    87
            //- XPStyle.XPImageBorder is not accessible: check it visually
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    88
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    89
            new BevelBorder(BevelBorder.RAISED),
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    90
            new CompoundBorder(),
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    91
            new EmptyBorder(1, 2, 3, 4),
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    92
            new EtchedBorder(),
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    93
            new LineBorder(Color.BLACK, 2, true),
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    94
            new MatteBorder(1, 2, 3, 4, Color.BLACK),
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    95
            new SoftBevelBorder(BevelBorder.LOWERED),
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    96
            new TitledBorder("4856008"),
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    97
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    98
            new BorderUIResource(new EmptyBorder(1, 2, 3, 4)),
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
    99
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   100
            new BasicBorders.ButtonBorder(Color.CYAN, Color.MAGENTA, Color.YELLOW, Color.BLACK),
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   101
            new BasicBorders.FieldBorder(Color.CYAN, Color.MAGENTA, Color.YELLOW, Color.BLACK),
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   102
            new BasicBorders.MarginBorder(),
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   103
            new BasicBorders.MenuBarBorder(Color.BLACK, Color.WHITE),
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   104
            new BasicBorders.RadioButtonBorder(Color.CYAN, Color.MAGENTA, Color.YELLOW, Color.BLACK),
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   105
            //+ BasicBorders.RolloverMarginBorder:
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   106
            new ToolBar().getRolloverMarginBorder(),
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   107
            new BasicBorders.SplitPaneBorder(Color.BLACK, Color.WHITE),
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   108
            //+ BasicBorders.SplitPaneDividerBorder:
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   109
            BasicBorders.getSplitPaneDividerBorder(),
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   110
            new BasicBorders.ToggleButtonBorder(Color.CYAN, Color.MAGENTA, Color.YELLOW, Color.BLACK),
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   111
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   112
            new MetalBorders.ButtonBorder(),
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   113
            //- MetalBorders.DialogBorder is not accessible: check it visually
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   114
            new MetalBorders.Flush3DBorder(),
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   115
            //- MetalBorders.FrameBorder is not accessible: check it visually
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   116
            new MetalBorders.InternalFrameBorder(),
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   117
            new MetalBorders.MenuBarBorder(),
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   118
            new MetalBorders.MenuItemBorder(),
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   119
            new MetalBorders.OptionDialogBorder(),
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   120
            new MetalBorders.PaletteBorder(),
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   121
            new MetalBorders.PopupMenuBorder(),
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   122
            //- MetalBorders.RolloverMarginBorder is not accessible: check it visually
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   123
            new MetalBorders.ScrollPaneBorder(),
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   124
            new MetalBorders.TableHeaderBorder(),
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   125
            new MetalBorders.ToolBarBorder(),
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   126
            //+ MetalComboBoxEditor.EditorBorder:
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   127
            new MetalEditor().getEditorBorder(),
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   128
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   129
            //- SynthBorder is not accessible: check it visually
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   130
            //- SynthScrollPaneUI.ViewportBorder is not accessible: check it visually
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   131
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   132
            //? CSSBorder is not accessible: check it visually
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   133
            //? CommentView.CommentBorder is not accessible: check it visually
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   134
            //- HiddenTagView.EndTagBorder is not accessible: check it visually
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   135
            //- HiddenTagView.StartTagBorder is not accessible: check it visually
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   136
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   137
            //+ SynthFileChooserUI.UIBorder:
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   138
            new SynthFileChooser().getUIBorder(),
8988
a4ce9022541e 7025987: Nimbus L&F increases insets unexpectedly
malenkov
parents: 6510
diff changeset
   139
a4ce9022541e 7025987: Nimbus L&F increases insets unexpectedly
malenkov
parents: 6510
diff changeset
   140
            //+ LoweredBorder:
a4ce9022541e 7025987: Nimbus L&F increases insets unexpectedly
malenkov
parents: 6510
diff changeset
   141
            new NimbusLookAndFeel().getDefaults().getBorder("TitledBorder.border"),
6510
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   142
    };
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   143
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   144
    public static void main(String[] args) {
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   145
        Component c = new Component() {};
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   146
        c.setBackground(Color.WHITE);
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   147
        c.setForeground(Color.BLACK);
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   148
        Graphics g = new BufferedImage(1024, 768, BufferedImage.TYPE_INT_RGB).getGraphics();
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   149
        g.setClip(0, 0, 1024, 768);
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   150
        for (Border border : BORDERS) {
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   151
            System.out.println(border.getClass());
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   152
            border.getBorderInsets(c);
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   153
            border.paintBorder(c, g, 0, 0, 1024, 768);
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   154
        }
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   155
    }
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   156
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   157
    // This class is used to get the instance of BasicBorders.RolloverMarginBorder
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   158
    private static class ToolBar extends BasicToolBarUI {
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   159
        private Border getRolloverMarginBorder() {
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   160
            JToggleButton button = new JToggleButton();
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   161
            CompoundBorder border = (CompoundBorder) getNonRolloverBorder(button);
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   162
            return border.getInsideBorder();
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   163
        }
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   164
    }
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   165
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   166
    // This class is used to get the instance of MetalComboBoxEditor.EditorBorder
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   167
    private static class MetalEditor extends MetalComboBoxEditor {
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   168
        private Border getEditorBorder() {
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   169
            return editor.getBorder();
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   170
        }
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   171
    }
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   172
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   173
    // This class is used to get the instance of SynthFileChooserUI.UIBorder
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   174
    private static class SynthFileChooser extends SynthFileChooserUI {
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   175
        private static final JFileChooser CHOOSER = new JFileChooser();
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   176
        private String name;
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   177
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   178
        private SynthFileChooser() {
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   179
            super(CHOOSER);
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   180
        }
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   181
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   182
        private Border getUIBorder() {
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   183
            new SynthLookAndFeel().initialize();
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   184
            CHOOSER.setBorder(null);
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   185
            installDefaults(CHOOSER);
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   186
            return CHOOSER.getBorder();
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   187
        }
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   188
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   189
        @Override
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   190
        protected ActionMap createActionMap() {
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   191
            return new ActionMapUIResource();
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   192
        }
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   193
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   194
        @Override
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   195
        public String getFileName() {
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   196
            return this.name;
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   197
        }
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   198
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   199
        @Override
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   200
        public void setFileName(String name) {
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   201
            this.name = name;
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   202
        }
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   203
    }
75e8a4664c38 6978482: MetalBorders.ToolBarBorder should specify that its getBorderInsets impl accepts only JToolBar inst
malenkov
parents:
diff changeset
   204
}