/*
 * Autopsy Forensic Browser
 * 
 * Copyright 2011 Basis Technology Corp.
 * Contact: carrier <at> sleuthkit <dot> org
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *     http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.sleuthkit.autopsy.corecomponents;

import java.awt.Dimension;
import java.awt.Point;
import java.awt.Polygon;
import java.awt.Rectangle;
import javax.swing.DefaultSingleSelectionModel;
import javax.swing.JComponent;
import javax.swing.SingleSelectionModel;
import javax.swing.plaf.ComponentUI;
import org.netbeans.swing.tabcontrol.TabDisplayer;
import org.netbeans.swing.tabcontrol.TabDisplayerUI;

/**
 *
 * @author dfickling
 */
public class NoTabsTabDisplayerUI extends TabDisplayerUI {
    
    /** Creates a new instance of NoTabsTabDisplayerUI */
    public NoTabsTabDisplayerUI(TabDisplayer displayer) {
        super(displayer);
    }
    
    public static ComponentUI createUI(JComponent jc) {
        assert jc instanceof TabDisplayer;
        return new NoTabsTabDisplayerUI((TabDisplayer) jc);
    }
    
    private static final int[] PTS = new int[] { 0, 0, 0 };
    public Polygon getExactTabIndication(int i) {
        //Should never be called
        return new Polygon(PTS, PTS, PTS.length);
    }
    
    public Polygon getInsertTabIndication(int i) {
        return new Polygon(PTS, PTS, PTS.length);
    }
    
    public int tabForCoordinate(Point point) {
        return -1;
    }
    
    public Rectangle getTabRect(int i, Rectangle rectangle) {
        return new Rectangle(0,0,0,0);
    }
    
    protected SingleSelectionModel createSelectionModel() {
        return new DefaultSingleSelectionModel();
    }
    
    public java.lang.String getCommandAtPoint(Point point) {
        return null;
    }
    
    public int dropIndexOfPoint(Point point) {
        return -1;
    }
    
    public void registerShortcuts(javax.swing.JComponent jComponent) {
        //do nothing
    }
    
    public void unregisterShortcuts(javax.swing.JComponent jComponent) {
        //do nothing
    }
    
    protected void requestAttention(int i) {
        //do nothing
    }
    
    protected void cancelRequestAttention(int i) {
        //do nothing
    }
    
    public Dimension getPreferredSize(javax.swing.JComponent c) {
        return new Dimension(0, 0);
    }
    
    public Dimension getMinimumSize(javax.swing.JComponent c) {
        return new Dimension(0, 0);
    }
    
    public Dimension getMaximumSize(javax.swing.JComponent c) {
        return new Dimension(0, 0);
    }
}
