Debian Codegraph @

src/com/bulenkov/iconloader/util/JBEmptyBorder.java

raw symbols SCIP
1 /*
2 * Copyright 2000-2016 JetBrains s.r.o.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package com.bulenkov.iconloader.util;
17
18 import javax.swing.border.EmptyBorder;
19 import javax.swing.plaf.UIResource;
20 import java.awt.*;
21
22 /**
23 * @author Konstantin Bulenkov
24 */
25 public class JBEmptyBorder extends EmptyBorder {
26 public JBEmptyBorder(int top, int left, int bottom, int right) {
27 super(JBUI.insets(top, left, bottom, right));
28 }
29
30 public JBEmptyBorder(Insets insets) {
31 super(JBUI.insets(insets));
32 }
33
34 public JBEmptyBorder(int offset) {
35 this(offset, offset, offset, offset);
36 }
37
38 public JBEmptyBorderUIResource asUIResource() {
39 return new JBEmptyBorderUIResource(this);
40 }
41
42 public static class JBEmptyBorderUIResource extends JBEmptyBorder implements UIResource {
43 public JBEmptyBorderUIResource(JBEmptyBorder border) {
44 super(0,0,0,0);
45 top = border.top;
46 left = border.left;
47 bottom = border.bottom;
48 right = border.right;
49 }
50 }
51 }