01: /*
02: * @(#)XertoFrameBorder.java 5/12/2005
03: *
04: * Copyright 2002 - 2005 JIDE Software Inc. All rights reserved.
05: */
06: package com.jidesoft.plaf.xerto;
07:
08: import javax.swing.border.Border;
09: import javax.swing.plaf.UIResource;
10: import java.awt.*;
11:
12: /**
13: * This class is an implementation of the DockableFrame border.
14: */
15: class XertoFrameBorder implements Border, UIResource {
16: private static Color[] _colors = new Color[] {
17: new Color(142, 145, 128), new Color(172, 172, 153),
18: new Color(203, 198, 181), new Color(213, 207, 188) /*,
19: new Color(179, 176, 154)*/
20: };
21: private Insets _insets;
22:
23: public XertoFrameBorder(Insets insets) {
24: _insets = insets;
25: }
26:
27: /**
28: * Returns the insets of the border.
29: *
30: * @param c the component for which this border insets value applies
31: */
32: public Insets getBorderInsets(Component c) {
33: return _insets;
34: }
35:
36: /**
37: * Returns whether or not the border is opaque. If the border
38: * is opaque, it is responsible for filling in it's own
39: * background when painting.
40: */
41: public boolean isBorderOpaque() {
42: return true;
43: }
44:
45: public void paintBorder(Component c, Graphics g, int x, int y,
46: int width, int height) {
47:
48: for (int i = 0; i < _colors.length; i++) {
49: g.setColor(_colors[i]);
50: g.drawRect(x + i, y + i, width - i * 2 - 1, height - i * 2
51: - 1);
52: }
53: }
54: }
|