View Javadoc

1   /***
2    * 
3    */
4   package org.telscenter.pas.ui.panel;
5   
6   import java.awt.BorderLayout;
7   import java.awt.LayoutManager;
8   
9   import javax.swing.JButton;
10  
11  import org.telscenter.pas.common.ui.ISelectable;
12  import org.telscenter.pas.common.ui.panel.SimpleGradientPanel;
13  
14  /***
15   * @author aperritano
16   *
17   */
18  public class PasGroupButtonPanel extends SimpleGradientPanel implements ISelectable {
19  
20  	private boolean selected;
21  	private JButton rightButton;
22  	private JButton leftButton;
23  	private boolean hasHints = false;
24  	private JButton middleButton;
25  	/***
26  	 * 
27  	 */
28  	public PasGroupButtonPanel() {
29  		init();
30  	}
31  	
32  
33  
34  	
35  	/***
36  	 * @param layout
37  	 */
38  	public PasGroupButtonPanel(LayoutManager layout) {
39  		super(layout);
40  		init();
41  	}
42  
43  	/***
44  	 * @param isDoubleBuffered
45  	 */
46  	public PasGroupButtonPanel(boolean isDoubleBuffered) {
47  		super(isDoubleBuffered);
48  		init();
49  	}
50  
51  	/***
52  	 * @param layout
53  	 * @param isDoubleBuffered
54  	 */
55  	public PasGroupButtonPanel(LayoutManager layout, boolean isDoubleBuffered) {
56  		super(layout, isDoubleBuffered);
57  		init();
58  	}
59  
60  	public void init() {
61  		this.setLayout(new BorderLayout(0,0));
62  	}
63  	
64  	public boolean isSelected() {
65  		return selected;
66  	}
67  
68  	public void setSelected(boolean selected) {
69  		this.selected = selected;
70  	}
71  
72  	/***
73  	 * @return the rightButton
74  	 */
75  	public JButton getRightButton() {
76  		return rightButton;
77  	}
78  
79  	/***
80  	 * @param rightButton the rightButton to set
81  	 */
82  	public void setRightButton(JButton rightButton) {
83  		this.rightButton = rightButton;
84  		add(rightButton,BorderLayout.EAST);
85  	}
86  
87  	/***
88  	 * @return the leftButton
89  	 */
90  	public JButton getLeftButton() {
91  		return leftButton;
92  	}
93  
94  	/***
95  	 * @param leftButton the leftButton to set
96  	 */
97  	public void setLeftButton(JButton leftButton) {
98  		this.leftButton = leftButton;
99  		add(leftButton,BorderLayout.WEST);
100 	}
101 
102 	/***
103 	 * @return the middleButton
104 	 */
105 	public JButton getMiddleButton() {
106 		return middleButton;
107 	}
108 
109 
110 
111 
112 	public void setMiddleButton(JButton middleButton) {
113 		this.middleButton = middleButton;
114 		add(middleButton,BorderLayout.CENTER);
115 	}
116 
117 
118 
119 	/***
120 	 * @return the hasHints
121 	 */
122 	public boolean hasHints() {
123 		return hasHints;
124 	}
125 
126 
127 
128 
129 	/***
130 	 * @param hasHints the hasHints to set
131 	 */
132 	public void setHasHints(boolean hasHints) {
133 		this.hasHints = hasHints;
134 	}
135 
136 }