Blame view

gui/morfeusz/PlaceHolder.java 835 Bytes
Marcin WoliƄski authored
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
35
36
37
38
39
40
41
package morfeusz;

import java.awt.*;

import javax.swing.*;

@SuppressWarnings("serial")
public class PlaceHolder extends JPanel
{
	private boolean show;

	public PlaceHolder()
	{
		super();
		show = false;
		setBackground(Morfeusz.LIGHT_GRAY);
	}

	public void showBottomLine(boolean f)
	{
		if (show != f) {
			show = f;
			repaint();
		}
	}

	public void paintComponent(Graphics graphics)
	{
		super.paintComponent(graphics);
		if (show) {
			graphics.setColor(Color.lightGray);
			if (Morfeusz.isMacOS()) {
				graphics.drawLine(0,  getHeight() - 2,  getWidth(), getHeight() - 2);
				graphics.setColor(Color.white);
				graphics.drawLine(0,  getHeight() - 1,  getWidth(), getHeight() - 1);
			}
			else graphics.drawLine(0,  getHeight() - 1,  getWidth(),  getHeight() - 1);
		}
	}

}