Autopsy  4.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 
41  public NoTabsTabDisplayerUI(TabDisplayer displayer) {
42  super(displayer);
43  }
44 
45  public static ComponentUI createUI(JComponent jc) {
46  assert jc instanceof TabDisplayer;
47  return new NoTabsTabDisplayerUI((TabDisplayer) jc);
48  }
49 
50  private static final int[] PTS = new int[]{0, 0, 0};
51 
52  public Polygon getExactTabIndication(int i) {
53  //Should never be called
54  return new Polygon(PTS, PTS, PTS.length);
55  }
56 
57  public Polygon getInsertTabIndication(int i) {
58  return new Polygon(PTS, PTS, PTS.length);
59  }
60 
61  public int tabForCoordinate(Point point) {
62  return -1;
63  }
64 
65  public Rectangle getTabRect(int i, Rectangle rectangle) {
66  return new Rectangle(0, 0, 0, 0);
67  }
68 
69  protected SingleSelectionModel createSelectionModel() {
70  return new DefaultSingleSelectionModel();
71  }
72 
73  public java.lang.String getCommandAtPoint(Point point) {
74  return null;
75  }
76 
77  public int dropIndexOfPoint(Point point) {
78  return -1;
79  }
80 
81  public void registerShortcuts(javax.swing.JComponent jComponent) {
82  //do nothing
83  }
84 
85  public void unregisterShortcuts(javax.swing.JComponent jComponent) {
86  //do nothing
87  }
88 
89  protected void requestAttention(int i) {
90  //do nothing
91  }
92 
93  protected void cancelRequestAttention(int i) {
94  //do nothing
95  }
96 
97  public Dimension getPreferredSize(javax.swing.JComponent c) {
98  return new Dimension(0, 0);
99  }
100 
101  public Dimension getMinimumSize(javax.swing.JComponent c) {
102  return new Dimension(0, 0);
103  }
104 
105  public Dimension getMaximumSize(javax.swing.JComponent c) {
106  return new Dimension(0, 0);
107  }
108 }
void unregisterShortcuts(javax.swing.JComponent jComponent)

Copyright © 2012-2016 Basis Technology. Generated on: Mon Apr 24 2017
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.