/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
class AquaTabbedPaneTabState {
protected int lastLeftmostTab;
protected int lastReturnAt;
private boolean needsScrollers;
private boolean hasMoreLeftTabs;
private boolean hasMoreRightTabs;
}
protected int getIndex(final int i) {
return visibleTabList[i];
}
final int[] tempVisibleTabs = new int[tabCount];
}
int getTotal() {
return numberOfVisibleTabs;
}
boolean needsScrollTabs() {
return needsScrollers;
}
this.needsScrollers = needsScrollers;
}
boolean needsLeftScrollTab() {
return hasMoreLeftTabs;
}
boolean needsRightScrollTab() {
return hasMoreRightTabs;
}
return leftScrollTabRect;
}
return rightScrollTabRect;
}
boolean isBefore(final int i) {
if (numberOfVisibleTabs == 0) return true;
if (i < visibleTabList[0]) return true;
return false;
}
boolean isAfter(final int i) {
return false;
}
}
}
void relayoutForScrolling(final Rectangle[] rects, final int startX, final int startY, final int returnAt, final int selectedIndex, final boolean verticalTabRuns, final int tabCount, final boolean isLeftToRight) {
if (!needsScrollers) {
hasMoreLeftTabs = false;
hasMoreRightTabs = false;
return;
}
// we don't fit, so we need to figure the space based on the size of the popup
// tab, then add the tabs, centering the selected tab as much as possible.
// Tabs on TOP or BOTTOM or LEFT or RIGHT
// if top or bottom, width is hardocoded
// if left or right height should be hardcoded.
if (verticalTabRuns) {
} else {
}
// we have all the tab rects, we just need to adjust the x coordinates
// and populate the visible list
// sja fix what do we do if remaining width is <0??
// we could try to center it based on width of tabs, but for now
// we try to center based on number of tabs on each side, putting the extra
// on the left (since the first right is the selected tab).
// if we have 0 selected we will just go right, and if we have
// the logic here is start with the selected tab, and then fit
// in as many tabs as possible on each side until we don't fit any more.
// but if all we did was change selection then we need to try to keep the same
// tabs on screen so we don't get a jarring tab moving out from under the mouse
// effect.
// so if we stay the same, make right the first tab and say left done = true
pane.popupSelectionChanged = false;
lastLeftmostTab = -1;
}
int right = selectedIndex;
// if we had a good last leftmost tab then we set left to unused and
// start at that tab.
if (lastLeftmostTab >= 0) {
left = -1;
} else if (selectedIndex < 0) {
// this is if there is none selected see radar 3138137
right = 0;
left = -1;
}
int remainingSpace = returnAt - pane.tabAreaInsets.right - pane.tabAreaInsets.left - FIXED_SCROLL_TAB_LENGTH * 2;
int visibleCount = 0;
// always show at least the selected one!
if (verticalTabRuns) {
} else {
}
visibleCount++;
} else {
boolean rightDone = false;
boolean leftDone = false;
// at least one if not more will fit
rightDone = true;
} else {
visibleCount++;
right++;
continue; // this gives a bias to "paging forward", and "inching backward"
}
} else {
rightDone = true;
}
leftDone = true;
} else {
visibleCount++;
left--;
}
} else {
leftDone = true;
}
}
}
// add the scroll tab at the end;
// move all "invisible" tabs beyond the edge of known space...
for (int i = 0; i < tabCount; i++) {
if (i < firstTabIndex || i > lastTabIndex) {
}
}
}
protected void alignRectsRunFor(final Rectangle[] rects, final Dimension tabPaneSize, final int tabPlacement, final boolean isRightToLeft) {
final boolean isVertical = tabPlacement == SwingConstants.LEFT || tabPlacement == SwingConstants.RIGHT;
if (isVertical) {
if (needsScrollers) {
} else {
}
} else {
if (needsScrollers) {
} else {
}
}
}
private void centerHorizontalRun(final Rectangle[] rects, final Dimension size, final boolean isRightToLeft) {
int totalLength = 0;
}
if (isRightToLeft) {
rect.x = x;
}
} else {
rect.x = x;
}
}
}
int totalLength = 0;
}
if (true) {
rect.y = y;
}
} else {
rect.y = y;
}
}
}
private void stretchScrollingHorizontalRun(final Rectangle[] rects, final Dimension size, final boolean isRightToLeft) {
int totalRunLength = 0;
for (int i = firstTabIndex; i <= lastTabIndex; i++) {
}
if (needsLeftScrollTab()) {
}
if (needsRightScrollTab()) {
}
int runningLength = 0;
if (isRightToLeft) {
for (int i = firstTabIndex; i <= lastTabIndex; i++) {
int slackToAdd = minSlack;
if (extraSlack > 0) {
slackToAdd++;
extraSlack--;
}
}
} else {
for (int i = lastTabIndex; i >= firstTabIndex; i--) {
int slackToAdd = minSlack;
if (extraSlack > 0) {
slackToAdd++;
extraSlack--;
}
}
}
if (isRightToLeft) {
} else {
if (needsLeftScrollTab()) {
for (int i = lastTabIndex; i >= firstTabIndex; i--) {
rect.x -= FIXED_SCROLL_TAB_LENGTH;
}
}
if (needsRightScrollTab()) {
for (int i = lastTabIndex; i >= firstTabIndex; i--) {
rect.x += FIXED_SCROLL_TAB_LENGTH;
}
}
}
}
int totalRunLength = 0;
for (int i = firstTabIndex; i <= lastTabIndex; i++) {
}
if (needsLeftScrollTab()) {
}
if (needsRightScrollTab()) {
}
int runningLength = 0;
for (int i = firstTabIndex; i <= lastTabIndex; i++) {
int slackToAdd = minSlack;
if (extraSlack > 0) {
slackToAdd++;
extraSlack--;
}
}
}
}