File: WidgetFactory.java

package info (click to toggle)
mac-widgets 0.10.0%2Bsvn416-dfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,968 kB
  • ctags: 2,003
  • sloc: java: 9,909; makefile: 13; sh: 12
file content (34 lines) | stat: -rwxr-xr-x 1,391 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package com.explodingpixels.macwidgets;

import java.awt.Color;

import javax.swing.BorderFactory;
import javax.swing.JComponent;
import javax.swing.JSplitPane;
import javax.swing.plaf.basic.BasicSplitPaneUI;

public class WidgetFactory {

	   public static JSplitPane createHorizontalSplitPane(JComponent componentLeft, JComponent componentRight) {
	        JSplitPane splitPane = new JSplitPane(
	                JSplitPane.HORIZONTAL_SPLIT, componentLeft, componentRight);
	        splitPane.setContinuousLayout(true);
	        splitPane.setDividerSize(1);
	        ((BasicSplitPaneUI) splitPane.getUI()).getDivider().setBorder(
	                BorderFactory.createMatteBorder(0, 1, 0, 0, new Color(0xa5a5a5)));
	        splitPane.setBorder(BorderFactory.createEmptyBorder());
	        return splitPane;
	    }
	
	   public static JSplitPane createVerticalSplitPane(JComponent componentTop, JComponent componentBottom) {
	        JSplitPane splitPane = new JSplitPane(
	                JSplitPane.VERTICAL_SPLIT, componentTop, componentBottom);
	        splitPane.setContinuousLayout(true);
	        splitPane.setDividerSize(1);
	        ((BasicSplitPaneUI) splitPane.getUI()).getDivider().setBorder(
	                BorderFactory.createMatteBorder(0, 1, 0, 0, new Color(0xa5a5a5)));
	        splitPane.setBorder(BorderFactory.createEmptyBorder());
	        return splitPane;
	    }

}