View Javadoc

1   /*
2    * Copyright 2006 - 2012 Christina Bohk and Roland Ewald
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 p3j.gui.panels.projections;
17  
18  import java.awt.Component;
19  
20  import javax.swing.JLabel;
21  import javax.swing.JTree;
22  import javax.swing.tree.DefaultTreeCellRenderer;
23  
24  /**
25   * Cell renderer for an {@link IProjectionTree} instance.
26   * 
27   * Created: September 7, 2008
28   * 
29   * @author Christina Bohk
30   * @author Roland Ewald
31   * 
32   */
33  public class ProjectionTreeCellRenderer extends DefaultTreeCellRenderer {
34  
35  	/** Serialization ID. */
36  	private static final long serialVersionUID = 7794868165808019534L;
37  
38  	@Override
39  	public Component getTreeCellRendererComponent(JTree tree, Object value,
40  	    boolean selected, boolean expanded, boolean leaf, int row,
41  	    boolean hasFocus) {
42  
43  		JLabel result = (JLabel) super.getTreeCellRendererComponent(tree, value,
44  		    selected, expanded, leaf, row, hasFocus);
45  
46  		return result;
47  	}
48  
49  }