src/share/classes/javax/swing/plaf/metal/MetalBorders.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 54,64 ****
* indicator. Only used with the Ocean theme.
*/
static Object NO_BUTTON_ROLLOVER =
new StringUIClientPropertyKey("NoButtonRollover");
!
public static class Flush3DBorder extends AbstractBorder implements UIResource{
public void paintBorder(Component c, Graphics g, int x, int y,
int w, int h) {
if (c.isEnabled()) {
MetalUtils.drawFlush3DBorder(g, x, y, w, h);
--- 54,64 ----
* indicator. Only used with the Ocean theme.
*/
static Object NO_BUTTON_ROLLOVER =
new StringUIClientPropertyKey("NoButtonRollover");
! @SuppressWarnings("serial") // Superclass is not serializable across versions
public static class Flush3DBorder extends AbstractBorder implements UIResource{
public void paintBorder(Component c, Graphics g, int x, int y,
int w, int h) {
if (c.isEnabled()) {
MetalUtils.drawFlush3DBorder(g, x, y, w, h);
*** 71,80 ****
--- 71,81 ----
newInsets.set(2, 2, 2, 2);
return newInsets;
}
}
+ @SuppressWarnings("serial") // Superclass is not serializable across versions
public static class ButtonBorder extends AbstractBorder implements UIResource {
protected static Insets borderInsets = new Insets( 3, 3, 3, 3 );
public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) {
*** 185,194 ****
--- 186,196 ----
newInsets.set(3, 3, 3, 3);
return newInsets;
}
}
+ @SuppressWarnings("serial") // Superclass is not serializable across versions
public static class InternalFrameBorder extends AbstractBorder implements UIResource {
private static final int corner = 14;
public void paintBorder(Component c, Graphics g, int x, int y,
int w, int h) {
*** 246,255 ****
--- 248,258 ----
/**
* Border for a Frame.
* @since 1.4
*/
+ @SuppressWarnings("serial") // Superclass is not serializable across versions
static class FrameBorder extends AbstractBorder implements UIResource {
private static final int corner = 14;
public void paintBorder(Component c, Graphics g, int x, int y,
int w, int h) {
*** 308,317 ****
--- 311,321 ----
/**
* Border for a Frame.
* @since 1.4
*/
+ @SuppressWarnings("serial") // Superclass is not serializable across versions
static class DialogBorder extends AbstractBorder implements UIResource
{
private static final int corner = 14;
protected Color getActiveBackground()
*** 401,410 ****
--- 405,415 ----
/**
* Border for an Error Dialog.
* @since 1.4
*/
+ @SuppressWarnings("serial") // Superclass is not serializable across versions
static class ErrorDialogBorder extends DialogBorder implements UIResource
{
protected Color getActiveBackground() {
return UIManager.getColor("OptionPane.errorDialog.border.background");
}
*** 414,423 ****
--- 419,429 ----
/**
* Border for a QuestionDialog. Also used for a JFileChooser and a
* JColorChooser..
* @since 1.4
*/
+ @SuppressWarnings("serial") // Superclass is not serializable across versions
static class QuestionDialogBorder extends DialogBorder implements UIResource
{
protected Color getActiveBackground() {
return UIManager.getColor("OptionPane.questionDialog.border.background");
}
*** 426,435 ****
--- 432,442 ----
/**
* Border for a Warning Dialog.
* @since 1.4
*/
+ @SuppressWarnings("serial") // Superclass is not serializable across versions
static class WarningDialogBorder extends DialogBorder implements UIResource
{
protected Color getActiveBackground() {
return UIManager.getColor("OptionPane.warningDialog.border.background");
}
*** 438,447 ****
--- 445,455 ----
/**
* Border for a Palette.
* @since 1.3
*/
+ @SuppressWarnings("serial") // Superclass is not serializable across versions
public static class PaletteBorder extends AbstractBorder implements UIResource {
int titleHeight = 0;
public void paintBorder( Component c, Graphics g, int x, int y, int w, int h ) {
*** 460,469 ****
--- 468,478 ----
newInsets.set(1, 1, 1, 1);
return newInsets;
}
}
+ @SuppressWarnings("serial") // Superclass is not serializable across versions
public static class OptionDialogBorder extends AbstractBorder implements UIResource {
int titleHeight = 0;
public void paintBorder( Component c, Graphics g, int x, int y, int w, int h ) {
*** 521,531 ****
newInsets.set(3, 3, 3, 3);
return newInsets;
}
}
!
public static class MenuBarBorder extends AbstractBorder implements UIResource {
protected static Insets borderInsets = new Insets( 1, 0, 1, 0 );
public void paintBorder( Component c, Graphics g, int x, int y, int w, int h ) {
g.translate( x, y );
--- 530,540 ----
newInsets.set(3, 3, 3, 3);
return newInsets;
}
}
! @SuppressWarnings("serial") // Superclass is not serializable across versions
public static class MenuBarBorder extends AbstractBorder implements UIResource {
protected static Insets borderInsets = new Insets( 1, 0, 1, 0 );
public void paintBorder( Component c, Graphics g, int x, int y, int w, int h ) {
g.translate( x, y );
*** 558,567 ****
--- 567,577 ----
}
return newInsets;
}
}
+ @SuppressWarnings("serial") // Superclass is not serializable across versions
public static class MenuItemBorder extends AbstractBorder implements UIResource {
protected static Insets borderInsets = new Insets( 2, 2, 2, 2 );
public void paintBorder( Component c, Graphics g, int x, int y, int w, int h ) {
if (!(c instanceof JMenuItem)) {
*** 605,614 ****
--- 615,625 ----
newInsets.set(2, 2, 2, 2);
return newInsets;
}
}
+ @SuppressWarnings("serial") // Superclass is not serializable across versions
public static class PopupMenuBorder extends AbstractBorder implements UIResource {
protected static Insets borderInsets = new Insets( 3, 1, 2, 1 );
public void paintBorder( Component c, Graphics g, int x, int y, int w, int h ) {
g.translate( x, y );
*** 629,639 ****
newInsets.set(3, 1, 2, 1);
return newInsets;
}
}
!
public static class RolloverButtonBorder extends ButtonBorder {
public void paintBorder( Component c, Graphics g, int x, int y, int w, int h ) {
AbstractButton b = (AbstractButton) c;
ButtonModel model = b.getModel();
--- 640,650 ----
newInsets.set(3, 1, 2, 1);
return newInsets;
}
}
! @SuppressWarnings("serial") // Superclass is not serializable across versions
public static class RolloverButtonBorder extends ButtonBorder {
public void paintBorder( Component c, Graphics g, int x, int y, int w, int h ) {
AbstractButton b = (AbstractButton) c;
ButtonModel model = b.getModel();
*** 650,659 ****
--- 661,671 ----
* if the margin has been explicitly set by the developer.
*
* Note: This is identical to the package private class
* BasicBorders.RolloverMarginBorder and should probably be consolidated.
*/
+ @SuppressWarnings("serial") // Superclass is not serializable across versions
static class RolloverMarginBorder extends EmptyBorder {
public RolloverMarginBorder() {
super(3,3,3,3); // hardcoded margin for JLF requirements.
}
*** 679,688 ****
--- 691,701 ----
}
return insets;
}
}
+ @SuppressWarnings("serial") // Superclass is not serializable across versions
public static class ToolBarBorder extends AbstractBorder implements UIResource, SwingConstants
{
protected MetalBumps bumps = new MetalBumps( 10, 10,
MetalLookAndFeel.getControlHighlight(),
MetalLookAndFeel.getControlDarkShadow(),
*** 806,815 ****
--- 819,829 ----
new BasicBorders.MarginBorder());
}
return textFieldBorder;
}
+ @SuppressWarnings("serial") // Superclass is not serializable across versions
public static class TextFieldBorder extends Flush3DBorder {
public void paintBorder(Component c, Graphics g, int x, int y,
int w, int h) {
*** 830,839 ****
--- 844,854 ----
}
}
}
+ @SuppressWarnings("serial") // Superclass is not serializable across versions
public static class ScrollPaneBorder extends AbstractBorder implements UIResource {
public void paintBorder(Component c, Graphics g, int x, int y,
int w, int h) {
if (!(c instanceof JScrollPane)) {
*** 890,899 ****
--- 905,915 ----
}
/**
* @since 1.3
*/
+ @SuppressWarnings("serial") // Superclass is not serializable across versions
public static class ToggleButtonBorder extends ButtonBorder {
public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) {
AbstractButton button = (AbstractButton)c;
ButtonModel model = button.getModel();
if (MetalLookAndFeel.usingOcean()) {
*** 922,931 ****
--- 938,948 ----
/**
* Border for a Table Header
* @since 1.3
*/
+ @SuppressWarnings("serial") // Superclass is not serializable across versions
public static class TableHeaderBorder extends javax.swing.border.AbstractBorder {
protected Insets editorBorderInsets = new Insets( 2, 2, 2, 0 );
public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) {
g.translate( x, y );