KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > swing > tabcontrol > plaf > TabLayoutModel


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */
/*
19  * TabLayoutModel.java
20  *
21  * Created on May 16, 2003, 3:47 PM
22  */

23
24 package org.netbeans.swing.tabcontrol.plaf;
25
26 import java.awt.*;
27
28
29 /**
30  * A model representing the visual layout of tabs in a TabDataModel as a set of
31  * rectangles. Used by BasicTabDisplayerUI and its subclasses to manage the layout of
32  * tabs in the displayer.
33  *
34  * @author Tim Boudreau
35  */

36 public interface TabLayoutModel {
37     /**
38      * Get the x coordinate of the tab rectangle for the tab at index
39      * <code>index</code> in the data model.
40      *
41      * @param index The tab index
42      * @return The coordinate
43      */

44     public int getX(int index);
45
46     /**
47      * Get the y coordinate of the tab rectangle for the tab at index
48      * <code>index</code> in the data model.
49      *
50      * @param index The tab index
51      * @return The coordinate
52      */

53     public int getY(int index);
54
55     /**
56      * Get the width of the tab rectangle for the tab at index
57      * <code>index</code> in the data model.
58      *
59      * @param index The tab index
60      * @return The width
61      */

62     public int getW(int index);
63
64     /**
65      * Get the height of the tab rectangle for the tab at index
66      * <code>index</code> in the data model.
67      *
68      * @param index The tab index
69      * @return The height
70      */

71     public int getH(int index);
72
73     /**
74      * Get the index of the tab in the data model for the supplied point.
75      *
76      * @param x X coordinate of a point representing a set of pixel coordinate in the space
77      * modeled by this layout model
78      * @param y Y coordinate
79      * @return The index into the data model of the tab displayed at the passed
80      * point or -1
81      */

82     public int indexOfPoint(int x, int y);
83
84     // XXX DnD only
85
/**
86      * Gets the index of possibly dropped component (as a new tab).
87      */

88     public int dropIndexOfPoint(int x, int y);
89
90     public void setPadding (Dimension d);
91 }
92
Popular Tags