< prev index next >

src/java.desktop/macosx/classes/com/apple/laf/AquaOptionPaneUI.java

Print this page




  30 import javax.swing.*;
  31 import javax.swing.plaf.ComponentUI;
  32 import javax.swing.plaf.basic.BasicOptionPaneUI;
  33 
  34 public class AquaOptionPaneUI extends BasicOptionPaneUI {
  35     private static final int kOKCancelButtonWidth = 79;
  36     private static final int kButtonHeight = 23;
  37 
  38     private static final int kDialogSmallPadding = 4;
  39     private static final int kDialogLargePadding = 23;
  40 
  41     /**
  42      * Creates a new BasicOptionPaneUI instance.
  43      */
  44     public static ComponentUI createUI(final JComponent x) {
  45         return new AquaOptionPaneUI();
  46     }
  47 
  48     /**
  49      * Creates and returns a Container containin the buttons. The buttons
  50      * are created by calling <code>getButtons</code>.
  51      */
  52     protected Container createButtonArea() {
  53         final Container bottom = super.createButtonArea();
  54         // Now replace the Layout
  55         bottom.setLayout(new AquaButtonAreaLayout(true, kDialogSmallPadding));
  56         return bottom;
  57     }
  58 
  59     /**
  60      * Messaged from installComponents to create a Container containing the
  61      * body of the message.
  62      * The icon and body should be aligned on their top edges
  63      */
  64     protected Container createMessageArea() {
  65         final JPanel top = new JPanel();
  66         top.setBorder(UIManager.getBorder("OptionPane.messageAreaBorder"));
  67         top.setLayout(new BoxLayout(top, BoxLayout.X_AXIS));
  68 
  69         /* Fill the body. */
  70         final Container body = new JPanel();




  30 import javax.swing.*;
  31 import javax.swing.plaf.ComponentUI;
  32 import javax.swing.plaf.basic.BasicOptionPaneUI;
  33 
  34 public class AquaOptionPaneUI extends BasicOptionPaneUI {
  35     private static final int kOKCancelButtonWidth = 79;
  36     private static final int kButtonHeight = 23;
  37 
  38     private static final int kDialogSmallPadding = 4;
  39     private static final int kDialogLargePadding = 23;
  40 
  41     /**
  42      * Creates a new BasicOptionPaneUI instance.
  43      */
  44     public static ComponentUI createUI(final JComponent x) {
  45         return new AquaOptionPaneUI();
  46     }
  47 
  48     /**
  49      * Creates and returns a Container containin the buttons. The buttons
  50      * are created by calling {@code getButtons}.
  51      */
  52     protected Container createButtonArea() {
  53         final Container bottom = super.createButtonArea();
  54         // Now replace the Layout
  55         bottom.setLayout(new AquaButtonAreaLayout(true, kDialogSmallPadding));
  56         return bottom;
  57     }
  58 
  59     /**
  60      * Messaged from installComponents to create a Container containing the
  61      * body of the message.
  62      * The icon and body should be aligned on their top edges
  63      */
  64     protected Container createMessageArea() {
  65         final JPanel top = new JPanel();
  66         top.setBorder(UIManager.getBorder("OptionPane.messageAreaBorder"));
  67         top.setLayout(new BoxLayout(top, BoxLayout.X_AXIS));
  68 
  69         /* Fill the body. */
  70         final Container body = new JPanel();


< prev index next >