~ubuntu-branches/debian/stretch/insubstantial/stretch

« back to all changes in this revision

Viewing changes to substance/src/main/java/org/pushingpixels/substance/internal/contrib/randelshofer/quaqua/colorchooser/SmallColorWellBorder.java

  • Committer: Package Import Robot
  • Author(s): Felix Natter
  • Date: 2016-01-18 20:58:45 UTC
  • Revision ID: package-import@ubuntu.com-20160118205845-crbmrkda61qsi5qa
Tags: upstream-7.3+dfsg2
ImportĀ upstreamĀ versionĀ 7.3+dfsg2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * @(#)QuaquaSmallColorWellBorder.java  1.0  2005-04-18
 
3
 *
 
4
 * Copyright (c) 2005 Werner Randelshofer
 
5
 * Staldenmattweg 2, Immensee, CH-6405, Switzerland.
 
6
 * All rights reserved.
 
7
 *
 
8
 * This software is the confidential and proprietary information of
 
9
 * Werner Randelshofer. ("Confidential Information").  You shall not
 
10
 * disclose such Confidential Information and shall use it only in
 
11
 * accordance with the terms of the license agreement you entered into
 
12
 * with Werner Randelshofer.
 
13
 */
 
14
 
 
15
package org.pushingpixels.substance.internal.contrib.randelshofer.quaqua.colorchooser;
 
16
 
 
17
import java.awt.*;
 
18
import javax.swing.*;
 
19
import javax.swing.border.*;
 
20
/**
 
21
 * SmallColorWellBorder.
 
22
 *
 
23
 * @author  werni
 
24
 */
 
25
public class SmallColorWellBorder implements Border {
 
26
    private static Color inner = Color.white;
 
27
    private static Color outer = new Color(0x949494);
 
28
    /** Creates a new instance of QuaquaSquareButtonBorder */
 
29
    public SmallColorWellBorder() {
 
30
    }
 
31
    
 
32
    @Override
 
33
    public Insets getBorderInsets(Component c) {
 
34
        return new Insets(1, 1, 1, 1);
 
35
    }
 
36
    
 
37
    @Override
 
38
    public boolean isBorderOpaque() {
 
39
        return true;
 
40
    }
 
41
    
 
42
    @Override
 
43
    public void paintBorder(Component c, Graphics gr, int x, int y, int width, int height) {
 
44
        gr.setColor(c.getBackground());
 
45
        gr.fillRect(x + 2, y + 2, width - 4, height - 4);
 
46
        gr.setColor(inner);
 
47
        gr.drawRect(x + 1, y + 1, width - 3, height - 3);
 
48
        gr.setColor(outer);
 
49
        gr.drawRect(x, y, width - 1, height - 1);
 
50
    }    
 
51
}