Autopsy  3.1
Graphical digital forensics platform for The Sleuth Kit and other tools.
NoTabsTabDisplayerUI.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2011 Basis Technology Corp.
5  * Contact: carrier <at> sleuthkit <dot> org
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 package org.sleuthkit.autopsy.corecomponents;
20 
21 import java.awt.Dimension;
22 import java.awt.Point;
23 import java.awt.Polygon;
24 import java.awt.Rectangle;
25 import javax.swing.DefaultSingleSelectionModel;
26 import javax.swing.JComponent;
27 import javax.swing.SingleSelectionModel;
28 import javax.swing.plaf.ComponentUI;
29 import org.netbeans.swing.tabcontrol.TabDisplayer;
30 import org.netbeans.swing.tabcontrol.TabDisplayerUI;
31 
36 public class NoTabsTabDisplayerUI extends TabDisplayerUI {
37 
39  public NoTabsTabDisplayerUI(TabDisplayer displayer) {
40  super(displayer);
41  }
42 
43  public static ComponentUI createUI(JComponent jc) {
44  assert jc instanceof TabDisplayer;
45  return new NoTabsTabDisplayerUI((TabDisplayer) jc);
46  }
47 
48  private static final int[] PTS = new int[] { 0, 0, 0 };
49  public Polygon getExactTabIndication(int i) {
50  //Should never be called
51  return new Polygon(PTS, PTS, PTS.length);
52  }
53 
54  public Polygon getInsertTabIndication(int i) {
55  return new Polygon(PTS, PTS, PTS.length);
56  }
57 
58  public int tabForCoordinate(Point point) {
59  return -1;
60  }
61 
62  public Rectangle getTabRect(int i, Rectangle rectangle) {
63  return new Rectangle(0,0,0,0);
64  }
65 
66  protected SingleSelectionModel createSelectionModel() {
67  return new DefaultSingleSelectionModel();
68  }
69 
70  public java.lang.String getCommandAtPoint(Point point) {
71  return null;
72  }
73 
74  public int dropIndexOfPoint(Point point) {
75  return -1;
76  }
77 
78  public void registerShortcuts(javax.swing.JComponent jComponent) {
79  //do nothing
80  }
81 
82  public void unregisterShortcuts(javax.swing.JComponent jComponent) {
83  //do nothing
84  }
85 
86  protected void requestAttention(int i) {
87  //do nothing
88  }
89 
90  protected void cancelRequestAttention(int i) {
91  //do nothing
92  }
93 
94  public Dimension getPreferredSize(javax.swing.JComponent c) {
95  return new Dimension(0, 0);
96  }
97 
98  public Dimension getMinimumSize(javax.swing.JComponent c) {
99  return new Dimension(0, 0);
100  }
101 
102  public Dimension getMaximumSize(javax.swing.JComponent c) {
103  return new Dimension(0, 0);
104  }
105 }
void unregisterShortcuts(javax.swing.JComponent jComponent)

Copyright © 2012-2015 Basis Technology. Generated on: Mon Oct 19 2015
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.