bugged
stringlengths
6
599k
fixed
stringlengths
6
40.8M
__index_level_0__
int64
0
3.24M
protected void setLong(int index, long data) { set(index, new Long(data)); }
protected void setLong(int index, long data) { set(index, new VmConstLong(data)); }
11,888
protected void setDouble(int index, double data) { set(index, new Double(data)); }
protected void setDouble(int index, double data) { set(index, new VmConstDouble(data)); }
11,889
public int getInt(int index) { if (index == 0) return 0; else return ((Integer) get(index)).intValue(); }
public int getInt(int index) { if (index == 0) return 0; else return ((VmConstInt) get(index)).intValue(); }
11,890
public double getDouble(int index) { return ((Double) get(index)).doubleValue(); }
public double getDouble(int index) { return ((VmConstDouble) get(index)).doubleValue(); }
11,891
public float getFloat(int index) { return ((Float) get(index)).floatValue(); }
public float getFloat(int index) { return ((VmConstFloat) get(index)).floatValue(); }
11,892
public long getLong(int index) { return ((Long) get(index)).longValue(); }
public long getLong(int index) { return ((VmConstLong) get(index)).longValue(); }
11,893
public PaneButton(Action a) { super(a); setMargin(new Insets(0, 0, 0, 0)); setBorder(null); }
public PaneButton(Action a) { super(a); setMargin(new Insets(0, 0, 0, 0)); }
11,894
public void propertyChange(PropertyChangeEvent evt) { // The title and frameIcon are taken care of during painting time. // The only other thing this will care about are the "is----izable" // properties. So we call enable actions to properly handle the // buttons and menu items for us. enableActions(); }
public void propertyChange(PropertyChangeEvent evt) { // The title and frameIcon are taken care of during painting time. // The only other thing this will care about are the "is----izable" // properties. So we call enable actions to properly handle the // buttons and menu items for us. String propName = evt.getPropertyName(); if (propName.equals("closable")) { if (evt.getNewValue().equals(Boolean.TRUE)) closeButton.setVisible(true); else closeButton.setVisible(false); } else if (propName.equals("iconifiable")) { if (evt.getNewValue().equals(Boolean.TRUE)) iconButton.setVisible(true); else iconButton.setVisible(false); } else if (propName.equals("maximizable")) { if (evt.getNewValue().equals(Boolean.TRUE)) maxButton.setVisible(true); else maxButton.setVisible(false); } }
11,895
public void layoutContainer(Container c) { enableActions(); Insets insets = c.getInsets(); int width = c.getBounds().width - insets.left - insets.right; int height = c.getBounds().height - insets.top - insets.bottom; // MenuBar is always present and located at the top left corner. Dimension menupref = menuBar.getPreferredSize(); menuBar.setBounds(insets.left, insets.top, menupref.width, height); int loc = width + insets.left; Insets i = closeButton.getInsets(); Dimension prefs = new Dimension(iconSize + i.left + i.right, iconSize + i.top + i.bottom); int top = insets.top + (height - prefs.height) / 2; if (closeAction.isEnabled()) { loc -= prefs.width; closeButton.setVisible(true); closeButton.setBounds(loc, top, prefs.width, prefs.height); } else closeButton.setVisible(false); if (maximizeAction.isEnabled()) { loc -= prefs.width; maxButton.setVisible(true); maxButton.setBounds(loc, top, prefs.width, prefs.height); } else maxButton.setVisible(false); if (iconifyAction.isEnabled()) { loc -= prefs.width; iconButton.setVisible(true); iconButton.setBounds(loc, top, prefs.width, prefs.height); } else iconButton.setVisible(false); if (title != null) title.setBounds(insets.left + menupref.width, insets.top, loc - menupref.width - insets.left, height); }
public void layoutContainer(Container c) { Dimension size = c.getSize(); Insets insets = c.getInsets(); int width = c.getBounds().width - insets.left - insets.right; int height = c.getBounds().height - insets.top - insets.bottom; // MenuBar is always present and located at the top left corner. Dimension menupref = menuBar.getPreferredSize(); menuBar.setBounds(insets.left, insets.top, menupref.width, height); int loc = width + insets.left; Insets i = closeButton.getInsets(); Dimension prefs = new Dimension(iconSize + i.left + i.right, iconSize + i.top + i.bottom); int top = insets.top + (height - prefs.height) / 2; if (closeAction.isEnabled()) { loc -= prefs.width; closeButton.setVisible(true); closeButton.setBounds(loc, top, prefs.width, prefs.height); } else closeButton.setVisible(false); if (maximizeAction.isEnabled()) { loc -= prefs.width; maxButton.setVisible(true); maxButton.setBounds(loc, top, prefs.width, prefs.height); } else maxButton.setVisible(false); if (iconifyAction.isEnabled()) { loc -= prefs.width; iconButton.setVisible(true); iconButton.setBounds(loc, top, prefs.width, prefs.height); } else iconButton.setVisible(false); if (title != null) title.setBounds(insets.left + menupref.width, insets.top, loc - menupref.width - insets.left, height); }
11,896
public void layoutContainer(Container c) { enableActions(); Insets insets = c.getInsets(); int width = c.getBounds().width - insets.left - insets.right; int height = c.getBounds().height - insets.top - insets.bottom; // MenuBar is always present and located at the top left corner. Dimension menupref = menuBar.getPreferredSize(); menuBar.setBounds(insets.left, insets.top, menupref.width, height); int loc = width + insets.left; Insets i = closeButton.getInsets(); Dimension prefs = new Dimension(iconSize + i.left + i.right, iconSize + i.top + i.bottom); int top = insets.top + (height - prefs.height) / 2; if (closeAction.isEnabled()) { loc -= prefs.width; closeButton.setVisible(true); closeButton.setBounds(loc, top, prefs.width, prefs.height); } else closeButton.setVisible(false); if (maximizeAction.isEnabled()) { loc -= prefs.width; maxButton.setVisible(true); maxButton.setBounds(loc, top, prefs.width, prefs.height); } else maxButton.setVisible(false); if (iconifyAction.isEnabled()) { loc -= prefs.width; iconButton.setVisible(true); iconButton.setBounds(loc, top, prefs.width, prefs.height); } else iconButton.setVisible(false); if (title != null) title.setBounds(insets.left + menupref.width, insets.top, loc - menupref.width - insets.left, height); }
public void layoutContainer(Container c) { enableActions(); Insets insets = c.getInsets(); int width = c.getBounds().width - insets.left - insets.right; int height = c.getBounds().height - insets.top - insets.bottom; // MenuBar is always present and located at the top left corner. Dimension menupref = menuBar.getPreferredSize(); menuBar.setBounds(insets.left, insets.top, menupref.width, height); int loc = width + insets.left; Insets i = closeButton.getInsets(); Dimension prefs = new Dimension(iconSize + i.left + i.right, iconSize + i.top + i.bottom); int top = insets.top + (height - prefs.height) / 2; if (closeAction.isEnabled()) { loc -= prefs.width; closeButton.setVisible(true); closeButton.setBounds(loc, top, prefs.width, prefs.height); } else closeButton.setVisible(false); if (maximizeAction.isEnabled()) { loc -= prefs.width; maxButton.setVisible(true); maxButton.setBounds(loc, top, prefs.width, prefs.height); } else maxButton.setVisible(false); if (iconifyAction.isEnabled()) { loc -= prefs.width; iconButton.setVisible(true); iconButton.setBounds(loc, top, prefs.width, prefs.height); } else iconButton.setVisible(false); if (title != null) title.setBounds(insets.left + menupref.width, insets.top, loc - menupref.width - insets.left, height); }
11,897
public void layoutContainer(Container c) { enableActions(); Insets insets = c.getInsets(); int width = c.getBounds().width - insets.left - insets.right; int height = c.getBounds().height - insets.top - insets.bottom; // MenuBar is always present and located at the top left corner. Dimension menupref = menuBar.getPreferredSize(); menuBar.setBounds(insets.left, insets.top, menupref.width, height); int loc = width + insets.left; Insets i = closeButton.getInsets(); Dimension prefs = new Dimension(iconSize + i.left + i.right, iconSize + i.top + i.bottom); int top = insets.top + (height - prefs.height) / 2; if (closeAction.isEnabled()) { loc -= prefs.width; closeButton.setVisible(true); closeButton.setBounds(loc, top, prefs.width, prefs.height); } else closeButton.setVisible(false); if (maximizeAction.isEnabled()) { loc -= prefs.width; maxButton.setVisible(true); maxButton.setBounds(loc, top, prefs.width, prefs.height); } else maxButton.setVisible(false); if (iconifyAction.isEnabled()) { loc -= prefs.width; iconButton.setVisible(true); iconButton.setBounds(loc, top, prefs.width, prefs.height); } else iconButton.setVisible(false); if (title != null) title.setBounds(insets.left + menupref.width, insets.top, loc - menupref.width - insets.left, height); }
public void layoutContainer(Container c) { enableActions(); Insets insets = c.getInsets(); int width = c.getBounds().width - insets.left - insets.right; int height = c.getBounds().height - insets.top - insets.bottom; // MenuBar is always present and located at the top left corner. Dimension menupref = menuBar.getPreferredSize(); menuBar.setBounds(insets.left, insets.top, menupref.width, height); int loc = width + insets.left - 1; int top = insets.top + 1; int buttonWidth = height - 2; int buttonHeight = height - 4; if (closeButton.isVisible()) { loc -= buttonWidth + 2; closeButton.setBounds(loc, top, buttonWidth, buttonHeight); } Insets i = closeButton.getInsets(); Dimension prefs = new Dimension(iconSize + i.left + i.right, iconSize + i.top + i.bottom); int top = insets.top + (height - prefs.height) / 2; if (closeAction.isEnabled()) { loc -= prefs.width; closeButton.setVisible(true); closeButton.setBounds(loc, top, prefs.width, prefs.height); } else closeButton.setVisible(false); if (maximizeAction.isEnabled()) { loc -= prefs.width; maxButton.setVisible(true); maxButton.setBounds(loc, top, prefs.width, prefs.height); } else maxButton.setVisible(false); if (iconifyAction.isEnabled()) { loc -= prefs.width; iconButton.setVisible(true); iconButton.setBounds(loc, top, prefs.width, prefs.height); } else iconButton.setVisible(false); if (title != null) title.setBounds(insets.left + menupref.width, insets.top, loc - menupref.width - insets.left, height); }
11,898
public void layoutContainer(Container c) { enableActions(); Insets insets = c.getInsets(); int width = c.getBounds().width - insets.left - insets.right; int height = c.getBounds().height - insets.top - insets.bottom; // MenuBar is always present and located at the top left corner. Dimension menupref = menuBar.getPreferredSize(); menuBar.setBounds(insets.left, insets.top, menupref.width, height); int loc = width + insets.left; Insets i = closeButton.getInsets(); Dimension prefs = new Dimension(iconSize + i.left + i.right, iconSize + i.top + i.bottom); int top = insets.top + (height - prefs.height) / 2; if (closeAction.isEnabled()) { loc -= prefs.width; closeButton.setVisible(true); closeButton.setBounds(loc, top, prefs.width, prefs.height); } else closeButton.setVisible(false); if (maximizeAction.isEnabled()) { loc -= prefs.width; maxButton.setVisible(true); maxButton.setBounds(loc, top, prefs.width, prefs.height); } else maxButton.setVisible(false); if (iconifyAction.isEnabled()) { loc -= prefs.width; iconButton.setVisible(true); iconButton.setBounds(loc, top, prefs.width, prefs.height); } else iconButton.setVisible(false); if (title != null) title.setBounds(insets.left + menupref.width, insets.top, loc - menupref.width - insets.left, height); }
public void layoutContainer(Container c) { enableActions(); Insets insets = c.getInsets(); int width = c.getBounds().width - insets.left - insets.right; int height = c.getBounds().height - insets.top - insets.bottom; // MenuBar is always present and located at the top left corner. Dimension menupref = menuBar.getPreferredSize(); menuBar.setBounds(insets.left, insets.top, menupref.width, height); int loc = width + insets.left; Insets i = closeButton.getInsets(); Dimension prefs = new Dimension(iconSize + i.left + i.right, iconSize + i.top + i.bottom); int top = insets.top + (height - prefs.height) / 2; if (closeAction.isEnabled()) { loc -= prefs.width; closeButton.setVisible(true); closeButton.setBounds(loc, top, prefs.width, prefs.height); } else closeButton.setVisible(false); if (maximizeAction.isEnabled()) { loc -= prefs.width; maxButton.setVisible(true); maxButton.setBounds(loc, top, prefs.width, prefs.height); } else maxButton.setVisible(false); if (iconifyAction.isEnabled()) { loc -= prefs.width; iconButton.setVisible(true); iconButton.setBounds(loc, top, prefs.width, prefs.height); } else iconButton.setVisible(false); if (title != null) title.setBounds(insets.left + menupref.width, insets.top, loc - menupref.width - insets.left, height); }
11,899
public void layoutContainer(Container c) { enableActions(); Insets insets = c.getInsets(); int width = c.getBounds().width - insets.left - insets.right; int height = c.getBounds().height - insets.top - insets.bottom; // MenuBar is always present and located at the top left corner. Dimension menupref = menuBar.getPreferredSize(); menuBar.setBounds(insets.left, insets.top, menupref.width, height); int loc = width + insets.left; Insets i = closeButton.getInsets(); Dimension prefs = new Dimension(iconSize + i.left + i.right, iconSize + i.top + i.bottom); int top = insets.top + (height - prefs.height) / 2; if (closeAction.isEnabled()) { loc -= prefs.width; closeButton.setVisible(true); closeButton.setBounds(loc, top, prefs.width, prefs.height); } else closeButton.setVisible(false); if (maximizeAction.isEnabled()) { loc -= prefs.width; maxButton.setVisible(true); maxButton.setBounds(loc, top, prefs.width, prefs.height); } else maxButton.setVisible(false); if (iconifyAction.isEnabled()) { loc -= prefs.width; iconButton.setVisible(true); iconButton.setBounds(loc, top, prefs.width, prefs.height); } else iconButton.setVisible(false); if (title != null) title.setBounds(insets.left + menupref.width, insets.top, loc - menupref.width - insets.left, height); }
public void layoutContainer(Container c) { enableActions(); Insets insets = c.getInsets(); int width = c.getBounds().width - insets.left - insets.right; int height = c.getBounds().height - insets.top - insets.bottom; // MenuBar is always present and located at the top left corner. Dimension menupref = menuBar.getPreferredSize(); menuBar.setBounds(insets.left, insets.top, menupref.width, height); int loc = width + insets.left; Insets i = closeButton.getInsets(); Dimension prefs = new Dimension(iconSize + i.left + i.right, iconSize + i.top + i.bottom); int top = insets.top + (height - prefs.height) / 2; if (closeAction.isEnabled()) { loc -= prefs.width; closeButton.setVisible(true); closeButton.setBounds(loc, top, prefs.width, prefs.height); } else closeButton.setVisible(false); if (maximizeAction.isEnabled()) { loc -= prefs.width; maxButton.setVisible(true); maxButton.setBounds(loc, top, prefs.width, prefs.height); } else maxButton.setVisible(false); if (iconifyAction.isEnabled()) { loc -= prefs.width; iconButton.setVisible(true); iconButton.setBounds(loc, top, prefs.width, prefs.height); } else iconButton.setVisible(false); if (title != null) title.setBounds(insets.left + menupref.width, insets.top, loc - menupref.width - insets.left, height); }
11,900
public void layoutContainer(Container c) { enableActions(); Insets insets = c.getInsets(); int width = c.getBounds().width - insets.left - insets.right; int height = c.getBounds().height - insets.top - insets.bottom; // MenuBar is always present and located at the top left corner. Dimension menupref = menuBar.getPreferredSize(); menuBar.setBounds(insets.left, insets.top, menupref.width, height); int loc = width + insets.left; Insets i = closeButton.getInsets(); Dimension prefs = new Dimension(iconSize + i.left + i.right, iconSize + i.top + i.bottom); int top = insets.top + (height - prefs.height) / 2; if (closeAction.isEnabled()) { loc -= prefs.width; closeButton.setVisible(true); closeButton.setBounds(loc, top, prefs.width, prefs.height); } else closeButton.setVisible(false); if (maximizeAction.isEnabled()) { loc -= prefs.width; maxButton.setVisible(true); maxButton.setBounds(loc, top, prefs.width, prefs.height); } else maxButton.setVisible(false); if (iconifyAction.isEnabled()) { loc -= prefs.width; iconButton.setVisible(true); iconButton.setBounds(loc, top, prefs.width, prefs.height); } else iconButton.setVisible(false); if (title != null) title.setBounds(insets.left + menupref.width, insets.top, loc - menupref.width - insets.left, height); }
public void layoutContainer(Container c) { enableActions(); Insets insets = c.getInsets(); int width = c.getBounds().width - insets.left - insets.right; int height = c.getBounds().height - insets.top - insets.bottom; // MenuBar is always present and located at the top left corner. Dimension menupref = menuBar.getPreferredSize(); menuBar.setBounds(insets.left, insets.top, menupref.width, height); int loc = width + insets.left; Insets i = closeButton.getInsets(); Dimension prefs = new Dimension(iconSize + i.left + i.right, iconSize + i.top + i.bottom); int top = insets.top + (height - prefs.height) / 2; if (closeAction.isEnabled()) { loc -= prefs.width; closeButton.setVisible(true); closeButton.setBounds(loc, top, prefs.width, prefs.height); } else closeButton.setVisible(false); if (maximizeAction.isEnabled()) { loc -= prefs.width; maxButton.setVisible(true); maxButton.setBounds(loc, top, prefs.width, prefs.height); } else maxButton.setVisible(false); if (iconifyAction.isEnabled()) { loc -= prefs.width; iconButton.setVisible(true); iconButton.setBounds(loc, top, prefs.width, prefs.height); } else iconButton.setVisible(false); if (title != null) title.setBounds(insets.left + menupref.width, insets.top, loc - menupref.width - insets.left, height); }
11,901
public void layoutContainer(Container c) { enableActions(); Insets insets = c.getInsets(); int width = c.getBounds().width - insets.left - insets.right; int height = c.getBounds().height - insets.top - insets.bottom; // MenuBar is always present and located at the top left corner. Dimension menupref = menuBar.getPreferredSize(); menuBar.setBounds(insets.left, insets.top, menupref.width, height); int loc = width + insets.left; Insets i = closeButton.getInsets(); Dimension prefs = new Dimension(iconSize + i.left + i.right, iconSize + i.top + i.bottom); int top = insets.top + (height - prefs.height) / 2; if (closeAction.isEnabled()) { loc -= prefs.width; closeButton.setVisible(true); closeButton.setBounds(loc, top, prefs.width, prefs.height); } else closeButton.setVisible(false); if (maximizeAction.isEnabled()) { loc -= prefs.width; maxButton.setVisible(true); maxButton.setBounds(loc, top, prefs.width, prefs.height); } else maxButton.setVisible(false); if (iconifyAction.isEnabled()) { loc -= prefs.width; iconButton.setVisible(true); iconButton.setBounds(loc, top, prefs.width, prefs.height); } else iconButton.setVisible(false); if (title != null) title.setBounds(insets.left + menupref.width, insets.top, loc - menupref.width - insets.left, height); }
public void layoutContainer(Container c) { enableActions(); Insets insets = c.getInsets(); int width = c.getBounds().width - insets.left - insets.right; int height = c.getBounds().height - insets.top - insets.bottom; // MenuBar is always present and located at the top left corner. Dimension menupref = menuBar.getPreferredSize(); menuBar.setBounds(insets.left, insets.top, menupref.width, height); int loc = width + insets.left; Insets i = closeButton.getInsets(); Dimension prefs = new Dimension(iconSize + i.left + i.right, iconSize + i.top + i.bottom); int top = insets.top + (height - prefs.height) / 2; if (closeAction.isEnabled()) { loc -= prefs.width; closeButton.setVisible(true); closeButton.setBounds(loc, top, prefs.width, prefs.height); } else closeButton.setVisible(false); if (iconButton.isVisible()) { loc -= prefs.width; maxButton.setVisible(true); maxButton.setBounds(loc, top, prefs.width, prefs.height); } else maxButton.setVisible(false); if (iconifyAction.isEnabled()) { loc -= prefs.width; iconButton.setVisible(true); iconButton.setBounds(loc, top, prefs.width, prefs.height); } else iconButton.setVisible(false); if (title != null) title.setBounds(insets.left + menupref.width, insets.top, loc - menupref.width - insets.left, height); }
11,902
public void layoutContainer(Container c) { enableActions(); Insets insets = c.getInsets(); int width = c.getBounds().width - insets.left - insets.right; int height = c.getBounds().height - insets.top - insets.bottom; // MenuBar is always present and located at the top left corner. Dimension menupref = menuBar.getPreferredSize(); menuBar.setBounds(insets.left, insets.top, menupref.width, height); int loc = width + insets.left; Insets i = closeButton.getInsets(); Dimension prefs = new Dimension(iconSize + i.left + i.right, iconSize + i.top + i.bottom); int top = insets.top + (height - prefs.height) / 2; if (closeAction.isEnabled()) { loc -= prefs.width; closeButton.setVisible(true); closeButton.setBounds(loc, top, prefs.width, prefs.height); } else closeButton.setVisible(false); if (maximizeAction.isEnabled()) { loc -= prefs.width; maxButton.setVisible(true); maxButton.setBounds(loc, top, prefs.width, prefs.height); } else maxButton.setVisible(false); if (iconifyAction.isEnabled()) { loc -= prefs.width; iconButton.setVisible(true); iconButton.setBounds(loc, top, prefs.width, prefs.height); } else iconButton.setVisible(false); if (title != null) title.setBounds(insets.left + menupref.width, insets.top, loc - menupref.width - insets.left, height); }
public void layoutContainer(Container c) { enableActions(); Insets insets = c.getInsets(); int width = c.getBounds().width - insets.left - insets.right; int height = c.getBounds().height - insets.top - insets.bottom; // MenuBar is always present and located at the top left corner. Dimension menupref = menuBar.getPreferredSize(); menuBar.setBounds(insets.left, insets.top, menupref.width, height); int loc = width + insets.left; Insets i = closeButton.getInsets(); Dimension prefs = new Dimension(iconSize + i.left + i.right, iconSize + i.top + i.bottom); int top = insets.top + (height - prefs.height) / 2; if (closeAction.isEnabled()) { loc -= prefs.width; closeButton.setVisible(true); closeButton.setBounds(loc, top, prefs.width, prefs.height); } else closeButton.setVisible(false); if (maximizeAction.isEnabled()) { loc -= prefs.width; maxButton.setVisible(true); maxButton.setBounds(loc, top, prefs.width, prefs.height); } else maxButton.setVisible(false); if (iconifyAction.isEnabled()) { loc -= prefs.width; iconButton.setVisible(true); iconButton.setBounds(loc, top, prefs.width, prefs.height); } else iconButton.setVisible(false); if (title != null) title.setBounds(insets.left + menupref.width, insets.top, loc - menupref.width - insets.left, height); }
11,903
public void layoutContainer(Container c) { enableActions(); Insets insets = c.getInsets(); int width = c.getBounds().width - insets.left - insets.right; int height = c.getBounds().height - insets.top - insets.bottom; // MenuBar is always present and located at the top left corner. Dimension menupref = menuBar.getPreferredSize(); menuBar.setBounds(insets.left, insets.top, menupref.width, height); int loc = width + insets.left; Insets i = closeButton.getInsets(); Dimension prefs = new Dimension(iconSize + i.left + i.right, iconSize + i.top + i.bottom); int top = insets.top + (height - prefs.height) / 2; if (closeAction.isEnabled()) { loc -= prefs.width; closeButton.setVisible(true); closeButton.setBounds(loc, top, prefs.width, prefs.height); } else closeButton.setVisible(false); if (maximizeAction.isEnabled()) { loc -= prefs.width; maxButton.setVisible(true); maxButton.setBounds(loc, top, prefs.width, prefs.height); } else maxButton.setVisible(false); if (iconifyAction.isEnabled()) { loc -= prefs.width; iconButton.setVisible(true); iconButton.setBounds(loc, top, prefs.width, prefs.height); } else iconButton.setVisible(false); if (title != null) title.setBounds(insets.left + menupref.width, insets.top, loc - menupref.width - insets.left, height); }
public void layoutContainer(Container c) { enableActions(); Insets insets = c.getInsets(); int width = c.getBounds().width - insets.left - insets.right; int height = c.getBounds().height - insets.top - insets.bottom; // MenuBar is always present and located at the top left corner. Dimension menupref = menuBar.getPreferredSize(); menuBar.setBounds(insets.left, insets.top, menupref.width, height); int loc = width + insets.left; Insets i = closeButton.getInsets(); Dimension prefs = new Dimension(iconSize + i.left + i.right, iconSize + i.top + i.bottom); int top = insets.top + (height - prefs.height) / 2; if (closeAction.isEnabled()) { loc -= prefs.width; closeButton.setVisible(true); closeButton.setBounds(loc, top, prefs.width, prefs.height); } else closeButton.setVisible(false); if (maximizeAction.isEnabled()) { loc -= prefs.width; maxButton.setVisible(true); maxButton.setBounds(loc, top, prefs.width, prefs.height); } else maxButton.setVisible(false); if (iconifyAction.isEnabled()) { loc -= prefs.width; iconButton.setVisible(true); iconButton.setBounds(loc, top, prefs.width, prefs.height); } else iconButton.setVisible(false); if (title != null) title.setBounds(insets.left + menupref.width, insets.top, loc - menupref.width - insets.left, height); }
11,904
public Dimension preferredLayoutSize(Container c) { Insets frameInsets = frame.getInsets(); // Height is the max of the preferredHeights of all components // inside the pane int height = 0; int width = 0; Dimension d; Component[] components = BasicInternalFrameTitlePane.this.getComponents(); for (int i = 0; i < components.length; i++) { d = components[i].getPreferredSize(); height = Math.max(height, d.height); width += d.width; } Insets insets = BasicInternalFrameTitlePane.this.getInsets(); height += insets.top + insets.bottom; return new Dimension(width, height); }
public Dimension preferredLayoutSize(Container c) { Insets frameInsets = frame.getInsets(); // Height is the max of the preferredHeights of all components // inside the pane int height = 0; int width = 0; Dimension d; Component[] components = BasicInternalFrameTitlePane.this.getComponents(); for (int i = 0; i < components.length; i++) { d = components[i].getPreferredSize(); height = Math.max(height, d.height); width += d.width; } Insets insets = BasicInternalFrameTitlePane.this.getInsets(); height += insets.top + insets.bottom; return new Dimension(width, height); }
11,905
protected void createButtons() { closeButton = new PaneButton(closeAction); closeButton.setOpaque(false); iconButton = new PaneButton(iconifyAction); iconButton.setOpaque(false); maxButton = new PaneButton(maximizeAction); maxButton.setOpaque(false); }
protected void createButtons() { closeButton = new PaneButton(closeAction); if (!frame.isClosable()) closeButton.setVisible(false); iconButton = new PaneButton(iconifyAction); iconButton.setOpaque(false); maxButton = new PaneButton(maximizeAction); maxButton.setOpaque(false); }
11,907
protected void createButtons() { closeButton = new PaneButton(closeAction); closeButton.setOpaque(false); iconButton = new PaneButton(iconifyAction); iconButton.setOpaque(false); maxButton = new PaneButton(maximizeAction); maxButton.setOpaque(false); }
protected void createButtons() { closeButton = new PaneButton(closeAction); closeButton.setOpaque(false); iconButton = new PaneButton(iconifyAction); if (!frame.isIconifiable()) iconButton.setVisible(false); maxButton = new PaneButton(maximizeAction); maxButton.setOpaque(false); }
11,908
protected void createButtons() { closeButton = new PaneButton(closeAction); closeButton.setOpaque(false); iconButton = new PaneButton(iconifyAction); iconButton.setOpaque(false); maxButton = new PaneButton(maximizeAction); maxButton.setOpaque(false); }
protected void createButtons() { closeButton = new PaneButton(closeAction); closeButton.setOpaque(false); iconButton = new PaneButton(iconifyAction); iconButton.setOpaque(false); maxButton = new PaneButton(maximizeAction); if (!frame.isMaximizable()) maxButton.setVisible(false); }
11,909
protected void setButtonIcons() { if (closeButton != null) closeButton.setIcon(closeIcon); if (iconButton != null) iconButton.setIcon(iconIcon); if (maxButton != null) maxButton.setIcon(maxIcon); }
protected void setButtonIcons() { if (closeButton != null) closeButton.setIcon(closeIcon); if (iconButton != null) iconButton.setIcon(iconIcon); if (maxButton != null) maxButton.setIcon(maxIcon); }
11,910
public void focusGained(FocusEvent e) { // FIXME: Implement. }
Object source = e.getSource(); if (source == panel ) tabPane.requestFocus(); else if (source == tabPane) tabPane.repaint(); Object source = e.getSource(); if (source == panel ) tabPane.requestFocus(); else if (source == tabPane) tabPane.repaint(); Object source = e.getSource(); if (source == panel ) tabPane.requestFocus(); else if (source == tabPane) tabPane.repaint(); Object source = e.getSource(); if (source == panel ) tabPane.requestFocus(); else if (source == tabPane) tabPane.repaint(); publicObject source = e.getSource(); if (source == panel ) tabPane.requestFocus(); else if (source == tabPane) tabPane.repaint(); voidObject source = e.getSource(); if (source == panel ) tabPane.requestFocus(); else if (source == tabPane) tabPane.repaint(); focusGained(FocusEventObject source = e.getSource(); if (source == panel ) tabPane.requestFocus(); else if (source == tabPane) tabPane.repaint(); e)Object source = e.getSource(); if (source == panel ) tabPane.requestFocus(); else if (source == tabPane) tabPane.repaint(); Object source = e.getSource(); if (source == panel ) tabPane.requestFocus(); else if (source == tabPane) tabPane.repaint(); Object source = e.getSource(); if (source == panel ) tabPane.requestFocus(); else if (source == tabPane) tabPane.repaint(); Object source = e.getSource(); if (source == panel ) tabPane.requestFocus(); else if (source == tabPane) tabPane.repaint(); {Object source = e.getSource(); if (source == panel ) tabPane.requestFocus(); else if (source == tabPane) tabPane.repaint(); Object source = e.getSource(); if (source == panel ) tabPane.requestFocus(); else if (source == tabPane) tabPane.repaint(); Object source = e.getSource(); if (source == panel ) tabPane.requestFocus(); else if (source == tabPane) tabPane.repaint(); Object source = e.getSource(); if (source == panel ) tabPane.requestFocus(); else if (source == tabPane) tabPane.repaint(); Object source = e.getSource(); if (source == panel ) tabPane.requestFocus(); else if (source == tabPane) tabPane.repaint(); Object source = e.getSource(); if (source == panel ) tabPane.requestFocus(); else if (source == tabPane) tabPane.repaint(); //Object source = e.getSource(); if (source == panel ) tabPane.requestFocus(); else if (source == tabPane) tabPane.repaint(); FIXME:Object source = e.getSource(); if (source == panel ) tabPane.requestFocus(); else if (source == tabPane) tabPane.repaint(); Implement.Object source = e.getSource(); if (source == panel ) tabPane.requestFocus(); else if (source == tabPane) tabPane.repaint(); Object source = e.getSource(); if (source == panel ) tabPane.requestFocus(); else if (source == tabPane) tabPane.repaint(); Object source = e.getSource(); if (source == panel ) tabPane.requestFocus(); else if (source == tabPane) tabPane.repaint(); Object source = e.getSource(); if (source == panel ) tabPane.requestFocus(); else if (source == tabPane) tabPane.repaint(); }
11,911
public void focusLost(FocusEvent e) { // FIXME: Implement. }
if (e.getOppositeComponent() == tabPane.getSelectedComponent()) tabPane.requestFocus(); else if (e.getSource() == tabPane) tabPane.repaint(); if (e.getOppositeComponent() == tabPane.getSelectedComponent()) tabPane.requestFocus(); else if (e.getSource() == tabPane) tabPane.repaint(); if (e.getOppositeComponent() == tabPane.getSelectedComponent()) tabPane.requestFocus(); else if (e.getSource() == tabPane) tabPane.repaint(); if (e.getOppositeComponent() == tabPane.getSelectedComponent()) tabPane.requestFocus(); else if (e.getSource() == tabPane) tabPane.repaint(); publicif (e.getOppositeComponent() == tabPane.getSelectedComponent()) tabPane.requestFocus(); else if (e.getSource() == tabPane) tabPane.repaint(); voidif (e.getOppositeComponent() == tabPane.getSelectedComponent()) tabPane.requestFocus(); else if (e.getSource() == tabPane) tabPane.repaint(); focusLost(FocusEventif (e.getOppositeComponent() == tabPane.getSelectedComponent()) tabPane.requestFocus(); else if (e.getSource() == tabPane) tabPane.repaint(); e)if (e.getOppositeComponent() == tabPane.getSelectedComponent()) tabPane.requestFocus(); else if (e.getSource() == tabPane) tabPane.repaint(); if (e.getOppositeComponent() == tabPane.getSelectedComponent()) tabPane.requestFocus(); else if (e.getSource() == tabPane) tabPane.repaint(); if (e.getOppositeComponent() == tabPane.getSelectedComponent()) tabPane.requestFocus(); else if (e.getSource() == tabPane) tabPane.repaint(); if (e.getOppositeComponent() == tabPane.getSelectedComponent()) tabPane.requestFocus(); else if (e.getSource() == tabPane) tabPane.repaint(); {if (e.getOppositeComponent() == tabPane.getSelectedComponent()) tabPane.requestFocus(); else if (e.getSource() == tabPane) tabPane.repaint(); if (e.getOppositeComponent() == tabPane.getSelectedComponent()) tabPane.requestFocus(); else if (e.getSource() == tabPane) tabPane.repaint(); if (e.getOppositeComponent() == tabPane.getSelectedComponent()) tabPane.requestFocus(); else if (e.getSource() == tabPane) tabPane.repaint(); if (e.getOppositeComponent() == tabPane.getSelectedComponent()) tabPane.requestFocus(); else if (e.getSource() == tabPane) tabPane.repaint(); if (e.getOppositeComponent() == tabPane.getSelectedComponent()) tabPane.requestFocus(); else if (e.getSource() == tabPane) tabPane.repaint(); if (e.getOppositeComponent() == tabPane.getSelectedComponent()) tabPane.requestFocus(); else if (e.getSource() == tabPane) tabPane.repaint(); //if (e.getOppositeComponent() == tabPane.getSelectedComponent()) tabPane.requestFocus(); else if (e.getSource() == tabPane) tabPane.repaint(); FIXME:if (e.getOppositeComponent() == tabPane.getSelectedComponent()) tabPane.requestFocus(); else if (e.getSource() == tabPane) tabPane.repaint(); Implement.if (e.getOppositeComponent() == tabPane.getSelectedComponent()) tabPane.requestFocus(); else if (e.getSource() == tabPane) tabPane.repaint(); if (e.getOppositeComponent() == tabPane.getSelectedComponent()) tabPane.requestFocus(); else if (e.getSource() == tabPane) tabPane.repaint(); if (e.getOppositeComponent() == tabPane.getSelectedComponent()) tabPane.requestFocus(); else if (e.getSource() == tabPane) tabPane.repaint(); if (e.getOppositeComponent() == tabPane.getSelectedComponent()) tabPane.requestFocus(); else if (e.getSource() == tabPane) tabPane.repaint(); }
11,912
public void mouseEntered(MouseEvent ev) { int tabIndex = tabForCoordinate(tabPane, ev.getX(), ev.getY()); setRolloverTab(tabIndex); }
public void mouseEntered(MouseEvent e) { int tabIndex = tabForCoordinate(tabPane, ev.getX(), ev.getY()); setRolloverTab(tabIndex); }
11,913
public void mouseEntered(MouseEvent ev) { int tabIndex = tabForCoordinate(tabPane, ev.getX(), ev.getY()); setRolloverTab(tabIndex); }
public void mouseEntered(MouseEvent ev) { Object s = e.getSource(); if (tabPane != e.getSource()) { redispatchEvent(e); e.setSource(s); } int tabIndex = tabForCoordinate(tabPane, e.getX(), e.getY()); setRolloverTab(tabIndex); }
11,914
public void mouseExited(MouseEvent ev) { setRolloverTab(-1); }
public void mouseExited(MouseEvent e) { setRolloverTab(-1); }
11,915
public void mousePressed(MouseEvent e) { if (tabPane.isEnabled()) { int index = tabForCoordinate(tabPane, e.getX(), e.getY()); if (index >= 0 && tabPane.isEnabledAt(index)) { tabPane.setSelectedIndex(index); } } }
public void mousePressed(MouseEvent e) { Object s = e.getSource(); if (tabPane != e.getSource()) { redispatchEvent(e); e.setSource(s); } int placement = tabPane.getTabPlacement(); if (s == incrButton) { if(!incrButton.isEnabled()) return; currentScrollLocation++; switch (placement) { case JTabbedPane.TOP: case JTabbedPane.BOTTOM: currentScrollOffset = getTabAreaInsets(placement).left; for (int i = 0; i < currentScrollLocation; i++) currentScrollOffset += rects[i].width; break; default: currentScrollOffset = getTabAreaInsets(placement).top; for (int i = 0; i < currentScrollLocation; i++) currentScrollOffset += rects[i].height; break; } updateViewPosition(); updateButtons(); tabPane.repaint(); } else if (s == decrButton) { if(!decrButton.isEnabled()) return; if (currentScrollLocation > 0) currentScrollLocation--; currentScrollOffset = 0; switch (placement) { case JTabbedPane.TOP: case JTabbedPane.BOTTOM: if (currentScrollLocation > 0) currentScrollOffset = getTabAreaInsets(placement).left; for (int i = 0; i < currentScrollLocation; i++) currentScrollOffset += rects[i].width; break; default: if (currentScrollLocation > 0) currentScrollOffset = getTabAreaInsets(placement).top; for (int i = 0; i < currentScrollLocation; i++) currentScrollOffset += rects[i].height; } updateViewPosition(); updateButtons(); tabPane.repaint(); } else if (tabPane.isEnabled()) { int index = tabForCoordinate(tabPane, e.getX(), e.getY()); if (index >= 0 && tabPane.isEnabledAt(index)) { tabPane.setSelectedIndex(index); } } }
11,918
public void mousePressed(MouseEvent e) { if (tabPane.isEnabled()) { int index = tabForCoordinate(tabPane, e.getX(), e.getY()); if (index >= 0 && tabPane.isEnabledAt(index)) { tabPane.setSelectedIndex(index); } } }
public void mousePressed(MouseEvent e) { if (tabPane.isEnabled()) { int index = tabForCoordinate(tabPane, e.getX(), e.getY()); if (!tabPane.isEnabledAt(index)) return; if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT && s == panel) { scrollTab(index, placement); tabPane.setSelectedIndex(index); tabPane.repaint(); } else { tabPane.setSelectedIndex(index); } } }
11,919
public void propertyChange(PropertyChangeEvent e) { if (e.getPropertyName().equals("tabLayoutPolicy")) { layoutManager = createLayoutManager(); tabPane.setLayout(layoutManager); } else if (e.getPropertyName().equals("tabPlacement") && tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { incrButton = createIncreaseButton(); decrButton = createDecreaseButton(); } tabPane.revalidate(); tabPane.repaint(); }
public void propertyChange(PropertyChangeEvent e) { if (e.getPropertyName().equals("tabLayoutPolicy")) { layoutManager = createLayoutManager(); tabPane.setLayout(layoutManager); } else if (e.getPropertyName().equals("tabPlacement") && tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { incrButton = createIncreaseButton(); decrButton = createDecreaseButton(); } tabPane.revalidate(); tabPane.repaint(); }
11,921
public void paint(Graphics g, JComponent c) { paintTabArea(g, tabPane.getTabPlacement(), tabPane.getSelectedIndex()); }
public void paint(Graphics g, JComponent c) { int placement = tabPane.getTabPlacement(); g.setColor(highlight); if (placement == SwingUtilities.TOP || placement == SwingUtilities.BOTTOM) g.fillRect(currentScrollOffset, 0, tabAreaRect.width, tabAreaRect.height); else g.fillRect(0, currentScrollOffset, tabAreaRect.width, tabAreaRect.height); paintTabArea(g, placement, tabPane.getSelectedIndex()); }
11,923
public void updateUI() { setUI((PanelUI) new ScrollingPanelUI()); }
public void updateUI() { setUI(new ScrollingPanelUI()); }
11,924
protected Dimension calculateSize(boolean minimum) { int tabPlacement = tabPane.getTabPlacement(); int width = 0; int height = 0; Component c; Dimension dims; // Find out the minimum/preferred size to display the largest child // of the tabbed pane. for (int i = 0; i < tabPane.getTabCount(); i++) { c = tabPane.getComponentAt(i); if (c == null) continue; dims = minimum ? c.getMinimumSize() : c.getPreferredSize(); if (dims != null) { height = Math.max(height, dims.height); width = Math.max(width, dims.width); } } Insets tabAreaInsets = getTabAreaInsets(tabPlacement); if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int min = calculateMaxTabWidth(tabPlacement); width = Math.max(min, width); int tabAreaHeight = preferredTabAreaHeight(tabPlacement, width - tabAreaInsets.left - tabAreaInsets.right); height += tabAreaHeight; } else { int min = calculateMaxTabHeight(tabPlacement); height = Math.max(min, height); int tabAreaWidth = preferredTabAreaWidth(tabPlacement, height - tabAreaInsets.top - tabAreaInsets.bottom); width += tabAreaWidth; } Insets tabPaneInsets = tabPane.getInsets(); return new Dimension(width + tabPaneInsets.left + tabPaneInsets.right, height + tabPaneInsets.top + tabPaneInsets.bottom); }
protected Dimension calculateSize(boolean minimum) { int tabPlacement = tabPane.getTabPlacement(); int width = 0; int height = 0; Component c; Dimension dims; // Find out the minimum/preferred size to display the largest child // of the tabbed pane. int count = tabPane.getTabCount(); for (int i = 0; i < count; i++) { c = tabPane.getComponentAt(i); if (c == null) continue; dims = minimum ? c.getMinimumSize() : c.getPreferredSize(); if (dims != null) { height = Math.max(height, dims.height); width = Math.max(width, dims.width); } } Insets tabAreaInsets = getTabAreaInsets(tabPlacement); if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int min = calculateMaxTabWidth(tabPlacement); width = Math.max(min, width); int tabAreaHeight = preferredTabAreaHeight(tabPlacement, width - tabAreaInsets.left - tabAreaInsets.right); height += tabAreaHeight; } else { int min = calculateMaxTabHeight(tabPlacement); height = Math.max(min, height); int tabAreaWidth = preferredTabAreaWidth(tabPlacement, height - tabAreaInsets.top - tabAreaInsets.bottom); width += tabAreaWidth; } Insets tabPaneInsets = tabPane.getInsets(); return new Dimension(width + tabPaneInsets.left + tabPaneInsets.right, height + tabPaneInsets.top + tabPaneInsets.bottom); }
11,926
protected Dimension calculateSize(boolean minimum) { int tabPlacement = tabPane.getTabPlacement(); int width = 0; int height = 0; Component c; Dimension dims; // Find out the minimum/preferred size to display the largest child // of the tabbed pane. for (int i = 0; i < tabPane.getTabCount(); i++) { c = tabPane.getComponentAt(i); if (c == null) continue; dims = minimum ? c.getMinimumSize() : c.getPreferredSize(); if (dims != null) { height = Math.max(height, dims.height); width = Math.max(width, dims.width); } } Insets tabAreaInsets = getTabAreaInsets(tabPlacement); if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int min = calculateMaxTabWidth(tabPlacement); width = Math.max(min, width); int tabAreaHeight = preferredTabAreaHeight(tabPlacement, width - tabAreaInsets.left - tabAreaInsets.right); height += tabAreaHeight; } else { int min = calculateMaxTabHeight(tabPlacement); height = Math.max(min, height); int tabAreaWidth = preferredTabAreaWidth(tabPlacement, height - tabAreaInsets.top - tabAreaInsets.bottom); width += tabAreaWidth; } Insets tabPaneInsets = tabPane.getInsets(); return new Dimension(width + tabPaneInsets.left + tabPaneInsets.right, height + tabPaneInsets.top + tabPaneInsets.bottom); }
protected Dimension calculateSize(boolean minimum) { int tabPlacement = tabPane.getTabPlacement(); int width = 0; int height = 0; Component c; Dimension dims; // Find out the minimum/preferred size to display the largest child // of the tabbed pane. for (int i = 0; i < tabPane.getTabCount(); i++) { c = tabPane.getComponentAt(i); if (c == null) continue; dims = minimum ? c.getMinimumSize() : c.getPreferredSize(); if (dims != null) { height = Math.max(height, dims.height); width = Math.max(width, dims.width); } } Insets tabAreaInsets = getTabAreaInsets(tabPlacement); if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int min = calculateMaxTabWidth(tabPlacement); width = Math.max(min, width); int tabAreaHeight = preferredTabAreaHeight(tabPlacement, width - tabAreaInsets.left - tabAreaInsets.right); height += tabAreaHeight; } else { int min = calculateMaxTabHeight(tabPlacement); height = Math.max(min, height); int tabAreaWidth = preferredTabAreaWidth(tabPlacement, height - tabAreaInsets.top - tabAreaInsets.bottom); width += tabAreaWidth; } Insets tabPaneInsets = tabPane.getInsets(); return new Dimension(width + tabPaneInsets.left + tabPaneInsets.right, height + tabPaneInsets.top + tabPaneInsets.bottom); }
11,927
protected Dimension calculateSize(boolean minimum) { int tabPlacement = tabPane.getTabPlacement(); int width = 0; int height = 0; Component c; Dimension dims; // Find out the minimum/preferred size to display the largest child // of the tabbed pane. for (int i = 0; i < tabPane.getTabCount(); i++) { c = tabPane.getComponentAt(i); if (c == null) continue; dims = minimum ? c.getMinimumSize() : c.getPreferredSize(); if (dims != null) { height = Math.max(height, dims.height); width = Math.max(width, dims.width); } } Insets tabAreaInsets = getTabAreaInsets(tabPlacement); if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int min = calculateMaxTabWidth(tabPlacement); width = Math.max(min, width); int tabAreaHeight = preferredTabAreaHeight(tabPlacement, width - tabAreaInsets.left - tabAreaInsets.right); height += tabAreaHeight; } else { int min = calculateMaxTabHeight(tabPlacement); height = Math.max(min, height); int tabAreaWidth = preferredTabAreaWidth(tabPlacement, height - tabAreaInsets.top - tabAreaInsets.bottom); width += tabAreaWidth; } Insets tabPaneInsets = tabPane.getInsets(); return new Dimension(width + tabPaneInsets.left + tabPaneInsets.right, height + tabPaneInsets.top + tabPaneInsets.bottom); }
protected Dimension calculateSize(boolean minimum) { int tabPlacement = tabPane.getTabPlacement(); int width = 0; int height = 0; Component c; Dimension dims; // Find out the minimum/preferred size to display the largest child // of the tabbed pane. for (int i = 0; i < tabPane.getTabCount(); i++) { c = tabPane.getComponentAt(i); if (c == null) continue; dims = minimum ? c.getMinimumSize() : c.getPreferredSize(); if (dims != null) { height = Math.max(height, dims.height); width = Math.max(width, dims.width); } } Insets tabAreaInsets = getTabAreaInsets(tabPlacement); if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int min = calculateMaxTabWidth(tabPlacement); width = Math.max(min, width); int tabAreaHeight = preferredTabAreaHeight(tabPlacement, width - tabAreaInsets.left - tabAreaInsets.right); } else { int min = calculateMaxTabHeight(tabPlacement); height = Math.max(min, height); int tabAreaWidth = preferredTabAreaWidth(tabPlacement, height - tabAreaInsets.top - tabAreaInsets.bottom); width += tabAreaWidth; } Insets tabPaneInsets = tabPane.getInsets(); return new Dimension(width + tabPaneInsets.left + tabPaneInsets.right, height + tabPaneInsets.top + tabPaneInsets.bottom); }
11,928
protected Dimension calculateSize(boolean minimum) { int tabPlacement = tabPane.getTabPlacement(); int width = 0; int height = 0; Component c; Dimension dims; // Find out the minimum/preferred size to display the largest child // of the tabbed pane. for (int i = 0; i < tabPane.getTabCount(); i++) { c = tabPane.getComponentAt(i); if (c == null) continue; dims = minimum ? c.getMinimumSize() : c.getPreferredSize(); if (dims != null) { height = Math.max(height, dims.height); width = Math.max(width, dims.width); } } Insets tabAreaInsets = getTabAreaInsets(tabPlacement); if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int min = calculateMaxTabWidth(tabPlacement); width = Math.max(min, width); int tabAreaHeight = preferredTabAreaHeight(tabPlacement, width - tabAreaInsets.left - tabAreaInsets.right); height += tabAreaHeight; } else { int min = calculateMaxTabHeight(tabPlacement); height = Math.max(min, height); int tabAreaWidth = preferredTabAreaWidth(tabPlacement, height - tabAreaInsets.top - tabAreaInsets.bottom); width += tabAreaWidth; } Insets tabPaneInsets = tabPane.getInsets(); return new Dimension(width + tabPaneInsets.left + tabPaneInsets.right, height + tabPaneInsets.top + tabPaneInsets.bottom); }
protected Dimension calculateSize(boolean minimum) { int tabPlacement = tabPane.getTabPlacement(); int width = 0; int height = 0; Component c; Dimension dims; // Find out the minimum/preferred size to display the largest child // of the tabbed pane. for (int i = 0; i < tabPane.getTabCount(); i++) { c = tabPane.getComponentAt(i); if (c == null) continue; dims = minimum ? c.getMinimumSize() : c.getPreferredSize(); if (dims != null) { height = Math.max(height, dims.height); width = Math.max(width, dims.width); } } Insets tabAreaInsets = getTabAreaInsets(tabPlacement); if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int min = calculateMaxTabWidth(tabPlacement); width = Math.max(min, width); int tabAreaHeight = preferredTabAreaHeight(tabPlacement, width - tabAreaInsets.left - tabAreaInsets.right); height += tabAreaHeight; } else { int min = calculateMaxTabHeight(tabPlacement); height = Math.max(min, height); int tabAreaWidth = preferredTabAreaWidth(tabPlacement, height - tabAreaInsets.top - tabAreaInsets.bottom); width += tabAreaWidth; } Insets tabPaneInsets = tabPane.getInsets(); return new Dimension(width + tabPaneInsets.left + tabPaneInsets.right, height + tabPaneInsets.top + tabPaneInsets.bottom); }
11,929
protected Dimension calculateSize(boolean minimum) { int tabPlacement = tabPane.getTabPlacement(); int width = 0; int height = 0; Component c; Dimension dims; // Find out the minimum/preferred size to display the largest child // of the tabbed pane. for (int i = 0; i < tabPane.getTabCount(); i++) { c = tabPane.getComponentAt(i); if (c == null) continue; dims = minimum ? c.getMinimumSize() : c.getPreferredSize(); if (dims != null) { height = Math.max(height, dims.height); width = Math.max(width, dims.width); } } Insets tabAreaInsets = getTabAreaInsets(tabPlacement); if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int min = calculateMaxTabWidth(tabPlacement); width = Math.max(min, width); int tabAreaHeight = preferredTabAreaHeight(tabPlacement, width - tabAreaInsets.left - tabAreaInsets.right); height += tabAreaHeight; } else { int min = calculateMaxTabHeight(tabPlacement); height = Math.max(min, height); int tabAreaWidth = preferredTabAreaWidth(tabPlacement, height - tabAreaInsets.top - tabAreaInsets.bottom); width += tabAreaWidth; } Insets tabPaneInsets = tabPane.getInsets(); return new Dimension(width + tabPaneInsets.left + tabPaneInsets.right, height + tabPaneInsets.top + tabPaneInsets.bottom); }
protected Dimension calculateSize(boolean minimum) { int tabPlacement = tabPane.getTabPlacement(); int width = 0; int height = 0; Component c; Dimension dims; // Find out the minimum/preferred size to display the largest child // of the tabbed pane. for (int i = 0; i < tabPane.getTabCount(); i++) { c = tabPane.getComponentAt(i); if (c == null) continue; dims = minimum ? c.getMinimumSize() : c.getPreferredSize(); if (dims != null) { height = Math.max(height, dims.height); width = Math.max(width, dims.width); } } Insets tabAreaInsets = getTabAreaInsets(tabPlacement); if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int min = calculateMaxTabWidth(tabPlacement); width = Math.max(min, width); int tabAreaHeight = preferredTabAreaHeight(tabPlacement, width - tabAreaInsets.left - tabAreaInsets.right); height += tabAreaHeight; } else { int min = calculateMaxTabHeight(tabPlacement); height = Math.max(min, height); int tabAreaWidth = preferredTabAreaWidth(tabPlacement, height - tabAreaInsets.top - tabAreaInsets.bottom); } Insets tabPaneInsets = tabPane.getInsets(); return new Dimension(width + tabPaneInsets.left + tabPaneInsets.right, height + tabPaneInsets.top + tabPaneInsets.bottom); }
11,930
protected void calculateTabRects(int tabPlacement, int tabCount) { Insets insets = tabPane.getInsets(); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); Dimension size = tabPane.getSize(); // The coordinates of the upper left corner of the tab area. int x; int y; // The location at which the runs must be broken. int breakAt; // Calculate the bounds for the tab area. switch (tabPlacement) { case LEFT: maxTabWidth = calculateMaxTabWidth(tabPlacement); x = insets.left + tabAreaInsets.left; y = insets.top + tabAreaInsets.top; breakAt = size.height - (insets.bottom + tabAreaInsets.bottom); break; case RIGHT: maxTabWidth = calculateMaxTabWidth(tabPlacement); x = size.width - (insets.right + tabAreaInsets.right) - maxTabWidth; y = insets.top + tabAreaInsets.top; breakAt = size.height - (insets.bottom + tabAreaInsets.bottom); break; case BOTTOM: maxTabHeight = calculateMaxTabHeight(tabPlacement); x = insets.left + tabAreaInsets.left; y = size.height - (insets.bottom + tabAreaInsets.bottom) - maxTabHeight; breakAt = size.width - (insets.right + tabAreaInsets.right); break; case TOP: default: maxTabHeight = calculateMaxTabHeight(tabPlacement); x = insets.left + tabAreaInsets.left; y = insets.top + tabAreaInsets.top; breakAt = size.width - (insets.right + tabAreaInsets.right); break; } if (tabCount == 0) return; FontMetrics fm = getFontMetrics(); runCount = 0; selectedRun = -1; int selectedIndex = tabPane.getSelectedIndex(); Rectangle rect; // Go through all the tabs and build the tab runs. if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { for (int i = 0; i < tabCount; i++) { rect = rects[i]; if (i > 0) { rect.x = rects[i - 1].x + rects[i - 1].width; } else { tabRuns[0] = 0; runCount = 1; maxTabWidth = 0; rect.x = x; } rect.width = calculateTabWidth(tabPlacement, i, fm); maxTabWidth = Math.max(maxTabWidth, rect.width); if (rect.x != 2 + insets.left && rect.x + rect.width > breakAt) { if (runCount > tabRuns.length - 1) expandTabRunsArray(); tabRuns[runCount] = i; runCount++; rect.x = x; } rect.y = y; rect.height = maxTabHeight; if (i == selectedIndex) selectedRun = runCount - 1; } } else { for (int i = 0; i < tabCount; i++) { rect = rects[i]; if (i > 0) { rect.y = rects[i - 1].y + rects[i - 1].height; } else { tabRuns[0] = 0; runCount = 1; maxTabHeight = 0; rect.y = y; } rect.height = calculateTabHeight(tabPlacement, i, fm.getHeight()); maxTabHeight = Math.max(maxTabHeight, rect.height); if (rect.y != 2 + insets.top && rect.y + rect.height > breakAt) { if (runCount > tabRuns.length - 1) expandTabRunsArray(); tabRuns[runCount] = i; runCount++; rect.y = y; } rect.x = x; rect.width = maxTabWidth; if (i == selectedIndex) selectedRun = runCount - 1; } } if (runCount > 1) { int start; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) start = y; else start = x; normalizeTabRuns(tabPlacement, tabCount, start, breakAt); selectedRun = getRunForTab(tabCount, selectedIndex); if (shouldRotateTabRuns(tabPlacement)) { rotateTabRuns(tabPlacement, selectedRun); } } // Pad the runs. int tabRunOverlay = getTabRunOverlay(tabPlacement); for (int i = runCount - 1; i >= 0; --i) { int start = tabRuns[i]; int nextIndex; if (i == runCount - 1) nextIndex = 0; else nextIndex = i + 1; int next = tabRuns[nextIndex]; int end = next != 0 ? next - 1 : tabCount - 1; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { for (int j = start; j <= end; ++j) { rect = rects[j]; rect.y = y; rect.x += getTabRunIndent(tabPlacement, i); } if (shouldPadTabRun(tabPlacement, i)) { padTabRun(tabPlacement, start, end, breakAt); } if (tabPlacement == BOTTOM) y -= maxTabHeight - tabRunOverlay; else y += maxTabHeight - tabRunOverlay; } else { for (int j = start; j <= end; ++j) { rect = rects[j]; rect.x = x; rect.y += getTabRunIndent(tabPlacement, i); } if (shouldPadTabRun(tabPlacement, i)) { padTabRun(tabPlacement, start, end, breakAt); } if (tabPlacement == RIGHT) x -= maxTabWidth - tabRunOverlay; else x += maxTabWidth - tabRunOverlay; } } padSelectedTab(tabPlacement, selectedIndex); }
protected void calculateTabRects(int tabPlacement, int tabCount) { Insets insets = tabPane.getInsets(); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); Dimension size = tabPane.getSize(); // The coordinates of the upper left corner of the tab area. int x; int y; // The location at which the runs must be broken. int breakAt; // Calculate the bounds for the tab area. switch (tabPlacement) { case LEFT: maxTabWidth = calculateMaxTabWidth(tabPlacement); x = insets.left + tabAreaInsets.left; y = insets.top + tabAreaInsets.top; breakAt = size.height - (insets.bottom + tabAreaInsets.bottom); break; case RIGHT: maxTabWidth = calculateMaxTabWidth(tabPlacement); x = size.width - (insets.right + tabAreaInsets.right) - maxTabWidth - 1; y = insets.top + tabAreaInsets.top; breakAt = size.height - (insets.bottom + tabAreaInsets.bottom); break; case BOTTOM: maxTabHeight = calculateMaxTabHeight(tabPlacement); x = insets.left + tabAreaInsets.left; y = size.height - (insets.bottom + tabAreaInsets.bottom) - maxTabHeight; breakAt = size.width - (insets.right + tabAreaInsets.right); break; case TOP: default: maxTabHeight = calculateMaxTabHeight(tabPlacement); x = insets.left + tabAreaInsets.left; y = insets.top + tabAreaInsets.top; breakAt = size.width - (insets.right + tabAreaInsets.right); break; } if (tabCount == 0) return; FontMetrics fm = getFontMetrics(); runCount = 0; selectedRun = -1; int selectedIndex = tabPane.getSelectedIndex(); Rectangle rect; // Go through all the tabs and build the tab runs. if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { for (int i = 0; i < tabCount; i++) { rect = rects[i]; if (i > 0) { rect.x = rects[i - 1].x + rects[i - 1].width; } else { tabRuns[0] = 0; runCount = 1; maxTabWidth = 0; rect.x = x; } rect.width = calculateTabWidth(tabPlacement, i, fm); maxTabWidth = Math.max(maxTabWidth, rect.width); if (rect.x != 2 + insets.left && rect.x + rect.width > breakAt) { if (runCount > tabRuns.length - 1) expandTabRunsArray(); tabRuns[runCount] = i; runCount++; rect.x = x; } rect.y = y; rect.height = maxTabHeight; if (i == selectedIndex) selectedRun = runCount - 1; } } else { for (int i = 0; i < tabCount; i++) { rect = rects[i]; if (i > 0) { rect.y = rects[i - 1].y + rects[i - 1].height; } else { tabRuns[0] = 0; runCount = 1; maxTabHeight = 0; rect.y = y; } rect.height = calculateTabHeight(tabPlacement, i, fm.getHeight()); maxTabHeight = Math.max(maxTabHeight, rect.height); if (rect.y != 2 + insets.top && rect.y + rect.height > breakAt) { if (runCount > tabRuns.length - 1) expandTabRunsArray(); tabRuns[runCount] = i; runCount++; rect.y = y; } rect.x = x; rect.width = maxTabWidth; if (i == selectedIndex) selectedRun = runCount - 1; } } if (runCount > 1) { int start; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) start = y; else start = x; normalizeTabRuns(tabPlacement, tabCount, start, breakAt); selectedRun = getRunForTab(tabCount, selectedIndex); if (shouldRotateTabRuns(tabPlacement)) { rotateTabRuns(tabPlacement, selectedRun); } } // Pad the runs. int tabRunOverlay = getTabRunOverlay(tabPlacement); for (int i = runCount - 1; i >= 0; --i) { int start = tabRuns[i]; int nextIndex; if (i == runCount - 1) nextIndex = 0; else nextIndex = i + 1; int next = tabRuns[nextIndex]; int end = next != 0 ? next - 1 : tabCount - 1; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { for (int j = start; j <= end; ++j) { rect = rects[j]; rect.y = y; rect.x += getTabRunIndent(tabPlacement, i); } if (shouldPadTabRun(tabPlacement, i)) { padTabRun(tabPlacement, start, end, breakAt); } if (tabPlacement == BOTTOM) y -= maxTabHeight - tabRunOverlay; else y += maxTabHeight - tabRunOverlay; } else { for (int j = start; j <= end; ++j) { rect = rects[j]; rect.x = x; rect.y += getTabRunIndent(tabPlacement, i); } if (shouldPadTabRun(tabPlacement, i)) { padTabRun(tabPlacement, start, end, breakAt); } if (tabPlacement == RIGHT) x -= maxTabWidth - tabRunOverlay; else x += maxTabWidth - tabRunOverlay; } } padSelectedTab(tabPlacement, selectedIndex); }
11,931
protected void calculateTabRects(int tabPlacement, int tabCount) { Insets insets = tabPane.getInsets(); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); Dimension size = tabPane.getSize(); // The coordinates of the upper left corner of the tab area. int x; int y; // The location at which the runs must be broken. int breakAt; // Calculate the bounds for the tab area. switch (tabPlacement) { case LEFT: maxTabWidth = calculateMaxTabWidth(tabPlacement); x = insets.left + tabAreaInsets.left; y = insets.top + tabAreaInsets.top; breakAt = size.height - (insets.bottom + tabAreaInsets.bottom); break; case RIGHT: maxTabWidth = calculateMaxTabWidth(tabPlacement); x = size.width - (insets.right + tabAreaInsets.right) - maxTabWidth; y = insets.top + tabAreaInsets.top; breakAt = size.height - (insets.bottom + tabAreaInsets.bottom); break; case BOTTOM: maxTabHeight = calculateMaxTabHeight(tabPlacement); x = insets.left + tabAreaInsets.left; y = size.height - (insets.bottom + tabAreaInsets.bottom) - maxTabHeight; breakAt = size.width - (insets.right + tabAreaInsets.right); break; case TOP: default: maxTabHeight = calculateMaxTabHeight(tabPlacement); x = insets.left + tabAreaInsets.left; y = insets.top + tabAreaInsets.top; breakAt = size.width - (insets.right + tabAreaInsets.right); break; } if (tabCount == 0) return; FontMetrics fm = getFontMetrics(); runCount = 0; selectedRun = -1; int selectedIndex = tabPane.getSelectedIndex(); Rectangle rect; // Go through all the tabs and build the tab runs. if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { for (int i = 0; i < tabCount; i++) { rect = rects[i]; if (i > 0) { rect.x = rects[i - 1].x + rects[i - 1].width; } else { tabRuns[0] = 0; runCount = 1; maxTabWidth = 0; rect.x = x; } rect.width = calculateTabWidth(tabPlacement, i, fm); maxTabWidth = Math.max(maxTabWidth, rect.width); if (rect.x != 2 + insets.left && rect.x + rect.width > breakAt) { if (runCount > tabRuns.length - 1) expandTabRunsArray(); tabRuns[runCount] = i; runCount++; rect.x = x; } rect.y = y; rect.height = maxTabHeight; if (i == selectedIndex) selectedRun = runCount - 1; } } else { for (int i = 0; i < tabCount; i++) { rect = rects[i]; if (i > 0) { rect.y = rects[i - 1].y + rects[i - 1].height; } else { tabRuns[0] = 0; runCount = 1; maxTabHeight = 0; rect.y = y; } rect.height = calculateTabHeight(tabPlacement, i, fm.getHeight()); maxTabHeight = Math.max(maxTabHeight, rect.height); if (rect.y != 2 + insets.top && rect.y + rect.height > breakAt) { if (runCount > tabRuns.length - 1) expandTabRunsArray(); tabRuns[runCount] = i; runCount++; rect.y = y; } rect.x = x; rect.width = maxTabWidth; if (i == selectedIndex) selectedRun = runCount - 1; } } if (runCount > 1) { int start; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) start = y; else start = x; normalizeTabRuns(tabPlacement, tabCount, start, breakAt); selectedRun = getRunForTab(tabCount, selectedIndex); if (shouldRotateTabRuns(tabPlacement)) { rotateTabRuns(tabPlacement, selectedRun); } } // Pad the runs. int tabRunOverlay = getTabRunOverlay(tabPlacement); for (int i = runCount - 1; i >= 0; --i) { int start = tabRuns[i]; int nextIndex; if (i == runCount - 1) nextIndex = 0; else nextIndex = i + 1; int next = tabRuns[nextIndex]; int end = next != 0 ? next - 1 : tabCount - 1; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { for (int j = start; j <= end; ++j) { rect = rects[j]; rect.y = y; rect.x += getTabRunIndent(tabPlacement, i); } if (shouldPadTabRun(tabPlacement, i)) { padTabRun(tabPlacement, start, end, breakAt); } if (tabPlacement == BOTTOM) y -= maxTabHeight - tabRunOverlay; else y += maxTabHeight - tabRunOverlay; } else { for (int j = start; j <= end; ++j) { rect = rects[j]; rect.x = x; rect.y += getTabRunIndent(tabPlacement, i); } if (shouldPadTabRun(tabPlacement, i)) { padTabRun(tabPlacement, start, end, breakAt); } if (tabPlacement == RIGHT) x -= maxTabWidth - tabRunOverlay; else x += maxTabWidth - tabRunOverlay; } } padSelectedTab(tabPlacement, selectedIndex); }
protected void calculateTabRects(int tabPlacement, int tabCount) { Insets insets = tabPane.getInsets(); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); Dimension size = tabPane.getSize(); // The coordinates of the upper left corner of the tab area. int x; int y; // The location at which the runs must be broken. int breakAt; // Calculate the bounds for the tab area. switch (tabPlacement) { case LEFT: maxTabWidth = calculateMaxTabWidth(tabPlacement); x = insets.left + tabAreaInsets.left; y = insets.top + tabAreaInsets.top; breakAt = size.height - (insets.bottom + tabAreaInsets.bottom); break; case RIGHT: maxTabWidth = calculateMaxTabWidth(tabPlacement); x = size.width - (insets.right + tabAreaInsets.right) - maxTabWidth; y = insets.top + tabAreaInsets.top; breakAt = size.height - (insets.bottom + tabAreaInsets.bottom); break; case BOTTOM: maxTabHeight = calculateMaxTabHeight(tabPlacement); x = insets.left + tabAreaInsets.left; y = size.height - (insets.bottom + tabAreaInsets.bottom) - maxTabHeight - 1; breakAt = size.width - (insets.right + tabAreaInsets.right); break; case TOP: default: maxTabHeight = calculateMaxTabHeight(tabPlacement); x = insets.left + tabAreaInsets.left; y = insets.top + tabAreaInsets.top; breakAt = size.width - (insets.right + tabAreaInsets.right); break; } if (tabCount == 0) return; FontMetrics fm = getFontMetrics(); runCount = 0; selectedRun = -1; int selectedIndex = tabPane.getSelectedIndex(); Rectangle rect; // Go through all the tabs and build the tab runs. if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { for (int i = 0; i < tabCount; i++) { rect = rects[i]; if (i > 0) { rect.x = rects[i - 1].x + rects[i - 1].width; } else { tabRuns[0] = 0; runCount = 1; maxTabWidth = 0; rect.x = x; } rect.width = calculateTabWidth(tabPlacement, i, fm); maxTabWidth = Math.max(maxTabWidth, rect.width); if (rect.x != 2 + insets.left && rect.x + rect.width > breakAt) { if (runCount > tabRuns.length - 1) expandTabRunsArray(); tabRuns[runCount] = i; runCount++; rect.x = x; } rect.y = y; rect.height = maxTabHeight; if (i == selectedIndex) selectedRun = runCount - 1; } } else { for (int i = 0; i < tabCount; i++) { rect = rects[i]; if (i > 0) { rect.y = rects[i - 1].y + rects[i - 1].height; } else { tabRuns[0] = 0; runCount = 1; maxTabHeight = 0; rect.y = y; } rect.height = calculateTabHeight(tabPlacement, i, fm.getHeight()); maxTabHeight = Math.max(maxTabHeight, rect.height); if (rect.y != 2 + insets.top && rect.y + rect.height > breakAt) { if (runCount > tabRuns.length - 1) expandTabRunsArray(); tabRuns[runCount] = i; runCount++; rect.y = y; } rect.x = x; rect.width = maxTabWidth; if (i == selectedIndex) selectedRun = runCount - 1; } } if (runCount > 1) { int start; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) start = y; else start = x; normalizeTabRuns(tabPlacement, tabCount, start, breakAt); selectedRun = getRunForTab(tabCount, selectedIndex); if (shouldRotateTabRuns(tabPlacement)) { rotateTabRuns(tabPlacement, selectedRun); } } // Pad the runs. int tabRunOverlay = getTabRunOverlay(tabPlacement); for (int i = runCount - 1; i >= 0; --i) { int start = tabRuns[i]; int nextIndex; if (i == runCount - 1) nextIndex = 0; else nextIndex = i + 1; int next = tabRuns[nextIndex]; int end = next != 0 ? next - 1 : tabCount - 1; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { for (int j = start; j <= end; ++j) { rect = rects[j]; rect.y = y; rect.x += getTabRunIndent(tabPlacement, i); } if (shouldPadTabRun(tabPlacement, i)) { padTabRun(tabPlacement, start, end, breakAt); } if (tabPlacement == BOTTOM) y -= maxTabHeight - tabRunOverlay; else y += maxTabHeight - tabRunOverlay; } else { for (int j = start; j <= end; ++j) { rect = rects[j]; rect.x = x; rect.y += getTabRunIndent(tabPlacement, i); } if (shouldPadTabRun(tabPlacement, i)) { padTabRun(tabPlacement, start, end, breakAt); } if (tabPlacement == RIGHT) x -= maxTabWidth - tabRunOverlay; else x += maxTabWidth - tabRunOverlay; } } padSelectedTab(tabPlacement, selectedIndex); }
11,932
protected void calculateTabRects(int tabPlacement, int tabCount) { Insets insets = tabPane.getInsets(); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); Dimension size = tabPane.getSize(); // The coordinates of the upper left corner of the tab area. int x; int y; // The location at which the runs must be broken. int breakAt; // Calculate the bounds for the tab area. switch (tabPlacement) { case LEFT: maxTabWidth = calculateMaxTabWidth(tabPlacement); x = insets.left + tabAreaInsets.left; y = insets.top + tabAreaInsets.top; breakAt = size.height - (insets.bottom + tabAreaInsets.bottom); break; case RIGHT: maxTabWidth = calculateMaxTabWidth(tabPlacement); x = size.width - (insets.right + tabAreaInsets.right) - maxTabWidth; y = insets.top + tabAreaInsets.top; breakAt = size.height - (insets.bottom + tabAreaInsets.bottom); break; case BOTTOM: maxTabHeight = calculateMaxTabHeight(tabPlacement); x = insets.left + tabAreaInsets.left; y = size.height - (insets.bottom + tabAreaInsets.bottom) - maxTabHeight; breakAt = size.width - (insets.right + tabAreaInsets.right); break; case TOP: default: maxTabHeight = calculateMaxTabHeight(tabPlacement); x = insets.left + tabAreaInsets.left; y = insets.top + tabAreaInsets.top; breakAt = size.width - (insets.right + tabAreaInsets.right); break; } if (tabCount == 0) return; FontMetrics fm = getFontMetrics(); runCount = 0; selectedRun = -1; int selectedIndex = tabPane.getSelectedIndex(); Rectangle rect; // Go through all the tabs and build the tab runs. if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { for (int i = 0; i < tabCount; i++) { rect = rects[i]; if (i > 0) { rect.x = rects[i - 1].x + rects[i - 1].width; } else { tabRuns[0] = 0; runCount = 1; maxTabWidth = 0; rect.x = x; } rect.width = calculateTabWidth(tabPlacement, i, fm); maxTabWidth = Math.max(maxTabWidth, rect.width); if (rect.x != 2 + insets.left && rect.x + rect.width > breakAt) { if (runCount > tabRuns.length - 1) expandTabRunsArray(); tabRuns[runCount] = i; runCount++; rect.x = x; } rect.y = y; rect.height = maxTabHeight; if (i == selectedIndex) selectedRun = runCount - 1; } } else { for (int i = 0; i < tabCount; i++) { rect = rects[i]; if (i > 0) { rect.y = rects[i - 1].y + rects[i - 1].height; } else { tabRuns[0] = 0; runCount = 1; maxTabHeight = 0; rect.y = y; } rect.height = calculateTabHeight(tabPlacement, i, fm.getHeight()); maxTabHeight = Math.max(maxTabHeight, rect.height); if (rect.y != 2 + insets.top && rect.y + rect.height > breakAt) { if (runCount > tabRuns.length - 1) expandTabRunsArray(); tabRuns[runCount] = i; runCount++; rect.y = y; } rect.x = x; rect.width = maxTabWidth; if (i == selectedIndex) selectedRun = runCount - 1; } } if (runCount > 1) { int start; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) start = y; else start = x; normalizeTabRuns(tabPlacement, tabCount, start, breakAt); selectedRun = getRunForTab(tabCount, selectedIndex); if (shouldRotateTabRuns(tabPlacement)) { rotateTabRuns(tabPlacement, selectedRun); } } // Pad the runs. int tabRunOverlay = getTabRunOverlay(tabPlacement); for (int i = runCount - 1; i >= 0; --i) { int start = tabRuns[i]; int nextIndex; if (i == runCount - 1) nextIndex = 0; else nextIndex = i + 1; int next = tabRuns[nextIndex]; int end = next != 0 ? next - 1 : tabCount - 1; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { for (int j = start; j <= end; ++j) { rect = rects[j]; rect.y = y; rect.x += getTabRunIndent(tabPlacement, i); } if (shouldPadTabRun(tabPlacement, i)) { padTabRun(tabPlacement, start, end, breakAt); } if (tabPlacement == BOTTOM) y -= maxTabHeight - tabRunOverlay; else y += maxTabHeight - tabRunOverlay; } else { for (int j = start; j <= end; ++j) { rect = rects[j]; rect.x = x; rect.y += getTabRunIndent(tabPlacement, i); } if (shouldPadTabRun(tabPlacement, i)) { padTabRun(tabPlacement, start, end, breakAt); } if (tabPlacement == RIGHT) x -= maxTabWidth - tabRunOverlay; else x += maxTabWidth - tabRunOverlay; } } padSelectedTab(tabPlacement, selectedIndex); }
protectedvoidcalculateTabRects(inttabPlacement,inttabCount){Insetsinsets=tabPane.getInsets();InsetstabAreaInsets=getTabAreaInsets(tabPlacement);Dimensionsize=tabPane.getSize();//Thecoordinatesoftheupperleftcornerofthetabarea.intx;inty;//Thelocationatwhichtherunsmustbebroken.intbreakAt;//Calculatetheboundsforthetabarea.switch(tabPlacement){caseLEFT:maxTabWidth=calculateMaxTabWidth(tabPlacement);x=insets.left+tabAreaInsets.left;y=insets.top+tabAreaInsets.top;breakAt=size.height-(insets.bottom+tabAreaInsets.bottom);break;caseRIGHT:maxTabWidth=calculateMaxTabWidth(tabPlacement);x=size.width-(insets.right+tabAreaInsets.right)-maxTabWidth;y=insets.top+tabAreaInsets.top;breakAt=size.height-(insets.bottom+tabAreaInsets.bottom);break;caseBOTTOM:maxTabHeight=calculateMaxTabHeight(tabPlacement);x=insets.left+tabAreaInsets.left;y=size.height-(insets.bottom+tabAreaInsets.bottom)-maxTabHeight;breakAt=size.width-(insets.right+tabAreaInsets.right);break;caseTOP:default:maxTabHeight=calculateMaxTabHeight(tabPlacement);x=insets.left+tabAreaInsets.left;y=insets.top+tabAreaInsets.top;breakAt=size.width-(insets.right+tabAreaInsets.right);break;}if(tabCount==0)return;FontMetricsfm=getFontMetrics();runCount=0;selectedRun=-1;intselectedIndex=tabPane.getSelectedIndex();Rectanglerect;//Gothroughallthetabsandbuildthetabruns.if(tabPlacement==SwingConstants.TOP||tabPlacement==SwingConstants.BOTTOM){for(inti=0;i<tabCount;i++){rect=rects[i];if(i>0){rect.x=rects[i-1].x+rects[i-1].width;}else{tabRuns[0]=0;runCount=1;maxTabWidth=0;rect.x=x;}rect.width=calculateTabWidth(tabPlacement,i,fm);maxTabWidth=Math.max(maxTabWidth,rect.width);if(rect.x!=2+insets.left&&rect.x+rect.width>breakAt){if(runCount>tabRuns.length-1)expandTabRunsArray();tabRuns[runCount]=i;runCount++;rect.x=x;}rect.y=y;rect.height=maxTabHeight;if(i==selectedIndex)selectedRun=runCount-1;}}else{for(inti=0;i<tabCount;i++){rect=rects[i];if(i>0){rect.y=rects[i-1].y+rects[i-1].height;}else{tabRuns[0]=0;runCount=1;maxTabHeight=0;rect.y=y;}rect.height=calculateTabHeight(tabPlacement,i,fm.getHeight());maxTabHeight=Math.max(maxTabHeight,rect.height);if(rect.y!=2+insets.top&&rect.y+rect.height>breakAt){if(runCount>tabRuns.length-1)expandTabRunsArray();tabRuns[runCount]=i;runCount++;rect.y=y;}rect.x=x;rect.width=maxTabWidth;if(i==selectedIndex)selectedRun=runCount-1;}}if(runCount>1){intstart;if(tabPlacement==SwingConstants.TOP||tabPlacement==SwingConstants.BOTTOM)start=y;elsestart=x;normalizeTabRuns(tabPlacement,tabCount,start,breakAt);selectedRun=getRunForTab(tabCount,selectedIndex);if(shouldRotateTabRuns(tabPlacement)){rotateTabRuns(tabPlacement,selectedRun);}}//Padtheruns.inttabRunOverlay=getTabRunOverlay(tabPlacement);for(inti=runCount-1;i>=0;--i){intstart=tabRuns[i];intnextIndex;if(i==runCount-1)nextIndex=0;elsenextIndex=i+1;intnext=tabRuns[nextIndex];intend=next!=0?next-1:tabCount-1;if(tabPlacement==SwingConstants.TOP||tabPlacement==SwingConstants.BOTTOM){for(intj=start;j<=end;++j){rect=rects[j];rect.y=y;rect.x+=getTabRunIndent(tabPlacement,i);}if(shouldPadTabRun(tabPlacement,i)){padTabRun(tabPlacement,start,end,breakAt);}if(tabPlacement==BOTTOM)y-=maxTabHeight-tabRunOverlay;elsey+=maxTabHeight-tabRunOverlay;}else{for(intj=start;j<=end;++j){rect=rects[j];rect.x=x;rect.y+=getTabRunIndent(tabPlacement,i);}if(shouldPadTabRun(tabPlacement,i)){padTabRun(tabPlacement,start,end,breakAt);}if(tabPlacement==RIGHT)x-=maxTabWidth-tabRunOverlay;elsex+=maxTabWidth-tabRunOverlay;}}padSelectedTab(tabPlacement,selectedIndex);}
11,933
protected void calculateTabRects(int tabPlacement, int tabCount) { Insets insets = tabPane.getInsets(); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); Dimension size = tabPane.getSize(); // The coordinates of the upper left corner of the tab area. int x; int y; // The location at which the runs must be broken. int breakAt; // Calculate the bounds for the tab area. switch (tabPlacement) { case LEFT: maxTabWidth = calculateMaxTabWidth(tabPlacement); x = insets.left + tabAreaInsets.left; y = insets.top + tabAreaInsets.top; breakAt = size.height - (insets.bottom + tabAreaInsets.bottom); break; case RIGHT: maxTabWidth = calculateMaxTabWidth(tabPlacement); x = size.width - (insets.right + tabAreaInsets.right) - maxTabWidth; y = insets.top + tabAreaInsets.top; breakAt = size.height - (insets.bottom + tabAreaInsets.bottom); break; case BOTTOM: maxTabHeight = calculateMaxTabHeight(tabPlacement); x = insets.left + tabAreaInsets.left; y = size.height - (insets.bottom + tabAreaInsets.bottom) - maxTabHeight; breakAt = size.width - (insets.right + tabAreaInsets.right); break; case TOP: default: maxTabHeight = calculateMaxTabHeight(tabPlacement); x = insets.left + tabAreaInsets.left; y = insets.top + tabAreaInsets.top; breakAt = size.width - (insets.right + tabAreaInsets.right); break; } if (tabCount == 0) return; FontMetrics fm = getFontMetrics(); runCount = 0; selectedRun = -1; int selectedIndex = tabPane.getSelectedIndex(); Rectangle rect; // Go through all the tabs and build the tab runs. if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { for (int i = 0; i < tabCount; i++) { rect = rects[i]; if (i > 0) { rect.x = rects[i - 1].x + rects[i - 1].width; } else { tabRuns[0] = 0; runCount = 1; maxTabWidth = 0; rect.x = x; } rect.width = calculateTabWidth(tabPlacement, i, fm); maxTabWidth = Math.max(maxTabWidth, rect.width); if (rect.x != 2 + insets.left && rect.x + rect.width > breakAt) { if (runCount > tabRuns.length - 1) expandTabRunsArray(); tabRuns[runCount] = i; runCount++; rect.x = x; } rect.y = y; rect.height = maxTabHeight; if (i == selectedIndex) selectedRun = runCount - 1; } } else { for (int i = 0; i < tabCount; i++) { rect = rects[i]; if (i > 0) { rect.y = rects[i - 1].y + rects[i - 1].height; } else { tabRuns[0] = 0; runCount = 1; maxTabHeight = 0; rect.y = y; } rect.height = calculateTabHeight(tabPlacement, i, fm.getHeight()); maxTabHeight = Math.max(maxTabHeight, rect.height); if (rect.y != 2 + insets.top && rect.y + rect.height > breakAt) { if (runCount > tabRuns.length - 1) expandTabRunsArray(); tabRuns[runCount] = i; runCount++; rect.y = y; } rect.x = x; rect.width = maxTabWidth; if (i == selectedIndex) selectedRun = runCount - 1; } } if (runCount > 1) { int start; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) start = y; else start = x; normalizeTabRuns(tabPlacement, tabCount, start, breakAt); selectedRun = getRunForTab(tabCount, selectedIndex); if (shouldRotateTabRuns(tabPlacement)) { rotateTabRuns(tabPlacement, selectedRun); } } // Pad the runs. int tabRunOverlay = getTabRunOverlay(tabPlacement); for (int i = runCount - 1; i >= 0; --i) { int start = tabRuns[i]; int nextIndex; if (i == runCount - 1) nextIndex = 0; else nextIndex = i + 1; int next = tabRuns[nextIndex]; int end = next != 0 ? next - 1 : tabCount - 1; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { for (int j = start; j <= end; ++j) { rect = rects[j]; rect.y = y; rect.x += getTabRunIndent(tabPlacement, i); } if (shouldPadTabRun(tabPlacement, i)) { padTabRun(tabPlacement, start, end, breakAt); } if (tabPlacement == BOTTOM) y -= maxTabHeight - tabRunOverlay; else y += maxTabHeight - tabRunOverlay; } else { for (int j = start; j <= end; ++j) { rect = rects[j]; rect.x = x; rect.y += getTabRunIndent(tabPlacement, i); } if (shouldPadTabRun(tabPlacement, i)) { padTabRun(tabPlacement, start, end, breakAt); } if (tabPlacement == RIGHT) x -= maxTabWidth - tabRunOverlay; else x += maxTabWidth - tabRunOverlay; } } padSelectedTab(tabPlacement, selectedIndex); }
protected void calculateTabRects(int tabPlacement, int tabCount) { Insets insets = tabPane.getInsets(); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); Dimension size = tabPane.getSize(); // The coordinates of the upper left corner of the tab area. int x; int y; // The location at which the runs must be broken. int breakAt; // Calculate the bounds for the tab area. switch (tabPlacement) { case LEFT: maxTabWidth = calculateMaxTabWidth(tabPlacement); x = insets.left + tabAreaInsets.left; y = insets.top + tabAreaInsets.top; breakAt = size.height - (insets.bottom + tabAreaInsets.bottom); break; case RIGHT: maxTabWidth = calculateMaxTabWidth(tabPlacement); x = size.width - (insets.right + tabAreaInsets.right) - maxTabWidth; y = insets.top + tabAreaInsets.top; breakAt = size.height - (insets.bottom + tabAreaInsets.bottom); break; case BOTTOM: maxTabHeight = calculateMaxTabHeight(tabPlacement); x = insets.left + tabAreaInsets.left; y = size.height - (insets.bottom + tabAreaInsets.bottom) - maxTabHeight; breakAt = size.width - (insets.right + tabAreaInsets.right); break; case TOP: default: maxTabHeight = calculateMaxTabHeight(tabPlacement); x = insets.left + tabAreaInsets.left; y = insets.top + tabAreaInsets.top; breakAt = size.width - (insets.right + tabAreaInsets.right); break; } if (tabCount == 0) return; FontMetrics fm = getFontMetrics(); runCount = 0; selectedRun = -1; int selectedIndex = tabPane.getSelectedIndex(); Rectangle rect; // Go through all the tabs and build the tab runs. if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { for (int i = 0; i < tabCount; i++) { rect = rects[i]; if (i > 0) { rect.x = rects[i - 1].x + rects[i - 1].width; } else { tabRuns[0] = 0; runCount = 1; maxTabWidth = 0; rect.x = x; } rect.width = calculateTabWidth(tabPlacement, i, fm); maxTabWidth = Math.max(maxTabWidth, rect.width); if (rect.x != 2 + insets.left && rect.x + rect.width > breakAt) { if (runCount > tabRuns.length - 1) expandTabRunsArray(); tabRuns[runCount] = i; runCount++; rect.x = x; } rect.y = y; rect.height = maxTabHeight; if (i == selectedIndex) selectedRun = runCount - 1; } } else { for (int i = 0; i < tabCount; i++) { rect = rects[i]; if (i > 0) { rect.y = rects[i - 1].y + rects[i - 1].height; } else { tabRuns[0] = 0; runCount = 1; maxTabHeight = 0; rect.y = y; } rect.height = calculateTabHeight(tabPlacement, i, fm.getHeight()); maxTabHeight = Math.max(maxTabHeight, rect.height); if (rect.y != 2 + insets.top && rect.y + rect.height > breakAt) { if (runCount > tabRuns.length - 1) expandTabRunsArray(); tabRuns[runCount] = i; runCount++; rect.y = y; } rect.x = x; rect.width = maxTabWidth; if (i == selectedIndex) selectedRun = runCount - 1; } } if (runCount > 1) { int start; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) start = y; else start = x; normalizeTabRuns(tabPlacement, tabCount, start, breakAt); selectedRun = getRunForTab(tabCount, selectedIndex); if (shouldRotateTabRuns(tabPlacement)) { rotateTabRuns(tabPlacement, selectedRun); } } // Pad the runs. int tabRunOverlay = getTabRunOverlay(tabPlacement); for (int i = runCount - 1; i >= 0; --i) { int start = tabRuns[i]; int nextIndex; if (i == runCount - 1) nextIndex = 0; else nextIndex = i + 1; int next = tabRuns[nextIndex]; int end = next != 0 ? next - 1 : tabCount - 1; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { for (int j = start; j <= end; ++j) { rect = rects[j]; rect.y = y; rect.x += getTabRunIndent(tabPlacement, i); } if (shouldPadTabRun(tabPlacement, i)) { padTabRun(tabPlacement, start, end, breakAt); } if (tabPlacement == BOTTOM) y -= maxTabHeight - tabRunOverlay; else y += maxTabHeight - tabRunOverlay; } else { for (int j = start; j <= end; ++j) { rect = rects[j]; rect.x = x; rect.y += getTabRunIndent(tabPlacement, i); } if (shouldPadTabRun(tabPlacement, i)) { padTabRun(tabPlacement, start, end, breakAt); } if (tabPlacement == RIGHT) x -= maxTabWidth - tabRunOverlay; else x += maxTabWidth - tabRunOverlay; } } padSelectedTab(tabPlacement, selectedIndex); }
11,934
public void layoutContainer(Container parent) { calculateLayoutInfo(); int tabPlacement = tabPane.getTabPlacement(); Insets insets = tabPane.getInsets(); int selectedIndex = tabPane.getSelectedIndex(); Component selectedComponent = tabPane.getComponentAt(selectedIndex); // The RI doesn't seem to change the component if the new selected // component == null. This is probably so that applications can add // one single component for every tab. if (selectedComponent != null) { setVisibleComponent(selectedComponent); } int childCount = tabPane.getComponentCount(); if (childCount > 0) { int compX; int compY; int tabAreaWidth = 0; int tabAreaHeight = 0; switch (tabPlacement) { case LEFT: tabAreaWidth = calculateTabAreaWidth(tabPlacement, runCount, maxTabWidth); compX = tabAreaWidth + insets.left + contentBorderInsets.left; compY = insets.top + contentBorderInsets.top; break; case RIGHT: tabAreaWidth = calculateTabAreaWidth(tabPlacement, runCount, maxTabWidth); compX = insets.left + contentBorderInsets.left; compY = insets.top + contentBorderInsets.top; break; case BOTTOM: tabAreaHeight = calculateTabAreaHeight(tabPlacement, runCount, maxTabHeight); compX = insets.left + contentBorderInsets.left; compY = insets.top + contentBorderInsets.top; break; case TOP: default: tabAreaHeight = calculateTabAreaHeight(tabPlacement, runCount, maxTabHeight); compX = insets.left + contentBorderInsets.left; compY = tabAreaHeight + insets.top + contentBorderInsets.top; } Rectangle bounds = tabPane.getBounds(); int compWidth = bounds.width - tabAreaWidth - insets.left - insets.right - contentBorderInsets.left - contentBorderInsets.right; int compHeight = bounds.height - tabAreaHeight - insets.top - insets.bottom - contentBorderInsets.top - contentBorderInsets.bottom; for (int i = 0; i < childCount; ++i) { Component c = tabPane.getComponent(i); c.setBounds(compX, compY, compWidth, compHeight); } } }
public void layoutContainer(Container parent) { calculateLayoutInfo(); int tabPlacement = tabPane.getTabPlacement(); Insets insets = tabPane.getInsets(); int selectedIndex = tabPane.getSelectedIndex(); Component selectedComponent = null; if (selectedIndex >= 0) selectedComponent = tabPane.getComponentAt(selectedIndex); // The RI doesn't seem to change the component if the new selected // component == null. This is probably so that applications can add // one single component for every tab. if (selectedComponent != null) { setVisibleComponent(selectedComponent); } int childCount = tabPane.getComponentCount(); if (childCount > 0) { int compX; int compY; int tabAreaWidth = 0; int tabAreaHeight = 0; switch (tabPlacement) { case LEFT: tabAreaWidth = calculateTabAreaWidth(tabPlacement, runCount, maxTabWidth); compX = tabAreaWidth + insets.left + contentBorderInsets.left; compY = insets.top + contentBorderInsets.top; break; case RIGHT: tabAreaWidth = calculateTabAreaWidth(tabPlacement, runCount, maxTabWidth); compX = insets.left + contentBorderInsets.left; compY = insets.top + contentBorderInsets.top; break; case BOTTOM: tabAreaHeight = calculateTabAreaHeight(tabPlacement, runCount, maxTabHeight); compX = insets.left + contentBorderInsets.left; compY = insets.top + contentBorderInsets.top; break; case TOP: default: tabAreaHeight = calculateTabAreaHeight(tabPlacement, runCount, maxTabHeight); compX = insets.left + contentBorderInsets.left; compY = tabAreaHeight + insets.top + contentBorderInsets.top; } Rectangle bounds = tabPane.getBounds(); int compWidth = bounds.width - tabAreaWidth - insets.left - insets.right - contentBorderInsets.left - contentBorderInsets.right; int compHeight = bounds.height - tabAreaHeight - insets.top - insets.bottom - contentBorderInsets.top - contentBorderInsets.bottom; for (int i = 0; i < childCount; ++i) { Component c = tabPane.getComponent(i); c.setBounds(compX, compY, compWidth, compHeight); } } }
11,936
public Dimension minimumLayoutSize(Container parent) { return calculateSize(false); }
public Dimension minimumLayoutSize(Container parent) { return calculateSize(true); }
11,937
protected void normalizeTabRuns(int tabPlacement, int tabCount, int start, int max) { Insets tabAreaInsets = getTabAreaInsets(tabPlacement); if (tabPlacement == SwingUtilities.TOP || tabPlacement == SwingUtilities.BOTTOM) { // We should only do this for runCount - 1, cause we can only shift that many times between // runs. for (int i = 1; i < runCount; i++) { Rectangle currRun = rects[lastTabInRun(tabCount, i)]; Rectangle nextRun = rects[lastTabInRun(tabCount, getNextTabRun(i))]; int spaceInCurr = currRun.x + currRun.width; int spaceInNext = nextRun.x + nextRun.width; int diffNow = spaceInCurr - spaceInNext; int diffLater = (spaceInCurr - currRun.width) - (spaceInNext + currRun.width); while (Math.abs(diffLater) < Math.abs(diffNow) && spaceInNext + currRun.width < max) { tabRuns[i]--; spaceInNext += currRun.width; spaceInCurr -= currRun.width; currRun = rects[lastTabInRun(tabCount, i)]; diffNow = spaceInCurr - spaceInNext; diffLater = (spaceInCurr - currRun.width) - (spaceInNext + currRun.width); } // Fix the bounds. int first = lastTabInRun(tabCount, i) + 1; int last = lastTabInRun(tabCount, getNextTabRun(i)); int currX = tabAreaInsets.left; for (int j = first; j <= last; j++) { rects[j].x = currX; currX += rects[j].width; } } } else { for (int i = 1; i < runCount; i++) { Rectangle currRun = rects[lastTabInRun(tabCount, i)]; Rectangle nextRun = rects[lastTabInRun(tabCount, getNextTabRun(i))]; int spaceInCurr = currRun.y + currRun.height; int spaceInNext = nextRun.y + nextRun.height; int diffNow = spaceInCurr - spaceInNext; int diffLater = (spaceInCurr - currRun.height) - (spaceInNext + currRun.height); while (Math.abs(diffLater) < Math.abs(diffNow) && spaceInNext + currRun.height < max) { tabRuns[i]--; spaceInNext += currRun.height; spaceInCurr -= currRun.height; currRun = rects[lastTabInRun(tabCount, i)]; diffNow = spaceInCurr - spaceInNext; diffLater = (spaceInCurr - currRun.height) - (spaceInNext + currRun.height); } int first = lastTabInRun(tabCount, i) + 1; int last = lastTabInRun(tabCount, getNextTabRun(i)); int currY = tabAreaInsets.top; for (int j = first; j <= last; j++) { rects[j].y = currY; currY += rects[j].height; } } } }
protected void normalizeTabRuns(int tabPlacement, int tabCount, int start, int max) { if (tabPlacement == SwingUtilities.TOP || tabPlacement == SwingUtilities.BOTTOM) { // We should only do this for runCount - 1, cause we can only shift that many times between // runs. for (int i = 1; i < runCount; i++) { Rectangle currRun = rects[lastTabInRun(tabCount, i)]; Rectangle nextRun = rects[lastTabInRun(tabCount, getNextTabRun(i))]; int spaceInCurr = currRun.x + currRun.width; int spaceInNext = nextRun.x + nextRun.width; int diffNow = spaceInCurr - spaceInNext; int diffLater = (spaceInCurr - currRun.width) - (spaceInNext + currRun.width); while (Math.abs(diffLater) < Math.abs(diffNow) && spaceInNext + currRun.width < max) { tabRuns[i]--; spaceInNext += currRun.width; spaceInCurr -= currRun.width; currRun = rects[lastTabInRun(tabCount, i)]; diffNow = spaceInCurr - spaceInNext; diffLater = (spaceInCurr - currRun.width) - (spaceInNext + currRun.width); } // Fix the bounds. int first = lastTabInRun(tabCount, i) + 1; int last = lastTabInRun(tabCount, getNextTabRun(i)); int currX = tabAreaInsets.left; for (int j = first; j <= last; j++) { rects[j].x = currX; currX += rects[j].width; } } } else { for (int i = 1; i < runCount; i++) { Rectangle currRun = rects[lastTabInRun(tabCount, i)]; Rectangle nextRun = rects[lastTabInRun(tabCount, getNextTabRun(i))]; int spaceInCurr = currRun.y + currRun.height; int spaceInNext = nextRun.y + nextRun.height; int diffNow = spaceInCurr - spaceInNext; int diffLater = (spaceInCurr - currRun.height) - (spaceInNext + currRun.height); while (Math.abs(diffLater) < Math.abs(diffNow) && spaceInNext + currRun.height < max) { tabRuns[i]--; spaceInNext += currRun.height; spaceInCurr -= currRun.height; currRun = rects[lastTabInRun(tabCount, i)]; diffNow = spaceInCurr - spaceInNext; diffLater = (spaceInCurr - currRun.height) - (spaceInNext + currRun.height); } int first = lastTabInRun(tabCount, i) + 1; int last = lastTabInRun(tabCount, getNextTabRun(i)); int currY = tabAreaInsets.top; for (int j = first; j <= last; j++) { rects[j].y = currY; currY += rects[j].height; } } } }
11,938
protected void normalizeTabRuns(int tabPlacement, int tabCount, int start, int max) { Insets tabAreaInsets = getTabAreaInsets(tabPlacement); if (tabPlacement == SwingUtilities.TOP || tabPlacement == SwingUtilities.BOTTOM) { // We should only do this for runCount - 1, cause we can only shift that many times between // runs. for (int i = 1; i < runCount; i++) { Rectangle currRun = rects[lastTabInRun(tabCount, i)]; Rectangle nextRun = rects[lastTabInRun(tabCount, getNextTabRun(i))]; int spaceInCurr = currRun.x + currRun.width; int spaceInNext = nextRun.x + nextRun.width; int diffNow = spaceInCurr - spaceInNext; int diffLater = (spaceInCurr - currRun.width) - (spaceInNext + currRun.width); while (Math.abs(diffLater) < Math.abs(diffNow) && spaceInNext + currRun.width < max) { tabRuns[i]--; spaceInNext += currRun.width; spaceInCurr -= currRun.width; currRun = rects[lastTabInRun(tabCount, i)]; diffNow = spaceInCurr - spaceInNext; diffLater = (spaceInCurr - currRun.width) - (spaceInNext + currRun.width); } // Fix the bounds. int first = lastTabInRun(tabCount, i) + 1; int last = lastTabInRun(tabCount, getNextTabRun(i)); int currX = tabAreaInsets.left; for (int j = first; j <= last; j++) { rects[j].x = currX; currX += rects[j].width; } } } else { for (int i = 1; i < runCount; i++) { Rectangle currRun = rects[lastTabInRun(tabCount, i)]; Rectangle nextRun = rects[lastTabInRun(tabCount, getNextTabRun(i))]; int spaceInCurr = currRun.y + currRun.height; int spaceInNext = nextRun.y + nextRun.height; int diffNow = spaceInCurr - spaceInNext; int diffLater = (spaceInCurr - currRun.height) - (spaceInNext + currRun.height); while (Math.abs(diffLater) < Math.abs(diffNow) && spaceInNext + currRun.height < max) { tabRuns[i]--; spaceInNext += currRun.height; spaceInCurr -= currRun.height; currRun = rects[lastTabInRun(tabCount, i)]; diffNow = spaceInCurr - spaceInNext; diffLater = (spaceInCurr - currRun.height) - (spaceInNext + currRun.height); } int first = lastTabInRun(tabCount, i) + 1; int last = lastTabInRun(tabCount, getNextTabRun(i)); int currY = tabAreaInsets.top; for (int j = first; j <= last; j++) { rects[j].y = currY; currY += rects[j].height; } } } }
protected void normalizeTabRuns(int tabPlacement, int tabCount, int start, int max) { Insets tabAreaInsets = getTabAreaInsets(tabPlacement); if (tabPlacement == SwingUtilities.TOP || tabPlacement == SwingUtilities.BOTTOM) { // We should only do this for runCount - 1, cause we can only shift that many times between // runs. for (int i = 1; i < runCount; i++) { Rectangle currRun = rects[lastTabInRun(tabCount, i)]; Rectangle nextRun = rects[lastTabInRun(tabCount, getNextTabRun(i))]; int spaceInCurr = currRun.x + currRun.width; int spaceInNext = nextRun.x + nextRun.width; int diffNow = spaceInCurr - spaceInNext; int diffLater = (spaceInCurr - currRun.width) - (spaceInNext + currRun.width); while (Math.abs(diffLater) < Math.abs(diffNow) && spaceInNext + currRun.width < max) { tabRuns[i]--; spaceInNext += currRun.width; spaceInCurr -= currRun.width; currRun = rects[lastTabInRun(tabCount, i)]; diffNow = spaceInCurr - spaceInNext; diffLater = (spaceInCurr - currRun.width) - (spaceInNext + currRun.width); } // Fix the bounds. int first = lastTabInRun(tabCount, i) + 1; int last = lastTabInRun(tabCount, getNextTabRun(i)); int currX = tabAreaInsets.left; for (int j = first; j <= last; j++) { rects[j].x = currX; currX += rects[j].width; } } } else { for (int i = 1; i < runCount; i++) { Rectangle currRun = rects[lastTabInRun(tabCount, i)]; Rectangle nextRun = rects[lastTabInRun(tabCount, getNextTabRun(i))]; int spaceInCurr = currRun.y + currRun.height; int spaceInNext = nextRun.y + nextRun.height; int diffNow = spaceInCurr - spaceInNext; int diffLater = (spaceInCurr - currRun.height) - (spaceInNext + currRun.height); while (Math.abs(diffLater) < Math.abs(diffNow) && spaceInNext + currRun.height < max) { tabRuns[i]--; spaceInNext += currRun.height; spaceInCurr -= currRun.height; currRun = rects[lastTabInRun(tabCount, i)]; diffNow = spaceInCurr - spaceInNext; diffLater = (spaceInCurr - currRun.height) - (spaceInNext + currRun.height); } int first = lastTabInRun(tabCount, i) + 1; int last = lastTabInRun(tabCount, getNextTabRun(i)); int currY = tabAreaInsets.top; for (int j = first; j <= last; j++) { rects[j].y = currY; currY += rects[j].height; } } } }
11,939
protected void normalizeTabRuns(int tabPlacement, int tabCount, int start, int max) { Insets tabAreaInsets = getTabAreaInsets(tabPlacement); if (tabPlacement == SwingUtilities.TOP || tabPlacement == SwingUtilities.BOTTOM) { // We should only do this for runCount - 1, cause we can only shift that many times between // runs. for (int i = 1; i < runCount; i++) { Rectangle currRun = rects[lastTabInRun(tabCount, i)]; Rectangle nextRun = rects[lastTabInRun(tabCount, getNextTabRun(i))]; int spaceInCurr = currRun.x + currRun.width; int spaceInNext = nextRun.x + nextRun.width; int diffNow = spaceInCurr - spaceInNext; int diffLater = (spaceInCurr - currRun.width) - (spaceInNext + currRun.width); while (Math.abs(diffLater) < Math.abs(diffNow) && spaceInNext + currRun.width < max) { tabRuns[i]--; spaceInNext += currRun.width; spaceInCurr -= currRun.width; currRun = rects[lastTabInRun(tabCount, i)]; diffNow = spaceInCurr - spaceInNext; diffLater = (spaceInCurr - currRun.width) - (spaceInNext + currRun.width); } // Fix the bounds. int first = lastTabInRun(tabCount, i) + 1; int last = lastTabInRun(tabCount, getNextTabRun(i)); int currX = tabAreaInsets.left; for (int j = first; j <= last; j++) { rects[j].x = currX; currX += rects[j].width; } } } else { for (int i = 1; i < runCount; i++) { Rectangle currRun = rects[lastTabInRun(tabCount, i)]; Rectangle nextRun = rects[lastTabInRun(tabCount, getNextTabRun(i))]; int spaceInCurr = currRun.y + currRun.height; int spaceInNext = nextRun.y + nextRun.height; int diffNow = spaceInCurr - spaceInNext; int diffLater = (spaceInCurr - currRun.height) - (spaceInNext + currRun.height); while (Math.abs(diffLater) < Math.abs(diffNow) && spaceInNext + currRun.height < max) { tabRuns[i]--; spaceInNext += currRun.height; spaceInCurr -= currRun.height; currRun = rects[lastTabInRun(tabCount, i)]; diffNow = spaceInCurr - spaceInNext; diffLater = (spaceInCurr - currRun.height) - (spaceInNext + currRun.height); } int first = lastTabInRun(tabCount, i) + 1; int last = lastTabInRun(tabCount, getNextTabRun(i)); int currY = tabAreaInsets.top; for (int j = first; j <= last; j++) { rects[j].y = currY; currY += rects[j].height; } } } }
protected void normalizeTabRuns(int tabPlacement, int tabCount, int start, int max) { Insets tabAreaInsets = getTabAreaInsets(tabPlacement); if (tabPlacement == SwingUtilities.TOP || tabPlacement == SwingUtilities.BOTTOM) { // We should only do this for runCount - 1, cause we can only shift that many times between // runs. for (int i = 1; i < runCount; i++) { Rectangle currRun = rects[lastTabInRun(tabCount, i)]; Rectangle nextRun = rects[lastTabInRun(tabCount, getNextTabRun(i))]; int spaceInCurr = currRun.x + currRun.width; int spaceInNext = nextRun.x + nextRun.width; int diffNow = spaceInCurr - spaceInNext; int diffLater = (spaceInCurr - currRun.width) - (spaceInNext + currRun.width); while (Math.abs(diffLater) < Math.abs(diffNow) && spaceInNext + currRun.width < max) { tabRuns[i]--; spaceInNext += currRun.width; spaceInCurr -= currRun.width; currRun = rects[lastTabInRun(tabCount, i)]; diffNow = spaceInCurr - spaceInNext; diffLater = (spaceInCurr - currRun.width) - (spaceInNext + currRun.width); } // Fix the bounds. int first = lastTabInRun(tabCount, i) + 1; int last = lastTabInRun(tabCount, getNextTabRun(i)); int currX = tabAreaInsets.left; for (int j = first; j <= last; j++) { rects[j].x = currX; currX += rects[j].width; } } } else { for (int i = 1; i < runCount; i++) { Rectangle currRun = rects[lastTabInRun(tabCount, i)]; Rectangle nextRun = rects[lastTabInRun(tabCount, getNextTabRun(i))]; int spaceInCurr = currRun.y + currRun.height; int spaceInNext = nextRun.y + nextRun.height; int diffNow = spaceInCurr - spaceInNext; int diffLater = (spaceInCurr - currRun.height) - (spaceInNext + currRun.height); while (Math.abs(diffLater) < Math.abs(diffNow) && spaceInNext + currRun.height < max) { tabRuns[i]--; spaceInNext += currRun.height; spaceInCurr -= currRun.height; currRun = rects[lastTabInRun(tabCount, i)]; diffNow = spaceInCurr - spaceInNext; diffLater = (spaceInCurr - currRun.height) - (spaceInNext + currRun.height); } int first = lastTabInRun(tabCount, i) + 1; int last = lastTabInRun(tabCount, getNextTabRun(i)); int currY = tabAreaInsets.top; for (int j = first; j <= last; j++) { rects[j].y = currY; currY += rects[j].height; } } } }
11,940
protected void normalizeTabRuns(int tabPlacement, int tabCount, int start, int max) { Insets tabAreaInsets = getTabAreaInsets(tabPlacement); if (tabPlacement == SwingUtilities.TOP || tabPlacement == SwingUtilities.BOTTOM) { // We should only do this for runCount - 1, cause we can only shift that many times between // runs. for (int i = 1; i < runCount; i++) { Rectangle currRun = rects[lastTabInRun(tabCount, i)]; Rectangle nextRun = rects[lastTabInRun(tabCount, getNextTabRun(i))]; int spaceInCurr = currRun.x + currRun.width; int spaceInNext = nextRun.x + nextRun.width; int diffNow = spaceInCurr - spaceInNext; int diffLater = (spaceInCurr - currRun.width) - (spaceInNext + currRun.width); while (Math.abs(diffLater) < Math.abs(diffNow) && spaceInNext + currRun.width < max) { tabRuns[i]--; spaceInNext += currRun.width; spaceInCurr -= currRun.width; currRun = rects[lastTabInRun(tabCount, i)]; diffNow = spaceInCurr - spaceInNext; diffLater = (spaceInCurr - currRun.width) - (spaceInNext + currRun.width); } // Fix the bounds. int first = lastTabInRun(tabCount, i) + 1; int last = lastTabInRun(tabCount, getNextTabRun(i)); int currX = tabAreaInsets.left; for (int j = first; j <= last; j++) { rects[j].x = currX; currX += rects[j].width; } } } else { for (int i = 1; i < runCount; i++) { Rectangle currRun = rects[lastTabInRun(tabCount, i)]; Rectangle nextRun = rects[lastTabInRun(tabCount, getNextTabRun(i))]; int spaceInCurr = currRun.y + currRun.height; int spaceInNext = nextRun.y + nextRun.height; int diffNow = spaceInCurr - spaceInNext; int diffLater = (spaceInCurr - currRun.height) - (spaceInNext + currRun.height); while (Math.abs(diffLater) < Math.abs(diffNow) && spaceInNext + currRun.height < max) { tabRuns[i]--; spaceInNext += currRun.height; spaceInCurr -= currRun.height; currRun = rects[lastTabInRun(tabCount, i)]; diffNow = spaceInCurr - spaceInNext; diffLater = (spaceInCurr - currRun.height) - (spaceInNext + currRun.height); } int first = lastTabInRun(tabCount, i) + 1; int last = lastTabInRun(tabCount, getNextTabRun(i)); int currY = tabAreaInsets.top; for (int j = first; j <= last; j++) { rects[j].y = currY; currY += rects[j].height; } } } }
protected void normalizeTabRuns(int tabPlacement, int tabCount, int start, int max) { Insets tabAreaInsets = getTabAreaInsets(tabPlacement); if (tabPlacement == SwingUtilities.TOP || tabPlacement == SwingUtilities.BOTTOM) { // We should only do this for runCount - 1, cause we can only shift that many times between // runs. for (int i = 1; i < runCount; i++) { Rectangle currRun = rects[lastTabInRun(tabCount, i)]; Rectangle nextRun = rects[lastTabInRun(tabCount, getNextTabRun(i))]; int spaceInCurr = currRun.x + currRun.width; int spaceInNext = nextRun.x + nextRun.width; int diffNow = spaceInCurr - spaceInNext; int diffLater = (spaceInCurr - currRun.width) - (spaceInNext + currRun.width); while (Math.abs(diffLater) < Math.abs(diffNow) && spaceInNext + currRun.width < max) { tabRuns[i]--; spaceInNext += currRun.width; spaceInCurr -= currRun.width; currRun = rects[lastTabInRun(tabCount, i)]; diffNow = spaceInCurr - spaceInNext; diffLater = (spaceInCurr - currRun.width) - (spaceInNext + currRun.width); } // Fix the bounds. int first = lastTabInRun(tabCount, i) + 1; int last = lastTabInRun(tabCount, getNextTabRun(i)); int currX = tabAreaInsets.left; for (int j = first; j <= last; j++) { rects[j].x = currX; currX += rects[j].width; } } } else { for (int i = 1; i < runCount; i++) { Rectangle currRun = rects[lastTabInRun(tabCount, i)]; Rectangle nextRun = rects[lastTabInRun(tabCount, getNextTabRun(i))]; int spaceInCurr = currRun.y + currRun.height; int spaceInNext = nextRun.y + nextRun.height; int diffNow = spaceInCurr - spaceInNext; int diffLater = (spaceInCurr - currRun.height) - (spaceInNext + currRun.height); while (Math.abs(diffLater) < Math.abs(diffNow) && spaceInNext + currRun.height < max) { tabRuns[i]--; spaceInNext += currRun.height; spaceInCurr -= currRun.height; currRun = rects[lastTabInRun(tabCount, i)]; diffNow = spaceInCurr - spaceInNext; diffLater = (spaceInCurr - currRun.height) - (spaceInNext + currRun.height); } int first = lastTabInRun(tabCount, i) + 1; int last = lastTabInRun(tabCount, getNextTabRun(i)); int currY = tabAreaInsets.top; for (int j = first; j <= last; j++) { rects[j].y = currY; currY += rects[j].height; } } } }
11,941
protected void normalizeTabRuns(int tabPlacement, int tabCount, int start, int max) { Insets tabAreaInsets = getTabAreaInsets(tabPlacement); if (tabPlacement == SwingUtilities.TOP || tabPlacement == SwingUtilities.BOTTOM) { // We should only do this for runCount - 1, cause we can only shift that many times between // runs. for (int i = 1; i < runCount; i++) { Rectangle currRun = rects[lastTabInRun(tabCount, i)]; Rectangle nextRun = rects[lastTabInRun(tabCount, getNextTabRun(i))]; int spaceInCurr = currRun.x + currRun.width; int spaceInNext = nextRun.x + nextRun.width; int diffNow = spaceInCurr - spaceInNext; int diffLater = (spaceInCurr - currRun.width) - (spaceInNext + currRun.width); while (Math.abs(diffLater) < Math.abs(diffNow) && spaceInNext + currRun.width < max) { tabRuns[i]--; spaceInNext += currRun.width; spaceInCurr -= currRun.width; currRun = rects[lastTabInRun(tabCount, i)]; diffNow = spaceInCurr - spaceInNext; diffLater = (spaceInCurr - currRun.width) - (spaceInNext + currRun.width); } // Fix the bounds. int first = lastTabInRun(tabCount, i) + 1; int last = lastTabInRun(tabCount, getNextTabRun(i)); int currX = tabAreaInsets.left; for (int j = first; j <= last; j++) { rects[j].x = currX; currX += rects[j].width; } } } else { for (int i = 1; i < runCount; i++) { Rectangle currRun = rects[lastTabInRun(tabCount, i)]; Rectangle nextRun = rects[lastTabInRun(tabCount, getNextTabRun(i))]; int spaceInCurr = currRun.y + currRun.height; int spaceInNext = nextRun.y + nextRun.height; int diffNow = spaceInCurr - spaceInNext; int diffLater = (spaceInCurr - currRun.height) - (spaceInNext + currRun.height); while (Math.abs(diffLater) < Math.abs(diffNow) && spaceInNext + currRun.height < max) { tabRuns[i]--; spaceInNext += currRun.height; spaceInCurr -= currRun.height; currRun = rects[lastTabInRun(tabCount, i)]; diffNow = spaceInCurr - spaceInNext; diffLater = (spaceInCurr - currRun.height) - (spaceInNext + currRun.height); } int first = lastTabInRun(tabCount, i) + 1; int last = lastTabInRun(tabCount, getNextTabRun(i)); int currY = tabAreaInsets.top; for (int j = first; j <= last; j++) { rects[j].y = currY; currY += rects[j].height; } } } }
protected void normalizeTabRuns(int tabPlacement, int tabCount, int start, int max) { Insets tabAreaInsets = getTabAreaInsets(tabPlacement); if (tabPlacement == SwingUtilities.TOP || tabPlacement == SwingUtilities.BOTTOM) { // We should only do this for runCount - 1, cause we can only shift that many times between // runs. for (int i = 1; i < runCount; i++) { Rectangle currRun = rects[lastTabInRun(tabCount, i)]; Rectangle nextRun = rects[lastTabInRun(tabCount, getNextTabRun(i))]; int spaceInCurr = currRun.x + currRun.width; int spaceInNext = nextRun.x + nextRun.width; int diffNow = spaceInCurr - spaceInNext; int diffLater = (spaceInCurr - currRun.width) - (spaceInNext + currRun.width); while (Math.abs(diffLater) < Math.abs(diffNow) && spaceInNext + currRun.width < max) { tabRuns[i]--; spaceInNext += currRun.width; spaceInCurr -= currRun.width; currRun = rects[lastTabInRun(tabCount, i)]; diffNow = spaceInCurr - spaceInNext; diffLater = (spaceInCurr - currRun.width) - (spaceInNext + currRun.width); } // Fix the bounds. int first = lastTabInRun(tabCount, i) + 1; int last = lastTabInRun(tabCount, getNextTabRun(i)); int currX = tabAreaInsets.left; for (int j = first; j <= last; j++) { rects[j].x = currX; currX += rects[j].width; } } } else { for (int i = 1; i < runCount; i++) { Rectangle currRun = rects[lastTabInRun(tabCount, i)]; Rectangle nextRun = rects[lastTabInRun(tabCount, getNextTabRun(i))]; int spaceInCurr = currRun.y + currRun.height; int spaceInNext = nextRun.y + nextRun.height; int diffNow = spaceInCurr - spaceInNext; int diffLater = (spaceInCurr - currRun.height) - (spaceInNext + currRun.height); while (Math.abs(diffLater) < Math.abs(diffNow) && spaceInNext + currRun.height < max) { tabRuns[i]--; spaceInNext += currRun.height; spaceInCurr -= currRun.height; currRun = rects[lastTabInRun(tabCount, i)]; diffNow = spaceInCurr - spaceInNext; diffLater = (spaceInCurr - currRun.height) - (spaceInNext + currRun.height); } int first = lastTabInRun(tabCount, i) + 1; int last = lastTabInRun(tabCount, getNextTabRun(i)); int currY = tabAreaInsets.top; for (int j = first; j <= last; j++) { rects[j].y = currY; currY += rects[j].height; } } } }
11,942
protected void normalizeTabRuns(int tabPlacement, int tabCount, int start, int max) { Insets tabAreaInsets = getTabAreaInsets(tabPlacement); if (tabPlacement == SwingUtilities.TOP || tabPlacement == SwingUtilities.BOTTOM) { // We should only do this for runCount - 1, cause we can only shift that many times between // runs. for (int i = 1; i < runCount; i++) { Rectangle currRun = rects[lastTabInRun(tabCount, i)]; Rectangle nextRun = rects[lastTabInRun(tabCount, getNextTabRun(i))]; int spaceInCurr = currRun.x + currRun.width; int spaceInNext = nextRun.x + nextRun.width; int diffNow = spaceInCurr - spaceInNext; int diffLater = (spaceInCurr - currRun.width) - (spaceInNext + currRun.width); while (Math.abs(diffLater) < Math.abs(diffNow) && spaceInNext + currRun.width < max) { tabRuns[i]--; spaceInNext += currRun.width; spaceInCurr -= currRun.width; currRun = rects[lastTabInRun(tabCount, i)]; diffNow = spaceInCurr - spaceInNext; diffLater = (spaceInCurr - currRun.width) - (spaceInNext + currRun.width); } // Fix the bounds. int first = lastTabInRun(tabCount, i) + 1; int last = lastTabInRun(tabCount, getNextTabRun(i)); int currX = tabAreaInsets.left; for (int j = first; j <= last; j++) { rects[j].x = currX; currX += rects[j].width; } } } else { for (int i = 1; i < runCount; i++) { Rectangle currRun = rects[lastTabInRun(tabCount, i)]; Rectangle nextRun = rects[lastTabInRun(tabCount, getNextTabRun(i))]; int spaceInCurr = currRun.y + currRun.height; int spaceInNext = nextRun.y + nextRun.height; int diffNow = spaceInCurr - spaceInNext; int diffLater = (spaceInCurr - currRun.height) - (spaceInNext + currRun.height); while (Math.abs(diffLater) < Math.abs(diffNow) && spaceInNext + currRun.height < max) { tabRuns[i]--; spaceInNext += currRun.height; spaceInCurr -= currRun.height; currRun = rects[lastTabInRun(tabCount, i)]; diffNow = spaceInCurr - spaceInNext; diffLater = (spaceInCurr - currRun.height) - (spaceInNext + currRun.height); } int first = lastTabInRun(tabCount, i) + 1; int last = lastTabInRun(tabCount, getNextTabRun(i)); int currY = tabAreaInsets.top; for (int j = first; j <= last; j++) { rects[j].y = currY; currY += rects[j].height; } } } }
protected void normalizeTabRuns(int tabPlacement, int tabCount, int start, int max) { Insets tabAreaInsets = getTabAreaInsets(tabPlacement); if (tabPlacement == SwingUtilities.TOP || tabPlacement == SwingUtilities.BOTTOM) { // We should only do this for runCount - 1, cause we can only shift that many times between // runs. for (int i = 1; i < runCount; i++) { Rectangle currRun = rects[lastTabInRun(tabCount, i)]; Rectangle nextRun = rects[lastTabInRun(tabCount, getNextTabRun(i))]; int spaceInCurr = currRun.x + currRun.width; int spaceInNext = nextRun.x + nextRun.width; int diffNow = spaceInCurr - spaceInNext; int diffLater = (spaceInCurr - currRun.width) - (spaceInNext + currRun.width); while (Math.abs(diffLater) < Math.abs(diffNow) && spaceInNext + currRun.width < max) { tabRuns[i]--; spaceInNext += currRun.width; spaceInCurr -= currRun.width; currRun = rects[lastTabInRun(tabCount, i)]; diffNow = spaceInCurr - spaceInNext; diffLater = (spaceInCurr - currRun.width) - (spaceInNext + currRun.width); } // Fix the bounds. int first = lastTabInRun(tabCount, i) + 1; int last = lastTabInRun(tabCount, getNextTabRun(i)); int currX = tabAreaInsets.left; for (int j = first; j <= last; j++) { rects[j].x = currX; currX += rects[j].width; } } } else { for (int i = 1; i < runCount; i++) { Rectangle currRun = rects[lastTabInRun(tabCount, i)]; Rectangle nextRun = rects[lastTabInRun(tabCount, getNextTabRun(i))]; int spaceInCurr = currRun.y + currRun.height; int spaceInNext = nextRun.y + nextRun.height; int diffNow = spaceInCurr - spaceInNext; int diffLater = (spaceInCurr - currRun.height) - (spaceInNext + currRun.height); while (Math.abs(diffLater) < Math.abs(diffNow) && spaceInNext + currRun.height < max) { tabRuns[i]--; spaceInNext += currRun.height; spaceInCurr -= currRun.height; currRun = rects[lastTabInRun(tabCount, i)]; diffNow = spaceInCurr - spaceInNext; diffLater = (spaceInCurr - currRun.height) - (spaceInNext + currRun.height); } int first = lastTabInRun(tabCount, i) + 1; int last = lastTabInRun(tabCount, getNextTabRun(i)); int currY = tabAreaInsets.top; for (int j = first; j <= last; j++) { rects[j].y = currY; currY += rects[j].height; } } } }
11,943
protected int preferredTabAreaWidth(int tabPlacement, int height) { if (tabPane.getTabCount() == 0) return calculateTabAreaHeight(tabPlacement, 0, 0); int runs = 0; int runHeight = 0; int tabHeight = 0; FontMetrics fm = getFontMetrics(); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); Insets insets = tabPane.getInsets(); height -= tabAreaInsets.top + tabAreaInsets.bottom + insets.top + insets.bottom; int fontHeight = fm.getHeight(); for (int i = 0; i < tabPane.getTabCount(); i++) { tabHeight = calculateTabHeight(tabPlacement, i, fontHeight); if (runHeight + tabHeight > height) { runHeight = tabHeight; runs++; } else runHeight += tabHeight; } runs++; int maxTabWidth = calculateMaxTabWidth(tabPlacement); int tabAreaWidth = calculateTabAreaWidth(tabPlacement, runs, maxTabWidth); return tabAreaWidth; }
protected int preferredTabAreaWidth(int tabPlacement, int height) { if (tabPane.getTabCount() == 0) return calculateTabAreaHeight(tabPlacement, 0, 0); int runs = 0; int runHeight = 0; int tabHeight = 0; FontMetrics fm = getFontMetrics(); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); Insets insets = tabPane.getInsets(); height -= tabAreaInsets.top + tabAreaInsets.bottom + insets.top + insets.bottom; int fontHeight = fm.getHeight(); for (int i = 0; i < tabPane.getTabCount(); i++) { tabHeight = calculateTabHeight(tabPlacement, i, fontHeight); if (runHeight + tabHeight > height) { runHeight = tabHeight; runs++; } else runHeight += tabHeight; } runs++; int maxTabWidth = calculateMaxTabWidth(tabPlacement); int tabAreaWidth = calculateTabAreaWidth(tabPlacement, runs, maxTabWidth); return tabAreaWidth; }
11,945
protected void rotateTabRuns(int tabPlacement, int selectedRun) { if (runCount == 1 || selectedRun == 1 || selectedRun == -1) return; int[] newTabRuns = new int[tabRuns.length]; int currentRun = selectedRun; int i = 1; do { newTabRuns[i] = tabRuns[currentRun]; currentRun = getNextTabRun(currentRun); i++; } while (i < runCount); if (runCount > 1) newTabRuns[0] = tabRuns[currentRun]; tabRuns = newTabRuns; BasicTabbedPaneUI.this.selectedRun = 1; }
protected void rotateTabRuns(int tabPlacement, int selectedRun) { if (runCount == 1 || selectedRun == 0 || selectedRun == -1) return; int[] newTabRuns = new int[tabRuns.length]; int currentRun = selectedRun; int i = 1; do { newTabRuns[i] = tabRuns[currentRun]; currentRun = getNextTabRun(currentRun); i++; } while (i < runCount); if (runCount > 1) newTabRuns[0] = tabRuns[currentRun]; tabRuns = newTabRuns; BasicTabbedPaneUI.this.selectedRun = 1; }
11,946
protected void rotateTabRuns(int tabPlacement, int selectedRun) { if (runCount == 1 || selectedRun == 1 || selectedRun == -1) return; int[] newTabRuns = new int[tabRuns.length]; int currentRun = selectedRun; int i = 1; do { newTabRuns[i] = tabRuns[currentRun]; currentRun = getNextTabRun(currentRun); i++; } while (i < runCount); if (runCount > 1) newTabRuns[0] = tabRuns[currentRun]; tabRuns = newTabRuns; BasicTabbedPaneUI.this.selectedRun = 1; }
protected void rotateTabRuns(int tabPlacement, int selectedRun) { if (runCount == 1 || selectedRun == 1 || selectedRun == -1) return; int[] newTabRuns = new int[tabRuns.length]; int currentRun = selectedRun; int i = 0; do { newTabRuns[i] = tabRuns[currentRun]; currentRun = getNextTabRun(currentRun); i++; } while (i < runCount); if (runCount > 1) newTabRuns[0] = tabRuns[currentRun]; tabRuns = newTabRuns; BasicTabbedPaneUI.this.selectedRun = 1; }
11,947
protected void rotateTabRuns(int tabPlacement, int selectedRun) { if (runCount == 1 || selectedRun == 1 || selectedRun == -1) return; int[] newTabRuns = new int[tabRuns.length]; int currentRun = selectedRun; int i = 1; do { newTabRuns[i] = tabRuns[currentRun]; currentRun = getNextTabRun(currentRun); i++; } while (i < runCount); if (runCount > 1) newTabRuns[0] = tabRuns[currentRun]; tabRuns = newTabRuns; BasicTabbedPaneUI.this.selectedRun = 1; }
protected void rotateTabRuns(int tabPlacement, int selectedRun) { if (runCount == 1 || selectedRun == 1 || selectedRun == -1) return; int[] newTabRuns = new int[tabRuns.length]; int currentRun = selectedRun; int i = 1; do { newTabRuns[i] = tabRuns[currentRun]; currentRun = getNextTabRun(currentRun); i++; } while (i < runCount); if (runCount > 1) newTabRuns[0] = tabRuns[currentRun]; tabRuns = newTabRuns; BasicTabbedPaneUI.this.selectedRun = 1; }
11,948
protected void calculateTabRects(int tabPlacement, int tabCount) { if (tabCount == 0) return; FontMetrics fm = getFontMetrics(); SwingUtilities.calculateInnerArea(tabPane, calcRect); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); Insets insets = tabPane.getInsets(); int runs = 1; int start = 0; int top = 0; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int maxHeight = calculateMaxTabHeight(tabPlacement); calcRect.width -= tabAreaInsets.left + tabAreaInsets.right; start = tabAreaInsets.left + insets.left; int width = 0; int runWidth = start; top = insets.top + tabAreaInsets.top; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); rects[i] = new Rectangle(runWidth, top, width, maxHeight); runWidth += width; } tabAreaRect.width = tabPane.getWidth() - insets.left - insets.right; tabAreaRect.height = runs * maxTabHeight - (runs - 1) * tabRunOverlay + tabAreaInsets.top + tabAreaInsets.bottom; contentRect.width = tabAreaRect.width; contentRect.height = tabPane.getHeight() - insets.top - insets.bottom - tabAreaRect.height; contentRect.x = insets.left; tabAreaRect.x = insets.left; if (tabPlacement == SwingConstants.BOTTOM) { contentRect.y = insets.top; tabAreaRect.y = contentRect.y + contentRect.height; } else { tabAreaRect.y = insets.top; contentRect.y = tabAreaRect.y + tabAreaRect.height; } } else { int maxWidth = calculateMaxTabWidth(tabPlacement); calcRect.height -= tabAreaInsets.top + tabAreaInsets.bottom; int height = 0; start = tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); top = insets.left + tabAreaInsets.left; for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); rects[i] = new Rectangle(top, runHeight, maxWidth, height); runHeight += height; } tabAreaRect.width = runs * maxTabWidth - (runs - 1) * tabRunOverlay + tabAreaInsets.left + tabAreaInsets.right; tabAreaRect.height = tabPane.getHeight() - insets.top - insets.bottom; tabAreaRect.y = insets.top; contentRect.width = tabPane.getWidth() - insets.left - insets.right - tabAreaRect.width; contentRect.height = tabAreaRect.height; contentRect.y = insets.top; if (tabPlacement == SwingConstants.LEFT) { tabAreaRect.x = insets.left; contentRect.x = tabAreaRect.x + tabAreaRect.width; } else { contentRect.x = insets.left; tabAreaRect.x = contentRect.x + contentRect.width; } } runCount = runs; if (runCount > tabRuns.length) expandTabRunsArray(); padSelectedTab(tabPlacement, tabPane.getSelectedIndex()); }
protected void calculateTabRects(int tabPlacement, int tabCount) { if (tabCount == 0) return; FontMetrics fm = getFontMetrics(); SwingUtilities.calculateInnerArea(tabPane, calcRect); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); Insets insets = tabPane.getInsets(); int runs = 1; int start = 0; int top = 0; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int maxHeight = calculateMaxTabHeight(tabPlacement); calcRect.width -= tabAreaInsets.left + tabAreaInsets.right; start = tabAreaInsets.left + insets.left; int width = 0; int runWidth = start; top = insets.top + tabAreaInsets.top; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); rects[i] = new Rectangle(runWidth, top, width, maxHeight); runWidth += width; } tabAreaRect.width = tabPane.getWidth() - insets.left - insets.right; tabAreaRect.height = runs * maxTabHeight - (runs - 1) * tabRunOverlay + tabAreaInsets.top + tabAreaInsets.bottom; contentRect.width = tabAreaRect.width; contentRect.height = tabPane.getHeight() - insets.top - insets.bottom - tabAreaRect.height; contentRect.x = insets.left; tabAreaRect.x = insets.left; if (tabPlacement == SwingConstants.BOTTOM) { contentRect.y = insets.top; tabAreaRect.y = contentRect.y + contentRect.height; } else { tabAreaRect.y = insets.top; contentRect.y = tabAreaRect.y + tabAreaRect.height; } } else { int maxWidth = calculateMaxTabWidth(tabPlacement); calcRect.height -= tabAreaInsets.top + tabAreaInsets.bottom; int height = 0; start = tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); top = insets.left + tabAreaInsets.left; for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); rects[i] = new Rectangle(top, runHeight, maxWidth, height); runHeight += height; } tabAreaRect.width = runs * maxTabWidth - (runs - 1) * tabRunOverlay + tabAreaInsets.left + tabAreaInsets.right; tabAreaRect.height = tabPane.getHeight() - insets.top - insets.bottom; tabAreaRect.y = insets.top; contentRect.width = tabPane.getWidth() - insets.left - insets.right - tabAreaRect.width; contentRect.height = tabAreaRect.height; contentRect.y = insets.top; if (tabPlacement == SwingConstants.LEFT) { tabAreaRect.x = insets.left; contentRect.x = tabAreaRect.x + tabAreaRect.width; } else { contentRect.x = insets.left; tabAreaRect.x = contentRect.x + contentRect.width; } } runCount = runs; if (runCount > tabRuns.length) expandTabRunsArray(); padSelectedTab(tabPlacement, tabPane.getSelectedIndex()); }
11,949
protected void calculateTabRects(int tabPlacement, int tabCount) { if (tabCount == 0) return; FontMetrics fm = getFontMetrics(); SwingUtilities.calculateInnerArea(tabPane, calcRect); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); Insets insets = tabPane.getInsets(); int runs = 1; int start = 0; int top = 0; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int maxHeight = calculateMaxTabHeight(tabPlacement); calcRect.width -= tabAreaInsets.left + tabAreaInsets.right; start = tabAreaInsets.left + insets.left; int width = 0; int runWidth = start; top = insets.top + tabAreaInsets.top; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); rects[i] = new Rectangle(runWidth, top, width, maxHeight); runWidth += width; } tabAreaRect.width = tabPane.getWidth() - insets.left - insets.right; tabAreaRect.height = runs * maxTabHeight - (runs - 1) * tabRunOverlay + tabAreaInsets.top + tabAreaInsets.bottom; contentRect.width = tabAreaRect.width; contentRect.height = tabPane.getHeight() - insets.top - insets.bottom - tabAreaRect.height; contentRect.x = insets.left; tabAreaRect.x = insets.left; if (tabPlacement == SwingConstants.BOTTOM) { contentRect.y = insets.top; tabAreaRect.y = contentRect.y + contentRect.height; } else { tabAreaRect.y = insets.top; contentRect.y = tabAreaRect.y + tabAreaRect.height; } } else { int maxWidth = calculateMaxTabWidth(tabPlacement); calcRect.height -= tabAreaInsets.top + tabAreaInsets.bottom; int height = 0; start = tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); top = insets.left + tabAreaInsets.left; for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); rects[i] = new Rectangle(top, runHeight, maxWidth, height); runHeight += height; } tabAreaRect.width = runs * maxTabWidth - (runs - 1) * tabRunOverlay + tabAreaInsets.left + tabAreaInsets.right; tabAreaRect.height = tabPane.getHeight() - insets.top - insets.bottom; tabAreaRect.y = insets.top; contentRect.width = tabPane.getWidth() - insets.left - insets.right - tabAreaRect.width; contentRect.height = tabAreaRect.height; contentRect.y = insets.top; if (tabPlacement == SwingConstants.LEFT) { tabAreaRect.x = insets.left; contentRect.x = tabAreaRect.x + tabAreaRect.width; } else { contentRect.x = insets.left; tabAreaRect.x = contentRect.x + contentRect.width; } } runCount = runs; if (runCount > tabRuns.length) expandTabRunsArray(); padSelectedTab(tabPlacement, tabPane.getSelectedIndex()); }
protected void calculateTabRects(int tabPlacement, int tabCount) { if (tabCount == 0) return; FontMetrics fm = getFontMetrics(); SwingUtilities.calculateInnerArea(tabPane, calcRect); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); Insets insets = tabPane.getInsets(); int runs = 1; int start = 0; int top = 0; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int maxHeight = calculateMaxTabHeight(tabPlacement); calcRect.width -= tabAreaInsets.left + tabAreaInsets.right; int width = 0; int runWidth = start; top = insets.top + tabAreaInsets.top; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); rects[i] = new Rectangle(runWidth, top, width, maxHeight); runWidth += width; } tabAreaRect.width = tabPane.getWidth() - insets.left - insets.right; tabAreaRect.height = runs * maxTabHeight - (runs - 1) * tabRunOverlay + tabAreaInsets.top + tabAreaInsets.bottom; contentRect.width = tabAreaRect.width; contentRect.height = tabPane.getHeight() - insets.top - insets.bottom - tabAreaRect.height; contentRect.x = insets.left; tabAreaRect.x = insets.left; if (tabPlacement == SwingConstants.BOTTOM) { contentRect.y = insets.top; tabAreaRect.y = contentRect.y + contentRect.height; } else { tabAreaRect.y = insets.top; contentRect.y = tabAreaRect.y + tabAreaRect.height; } } else { int maxWidth = calculateMaxTabWidth(tabPlacement); calcRect.height -= tabAreaInsets.top + tabAreaInsets.bottom; int height = 0; start = tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); top = insets.left + tabAreaInsets.left; for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); rects[i] = new Rectangle(top, runHeight, maxWidth, height); runHeight += height; } tabAreaRect.width = runs * maxTabWidth - (runs - 1) * tabRunOverlay + tabAreaInsets.left + tabAreaInsets.right; tabAreaRect.height = tabPane.getHeight() - insets.top - insets.bottom; tabAreaRect.y = insets.top; contentRect.width = tabPane.getWidth() - insets.left - insets.right - tabAreaRect.width; contentRect.height = tabAreaRect.height; contentRect.y = insets.top; if (tabPlacement == SwingConstants.LEFT) { tabAreaRect.x = insets.left; contentRect.x = tabAreaRect.x + tabAreaRect.width; } else { contentRect.x = insets.left; tabAreaRect.x = contentRect.x + contentRect.width; } } runCount = runs; if (runCount > tabRuns.length) expandTabRunsArray(); padSelectedTab(tabPlacement, tabPane.getSelectedIndex()); }
11,950
protected void calculateTabRects(int tabPlacement, int tabCount) { if (tabCount == 0) return; FontMetrics fm = getFontMetrics(); SwingUtilities.calculateInnerArea(tabPane, calcRect); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); Insets insets = tabPane.getInsets(); int runs = 1; int start = 0; int top = 0; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int maxHeight = calculateMaxTabHeight(tabPlacement); calcRect.width -= tabAreaInsets.left + tabAreaInsets.right; start = tabAreaInsets.left + insets.left; int width = 0; int runWidth = start; top = insets.top + tabAreaInsets.top; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); rects[i] = new Rectangle(runWidth, top, width, maxHeight); runWidth += width; } tabAreaRect.width = tabPane.getWidth() - insets.left - insets.right; tabAreaRect.height = runs * maxTabHeight - (runs - 1) * tabRunOverlay + tabAreaInsets.top + tabAreaInsets.bottom; contentRect.width = tabAreaRect.width; contentRect.height = tabPane.getHeight() - insets.top - insets.bottom - tabAreaRect.height; contentRect.x = insets.left; tabAreaRect.x = insets.left; if (tabPlacement == SwingConstants.BOTTOM) { contentRect.y = insets.top; tabAreaRect.y = contentRect.y + contentRect.height; } else { tabAreaRect.y = insets.top; contentRect.y = tabAreaRect.y + tabAreaRect.height; } } else { int maxWidth = calculateMaxTabWidth(tabPlacement); calcRect.height -= tabAreaInsets.top + tabAreaInsets.bottom; int height = 0; start = tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); top = insets.left + tabAreaInsets.left; for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); rects[i] = new Rectangle(top, runHeight, maxWidth, height); runHeight += height; } tabAreaRect.width = runs * maxTabWidth - (runs - 1) * tabRunOverlay + tabAreaInsets.left + tabAreaInsets.right; tabAreaRect.height = tabPane.getHeight() - insets.top - insets.bottom; tabAreaRect.y = insets.top; contentRect.width = tabPane.getWidth() - insets.left - insets.right - tabAreaRect.width; contentRect.height = tabAreaRect.height; contentRect.y = insets.top; if (tabPlacement == SwingConstants.LEFT) { tabAreaRect.x = insets.left; contentRect.x = tabAreaRect.x + tabAreaRect.width; } else { contentRect.x = insets.left; tabAreaRect.x = contentRect.x + contentRect.width; } } runCount = runs; if (runCount > tabRuns.length) expandTabRunsArray(); padSelectedTab(tabPlacement, tabPane.getSelectedIndex()); }
protected void calculateTabRects(int tabPlacement, int tabCount) { if (tabCount == 0) return; FontMetrics fm = getFontMetrics(); SwingUtilities.calculateInnerArea(tabPane, calcRect); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); Insets insets = tabPane.getInsets(); int runs = 1; int start = 0; int top = 0; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int maxHeight = calculateMaxTabHeight(tabPlacement); calcRect.width -= tabAreaInsets.left + tabAreaInsets.right; start = tabAreaInsets.left + insets.left; int width = 0; int runWidth = start; top = insets.top + tabAreaInsets.top; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); rects[i] = new Rectangle(runWidth, top, width, maxHeight); runWidth += width; } tabAreaRect.width = tabPane.getWidth() - insets.left - insets.right; tabAreaRect.height = runs * maxTabHeight - (runs - 1) * tabRunOverlay + tabAreaInsets.top + tabAreaInsets.bottom; contentRect.width = tabAreaRect.width; contentRect.height = tabPane.getHeight() - insets.top - insets.bottom - tabAreaRect.height; contentRect.x = insets.left; tabAreaRect.x = insets.left; if (tabPlacement == SwingConstants.BOTTOM) { contentRect.y = insets.top; tabAreaRect.y = contentRect.y + contentRect.height; } else { tabAreaRect.y = insets.top; contentRect.y = tabAreaRect.y + tabAreaRect.height; } } else { int maxWidth = calculateMaxTabWidth(tabPlacement); calcRect.height -= tabAreaInsets.top + tabAreaInsets.bottom; int height = 0; start = tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); top = insets.left + tabAreaInsets.left; for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); rects[i] = new Rectangle(top, runHeight, maxWidth, height); runHeight += height; } tabAreaRect.width = runs * maxTabWidth - (runs - 1) * tabRunOverlay + tabAreaInsets.left + tabAreaInsets.right; tabAreaRect.height = tabPane.getHeight() - insets.top - insets.bottom; tabAreaRect.y = insets.top; contentRect.width = tabPane.getWidth() - insets.left - insets.right - tabAreaRect.width; contentRect.height = tabAreaRect.height; contentRect.y = insets.top; if (tabPlacement == SwingConstants.LEFT) { tabAreaRect.x = insets.left; contentRect.x = tabAreaRect.x + tabAreaRect.width; } else { contentRect.x = insets.left; tabAreaRect.x = contentRect.x + contentRect.width; } } runCount = runs; if (runCount > tabRuns.length) expandTabRunsArray(); padSelectedTab(tabPlacement, tabPane.getSelectedIndex()); }
11,951
protected void calculateTabRects(int tabPlacement, int tabCount) { if (tabCount == 0) return; FontMetrics fm = getFontMetrics(); SwingUtilities.calculateInnerArea(tabPane, calcRect); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); Insets insets = tabPane.getInsets(); int runs = 1; int start = 0; int top = 0; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int maxHeight = calculateMaxTabHeight(tabPlacement); calcRect.width -= tabAreaInsets.left + tabAreaInsets.right; start = tabAreaInsets.left + insets.left; int width = 0; int runWidth = start; top = insets.top + tabAreaInsets.top; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); rects[i] = new Rectangle(runWidth, top, width, maxHeight); runWidth += width; } tabAreaRect.width = tabPane.getWidth() - insets.left - insets.right; tabAreaRect.height = runs * maxTabHeight - (runs - 1) * tabRunOverlay + tabAreaInsets.top + tabAreaInsets.bottom; contentRect.width = tabAreaRect.width; contentRect.height = tabPane.getHeight() - insets.top - insets.bottom - tabAreaRect.height; contentRect.x = insets.left; tabAreaRect.x = insets.left; if (tabPlacement == SwingConstants.BOTTOM) { contentRect.y = insets.top; tabAreaRect.y = contentRect.y + contentRect.height; } else { tabAreaRect.y = insets.top; contentRect.y = tabAreaRect.y + tabAreaRect.height; } } else { int maxWidth = calculateMaxTabWidth(tabPlacement); calcRect.height -= tabAreaInsets.top + tabAreaInsets.bottom; int height = 0; start = tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); top = insets.left + tabAreaInsets.left; for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); rects[i] = new Rectangle(top, runHeight, maxWidth, height); runHeight += height; } tabAreaRect.width = runs * maxTabWidth - (runs - 1) * tabRunOverlay + tabAreaInsets.left + tabAreaInsets.right; tabAreaRect.height = tabPane.getHeight() - insets.top - insets.bottom; tabAreaRect.y = insets.top; contentRect.width = tabPane.getWidth() - insets.left - insets.right - tabAreaRect.width; contentRect.height = tabAreaRect.height; contentRect.y = insets.top; if (tabPlacement == SwingConstants.LEFT) { tabAreaRect.x = insets.left; contentRect.x = tabAreaRect.x + tabAreaRect.width; } else { contentRect.x = insets.left; tabAreaRect.x = contentRect.x + contentRect.width; } } runCount = runs; if (runCount > tabRuns.length) expandTabRunsArray(); padSelectedTab(tabPlacement, tabPane.getSelectedIndex()); }
protected void calculateTabRects(int tabPlacement, int tabCount) { if (tabCount == 0) return; FontMetrics fm = getFontMetrics(); SwingUtilities.calculateInnerArea(tabPane, calcRect); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); Insets insets = tabPane.getInsets(); int runs = 1; int start = 0; int top = 0; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int maxHeight = calculateMaxTabHeight(tabPlacement); calcRect.width -= tabAreaInsets.left + tabAreaInsets.right; start = tabAreaInsets.left + insets.left; int width = 0; int runWidth = start; top = insets.top + tabAreaInsets.top; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); rects[i].setBounds(runWidth, top, width, maxHeight); runWidth += width; } tabAreaRect.width = tabPane.getWidth() - insets.left - insets.right; tabAreaRect.height = runs * maxTabHeight - (runs - 1) * tabRunOverlay + tabAreaInsets.top + tabAreaInsets.bottom; contentRect.width = tabAreaRect.width; contentRect.height = tabPane.getHeight() - insets.top - insets.bottom - tabAreaRect.height; contentRect.x = insets.left; tabAreaRect.x = insets.left; if (tabPlacement == SwingConstants.BOTTOM) { contentRect.y = insets.top; tabAreaRect.y = contentRect.y + contentRect.height; } else { tabAreaRect.y = insets.top; contentRect.y = tabAreaRect.y + tabAreaRect.height; } } else { int maxWidth = calculateMaxTabWidth(tabPlacement); calcRect.height -= tabAreaInsets.top + tabAreaInsets.bottom; int height = 0; start = tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); top = insets.left + tabAreaInsets.left; for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); rects[i] = new Rectangle(top, runHeight, maxWidth, height); runHeight += height; } tabAreaRect.width = runs * maxTabWidth - (runs - 1) * tabRunOverlay + tabAreaInsets.left + tabAreaInsets.right; tabAreaRect.height = tabPane.getHeight() - insets.top - insets.bottom; tabAreaRect.y = insets.top; contentRect.width = tabPane.getWidth() - insets.left - insets.right - tabAreaRect.width; contentRect.height = tabAreaRect.height; contentRect.y = insets.top; if (tabPlacement == SwingConstants.LEFT) { tabAreaRect.x = insets.left; contentRect.x = tabAreaRect.x + tabAreaRect.width; } else { contentRect.x = insets.left; tabAreaRect.x = contentRect.x + contentRect.width; } } runCount = runs; if (runCount > tabRuns.length) expandTabRunsArray(); padSelectedTab(tabPlacement, tabPane.getSelectedIndex()); }
11,952
protected void calculateTabRects(int tabPlacement, int tabCount) { if (tabCount == 0) return; FontMetrics fm = getFontMetrics(); SwingUtilities.calculateInnerArea(tabPane, calcRect); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); Insets insets = tabPane.getInsets(); int runs = 1; int start = 0; int top = 0; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int maxHeight = calculateMaxTabHeight(tabPlacement); calcRect.width -= tabAreaInsets.left + tabAreaInsets.right; start = tabAreaInsets.left + insets.left; int width = 0; int runWidth = start; top = insets.top + tabAreaInsets.top; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); rects[i] = new Rectangle(runWidth, top, width, maxHeight); runWidth += width; } tabAreaRect.width = tabPane.getWidth() - insets.left - insets.right; tabAreaRect.height = runs * maxTabHeight - (runs - 1) * tabRunOverlay + tabAreaInsets.top + tabAreaInsets.bottom; contentRect.width = tabAreaRect.width; contentRect.height = tabPane.getHeight() - insets.top - insets.bottom - tabAreaRect.height; contentRect.x = insets.left; tabAreaRect.x = insets.left; if (tabPlacement == SwingConstants.BOTTOM) { contentRect.y = insets.top; tabAreaRect.y = contentRect.y + contentRect.height; } else { tabAreaRect.y = insets.top; contentRect.y = tabAreaRect.y + tabAreaRect.height; } } else { int maxWidth = calculateMaxTabWidth(tabPlacement); calcRect.height -= tabAreaInsets.top + tabAreaInsets.bottom; int height = 0; start = tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); top = insets.left + tabAreaInsets.left; for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); rects[i] = new Rectangle(top, runHeight, maxWidth, height); runHeight += height; } tabAreaRect.width = runs * maxTabWidth - (runs - 1) * tabRunOverlay + tabAreaInsets.left + tabAreaInsets.right; tabAreaRect.height = tabPane.getHeight() - insets.top - insets.bottom; tabAreaRect.y = insets.top; contentRect.width = tabPane.getWidth() - insets.left - insets.right - tabAreaRect.width; contentRect.height = tabAreaRect.height; contentRect.y = insets.top; if (tabPlacement == SwingConstants.LEFT) { tabAreaRect.x = insets.left; contentRect.x = tabAreaRect.x + tabAreaRect.width; } else { contentRect.x = insets.left; tabAreaRect.x = contentRect.x + contentRect.width; } } runCount = runs; if (runCount > tabRuns.length) expandTabRunsArray(); padSelectedTab(tabPlacement, tabPane.getSelectedIndex()); }
protected void calculateTabRects(int tabPlacement, int tabCount) { if (tabCount == 0) return; FontMetrics fm = getFontMetrics(); SwingUtilities.calculateInnerArea(tabPane, calcRect); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); Insets insets = tabPane.getInsets(); int runs = 1; int start = 0; int top = 0; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int maxHeight = calculateMaxTabHeight(tabPlacement); calcRect.width -= tabAreaInsets.left + tabAreaInsets.right; start = tabAreaInsets.left + insets.left; int width = 0; int runWidth = start; top = insets.top + tabAreaInsets.top; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); rects[i] = new Rectangle(runWidth, top, width, maxHeight); runWidth += width; } tabAreaRect.width = tabPane.getWidth() - insets.left - insets.right; tabAreaRect.height = runs * maxTabHeight - (runs - 1) * tabRunOverlay + tabAreaInsets.top + tabAreaInsets.bottom; contentRect.width = tabAreaRect.width; contentRect.height = tabPane.getHeight() - insets.top - insets.bottom - tabAreaRect.height; contentRect.x = insets.left; tabAreaRect.x = insets.left; if (tabPlacement == SwingConstants.BOTTOM) { contentRect.y = insets.top; tabAreaRect.y = contentRect.y + contentRect.height; } else { tabAreaRect.y = insets.top; contentRect.y = tabAreaRect.y + tabAreaRect.height; } } else { int maxWidth = calculateMaxTabWidth(tabPlacement); calcRect.height -= tabAreaInsets.top + tabAreaInsets.bottom; int height = 0; start = tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); top = insets.left + tabAreaInsets.left; for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); rects[i] = new Rectangle(top, runHeight, maxWidth, height); runHeight += height; } tabAreaRect.width = runs * maxTabWidth - (runs - 1) * tabRunOverlay + tabAreaInsets.left + tabAreaInsets.right; tabAreaRect.height = tabPane.getHeight() - insets.top - insets.bottom; tabAreaRect.y = insets.top; contentRect.width = tabPane.getWidth() - insets.left - insets.right - tabAreaRect.width; contentRect.height = tabAreaRect.height; contentRect.y = insets.top; if (tabPlacement == SwingConstants.LEFT) { tabAreaRect.x = insets.left; contentRect.x = tabAreaRect.x + tabAreaRect.width; } else { contentRect.x = insets.left; tabAreaRect.x = contentRect.x + contentRect.width; } } runCount = runs; if (runCount > tabRuns.length) expandTabRunsArray(); padSelectedTab(tabPlacement, tabPane.getSelectedIndex()); }
11,953
protected void calculateTabRects(int tabPlacement, int tabCount) { if (tabCount == 0) return; FontMetrics fm = getFontMetrics(); SwingUtilities.calculateInnerArea(tabPane, calcRect); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); Insets insets = tabPane.getInsets(); int runs = 1; int start = 0; int top = 0; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int maxHeight = calculateMaxTabHeight(tabPlacement); calcRect.width -= tabAreaInsets.left + tabAreaInsets.right; start = tabAreaInsets.left + insets.left; int width = 0; int runWidth = start; top = insets.top + tabAreaInsets.top; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); rects[i] = new Rectangle(runWidth, top, width, maxHeight); runWidth += width; } tabAreaRect.width = tabPane.getWidth() - insets.left - insets.right; tabAreaRect.height = runs * maxTabHeight - (runs - 1) * tabRunOverlay + tabAreaInsets.top + tabAreaInsets.bottom; contentRect.width = tabAreaRect.width; contentRect.height = tabPane.getHeight() - insets.top - insets.bottom - tabAreaRect.height; contentRect.x = insets.left; tabAreaRect.x = insets.left; if (tabPlacement == SwingConstants.BOTTOM) { contentRect.y = insets.top; tabAreaRect.y = contentRect.y + contentRect.height; } else { tabAreaRect.y = insets.top; contentRect.y = tabAreaRect.y + tabAreaRect.height; } } else { int maxWidth = calculateMaxTabWidth(tabPlacement); calcRect.height -= tabAreaInsets.top + tabAreaInsets.bottom; int height = 0; start = tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); top = insets.left + tabAreaInsets.left; for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); rects[i] = new Rectangle(top, runHeight, maxWidth, height); runHeight += height; } tabAreaRect.width = runs * maxTabWidth - (runs - 1) * tabRunOverlay + tabAreaInsets.left + tabAreaInsets.right; tabAreaRect.height = tabPane.getHeight() - insets.top - insets.bottom; tabAreaRect.y = insets.top; contentRect.width = tabPane.getWidth() - insets.left - insets.right - tabAreaRect.width; contentRect.height = tabAreaRect.height; contentRect.y = insets.top; if (tabPlacement == SwingConstants.LEFT) { tabAreaRect.x = insets.left; contentRect.x = tabAreaRect.x + tabAreaRect.width; } else { contentRect.x = insets.left; tabAreaRect.x = contentRect.x + contentRect.width; } } runCount = runs; if (runCount > tabRuns.length) expandTabRunsArray(); padSelectedTab(tabPlacement, tabPane.getSelectedIndex()); }
protected void calculateTabRects(int tabPlacement, int tabCount) { if (tabCount == 0) return; FontMetrics fm = getFontMetrics(); SwingUtilities.calculateInnerArea(tabPane, calcRect); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); Insets insets = tabPane.getInsets(); int runs = 1; int start = 0; int top = 0; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int maxHeight = calculateMaxTabHeight(tabPlacement); calcRect.width -= tabAreaInsets.left + tabAreaInsets.right; start = tabAreaInsets.left + insets.left; int width = 0; int runWidth = start; top = insets.top + tabAreaInsets.top; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); rects[i] = new Rectangle(runWidth, top, width, maxHeight); runWidth += width; } tabAreaRect.width = tabPane.getWidth() - insets.left - insets.right; tabAreaRect.height = runs * maxTabHeight - (runs - 1) * tabRunOverlay + tabAreaInsets.top + tabAreaInsets.bottom; contentRect.width = tabAreaRect.width; contentRect.height = tabPane.getHeight() - insets.top - insets.bottom - tabAreaRect.height; contentRect.x = insets.left; tabAreaRect.x = insets.left; if (tabPlacement == SwingConstants.BOTTOM) { contentRect.y = insets.top; tabAreaRect.y = contentRect.y + contentRect.height; } else { tabAreaRect.y = insets.top; contentRect.y = tabAreaRect.y + tabAreaRect.height; } } else { int maxWidth = calculateMaxTabWidth(tabPlacement); calcRect.height -= tabAreaInsets.top + tabAreaInsets.bottom; int height = 0; start = tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); top = insets.left + tabAreaInsets.left; for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); rects[i] = new Rectangle(top, runHeight, maxWidth, height); runHeight += height; } tabAreaRect.width = runs * maxTabWidth - (runs - 1) * tabRunOverlay + tabAreaInsets.left + tabAreaInsets.right; tabAreaRect.height = tabPane.getHeight() - insets.top - insets.bottom; tabAreaRect.y = insets.top; contentRect.width = tabPane.getWidth() - insets.left - insets.right - tabAreaRect.width; contentRect.height = tabAreaRect.height; contentRect.y = insets.top; if (tabPlacement == SwingConstants.LEFT) { tabAreaRect.x = insets.left; contentRect.x = tabAreaRect.x + tabAreaRect.width; } else { contentRect.x = insets.left; tabAreaRect.x = contentRect.x + contentRect.width; } } runCount = runs; if (runCount > tabRuns.length) expandTabRunsArray(); padSelectedTab(tabPlacement, tabPane.getSelectedIndex()); }
11,954
protected void calculateTabRects(int tabPlacement, int tabCount) { if (tabCount == 0) return; FontMetrics fm = getFontMetrics(); SwingUtilities.calculateInnerArea(tabPane, calcRect); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); Insets insets = tabPane.getInsets(); int runs = 1; int start = 0; int top = 0; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int maxHeight = calculateMaxTabHeight(tabPlacement); calcRect.width -= tabAreaInsets.left + tabAreaInsets.right; start = tabAreaInsets.left + insets.left; int width = 0; int runWidth = start; top = insets.top + tabAreaInsets.top; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); rects[i] = new Rectangle(runWidth, top, width, maxHeight); runWidth += width; } tabAreaRect.width = tabPane.getWidth() - insets.left - insets.right; tabAreaRect.height = runs * maxTabHeight - (runs - 1) * tabRunOverlay + tabAreaInsets.top + tabAreaInsets.bottom; contentRect.width = tabAreaRect.width; contentRect.height = tabPane.getHeight() - insets.top - insets.bottom - tabAreaRect.height; contentRect.x = insets.left; tabAreaRect.x = insets.left; if (tabPlacement == SwingConstants.BOTTOM) { contentRect.y = insets.top; tabAreaRect.y = contentRect.y + contentRect.height; } else { tabAreaRect.y = insets.top; contentRect.y = tabAreaRect.y + tabAreaRect.height; } } else { int maxWidth = calculateMaxTabWidth(tabPlacement); calcRect.height -= tabAreaInsets.top + tabAreaInsets.bottom; int height = 0; start = tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); top = insets.left + tabAreaInsets.left; for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); rects[i] = new Rectangle(top, runHeight, maxWidth, height); runHeight += height; } tabAreaRect.width = runs * maxTabWidth - (runs - 1) * tabRunOverlay + tabAreaInsets.left + tabAreaInsets.right; tabAreaRect.height = tabPane.getHeight() - insets.top - insets.bottom; tabAreaRect.y = insets.top; contentRect.width = tabPane.getWidth() - insets.left - insets.right - tabAreaRect.width; contentRect.height = tabAreaRect.height; contentRect.y = insets.top; if (tabPlacement == SwingConstants.LEFT) { tabAreaRect.x = insets.left; contentRect.x = tabAreaRect.x + tabAreaRect.width; } else { contentRect.x = insets.left; tabAreaRect.x = contentRect.x + contentRect.width; } } runCount = runs; if (runCount > tabRuns.length) expandTabRunsArray(); padSelectedTab(tabPlacement, tabPane.getSelectedIndex()); }
protected void calculateTabRects(int tabPlacement, int tabCount) { if (tabCount == 0) return; FontMetrics fm = getFontMetrics(); SwingUtilities.calculateInnerArea(tabPane, calcRect); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); Insets insets = tabPane.getInsets(); int runs = 1; int start = 0; int top = 0; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int maxHeight = calculateMaxTabHeight(tabPlacement); calcRect.width -= tabAreaInsets.left + tabAreaInsets.right; start = tabAreaInsets.left + insets.left; int width = 0; int runWidth = start; top = insets.top + tabAreaInsets.top; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); rects[i] = new Rectangle(runWidth, top, width, maxHeight); runWidth += width; } tabAreaRect.width = tabPane.getWidth() - insets.left - insets.right; tabAreaRect.height = runs * maxTabHeight - (runs - 1) * tabRunOverlay + tabAreaInsets.top + tabAreaInsets.bottom; contentRect.width = tabAreaRect.width; contentRect.height = tabPane.getHeight() - insets.top - insets.bottom - tabAreaRect.height; contentRect.x = insets.left; tabAreaRect.x = insets.left; if (tabPlacement == SwingConstants.BOTTOM) { contentRect.y = insets.top; tabAreaRect.y = contentRect.y + contentRect.height; } else { tabAreaRect.y = insets.top; contentRect.y = tabAreaRect.y + tabAreaRect.height; } } else { int maxWidth = calculateMaxTabWidth(tabPlacement); calcRect.height -= tabAreaInsets.top + tabAreaInsets.bottom; int height = 0; start = tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); int left = insets.left + tabAreaInsets.left; for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); rects[i] = new Rectangle(top, runHeight, maxWidth, height); runHeight += height; } tabAreaRect.width = runs * maxTabWidth - (runs - 1) * tabRunOverlay + tabAreaInsets.left + tabAreaInsets.right; tabAreaRect.height = tabPane.getHeight() - insets.top - insets.bottom; tabAreaRect.y = insets.top; contentRect.width = tabPane.getWidth() - insets.left - insets.right - tabAreaRect.width; contentRect.height = tabAreaRect.height; contentRect.y = insets.top; if (tabPlacement == SwingConstants.LEFT) { tabAreaRect.x = insets.left; contentRect.x = tabAreaRect.x + tabAreaRect.width; } else { contentRect.x = insets.left; tabAreaRect.x = contentRect.x + contentRect.width; } } runCount = runs; if (runCount > tabRuns.length) expandTabRunsArray(); padSelectedTab(tabPlacement, tabPane.getSelectedIndex()); }
11,955
protected void calculateTabRects(int tabPlacement, int tabCount) { if (tabCount == 0) return; FontMetrics fm = getFontMetrics(); SwingUtilities.calculateInnerArea(tabPane, calcRect); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); Insets insets = tabPane.getInsets(); int runs = 1; int start = 0; int top = 0; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int maxHeight = calculateMaxTabHeight(tabPlacement); calcRect.width -= tabAreaInsets.left + tabAreaInsets.right; start = tabAreaInsets.left + insets.left; int width = 0; int runWidth = start; top = insets.top + tabAreaInsets.top; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); rects[i] = new Rectangle(runWidth, top, width, maxHeight); runWidth += width; } tabAreaRect.width = tabPane.getWidth() - insets.left - insets.right; tabAreaRect.height = runs * maxTabHeight - (runs - 1) * tabRunOverlay + tabAreaInsets.top + tabAreaInsets.bottom; contentRect.width = tabAreaRect.width; contentRect.height = tabPane.getHeight() - insets.top - insets.bottom - tabAreaRect.height; contentRect.x = insets.left; tabAreaRect.x = insets.left; if (tabPlacement == SwingConstants.BOTTOM) { contentRect.y = insets.top; tabAreaRect.y = contentRect.y + contentRect.height; } else { tabAreaRect.y = insets.top; contentRect.y = tabAreaRect.y + tabAreaRect.height; } } else { int maxWidth = calculateMaxTabWidth(tabPlacement); calcRect.height -= tabAreaInsets.top + tabAreaInsets.bottom; int height = 0; start = tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); top = insets.left + tabAreaInsets.left; for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); rects[i] = new Rectangle(top, runHeight, maxWidth, height); runHeight += height; } tabAreaRect.width = runs * maxTabWidth - (runs - 1) * tabRunOverlay + tabAreaInsets.left + tabAreaInsets.right; tabAreaRect.height = tabPane.getHeight() - insets.top - insets.bottom; tabAreaRect.y = insets.top; contentRect.width = tabPane.getWidth() - insets.left - insets.right - tabAreaRect.width; contentRect.height = tabAreaRect.height; contentRect.y = insets.top; if (tabPlacement == SwingConstants.LEFT) { tabAreaRect.x = insets.left; contentRect.x = tabAreaRect.x + tabAreaRect.width; } else { contentRect.x = insets.left; tabAreaRect.x = contentRect.x + contentRect.width; } } runCount = runs; if (runCount > tabRuns.length) expandTabRunsArray(); padSelectedTab(tabPlacement, tabPane.getSelectedIndex()); }
protected void calculateTabRects(int tabPlacement, int tabCount) { if (tabCount == 0) return; FontMetrics fm = getFontMetrics(); SwingUtilities.calculateInnerArea(tabPane, calcRect); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); Insets insets = tabPane.getInsets(); int runs = 1; int start = 0; int top = 0; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int maxHeight = calculateMaxTabHeight(tabPlacement); calcRect.width -= tabAreaInsets.left + tabAreaInsets.right; start = tabAreaInsets.left + insets.left; int width = 0; int runWidth = start; top = insets.top + tabAreaInsets.top; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); rects[i] = new Rectangle(runWidth, top, width, maxHeight); runWidth += width; } tabAreaRect.width = tabPane.getWidth() - insets.left - insets.right; tabAreaRect.height = runs * maxTabHeight - (runs - 1) * tabRunOverlay + tabAreaInsets.top + tabAreaInsets.bottom; contentRect.width = tabAreaRect.width; contentRect.height = tabPane.getHeight() - insets.top - insets.bottom - tabAreaRect.height; contentRect.x = insets.left; tabAreaRect.x = insets.left; if (tabPlacement == SwingConstants.BOTTOM) { contentRect.y = insets.top; tabAreaRect.y = contentRect.y + contentRect.height; } else { tabAreaRect.y = insets.top; contentRect.y = tabAreaRect.y + tabAreaRect.height; } } else { int maxWidth = calculateMaxTabWidth(tabPlacement); calcRect.height -= tabAreaInsets.top + tabAreaInsets.bottom; int height = 0; start = tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); top = insets.left + tabAreaInsets.left; for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); rects[i].setBounds(left, runHeight, maxWidth, height); runHeight += height; } tabAreaRect.width = runs * maxTabWidth - (runs - 1) * tabRunOverlay + tabAreaInsets.left + tabAreaInsets.right; tabAreaRect.height = tabPane.getHeight() - insets.top - insets.bottom; tabAreaRect.y = insets.top; contentRect.width = tabPane.getWidth() - insets.left - insets.right - tabAreaRect.width; contentRect.height = tabAreaRect.height; contentRect.y = insets.top; if (tabPlacement == SwingConstants.LEFT) { tabAreaRect.x = insets.left; contentRect.x = tabAreaRect.x + tabAreaRect.width; } else { contentRect.x = insets.left; tabAreaRect.x = contentRect.x + contentRect.width; } } runCount = runs; if (runCount > tabRuns.length) expandTabRunsArray(); padSelectedTab(tabPlacement, tabPane.getSelectedIndex()); }
11,956
protected void calculateTabRects(int tabPlacement, int tabCount) { if (tabCount == 0) return; FontMetrics fm = getFontMetrics(); SwingUtilities.calculateInnerArea(tabPane, calcRect); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); Insets insets = tabPane.getInsets(); int runs = 1; int start = 0; int top = 0; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int maxHeight = calculateMaxTabHeight(tabPlacement); calcRect.width -= tabAreaInsets.left + tabAreaInsets.right; start = tabAreaInsets.left + insets.left; int width = 0; int runWidth = start; top = insets.top + tabAreaInsets.top; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); rects[i] = new Rectangle(runWidth, top, width, maxHeight); runWidth += width; } tabAreaRect.width = tabPane.getWidth() - insets.left - insets.right; tabAreaRect.height = runs * maxTabHeight - (runs - 1) * tabRunOverlay + tabAreaInsets.top + tabAreaInsets.bottom; contentRect.width = tabAreaRect.width; contentRect.height = tabPane.getHeight() - insets.top - insets.bottom - tabAreaRect.height; contentRect.x = insets.left; tabAreaRect.x = insets.left; if (tabPlacement == SwingConstants.BOTTOM) { contentRect.y = insets.top; tabAreaRect.y = contentRect.y + contentRect.height; } else { tabAreaRect.y = insets.top; contentRect.y = tabAreaRect.y + tabAreaRect.height; } } else { int maxWidth = calculateMaxTabWidth(tabPlacement); calcRect.height -= tabAreaInsets.top + tabAreaInsets.bottom; int height = 0; start = tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); top = insets.left + tabAreaInsets.left; for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); rects[i] = new Rectangle(top, runHeight, maxWidth, height); runHeight += height; } tabAreaRect.width = runs * maxTabWidth - (runs - 1) * tabRunOverlay + tabAreaInsets.left + tabAreaInsets.right; tabAreaRect.height = tabPane.getHeight() - insets.top - insets.bottom; tabAreaRect.y = insets.top; contentRect.width = tabPane.getWidth() - insets.left - insets.right - tabAreaRect.width; contentRect.height = tabAreaRect.height; contentRect.y = insets.top; if (tabPlacement == SwingConstants.LEFT) { tabAreaRect.x = insets.left; contentRect.x = tabAreaRect.x + tabAreaRect.width; } else { contentRect.x = insets.left; tabAreaRect.x = contentRect.x + contentRect.width; } } runCount = runs; if (runCount > tabRuns.length) expandTabRunsArray(); padSelectedTab(tabPlacement, tabPane.getSelectedIndex()); }
protected void calculateTabRects(int tabPlacement, int tabCount) { if (tabCount == 0) return; FontMetrics fm = getFontMetrics(); SwingUtilities.calculateInnerArea(tabPane, calcRect); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); Insets insets = tabPane.getInsets(); int runs = 1; int start = 0; int top = 0; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int maxHeight = calculateMaxTabHeight(tabPlacement); calcRect.width -= tabAreaInsets.left + tabAreaInsets.right; start = tabAreaInsets.left + insets.left; int width = 0; int runWidth = start; top = insets.top + tabAreaInsets.top; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); rects[i] = new Rectangle(runWidth, top, width, maxHeight); runWidth += width; } tabAreaRect.width = tabPane.getWidth() - insets.left - insets.right; tabAreaRect.height = runs * maxTabHeight - (runs - 1) * tabRunOverlay + tabAreaInsets.top + tabAreaInsets.bottom; contentRect.width = tabAreaRect.width; contentRect.height = tabPane.getHeight() - insets.top - insets.bottom - tabAreaRect.height; contentRect.x = insets.left; tabAreaRect.x = insets.left; if (tabPlacement == SwingConstants.BOTTOM) { contentRect.y = insets.top; tabAreaRect.y = contentRect.y + contentRect.height; } else { tabAreaRect.y = insets.top; contentRect.y = tabAreaRect.y + tabAreaRect.height; } } else { int maxWidth = calculateMaxTabWidth(tabPlacement); calcRect.height -= tabAreaInsets.top + tabAreaInsets.bottom; int height = 0; start = tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); top = insets.left + tabAreaInsets.left; for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); rects[i] = new Rectangle(top, runHeight, maxWidth, height); runHeight += height; } tabAreaRect.width = runs * maxTabWidth - (runs - 1) * tabRunOverlay + tabAreaInsets.left + tabAreaInsets.right; tabAreaRect.height = tabPane.getHeight() - insets.top - insets.bottom; tabAreaRect.y = insets.top; contentRect.width = tabPane.getWidth() - insets.left - insets.right - tabAreaRect.width; contentRect.height = tabAreaRect.height; contentRect.y = insets.top; if (tabPlacement == SwingConstants.LEFT) { tabAreaRect.x = insets.left; contentRect.x = tabAreaRect.x + tabAreaRect.width; } else { contentRect.x = insets.left; tabAreaRect.x = contentRect.x + contentRect.width; } } runCount = runs; if (runCount > tabRuns.length) expandTabRunsArray(); padSelectedTab(tabPlacement, tabPane.getSelectedIndex()); }
11,957
protected void calculateTabRects(int tabPlacement, int tabCount) { if (tabCount == 0) return; FontMetrics fm = getFontMetrics(); SwingUtilities.calculateInnerArea(tabPane, calcRect); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); Insets insets = tabPane.getInsets(); int runs = 1; int start = 0; int top = 0; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int maxHeight = calculateMaxTabHeight(tabPlacement); calcRect.width -= tabAreaInsets.left + tabAreaInsets.right; start = tabAreaInsets.left + insets.left; int width = 0; int runWidth = start; top = insets.top + tabAreaInsets.top; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); rects[i] = new Rectangle(runWidth, top, width, maxHeight); runWidth += width; } tabAreaRect.width = tabPane.getWidth() - insets.left - insets.right; tabAreaRect.height = runs * maxTabHeight - (runs - 1) * tabRunOverlay + tabAreaInsets.top + tabAreaInsets.bottom; contentRect.width = tabAreaRect.width; contentRect.height = tabPane.getHeight() - insets.top - insets.bottom - tabAreaRect.height; contentRect.x = insets.left; tabAreaRect.x = insets.left; if (tabPlacement == SwingConstants.BOTTOM) { contentRect.y = insets.top; tabAreaRect.y = contentRect.y + contentRect.height; } else { tabAreaRect.y = insets.top; contentRect.y = tabAreaRect.y + tabAreaRect.height; } } else { int maxWidth = calculateMaxTabWidth(tabPlacement); calcRect.height -= tabAreaInsets.top + tabAreaInsets.bottom; int height = 0; start = tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); top = insets.left + tabAreaInsets.left; for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); rects[i] = new Rectangle(top, runHeight, maxWidth, height); runHeight += height; } tabAreaRect.width = runs * maxTabWidth - (runs - 1) * tabRunOverlay + tabAreaInsets.left + tabAreaInsets.right; tabAreaRect.height = tabPane.getHeight() - insets.top - insets.bottom; tabAreaRect.y = insets.top; contentRect.width = tabPane.getWidth() - insets.left - insets.right - tabAreaRect.width; contentRect.height = tabAreaRect.height; contentRect.y = insets.top; if (tabPlacement == SwingConstants.LEFT) { tabAreaRect.x = insets.left; contentRect.x = tabAreaRect.x + tabAreaRect.width; } else { contentRect.x = insets.left; tabAreaRect.x = contentRect.x + contentRect.width; } } runCount = runs; if (runCount > tabRuns.length) expandTabRunsArray(); padSelectedTab(tabPlacement, tabPane.getSelectedIndex()); }
protected void calculateTabRects(int tabPlacement, int tabCount) { if (tabCount == 0) return; FontMetrics fm = getFontMetrics(); SwingUtilities.calculateInnerArea(tabPane, calcRect); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); Insets insets = tabPane.getInsets(); int runs = 1; int start = 0; int top = 0; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int maxHeight = calculateMaxTabHeight(tabPlacement); calcRect.width -= tabAreaInsets.left + tabAreaInsets.right; start = tabAreaInsets.left + insets.left; int width = 0; int runWidth = start; top = insets.top + tabAreaInsets.top; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); rects[i] = new Rectangle(runWidth, top, width, maxHeight); runWidth += width; } tabAreaRect.width = tabPane.getWidth() - insets.left - insets.right; tabAreaRect.height = runs * maxTabHeight - (runs - 1) * tabRunOverlay + tabAreaInsets.top + tabAreaInsets.bottom; contentRect.width = tabAreaRect.width; contentRect.height = tabPane.getHeight() - insets.top - insets.bottom - tabAreaRect.height; contentRect.x = insets.left; tabAreaRect.x = insets.left; if (tabPlacement == SwingConstants.BOTTOM) { contentRect.y = insets.top; tabAreaRect.y = contentRect.y + contentRect.height; } else { tabAreaRect.y = insets.top; contentRect.y = tabAreaRect.y + tabAreaRect.height; } } else { int maxWidth = calculateMaxTabWidth(tabPlacement); calcRect.height -= tabAreaInsets.top + tabAreaInsets.bottom; int height = 0; start = tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); top = insets.left + tabAreaInsets.left; for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); rects[i] = new Rectangle(top, runHeight, maxWidth, height); runHeight += height; } tabAreaRect.width = runs * maxTabWidth - (runs - 1) * tabRunOverlay + tabAreaInsets.left + tabAreaInsets.right; tabAreaRect.height = tabPane.getHeight() - insets.top - insets.bottom; tabAreaRect.y = insets.top; contentRect.width = tabPane.getWidth() - insets.left - insets.right - tabAreaRect.width; contentRect.height = tabAreaRect.height; contentRect.y = insets.top; if (tabPlacement == SwingConstants.LEFT) { tabAreaRect.x = insets.left; contentRect.x = tabAreaRect.x + tabAreaRect.width; } else { contentRect.x = insets.left; tabAreaRect.x = contentRect.x + contentRect.width; } } runCount = runs; if (runCount > tabRuns.length) expandTabRunsArray(); padSelectedTab(tabPlacement, tabPane.getSelectedIndex()); }
11,958
protected void calculateTabRects(int tabPlacement, int tabCount) { if (tabCount == 0) return; FontMetrics fm = getFontMetrics(); SwingUtilities.calculateInnerArea(tabPane, calcRect); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); Insets insets = tabPane.getInsets(); int runs = 1; int start = 0; int top = 0; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int maxHeight = calculateMaxTabHeight(tabPlacement); calcRect.width -= tabAreaInsets.left + tabAreaInsets.right; start = tabAreaInsets.left + insets.left; int width = 0; int runWidth = start; top = insets.top + tabAreaInsets.top; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); rects[i] = new Rectangle(runWidth, top, width, maxHeight); runWidth += width; } tabAreaRect.width = tabPane.getWidth() - insets.left - insets.right; tabAreaRect.height = runs * maxTabHeight - (runs - 1) * tabRunOverlay + tabAreaInsets.top + tabAreaInsets.bottom; contentRect.width = tabAreaRect.width; contentRect.height = tabPane.getHeight() - insets.top - insets.bottom - tabAreaRect.height; contentRect.x = insets.left; tabAreaRect.x = insets.left; if (tabPlacement == SwingConstants.BOTTOM) { contentRect.y = insets.top; tabAreaRect.y = contentRect.y + contentRect.height; } else { tabAreaRect.y = insets.top; contentRect.y = tabAreaRect.y + tabAreaRect.height; } } else { int maxWidth = calculateMaxTabWidth(tabPlacement); calcRect.height -= tabAreaInsets.top + tabAreaInsets.bottom; int height = 0; start = tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); top = insets.left + tabAreaInsets.left; for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); rects[i] = new Rectangle(top, runHeight, maxWidth, height); runHeight += height; } tabAreaRect.width = runs * maxTabWidth - (runs - 1) * tabRunOverlay + tabAreaInsets.left + tabAreaInsets.right; tabAreaRect.height = tabPane.getHeight() - insets.top - insets.bottom; tabAreaRect.y = insets.top; contentRect.width = tabPane.getWidth() - insets.left - insets.right - tabAreaRect.width; contentRect.height = tabAreaRect.height; contentRect.y = insets.top; if (tabPlacement == SwingConstants.LEFT) { tabAreaRect.x = insets.left; contentRect.x = tabAreaRect.x + tabAreaRect.width; } else { contentRect.x = insets.left; tabAreaRect.x = contentRect.x + contentRect.width; } } runCount = runs; if (runCount > tabRuns.length) expandTabRunsArray(); padSelectedTab(tabPlacement, tabPane.getSelectedIndex()); }
protected void calculateTabRects(int tabPlacement, int tabCount) { if (tabCount == 0) return; FontMetrics fm = getFontMetrics(); SwingUtilities.calculateInnerArea(tabPane, calcRect); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); Insets insets = tabPane.getInsets(); int runs = 1; int start = 0; int top = 0; if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { int maxHeight = calculateMaxTabHeight(tabPlacement); calcRect.width -= tabAreaInsets.left + tabAreaInsets.right; start = tabAreaInsets.left + insets.left; int width = 0; int runWidth = start; top = insets.top + tabAreaInsets.top; for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); rects[i] = new Rectangle(runWidth, top, width, maxHeight); runWidth += width; } tabAreaRect.width = tabPane.getWidth() - insets.left - insets.right; tabAreaRect.height = runs * maxTabHeight - (runs - 1) * tabRunOverlay + tabAreaInsets.top + tabAreaInsets.bottom; contentRect.width = tabAreaRect.width; contentRect.height = tabPane.getHeight() - insets.top - insets.bottom - tabAreaRect.height; contentRect.x = insets.left; tabAreaRect.x = insets.left; if (tabPlacement == SwingConstants.BOTTOM) { contentRect.y = insets.top; tabAreaRect.y = contentRect.y + contentRect.height; } else { tabAreaRect.y = insets.top; contentRect.y = tabAreaRect.y + tabAreaRect.height; } } else { int maxWidth = calculateMaxTabWidth(tabPlacement); calcRect.height -= tabAreaInsets.top + tabAreaInsets.bottom; int height = 0; start = tabAreaInsets.top + insets.top; int runHeight = start; int fontHeight = fm.getHeight(); top = insets.left + tabAreaInsets.left; for (int i = 0; i < tabCount; i++) { height = calculateTabHeight(tabPlacement, i, fontHeight); rects[i] = new Rectangle(top, runHeight, maxWidth, height); runHeight += height; } tabAreaRect.width = runs * maxTabWidth - (runs - 1) * tabRunOverlay + tabAreaInsets.left + tabAreaInsets.right; tabAreaRect.height = tabPane.getHeight() - insets.top - insets.bottom; tabAreaRect.y = insets.top; contentRect.width = tabPane.getWidth() - insets.left - insets.right - tabAreaRect.width; contentRect.height = tabAreaRect.height; contentRect.y = insets.top; if (tabPlacement == SwingConstants.LEFT) { tabAreaRect.x = insets.left; contentRect.x = tabAreaRect.x + tabAreaRect.width; } else { contentRect.x = insets.left; tabAreaRect.x = contentRect.x + contentRect.width; } } runCount = runs; if (runCount > tabRuns.length) expandTabRunsArray(); }
11,959
public void layoutContainer(Container pane) { super.layoutContainer(pane); int tabCount = tabPane.getTabCount(); Point p = null; if (tabCount == 0) return; int tabPlacement = tabPane.getTabPlacement(); incrButton.setVisible(false); decrButton.setVisible(false); if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { if (tabAreaRect.x + tabAreaRect.width < rects[tabCount - 1].x + rects[tabCount - 1].width) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); decrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width - decrDims.width, tabAreaRect.y, decrDims.width, tabAreaRect.height); incrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width, tabAreaRect.y, decrDims.width, tabAreaRect.height); tabAreaRect.width -= decrDims.width + incrDims.width; incrButton.setVisible(true); decrButton.setVisible(true); } } if (tabPlacement == SwingConstants.LEFT || tabPlacement == SwingConstants.RIGHT) { if (tabAreaRect.y + tabAreaRect.height < rects[tabCount - 1].y + rects[tabCount - 1].height) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); decrButton.setBounds(tabAreaRect.x, tabAreaRect.y + tabAreaRect.height - incrDims.height - decrDims.height, tabAreaRect.width, decrDims.height); incrButton.setBounds(tabAreaRect.x, tabAreaRect.y + tabAreaRect.height - incrDims.height, tabAreaRect.width, incrDims.height); tabAreaRect.height -= decrDims.height + incrDims.height; incrButton.setVisible(true); decrButton.setVisible(true); } } viewport.setBounds(tabAreaRect.x, tabAreaRect.y, tabAreaRect.width, tabAreaRect.height); int tabC = tabPane.getTabCount() - 1; if (tabCount > 0) { int w = Math.max(rects[tabC].width + rects[tabC].x, tabAreaRect.width); int h = Math.max(rects[tabC].height, tabAreaRect.height); p = findPointForIndex(currentScrollLocation); // we want to cover that entire space so that borders that run under // the tab area don't show up when we move the viewport around. panel.setSize(w + p.x, h + p.y); } viewport.setViewPosition(p); viewport.repaint(); }
public void layoutContainer(Container pane) { super.layoutContainer(pane); int tabCount = tabPane.getTabCount(); if (tabCount == 0) return; int tabPlacement = tabPane.getTabPlacement(); incrButton.setVisible(false); decrButton.setVisible(false); if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { if (tabAreaRect.x + tabAreaRect.width < rects[tabCount - 1].x + rects[tabCount - 1].width) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); decrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width - decrDims.width, tabAreaRect.y, decrDims.width, tabAreaRect.height); incrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width, tabAreaRect.y, decrDims.width, tabAreaRect.height); tabAreaRect.width -= decrDims.width + incrDims.width; incrButton.setVisible(true); decrButton.setVisible(true); } } if (tabPlacement == SwingConstants.LEFT || tabPlacement == SwingConstants.RIGHT) { if (tabAreaRect.y + tabAreaRect.height < rects[tabCount - 1].y + rects[tabCount - 1].height) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); decrButton.setBounds(tabAreaRect.x, tabAreaRect.y + tabAreaRect.height - incrDims.height - decrDims.height, tabAreaRect.width, decrDims.height); incrButton.setBounds(tabAreaRect.x, tabAreaRect.y + tabAreaRect.height - incrDims.height, tabAreaRect.width, incrDims.height); tabAreaRect.height -= decrDims.height + incrDims.height; incrButton.setVisible(true); decrButton.setVisible(true); } } viewport.setBounds(tabAreaRect.x, tabAreaRect.y, tabAreaRect.width, tabAreaRect.height); int tabC = tabPane.getTabCount() - 1; if (tabCount > 0) { int w = Math.max(rects[tabC].width + rects[tabC].x, tabAreaRect.width); int h = Math.max(rects[tabC].height, tabAreaRect.height); p = findPointForIndex(currentScrollLocation); // we want to cover that entire space so that borders that run under // the tab area don't show up when we move the viewport around. panel.setSize(w + p.x, h + p.y); } viewport.setViewPosition(p); viewport.repaint(); }
11,960
public void layoutContainer(Container pane) { super.layoutContainer(pane); int tabCount = tabPane.getTabCount(); Point p = null; if (tabCount == 0) return; int tabPlacement = tabPane.getTabPlacement(); incrButton.setVisible(false); decrButton.setVisible(false); if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { if (tabAreaRect.x + tabAreaRect.width < rects[tabCount - 1].x + rects[tabCount - 1].width) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); decrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width - decrDims.width, tabAreaRect.y, decrDims.width, tabAreaRect.height); incrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width, tabAreaRect.y, decrDims.width, tabAreaRect.height); tabAreaRect.width -= decrDims.width + incrDims.width; incrButton.setVisible(true); decrButton.setVisible(true); } } if (tabPlacement == SwingConstants.LEFT || tabPlacement == SwingConstants.RIGHT) { if (tabAreaRect.y + tabAreaRect.height < rects[tabCount - 1].y + rects[tabCount - 1].height) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); decrButton.setBounds(tabAreaRect.x, tabAreaRect.y + tabAreaRect.height - incrDims.height - decrDims.height, tabAreaRect.width, decrDims.height); incrButton.setBounds(tabAreaRect.x, tabAreaRect.y + tabAreaRect.height - incrDims.height, tabAreaRect.width, incrDims.height); tabAreaRect.height -= decrDims.height + incrDims.height; incrButton.setVisible(true); decrButton.setVisible(true); } } viewport.setBounds(tabAreaRect.x, tabAreaRect.y, tabAreaRect.width, tabAreaRect.height); int tabC = tabPane.getTabCount() - 1; if (tabCount > 0) { int w = Math.max(rects[tabC].width + rects[tabC].x, tabAreaRect.width); int h = Math.max(rects[tabC].height, tabAreaRect.height); p = findPointForIndex(currentScrollLocation); // we want to cover that entire space so that borders that run under // the tab area don't show up when we move the viewport around. panel.setSize(w + p.x, h + p.y); } viewport.setViewPosition(p); viewport.repaint(); }
public void layoutContainer(Container pane) { super.layoutContainer(pane); int tabCount = tabPane.getTabCount(); Point p = null; if (tabCount == 0) return; int tabPlacement = tabPane.getTabPlacement(); incrButton.setVisible(false); decrButton.setVisible(false); if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { if (tabAreaRect.x + tabAreaRect.width < rects[tabCount - 1].x + rects[tabCount - 1].width) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); decrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width - decrDims.width, tabAreaRect.y, decrDims.width, tabAreaRect.height); incrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width, tabAreaRect.y, decrDims.width, tabAreaRect.height); tabAreaRect.width -= decrDims.width + incrDims.width; incrButton.setVisible(true); decrButton.setVisible(true); } } if (tabPlacement == SwingConstants.LEFT || tabPlacement == SwingConstants.RIGHT) { if (tabAreaRect.y + tabAreaRect.height < rects[tabCount - 1].y + rects[tabCount - 1].height) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); decrButton.setBounds(tabAreaRect.x, tabAreaRect.y + tabAreaRect.height - incrDims.height - decrDims.height, tabAreaRect.width, decrDims.height); incrButton.setBounds(tabAreaRect.x, tabAreaRect.y + tabAreaRect.height - incrDims.height, tabAreaRect.width, incrDims.height); tabAreaRect.height -= decrDims.height + incrDims.height; incrButton.setVisible(true); decrButton.setVisible(true); } } viewport.setBounds(tabAreaRect.x, tabAreaRect.y, tabAreaRect.width, tabAreaRect.height); int tabC = tabPane.getTabCount() - 1; if (tabCount > 0) { int w = Math.max(rects[tabC].width + rects[tabC].x, tabAreaRect.width); int h = Math.max(rects[tabC].height, tabAreaRect.height); p = findPointForIndex(currentScrollLocation); // we want to cover that entire space so that borders that run under // the tab area don't show up when we move the viewport around. panel.setSize(w + p.x, h + p.y); } viewport.setViewPosition(p); viewport.repaint(); }
11,961
public void layoutContainer(Container pane) { super.layoutContainer(pane); int tabCount = tabPane.getTabCount(); Point p = null; if (tabCount == 0) return; int tabPlacement = tabPane.getTabPlacement(); incrButton.setVisible(false); decrButton.setVisible(false); if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { if (tabAreaRect.x + tabAreaRect.width < rects[tabCount - 1].x + rects[tabCount - 1].width) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); decrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width - decrDims.width, tabAreaRect.y, decrDims.width, tabAreaRect.height); incrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width, tabAreaRect.y, decrDims.width, tabAreaRect.height); tabAreaRect.width -= decrDims.width + incrDims.width; incrButton.setVisible(true); decrButton.setVisible(true); } } if (tabPlacement == SwingConstants.LEFT || tabPlacement == SwingConstants.RIGHT) { if (tabAreaRect.y + tabAreaRect.height < rects[tabCount - 1].y + rects[tabCount - 1].height) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); decrButton.setBounds(tabAreaRect.x, tabAreaRect.y + tabAreaRect.height - incrDims.height - decrDims.height, tabAreaRect.width, decrDims.height); incrButton.setBounds(tabAreaRect.x, tabAreaRect.y + tabAreaRect.height - incrDims.height, tabAreaRect.width, incrDims.height); tabAreaRect.height -= decrDims.height + incrDims.height; incrButton.setVisible(true); decrButton.setVisible(true); } } viewport.setBounds(tabAreaRect.x, tabAreaRect.y, tabAreaRect.width, tabAreaRect.height); int tabC = tabPane.getTabCount() - 1; if (tabCount > 0) { int w = Math.max(rects[tabC].width + rects[tabC].x, tabAreaRect.width); int h = Math.max(rects[tabC].height, tabAreaRect.height); p = findPointForIndex(currentScrollLocation); // we want to cover that entire space so that borders that run under // the tab area don't show up when we move the viewport around. panel.setSize(w + p.x, h + p.y); } viewport.setViewPosition(p); viewport.repaint(); }
public void layoutContainer(Container pane) { super.layoutContainer(pane); int tabCount = tabPane.getTabCount(); Point p = null; if (tabCount == 0) return; int tabPlacement = tabPane.getTabPlacement(); incrButton.setVisible(false); decrButton.setVisible(false); if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { if (tabAreaRect.x + tabAreaRect.width < rects[tabCount - 1].x + rects[tabCount - 1].width) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); decrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width - decrDims.width, tabAreaRect.y, decrDims.width, decrDims.height); incrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width, tabAreaRect.y, decrDims.width, decrDims.height); tabAreaRect.width -= decrDims.width + incrDims.width; incrButton.setVisible(true); decrButton.setVisible(true); } } if (tabPlacement == SwingConstants.LEFT || tabPlacement == SwingConstants.RIGHT) { if (tabAreaRect.y + tabAreaRect.height < rects[tabCount - 1].y + rects[tabCount - 1].height) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); decrButton.setBounds(tabAreaRect.x, tabAreaRect.y + tabAreaRect.height - incrDims.height - decrDims.height, tabAreaRect.width, decrDims.height); incrButton.setBounds(tabAreaRect.x, tabAreaRect.y + tabAreaRect.height - incrDims.height, tabAreaRect.width, incrDims.height); tabAreaRect.height -= decrDims.height + incrDims.height; incrButton.setVisible(true); decrButton.setVisible(true); } } viewport.setBounds(tabAreaRect.x, tabAreaRect.y, tabAreaRect.width, decrDims.height); int tabC = tabPane.getTabCount() - 1; if (tabCount > 0) { int w = Math.max(rects[tabC].width + rects[tabC].x, tabAreaRect.width); int h = Math.max(rects[tabC].height, decrDims.height); p = findPointForIndex(currentScrollLocation); // we want to cover that entire space so that borders that run under // the tab area don't show up when we move the viewport around. panel.setSize(w + p.x, h + p.y); } viewport.setViewPosition(p); viewport.repaint(); }
11,962
public void layoutContainer(Container pane) { super.layoutContainer(pane); int tabCount = tabPane.getTabCount(); Point p = null; if (tabCount == 0) return; int tabPlacement = tabPane.getTabPlacement(); incrButton.setVisible(false); decrButton.setVisible(false); if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { if (tabAreaRect.x + tabAreaRect.width < rects[tabCount - 1].x + rects[tabCount - 1].width) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); decrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width - decrDims.width, tabAreaRect.y, decrDims.width, tabAreaRect.height); incrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width, tabAreaRect.y, decrDims.width, tabAreaRect.height); tabAreaRect.width -= decrDims.width + incrDims.width; incrButton.setVisible(true); decrButton.setVisible(true); } } if (tabPlacement == SwingConstants.LEFT || tabPlacement == SwingConstants.RIGHT) { if (tabAreaRect.y + tabAreaRect.height < rects[tabCount - 1].y + rects[tabCount - 1].height) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); decrButton.setBounds(tabAreaRect.x, tabAreaRect.y + tabAreaRect.height - incrDims.height - decrDims.height, tabAreaRect.width, decrDims.height); incrButton.setBounds(tabAreaRect.x, tabAreaRect.y + tabAreaRect.height - incrDims.height, tabAreaRect.width, incrDims.height); tabAreaRect.height -= decrDims.height + incrDims.height; incrButton.setVisible(true); decrButton.setVisible(true); } } viewport.setBounds(tabAreaRect.x, tabAreaRect.y, tabAreaRect.width, tabAreaRect.height); int tabC = tabPane.getTabCount() - 1; if (tabCount > 0) { int w = Math.max(rects[tabC].width + rects[tabC].x, tabAreaRect.width); int h = Math.max(rects[tabC].height, tabAreaRect.height); p = findPointForIndex(currentScrollLocation); // we want to cover that entire space so that borders that run under // the tab area don't show up when we move the viewport around. panel.setSize(w + p.x, h + p.y); } viewport.setViewPosition(p); viewport.repaint(); }
public void layoutContainer(Container pane) { super.layoutContainer(pane); int tabCount = tabPane.getTabCount(); Point p = null; if (tabCount == 0) return; int tabPlacement = tabPane.getTabPlacement(); incrButton.setVisible(false); decrButton.setVisible(false); if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { if (tabAreaRect.x + tabAreaRect.width < rects[tabCount - 1].x + rects[tabCount - 1].width) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); decrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width - decrDims.width, tabAreaRect.y, decrDims.width, tabAreaRect.height); incrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width, tabAreaRect.y, incrDims.width, incrDims.height); } else { decrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width - decrDims.width, tabAreaRect.y + tabAreaRect.height - decrDims.height, decrDims.width, decrDims.height); incrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width, tabAreaRect.y + tabAreaRect.height - incrDims.height, incrDims.width, incrDims.height); } tabAreaRect.width -= decrDims.width + incrDims.width; incrButton.setVisible(true); decrButton.setVisible(true); } } if (tabPlacement == SwingConstants.LEFT || tabPlacement == SwingConstants.RIGHT) { if (tabAreaRect.y + tabAreaRect.height < rects[tabCount - 1].y + rects[tabCount - 1].height) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); decrButton.setBounds(tabAreaRect.x, tabAreaRect.y + tabAreaRect.height - incrDims.height - decrDims.height, tabAreaRect.width, decrDims.height); incrButton.setBounds(tabAreaRect.x, tabAreaRect.y + tabAreaRect.height - incrDims.height, tabAreaRect.width, incrDims.height); tabAreaRect.height -= decrDims.height + incrDims.height; incrButton.setVisible(true); decrButton.setVisible(true); } } viewport.setBounds(tabAreaRect.x, tabAreaRect.y, tabAreaRect.width, tabAreaRect.height); int tabC = tabPane.getTabCount() - 1; if (tabCount > 0) { int w = Math.max(rects[tabC].width + rects[tabC].x, tabAreaRect.width); int h = Math.max(rects[tabC].height, tabAreaRect.height); p = findPointForIndex(currentScrollLocation); // we want to cover that entire space so that borders that run under // the tab area don't show up when we move the viewport around. panel.setSize(w + p.x, h + p.y); } viewport.setViewPosition(p); viewport.repaint(); }
11,963
public void layoutContainer(Container pane) { super.layoutContainer(pane); int tabCount = tabPane.getTabCount(); Point p = null; if (tabCount == 0) return; int tabPlacement = tabPane.getTabPlacement(); incrButton.setVisible(false); decrButton.setVisible(false); if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { if (tabAreaRect.x + tabAreaRect.width < rects[tabCount - 1].x + rects[tabCount - 1].width) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); decrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width - decrDims.width, tabAreaRect.y, decrDims.width, tabAreaRect.height); incrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width, tabAreaRect.y, decrDims.width, tabAreaRect.height); tabAreaRect.width -= decrDims.width + incrDims.width; incrButton.setVisible(true); decrButton.setVisible(true); } } if (tabPlacement == SwingConstants.LEFT || tabPlacement == SwingConstants.RIGHT) { if (tabAreaRect.y + tabAreaRect.height < rects[tabCount - 1].y + rects[tabCount - 1].height) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); decrButton.setBounds(tabAreaRect.x, tabAreaRect.y + tabAreaRect.height - incrDims.height - decrDims.height, tabAreaRect.width, decrDims.height); incrButton.setBounds(tabAreaRect.x, tabAreaRect.y + tabAreaRect.height - incrDims.height, tabAreaRect.width, incrDims.height); tabAreaRect.height -= decrDims.height + incrDims.height; incrButton.setVisible(true); decrButton.setVisible(true); } } viewport.setBounds(tabAreaRect.x, tabAreaRect.y, tabAreaRect.width, tabAreaRect.height); int tabC = tabPane.getTabCount() - 1; if (tabCount > 0) { int w = Math.max(rects[tabC].width + rects[tabC].x, tabAreaRect.width); int h = Math.max(rects[tabC].height, tabAreaRect.height); p = findPointForIndex(currentScrollLocation); // we want to cover that entire space so that borders that run under // the tab area don't show up when we move the viewport around. panel.setSize(w + p.x, h + p.y); } viewport.setViewPosition(p); viewport.repaint(); }
public void layoutContainer(Container pane) { super.layoutContainer(pane); int tabCount = tabPane.getTabCount(); Point p = null; if (tabCount == 0) return; int tabPlacement = tabPane.getTabPlacement(); incrButton.setVisible(false); decrButton.setVisible(false); if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { if (tabAreaRect.x + tabAreaRect.width < rects[tabCount - 1].x + rects[tabCount - 1].width) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); decrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width - decrDims.width, tabAreaRect.y, decrDims.width, tabAreaRect.height); incrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width, tabAreaRect.y, decrDims.width, tabAreaRect.height); tabAreaRect.width -= decrDims.width + incrDims.width; incrButton.setVisible(true); decrButton.setVisible(true); } } if (tabPlacement == SwingConstants.LEFT || tabPlacement == SwingConstants.RIGHT) { if (tabAreaRect.y + tabAreaRect.height < rects[tabCount - 1].y + rects[tabCount - 1].height) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); decrButton.setBounds(tabAreaRect.x, tabAreaRect.y + tabAreaRect.height - incrDims.height - decrDims.height, decrDims.width, decrDims.height); incrButton.setBounds(tabAreaRect.x, tabAreaRect.y + tabAreaRect.height - incrDims.height, tabAreaRect.width, incrDims.height); tabAreaRect.height -= decrDims.height + incrDims.height; incrButton.setVisible(true); decrButton.setVisible(true); } } viewport.setBounds(tabAreaRect.x, tabAreaRect.y, tabAreaRect.width, tabAreaRect.height); int tabC = tabPane.getTabCount() - 1; if (tabCount > 0) { int w = Math.max(rects[tabC].width + rects[tabC].x, tabAreaRect.width); int h = Math.max(rects[tabC].height, tabAreaRect.height); p = findPointForIndex(currentScrollLocation); // we want to cover that entire space so that borders that run under // the tab area don't show up when we move the viewport around. panel.setSize(w + p.x, h + p.y); } viewport.setViewPosition(p); viewport.repaint(); }
11,964
public void layoutContainer(Container pane) { super.layoutContainer(pane); int tabCount = tabPane.getTabCount(); Point p = null; if (tabCount == 0) return; int tabPlacement = tabPane.getTabPlacement(); incrButton.setVisible(false); decrButton.setVisible(false); if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { if (tabAreaRect.x + tabAreaRect.width < rects[tabCount - 1].x + rects[tabCount - 1].width) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); decrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width - decrDims.width, tabAreaRect.y, decrDims.width, tabAreaRect.height); incrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width, tabAreaRect.y, decrDims.width, tabAreaRect.height); tabAreaRect.width -= decrDims.width + incrDims.width; incrButton.setVisible(true); decrButton.setVisible(true); } } if (tabPlacement == SwingConstants.LEFT || tabPlacement == SwingConstants.RIGHT) { if (tabAreaRect.y + tabAreaRect.height < rects[tabCount - 1].y + rects[tabCount - 1].height) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); decrButton.setBounds(tabAreaRect.x, tabAreaRect.y + tabAreaRect.height - incrDims.height - decrDims.height, tabAreaRect.width, decrDims.height); incrButton.setBounds(tabAreaRect.x, tabAreaRect.y + tabAreaRect.height - incrDims.height, tabAreaRect.width, incrDims.height); tabAreaRect.height -= decrDims.height + incrDims.height; incrButton.setVisible(true); decrButton.setVisible(true); } } viewport.setBounds(tabAreaRect.x, tabAreaRect.y, tabAreaRect.width, tabAreaRect.height); int tabC = tabPane.getTabCount() - 1; if (tabCount > 0) { int w = Math.max(rects[tabC].width + rects[tabC].x, tabAreaRect.width); int h = Math.max(rects[tabC].height, tabAreaRect.height); p = findPointForIndex(currentScrollLocation); // we want to cover that entire space so that borders that run under // the tab area don't show up when we move the viewport around. panel.setSize(w + p.x, h + p.y); } viewport.setViewPosition(p); viewport.repaint(); }
public void layoutContainer(Container pane) { super.layoutContainer(pane); int tabCount = tabPane.getTabCount(); Point p = null; if (tabCount == 0) return; int tabPlacement = tabPane.getTabPlacement(); incrButton.setVisible(false); decrButton.setVisible(false); if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { if (tabAreaRect.x + tabAreaRect.width < rects[tabCount - 1].x + rects[tabCount - 1].width) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); decrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width - decrDims.width, tabAreaRect.y, decrDims.width, tabAreaRect.height); incrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width, tabAreaRect.y, decrDims.width, tabAreaRect.height); tabAreaRect.width -= decrDims.width + incrDims.width; incrButton.setVisible(true); decrButton.setVisible(true); } } if (tabPlacement == SwingConstants.LEFT || tabPlacement == SwingConstants.RIGHT) { if (tabAreaRect.y + tabAreaRect.height < rects[tabCount - 1].y + rects[tabCount - 1].height) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); decrButton.setBounds(tabAreaRect.x, tabAreaRect.y + tabAreaRect.height - incrDims.height - decrDims.height, tabAreaRect.width, decrDims.height); incrButton.setBounds(tabAreaRect.x, tabAreaRect.y + tabAreaRect.height - incrDims.height, incrDims.width, incrDims.height); tabAreaRect.height -= decrDims.height + incrDims.height; incrButton.setVisible(true); decrButton.setVisible(true); } } viewport.setBounds(tabAreaRect.x, tabAreaRect.y, tabAreaRect.width, tabAreaRect.height); int tabC = tabPane.getTabCount() - 1; if (tabCount > 0) { int w = Math.max(rects[tabC].width + rects[tabC].x, tabAreaRect.width); int h = Math.max(rects[tabC].height, tabAreaRect.height); p = findPointForIndex(currentScrollLocation); // we want to cover that entire space so that borders that run under // the tab area don't show up when we move the viewport around. panel.setSize(w + p.x, h + p.y); } viewport.setViewPosition(p); viewport.repaint(); }
11,965
public void layoutContainer(Container pane) { super.layoutContainer(pane); int tabCount = tabPane.getTabCount(); Point p = null; if (tabCount == 0) return; int tabPlacement = tabPane.getTabPlacement(); incrButton.setVisible(false); decrButton.setVisible(false); if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { if (tabAreaRect.x + tabAreaRect.width < rects[tabCount - 1].x + rects[tabCount - 1].width) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); decrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width - decrDims.width, tabAreaRect.y, decrDims.width, tabAreaRect.height); incrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width, tabAreaRect.y, decrDims.width, tabAreaRect.height); tabAreaRect.width -= decrDims.width + incrDims.width; incrButton.setVisible(true); decrButton.setVisible(true); } } if (tabPlacement == SwingConstants.LEFT || tabPlacement == SwingConstants.RIGHT) { if (tabAreaRect.y + tabAreaRect.height < rects[tabCount - 1].y + rects[tabCount - 1].height) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); decrButton.setBounds(tabAreaRect.x, tabAreaRect.y + tabAreaRect.height - incrDims.height - decrDims.height, tabAreaRect.width, decrDims.height); incrButton.setBounds(tabAreaRect.x, tabAreaRect.y + tabAreaRect.height - incrDims.height, tabAreaRect.width, incrDims.height); tabAreaRect.height -= decrDims.height + incrDims.height; incrButton.setVisible(true); decrButton.setVisible(true); } } viewport.setBounds(tabAreaRect.x, tabAreaRect.y, tabAreaRect.width, tabAreaRect.height); int tabC = tabPane.getTabCount() - 1; if (tabCount > 0) { int w = Math.max(rects[tabC].width + rects[tabC].x, tabAreaRect.width); int h = Math.max(rects[tabC].height, tabAreaRect.height); p = findPointForIndex(currentScrollLocation); // we want to cover that entire space so that borders that run under // the tab area don't show up when we move the viewport around. panel.setSize(w + p.x, h + p.y); } viewport.setViewPosition(p); viewport.repaint(); }
public void layoutContainer(Container pane) { super.layoutContainer(pane); int tabCount = tabPane.getTabCount(); Point p = null; if (tabCount == 0) return; int tabPlacement = tabPane.getTabPlacement(); incrButton.setVisible(false); decrButton.setVisible(false); if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { if (tabAreaRect.x + tabAreaRect.width < rects[tabCount - 1].x + rects[tabCount - 1].width) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); decrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width - decrDims.width, tabAreaRect.y, decrDims.width, tabAreaRect.height); incrButton.setBounds(tabAreaRect.x + tabAreaRect.width - incrDims.width, tabAreaRect.y, decrDims.width, tabAreaRect.height); tabAreaRect.width -= decrDims.width + incrDims.width; incrButton.setVisible(true); decrButton.setVisible(true); } } if (tabPlacement == SwingConstants.LEFT || tabPlacement == SwingConstants.RIGHT) { if (tabAreaRect.y + tabAreaRect.height < rects[tabCount - 1].y + rects[tabCount - 1].height) { Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); decrButton.setBounds(tabAreaRect.x, tabAreaRect.y + tabAreaRect.height - incrDims.height - decrDims.height, tabAreaRect.width, decrDims.height); incrButton.setBounds(tabAreaRect.x, tabAreaRect.y + tabAreaRect.height - incrDims.height, tabAreaRect.width, incrDims.height); tabAreaRect.height -= decrDims.height + incrDims.height; incrButton.setVisible(true); decrButton.setVisible(true); } } viewport.setBounds(tabAreaRect.x, tabAreaRect.y, tabAreaRect.width, tabAreaRect.height); int tabC = tabPane.getTabCount() - 1; if (tabCount > 0) { int w = Math.max(rects[tabC].width + rects[tabC].x, tabAreaRect.width); int h = Math.max(rects[tabC].height, tabAreaRect.height); p = findPointForIndex(currentScrollLocation); // we want to cover that entire space so that borders that run under // the tab area don't show up when we move the viewport around. panel.setSize(w + p.x, h + p.y); } viewport.setViewPosition(p); viewport.repaint(); }
11,966
public Dimension preferredLayoutSize(Container parent) { return super.calculateSize(true); }
public Dimension preferredLayoutSize(Container parent) { return super.calculateSize(false); }
11,967
protected int calculateTabHeight(int tabPlacement, int tabIndex, int fontHeight) { // FIXME: Handle HTML somehow. int height = fontHeight; Icon icon = getIconForTab(tabIndex); Insets tabInsets = getTabInsets(tabPlacement, tabIndex); if (icon != null) height = Math.max(height, icon.getIconHeight()); height += tabInsets.top + tabInsets.bottom + 2; return height; }
protected int calculateTabHeight(int tabPlacement, int tabIndex, int fontHeight) { // FIXME: Handle HTML somehow. int height = fontHeight; Icon icon = getIconForTab(tabIndex); Insets tabInsets = getTabInsets(tabPlacement, tabIndex); if (icon != null) height = Math.max(height, icon.getIconHeight()); height += tabInsets.top + tabInsets.bottom + 2; return height; }
11,968
protected int calculateTabWidth(int tabPlacement, int tabIndex, FontMetrics metrics) { Icon icon = getIconForTab(tabIndex); Insets insets = getTabInsets(tabPlacement, tabIndex); int width = 0; if (icon != null) { Rectangle vr = new Rectangle(); Rectangle ir = new Rectangle(); Rectangle tr = new Rectangle(); layoutLabel(tabPlacement, getFontMetrics(), tabIndex, tabPane.getTitleAt(tabIndex), icon, vr, ir, tr, tabIndex == tabPane.getSelectedIndex()); width = tr.union(ir).width; } else width = metrics.stringWidth(tabPane.getTitleAt(tabIndex)); width += insets.left + insets.right; return width; }
protected int calculateTabWidth(int tabPlacement, int tabIndex, FontMetrics metrics) { Icon icon = getIconForTab(tabIndex); Insets insets = getTabInsets(tabPlacement, tabIndex); int width = insets.bottom + insets.right + 3; if (icon != null) { Rectangle vr = new Rectangle(); Rectangle ir = new Rectangle(); Rectangle tr = new Rectangle(); layoutLabel(tabPlacement, getFontMetrics(), tabIndex, tabPane.getTitleAt(tabIndex), icon, vr, ir, tr, tabIndex == tabPane.getSelectedIndex()); width = tr.union(ir).width; } else width = metrics.stringWidth(tabPane.getTitleAt(tabIndex)); width += insets.left + insets.right; return width; }
11,969
protected int calculateTabWidth(int tabPlacement, int tabIndex, FontMetrics metrics) { Icon icon = getIconForTab(tabIndex); Insets insets = getTabInsets(tabPlacement, tabIndex); int width = 0; if (icon != null) { Rectangle vr = new Rectangle(); Rectangle ir = new Rectangle(); Rectangle tr = new Rectangle(); layoutLabel(tabPlacement, getFontMetrics(), tabIndex, tabPane.getTitleAt(tabIndex), icon, vr, ir, tr, tabIndex == tabPane.getSelectedIndex()); width = tr.union(ir).width; } else width = metrics.stringWidth(tabPane.getTitleAt(tabIndex)); width += insets.left + insets.right; return width; }
protected int calculateTabWidth(int tabPlacement, int tabIndex, FontMetrics metrics) { Icon icon = getIconForTab(tabIndex); Insets insets = getTabInsets(tabPlacement, tabIndex); int width = 0; if (icon != null) { Rectangle vr = new Rectangle(); Rectangle ir = new Rectangle(); Rectangle tr = new Rectangle(); layoutLabel(tabPlacement, getFontMetrics(), tabIndex, tabPane.getTitleAt(tabIndex), icon, vr, ir, tr, tabIndex == tabPane.getSelectedIndex()); width = tr.union(ir).width; } else width = metrics.stringWidth(tabPane.getTitleAt(tabIndex)); width += insets.left + insets.right; return width; }
11,970
protected int calculateTabWidth(int tabPlacement, int tabIndex, FontMetrics metrics) { Icon icon = getIconForTab(tabIndex); Insets insets = getTabInsets(tabPlacement, tabIndex); int width = 0; if (icon != null) { Rectangle vr = new Rectangle(); Rectangle ir = new Rectangle(); Rectangle tr = new Rectangle(); layoutLabel(tabPlacement, getFontMetrics(), tabIndex, tabPane.getTitleAt(tabIndex), icon, vr, ir, tr, tabIndex == tabPane.getSelectedIndex()); width = tr.union(ir).width; } else width = metrics.stringWidth(tabPane.getTitleAt(tabIndex)); width += insets.left + insets.right; return width; }
protected int calculateTabWidth(int tabPlacement, int tabIndex, FontMetrics metrics) { Icon icon = getIconForTab(tabIndex); Insets insets = getTabInsets(tabPlacement, tabIndex); int width = 0; if (icon != null) { Rectangle vr = new Rectangle(); Rectangle ir = new Rectangle(); Rectangle tr = new Rectangle(); layoutLabel(tabPlacement, getFontMetrics(), tabIndex, tabPane.getTitleAt(tabIndex), icon, vr, ir, tr, tabIndex == tabPane.getSelectedIndex()); width = tr.union(ir).width; } else width = metrics.stringWidth(tabPane.getTitleAt(tabIndex)); width += insets.left + insets.right; return width; }
11,971
protected LayoutManager createLayoutManager() { if (tabPane.getTabLayoutPolicy() == JTabbedPane.WRAP_TAB_LAYOUT) return new TabbedPaneLayout(); else { incrButton = createIncreaseButton(); decrButton = createDecreaseButton(); viewport = new ScrollingViewport(); viewport.setLayout(null); panel = new ScrollingPanel(); viewport.setView(panel); tabPane.add(incrButton); tabPane.add(decrButton); tabPane.add(viewport); currentScrollLocation = 0; decrButton.setEnabled(false); panel.addMouseListener(mouseListener); incrButton.addMouseListener(mouseListener); decrButton.addMouseListener(mouseListener); viewport.setBackground(Color.LIGHT_GRAY); return new TabbedPaneScrollLayout(); } }
protected LayoutManager createLayoutManager() { if (tabPane.getTabLayoutPolicy() == JTabbedPane.WRAP_TAB_LAYOUT) return new TabbedPaneLayout(); else { incrButton = createIncreaseButton(); decrButton = createDecreaseButton(); viewport = new ScrollingViewport(); viewport.setLayout(null); panel = new ScrollingPanel(); viewport.setView(panel); tabPane.add(incrButton); tabPane.add(decrButton); tabPane.add(viewport); currentScrollLocation = 0; decrButton.setEnabled(false); panel.addMouseListener(mouseListener); incrButton.addMouseListener(mouseListener); decrButton.addMouseListener(mouseListener); viewport.setBackground(Color.LIGHT_GRAY); return new TabbedPaneScrollLayout(); } }
11,972
protected LayoutManager createLayoutManager() { if (tabPane.getTabLayoutPolicy() == JTabbedPane.WRAP_TAB_LAYOUT) return new TabbedPaneLayout(); else { incrButton = createIncreaseButton(); decrButton = createDecreaseButton(); viewport = new ScrollingViewport(); viewport.setLayout(null); panel = new ScrollingPanel(); viewport.setView(panel); tabPane.add(incrButton); tabPane.add(decrButton); tabPane.add(viewport); currentScrollLocation = 0; decrButton.setEnabled(false); panel.addMouseListener(mouseListener); incrButton.addMouseListener(mouseListener); decrButton.addMouseListener(mouseListener); viewport.setBackground(Color.LIGHT_GRAY); return new TabbedPaneScrollLayout(); } }
protected LayoutManager createLayoutManager() { if (tabPane.getTabLayoutPolicy() == JTabbedPane.WRAP_TAB_LAYOUT) return new TabbedPaneLayout(); else { incrButton = createIncreaseButton(); decrButton = createDecreaseButton(); viewport = new ScrollingViewport(); viewport.setLayout(null); panel = new ScrollingPanel(); viewport.setView(panel); tabPane.add(incrButton); tabPane.add(decrButton); tabPane.add(viewport); currentScrollLocation = 0; decrButton.setEnabled(false); panel.addMouseListener(mouseListener); incrButton.addMouseListener(mouseListener); decrButton.addMouseListener(mouseListener); viewport.setBackground(Color.LIGHT_GRAY); return new TabbedPaneScrollLayout(); } }
11,973
protected int getNextTabIndexInRun(int tabCount, int base) { int index = getNextTabIndex(base); int run = getRunForTab(tabCount, base); if (index == lastTabInRun(tabCount, run) + 1) index = lastTabInRun(tabCount, getPreviousTabRun(run)) + 1; return getNextTabIndex(base); }
protected int getNextTabIndexInRun(int tabCount, int base) { int index = getNextTabIndex(base); int run = getRunForTab(tabCount, base); if (index == lastTabInRun(tabCount, run) + 1) index = lastTabInRun(tabCount, getPreviousTabRun(run)) + 1; return getNextTabIndex(base); }
11,974
protected int getPreviousTabIndexInRun(int tabCount, int base) { int index = getPreviousTabIndex(base); int run = getRunForTab(tabCount, base); if (index == lastTabInRun(tabCount, getPreviousTabRun(run))) index = lastTabInRun(tabCount, run); return getPreviousTabIndex(base); }
protected int getPreviousTabIndexInRun(int tabCount, int base) { int index = getPreviousTabIndex(base); int run = getRunForTab(tabCount, base); if (index == lastTabInRun(tabCount, getPreviousTabRun(run))) index = lastTabInRun(tabCount, run); return index; }
11,975
protected int getRunForTab(int tabCount, int tabIndex) { if (runCount == 1 && tabIndex < tabCount && tabIndex >= 0) return 1; for (int i = 0; i < runCount; i++) { int first = lastTabInRun(tabCount, getPreviousTabRun(i)) + 1; if (first == tabCount) first = 0; int last = lastTabInRun(tabCount, i); if (last >= tabIndex && first <= tabIndex) return i; } return -1; }
protected int getRunForTab(int tabCount, int tabIndex) { if (runCount == 1 && tabIndex < tabCount && tabIndex >= 0) return 0; for (int i = 0; i < runCount; i++) { int first = lastTabInRun(tabCount, getPreviousTabRun(i)) + 1; if (first == tabCount) first = 0; int last = lastTabInRun(tabCount, i); if (last >= tabIndex && first <= tabIndex) return i; } return -1; }
11,976
protected int getTabLabelShiftX(int tabPlacement, int tabIndex, boolean isSelected) { // No reason to shift. return 0; }
protected int getTabLabelShiftX(int tabPlacement, int tabIndex, boolean isSelected) { // No reason to shift. switch (tabPlacement) { default: case SwingUtilities.TOP: case SwingUtilities.BOTTOM: return 1; case SwingUtilities.LEFT: return (isSelected) ? -1 : 1; case SwingUtilities.RIGHT: return (isSelected) ? 1 : -1; } }
11,978
protected int getTabLabelShiftY(int tabPlacement, int tabIndex, boolean isSelected) { // No reason to shift. return 0; }
switch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: switch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: protectedswitch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: intswitch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: getTabLabelShiftY(intswitch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: tabPlacement,switch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: intswitch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: tabIndex,switch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: switch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: switch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: switch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: switch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: switch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: switch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: switch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: switch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: switch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: switch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: switch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: switch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: switch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: switch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: switch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: switch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: switch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: switch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: switch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: switch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: switch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: switch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: switch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: switch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: switch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: switch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: switch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: switch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: switch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: switch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: switch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: switch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: switch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: booleanswitch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: isSelected)switch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: switch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: {switch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: switch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: switch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: switch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: //switch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: Noswitch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: reasonswitch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: toswitch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: shift.switch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: switch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: switch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: switch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: returnswitch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: 0;switch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: switch (tabPlacement) { default: case SwingUtilities.TOP: return (isSelected) ? -1 : 1; case SwingUtilities.BOTTOM: return (isSelected) ? 1 : -1; case SwingUtilities.LEFT: case SwingUtilities.RIGHT: }
11,979
protected void installDefaults() { LookAndFeel.installColorsAndFont(tabPane, "TabbedPane.background", "TabbedPane.foreground", "TabbedPane.font"); tabPane.setOpaque(false); highlight = UIManager.getColor("TabbedPane.highlight"); lightHighlight = UIManager.getColor("TabbedPane.lightHighlight"); shadow = UIManager.getColor("TabbedPane.shadow"); darkShadow = UIManager.getColor("TabbedPane.darkShadow"); focus = UIManager.getColor("TabbedPane.focus"); textIconGap = UIManager.getInt("TabbedPane.textIconGap"); tabRunOverlay = UIManager.getInt("TabbedPane.tabRunOverlay"); tabInsets = UIManager.getInsets("TabbedPane.tabInsets"); selectedTabPadInsets = UIManager.getInsets("TabbedPane.tabbedPaneTabPadInsets"); tabAreaInsets = UIManager.getInsets("TabbedPane.tabAreaInsets"); contentBorderInsets = UIManager.getInsets("TabbedPane.tabbedPaneContentBorderInsets"); tabsOpaque = UIManager.getBoolean("TabbedPane.tabsOpaque"); calcRect = new Rectangle(); tabRuns = new int[10]; tabAreaRect = new Rectangle(); contentRect = new Rectangle(); }
protected void installDefaults() { LookAndFeel.installColorsAndFont(tabPane, "TabbedPane.background", "TabbedPane.foreground", "TabbedPane.font"); tabPane.setOpaque(false); highlight = UIManager.getColor("TabbedPane.highlight"); lightHighlight = UIManager.getColor("TabbedPane.lightHighlight"); shadow = UIManager.getColor("TabbedPane.shadow"); darkShadow = UIManager.getColor("TabbedPane.darkShadow"); focus = UIManager.getColor("TabbedPane.focus"); textIconGap = UIManager.getInt("TabbedPane.textIconGap"); tabRunOverlay = UIManager.getInt("TabbedPane.tabRunOverlay"); tabInsets = UIManager.getInsets("TabbedPane.tabInsets"); selectedTabPadInsets = UIManager.getInsets("TabbedPane.tabbedPaneTabPadInsets"); tabAreaInsets = UIManager.getInsets("TabbedPane.tabAreaInsets"); contentBorderInsets = UIManager.getInsets("TabbedPane.tabbedPaneContentBorderInsets"); tabsOpaque = UIManager.getBoolean("TabbedPane.tabsOpaque"); calcRect = new Rectangle(); tabRuns = new int[10]; tabAreaRect = new Rectangle(); contentRect = new Rectangle(); }
11,983
protected void installDefaults() { LookAndFeel.installColorsAndFont(tabPane, "TabbedPane.background", "TabbedPane.foreground", "TabbedPane.font"); tabPane.setOpaque(false); highlight = UIManager.getColor("TabbedPane.highlight"); lightHighlight = UIManager.getColor("TabbedPane.lightHighlight"); shadow = UIManager.getColor("TabbedPane.shadow"); darkShadow = UIManager.getColor("TabbedPane.darkShadow"); focus = UIManager.getColor("TabbedPane.focus"); textIconGap = UIManager.getInt("TabbedPane.textIconGap"); tabRunOverlay = UIManager.getInt("TabbedPane.tabRunOverlay"); tabInsets = UIManager.getInsets("TabbedPane.tabInsets"); selectedTabPadInsets = UIManager.getInsets("TabbedPane.tabbedPaneTabPadInsets"); tabAreaInsets = UIManager.getInsets("TabbedPane.tabAreaInsets"); contentBorderInsets = UIManager.getInsets("TabbedPane.tabbedPaneContentBorderInsets"); tabsOpaque = UIManager.getBoolean("TabbedPane.tabsOpaque"); calcRect = new Rectangle(); tabRuns = new int[10]; tabAreaRect = new Rectangle(); contentRect = new Rectangle(); }
protected void installDefaults() { LookAndFeel.installColorsAndFont(tabPane, "TabbedPane.background", "TabbedPane.foreground", "TabbedPane.font"); tabPane.setOpaque(false); highlight = UIManager.getColor("TabbedPane.highlight"); lightHighlight = UIManager.getColor("TabbedPane.lightHighlight"); shadow = UIManager.getColor("TabbedPane.shadow"); darkShadow = UIManager.getColor("TabbedPane.darkShadow"); focus = UIManager.getColor("TabbedPane.focus"); textIconGap = UIManager.getInt("TabbedPane.textIconGap"); tabRunOverlay = UIManager.getInt("TabbedPane.tabRunOverlay"); tabInsets = UIManager.getInsets("TabbedPane.tabInsets"); selectedTabPadInsets = UIManager.getInsets("TabbedPane.selectedTabPadInsets"); tabAreaInsets = UIManager.getInsets("TabbedPane.tabAreaInsets"); contentBorderInsets = UIManager.getInsets("TabbedPane.tabbedPaneContentBorderInsets"); tabsOpaque = UIManager.getBoolean("TabbedPane.tabsOpaque"); calcRect = new Rectangle(); tabRuns = new int[10]; tabAreaRect = new Rectangle(); contentRect = new Rectangle(); }
11,984
protected void installDefaults() { LookAndFeel.installColorsAndFont(tabPane, "TabbedPane.background", "TabbedPane.foreground", "TabbedPane.font"); tabPane.setOpaque(false); highlight = UIManager.getColor("TabbedPane.highlight"); lightHighlight = UIManager.getColor("TabbedPane.lightHighlight"); shadow = UIManager.getColor("TabbedPane.shadow"); darkShadow = UIManager.getColor("TabbedPane.darkShadow"); focus = UIManager.getColor("TabbedPane.focus"); textIconGap = UIManager.getInt("TabbedPane.textIconGap"); tabRunOverlay = UIManager.getInt("TabbedPane.tabRunOverlay"); tabInsets = UIManager.getInsets("TabbedPane.tabInsets"); selectedTabPadInsets = UIManager.getInsets("TabbedPane.tabbedPaneTabPadInsets"); tabAreaInsets = UIManager.getInsets("TabbedPane.tabAreaInsets"); contentBorderInsets = UIManager.getInsets("TabbedPane.tabbedPaneContentBorderInsets"); tabsOpaque = UIManager.getBoolean("TabbedPane.tabsOpaque"); calcRect = new Rectangle(); tabRuns = new int[10]; tabAreaRect = new Rectangle(); contentRect = new Rectangle(); }
protected void installDefaults() { LookAndFeel.installColorsAndFont(tabPane, "TabbedPane.background", "TabbedPane.foreground", "TabbedPane.font"); tabPane.setOpaque(false); highlight = UIManager.getColor("TabbedPane.highlight"); lightHighlight = UIManager.getColor("TabbedPane.lightHighlight"); shadow = UIManager.getColor("TabbedPane.shadow"); darkShadow = UIManager.getColor("TabbedPane.darkShadow"); focus = UIManager.getColor("TabbedPane.focus"); textIconGap = UIManager.getInt("TabbedPane.textIconGap"); tabRunOverlay = UIManager.getInt("TabbedPane.tabRunOverlay"); tabInsets = UIManager.getInsets("TabbedPane.tabInsets"); selectedTabPadInsets = UIManager.getInsets("TabbedPane.tabbedPaneTabPadInsets"); tabAreaInsets = UIManager.getInsets("TabbedPane.tabAreaInsets"); contentBorderInsets = UIManager.getInsets("TabbedPane.contentBorderInsets"); tabsOpaque = UIManager.getBoolean("TabbedPane.tabsOpaque"); calcRect = new Rectangle(); tabRuns = new int[10]; tabAreaRect = new Rectangle(); contentRect = new Rectangle(); }
11,985
protected void installKeyboardActions() throws NotImplementedException { // FIXME: Implement. }
protected void installKeyboardActions() { // FIXME: Implement. }
11,987
protected void installKeyboardActions() throws NotImplementedException { // FIXME: Implement. }
InputMap keyMap = (InputMap) UIManager.get("TabbedPane.focusInputMap"); SwingUtilities.replaceUIInputMap(tabPane, JComponent.WHEN_FOCUSED, keyMap); keyMap = (InputMap) UIManager.get("TabbedPane.ancestorInputMap"); SwingUtilities .replaceUIInputMap(tabPane, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, keyMap); ActionMap map = getActionMap(); SwingUtilities.replaceUIActionMap(tabPane, map); InputMap keyMap = (InputMap) UIManager.get("TabbedPane.focusInputMap"); SwingUtilities.replaceUIInputMap(tabPane, JComponent.WHEN_FOCUSED, keyMap); keyMap = (InputMap) UIManager.get("TabbedPane.ancestorInputMap"); SwingUtilities .replaceUIInputMap(tabPane, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, keyMap); ActionMap map = getActionMap(); SwingUtilities.replaceUIActionMap(tabPane, map); protectedInputMap keyMap = (InputMap) UIManager.get("TabbedPane.focusInputMap"); SwingUtilities.replaceUIInputMap(tabPane, JComponent.WHEN_FOCUSED, keyMap); keyMap = (InputMap) UIManager.get("TabbedPane.ancestorInputMap"); SwingUtilities .replaceUIInputMap(tabPane, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, keyMap); ActionMap map = getActionMap(); SwingUtilities.replaceUIActionMap(tabPane, map); voidInputMap keyMap = (InputMap) UIManager.get("TabbedPane.focusInputMap"); SwingUtilities.replaceUIInputMap(tabPane, JComponent.WHEN_FOCUSED, keyMap); keyMap = (InputMap) UIManager.get("TabbedPane.ancestorInputMap"); SwingUtilities .replaceUIInputMap(tabPane, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, keyMap); ActionMap map = getActionMap(); SwingUtilities.replaceUIActionMap(tabPane, map); installKeyboardActions()InputMap keyMap = (InputMap) UIManager.get("TabbedPane.focusInputMap"); SwingUtilities.replaceUIInputMap(tabPane, JComponent.WHEN_FOCUSED, keyMap); keyMap = (InputMap) UIManager.get("TabbedPane.ancestorInputMap"); SwingUtilities .replaceUIInputMap(tabPane, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, keyMap); ActionMap map = getActionMap(); SwingUtilities.replaceUIActionMap(tabPane, map); InputMap keyMap = (InputMap) UIManager.get("TabbedPane.focusInputMap"); SwingUtilities.replaceUIInputMap(tabPane, JComponent.WHEN_FOCUSED, keyMap); keyMap = (InputMap) UIManager.get("TabbedPane.ancestorInputMap"); SwingUtilities .replaceUIInputMap(tabPane, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, keyMap); ActionMap map = getActionMap(); SwingUtilities.replaceUIActionMap(tabPane, map); InputMap keyMap = (InputMap) UIManager.get("TabbedPane.focusInputMap"); SwingUtilities.replaceUIInputMap(tabPane, JComponent.WHEN_FOCUSED, keyMap); keyMap = (InputMap) UIManager.get("TabbedPane.ancestorInputMap"); SwingUtilities .replaceUIInputMap(tabPane, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, keyMap); ActionMap map = getActionMap(); SwingUtilities.replaceUIActionMap(tabPane, map); InputMap keyMap = (InputMap) UIManager.get("TabbedPane.focusInputMap"); SwingUtilities.replaceUIInputMap(tabPane, JComponent.WHEN_FOCUSED, keyMap); keyMap = (InputMap) UIManager.get("TabbedPane.ancestorInputMap"); SwingUtilities .replaceUIInputMap(tabPane, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, keyMap); ActionMap map = getActionMap(); SwingUtilities.replaceUIActionMap(tabPane, map); throwsInputMap keyMap = (InputMap) UIManager.get("TabbedPane.focusInputMap"); SwingUtilities.replaceUIInputMap(tabPane, JComponent.WHEN_FOCUSED, keyMap); keyMap = (InputMap) UIManager.get("TabbedPane.ancestorInputMap"); SwingUtilities .replaceUIInputMap(tabPane, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, keyMap); ActionMap map = getActionMap(); SwingUtilities.replaceUIActionMap(tabPane, map); NotImplementedExceptionInputMap keyMap = (InputMap) UIManager.get("TabbedPane.focusInputMap"); SwingUtilities.replaceUIInputMap(tabPane, JComponent.WHEN_FOCUSED, keyMap); keyMap = (InputMap) UIManager.get("TabbedPane.ancestorInputMap"); SwingUtilities .replaceUIInputMap(tabPane, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, keyMap); ActionMap map = getActionMap(); SwingUtilities.replaceUIActionMap(tabPane, map); InputMap keyMap = (InputMap) UIManager.get("TabbedPane.focusInputMap"); SwingUtilities.replaceUIInputMap(tabPane, JComponent.WHEN_FOCUSED, keyMap); keyMap = (InputMap) UIManager.get("TabbedPane.ancestorInputMap"); SwingUtilities .replaceUIInputMap(tabPane, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, keyMap); ActionMap map = getActionMap(); SwingUtilities.replaceUIActionMap(tabPane, map); {InputMap keyMap = (InputMap) UIManager.get("TabbedPane.focusInputMap"); SwingUtilities.replaceUIInputMap(tabPane, JComponent.WHEN_FOCUSED, keyMap); keyMap = (InputMap) UIManager.get("TabbedPane.ancestorInputMap"); SwingUtilities .replaceUIInputMap(tabPane, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, keyMap); ActionMap map = getActionMap(); SwingUtilities.replaceUIActionMap(tabPane, map); InputMap keyMap = (InputMap) UIManager.get("TabbedPane.focusInputMap"); SwingUtilities.replaceUIInputMap(tabPane, JComponent.WHEN_FOCUSED, keyMap); keyMap = (InputMap) UIManager.get("TabbedPane.ancestorInputMap"); SwingUtilities .replaceUIInputMap(tabPane, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, keyMap); ActionMap map = getActionMap(); SwingUtilities.replaceUIActionMap(tabPane, map); InputMap keyMap = (InputMap) UIManager.get("TabbedPane.focusInputMap"); SwingUtilities.replaceUIInputMap(tabPane, JComponent.WHEN_FOCUSED, keyMap); keyMap = (InputMap) UIManager.get("TabbedPane.ancestorInputMap"); SwingUtilities .replaceUIInputMap(tabPane, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, keyMap); ActionMap map = getActionMap(); SwingUtilities.replaceUIActionMap(tabPane, map); InputMap keyMap = (InputMap) UIManager.get("TabbedPane.focusInputMap"); SwingUtilities.replaceUIInputMap(tabPane, JComponent.WHEN_FOCUSED, keyMap); keyMap = (InputMap) UIManager.get("TabbedPane.ancestorInputMap"); SwingUtilities .replaceUIInputMap(tabPane, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, keyMap); ActionMap map = getActionMap(); SwingUtilities.replaceUIActionMap(tabPane, map); //InputMap keyMap = (InputMap) UIManager.get("TabbedPane.focusInputMap"); SwingUtilities.replaceUIInputMap(tabPane, JComponent.WHEN_FOCUSED, keyMap); keyMap = (InputMap) UIManager.get("TabbedPane.ancestorInputMap"); SwingUtilities .replaceUIInputMap(tabPane, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, keyMap); ActionMap map = getActionMap(); SwingUtilities.replaceUIActionMap(tabPane, map); FIXME:InputMap keyMap = (InputMap) UIManager.get("TabbedPane.focusInputMap"); SwingUtilities.replaceUIInputMap(tabPane, JComponent.WHEN_FOCUSED, keyMap); keyMap = (InputMap) UIManager.get("TabbedPane.ancestorInputMap"); SwingUtilities .replaceUIInputMap(tabPane, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, keyMap); ActionMap map = getActionMap(); SwingUtilities.replaceUIActionMap(tabPane, map); Implement.InputMap keyMap = (InputMap) UIManager.get("TabbedPane.focusInputMap"); SwingUtilities.replaceUIInputMap(tabPane, JComponent.WHEN_FOCUSED, keyMap); keyMap = (InputMap) UIManager.get("TabbedPane.ancestorInputMap"); SwingUtilities .replaceUIInputMap(tabPane, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, keyMap); ActionMap map = getActionMap(); SwingUtilities.replaceUIActionMap(tabPane, map); InputMap keyMap = (InputMap) UIManager.get("TabbedPane.focusInputMap"); SwingUtilities.replaceUIInputMap(tabPane, JComponent.WHEN_FOCUSED, keyMap); keyMap = (InputMap) UIManager.get("TabbedPane.ancestorInputMap"); SwingUtilities .replaceUIInputMap(tabPane, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, keyMap); ActionMap map = getActionMap(); SwingUtilities.replaceUIActionMap(tabPane, map); }
11,988
protected void layoutLabel(int tabPlacement, FontMetrics metrics, int tabIndex, String title, Icon icon, Rectangle tabRect, Rectangle iconRect, Rectangle textRect, boolean isSelected) { SwingUtilities.layoutCompoundLabel(metrics, title, icon, SwingConstants.CENTER, SwingConstants.CENTER, SwingConstants.CENTER, SwingConstants.RIGHT, tabRect, iconRect, textRect, textIconGap); int shiftX = getTabLabelShiftX(tabPlacement, tabIndex, isSelected); int shiftY = getTabLabelShiftY(tabPlacement, tabIndex, isSelected); iconRect.x += shiftX; iconRect.y += shiftY; textRect.x += shiftX; textRect.y += shiftY; }
protected void layoutLabel(int tabPlacement, FontMetrics metrics, int tabIndex, String title, Icon icon, Rectangle tabRect, Rectangle iconRect, Rectangle textRect, boolean isSelected) { textRect.x = 0; textRect.y = 0; textRect.width = 0; textRect.height = 0; iconRect.x = 0; iconRect.y = 0; iconRect.width = 0; iconRect.height = 0; SwingUtilities.layoutCompoundLabel(tabPane, metrics, title, icon, SwingConstants.CENTER, SwingConstants.CENTER, SwingConstants.CENTER, SwingConstants.RIGHT, tabRect, iconRect, textRect, textIconGap); int shiftX = getTabLabelShiftX(tabPlacement, tabIndex, isSelected); int shiftY = getTabLabelShiftY(tabPlacement, tabIndex, isSelected); iconRect.x += shiftX; iconRect.y += shiftY; textRect.x += shiftX; textRect.y += shiftY; }
11,989
protected void navigateSelectedTab(int direction) { int tabPlacement = tabPane.getTabPlacement(); if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { if (direction == SwingConstants.WEST) selectPreviousTabInRun(tabPane.getSelectedIndex()); else if (direction == SwingConstants.EAST) selectNextTabInRun(tabPane.getSelectedIndex()); else { int offset = getTabRunOffset(tabPlacement, tabPane.getTabCount(), tabPane.getSelectedIndex(), (tabPlacement == SwingConstants.RIGHT) ? true : false); selectAdjacentRunTab(tabPlacement, tabPane.getSelectedIndex(), offset); } } if (tabPlacement == SwingConstants.LEFT || tabPlacement == SwingConstants.RIGHT) { if (direction == SwingConstants.NORTH) selectPreviousTabInRun(tabPane.getSelectedIndex()); else if (direction == SwingConstants.SOUTH) selectNextTabInRun(tabPane.getSelectedIndex()); else { int offset = getTabRunOffset(tabPlacement, tabPane.getTabCount(), tabPane.getSelectedIndex(), (tabPlacement == SwingConstants.RIGHT) ? true : false); selectAdjacentRunTab(tabPlacement, tabPane.getSelectedIndex(), offset); } } }
protected void navigateSelectedTab(int direction) { int tabPlacement = tabPane.getTabPlacement(); if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { if (direction == SwingConstants.WEST) selectPreviousTabInRun(tabPane.getSelectedIndex()); else if (direction == SwingConstants.EAST) selectNextTabInRun(tabPane.getSelectedIndex()); else { int offset = getTabRunOffset(tabPlacement, tabPane.getTabCount(), tabPane.getSelectedIndex(), (tabPlacement == SwingConstants.RIGHT) ? true : false); selectAdjacentRunTab(tabPlacement, tabPane.getSelectedIndex(), offset); } } if (tabPlacement == SwingConstants.LEFT || tabPlacement == SwingConstants.RIGHT) { if (direction == SwingConstants.NORTH) selectPreviousTabInRun(tabPane.getSelectedIndex()); else if (direction == SwingConstants.SOUTH) selectNextTabInRun(tabPane.getSelectedIndex()); else { int offset = getTabRunOffset(tabPlacement, tabPane.getTabCount(), tabPane.getSelectedIndex(), (tabPlacement == SwingConstants.RIGHT) ? true : false); selectAdjacentRunTab(tabPlacement, tabPane.getSelectedIndex(), offset); } } }
11,990
protected void navigateSelectedTab(int direction) { int tabPlacement = tabPane.getTabPlacement(); if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { if (direction == SwingConstants.WEST) selectPreviousTabInRun(tabPane.getSelectedIndex()); else if (direction == SwingConstants.EAST) selectNextTabInRun(tabPane.getSelectedIndex()); else { int offset = getTabRunOffset(tabPlacement, tabPane.getTabCount(), tabPane.getSelectedIndex(), (tabPlacement == SwingConstants.RIGHT) ? true : false); selectAdjacentRunTab(tabPlacement, tabPane.getSelectedIndex(), offset); } } if (tabPlacement == SwingConstants.LEFT || tabPlacement == SwingConstants.RIGHT) { if (direction == SwingConstants.NORTH) selectPreviousTabInRun(tabPane.getSelectedIndex()); else if (direction == SwingConstants.SOUTH) selectNextTabInRun(tabPane.getSelectedIndex()); else { int offset = getTabRunOffset(tabPlacement, tabPane.getTabCount(), tabPane.getSelectedIndex(), (tabPlacement == SwingConstants.RIGHT) ? true : false); selectAdjacentRunTab(tabPlacement, tabPane.getSelectedIndex(), offset); } } }
protected void navigateSelectedTab(int direction) { int tabPlacement = tabPane.getTabPlacement(); if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { if (direction == SwingConstants.WEST) selectPreviousTabInRun(tabPane.getSelectedIndex()); else if (direction == SwingConstants.EAST) selectNextTabInRun(tabPane.getSelectedIndex()); else { int offset = getTabRunOffset(tabPlacement, tabPane.getTabCount(), tabPane.getSelectedIndex(), (tabPlacement == SwingConstants.RIGHT) ? true : false); selectAdjacentRunTab(tabPlacement, tabPane.getSelectedIndex(), offset); } } if (tabPlacement == SwingConstants.LEFT || tabPlacement == SwingConstants.RIGHT) { if (direction == SwingConstants.NORTH) selectPreviousTabInRun(tabPane.getSelectedIndex()); else if (direction == SwingConstants.SOUTH) selectNextTabInRun(tabPane.getSelectedIndex()); else { int offset = getTabRunOffset(tabPlacement, tabPane.getTabCount(), tabPane.getSelectedIndex(), (tabPlacement == SwingConstants.RIGHT) ? true : false); selectAdjacentRunTab(tabPlacement, tabPane.getSelectedIndex(), offset); } } }
11,991
public void paint(Graphics g, JComponent c) { if (!tabPane.isValid()) tabPane.validate(); if (tabPane.getTabCount() == 0) return; if (tabPane.getTabLayoutPolicy() == JTabbedPane.WRAP_TAB_LAYOUT) paintTabArea(g, tabPane.getTabPlacement(), tabPane.getSelectedIndex()); paintContentBorder(g, tabPane.getTabPlacement(), tabPane.getSelectedIndex()); }
public void paint(Graphics g, JComponent c) { if (!tabPane.isValid()) tabPane.validate(); if (tabPane.getTabCount() == 0) return; if (tabPane.getTabLayoutPolicy() == JTabbedPane.WRAP_TAB_LAYOUT) paintTabArea(g, tabPane.getTabPlacement(), tabPane.getSelectedIndex()); paintContentBorder(g, tabPane.getTabPlacement(), tabPane.getSelectedIndex()); }
11,992
protected void paintContentBorder(Graphics g, int tabPlacement, int selectedIndex) { int width = tabPane.getWidth(); int height = tabPane.getHeight(); Insets insets = tabPane.getInsets(); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); // Calculate coordinates of content area. int x = insets.left; int y = insets.top; int w = width - insets.left - insets.right; int h = height - insets.top - insets.bottom; switch (tabPlacement) { case LEFT: x += calculateTabAreaWidth(tabPlacement, runCount, maxTabWidth); w -= x - insets.left; break; case RIGHT: w -= calculateTabAreaWidth(tabPlacement, runCount, maxTabWidth); break; case BOTTOM: h -= calculateTabAreaHeight(tabPlacement, runCount, maxTabHeight); break; case TOP: default: y += calculateTabAreaHeight(tabPlacement, runCount, maxTabHeight); h -= y - insets.top; } // Fill background if necessary. if (tabPane.isOpaque()) { Color bg = UIManager.getColor("TabbedPane.contentAreaColor"); g.setColor(bg); g.fillRect(x, y, w, h); } // Paint border. paintContentBorderTopEdge(g, tabPlacement, selectedIndex, x, y, w, h); paintContentBorderLeftEdge(g, tabPlacement, selectedIndex, x, y, w, h); paintContentBorderBottomEdge(g, tabPlacement, selectedIndex, x, y, w, h); paintContentBorderRightEdge(g, tabPlacement, selectedIndex, x, y, w, h); }
protected void paintContentBorder(Graphics g, int tabPlacement, int selectedIndex) { int width = tabPane.getWidth(); int height = tabPane.getHeight(); Insets insets = tabPane.getInsets(); // Calculate coordinates of content area. int x = insets.left; int y = insets.top; int w = width - insets.left - insets.right; int h = height - insets.top - insets.bottom; switch (tabPlacement) { case LEFT: x += calculateTabAreaWidth(tabPlacement, runCount, maxTabWidth); w -= x - insets.left; break; case RIGHT: w -= calculateTabAreaWidth(tabPlacement, runCount, maxTabWidth); break; case BOTTOM: h -= calculateTabAreaHeight(tabPlacement, runCount, maxTabHeight); break; case TOP: default: y += calculateTabAreaHeight(tabPlacement, runCount, maxTabHeight); h -= y - insets.top; } // Fill background if necessary. if (tabPane.isOpaque()) { Color bg = UIManager.getColor("TabbedPane.contentAreaColor"); g.setColor(bg); g.fillRect(x, y, w, h); } // Paint border. paintContentBorderTopEdge(g, tabPlacement, selectedIndex, x, y, w, h); paintContentBorderLeftEdge(g, tabPlacement, selectedIndex, x, y, w, h); paintContentBorderBottomEdge(g, tabPlacement, selectedIndex, x, y, w, h); paintContentBorderRightEdge(g, tabPlacement, selectedIndex, x, y, w, h); }
11,993
protected void paintContentBorderBottomEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); int startgap = rects[selectedIndex].x; int endgap = rects[selectedIndex].x + rects[selectedIndex].width; int diff = 0; if (tabPlacement == SwingConstants.BOTTOM) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.x; } g.setColor(shadow); g.drawLine(x + 1, y + h - 1, startgap - diff, y + h - 1); g.drawLine(endgap - diff, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, startgap - diff, y + h); g.drawLine(endgap - diff, y + h, x + w, y + h); } else { g.setColor(shadow); g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } g.setColor(saved); }
protected void paintContentBorderBottomEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); int startgap = rects[selectedIndex].x; int endgap = rects[selectedIndex].x + rects[selectedIndex].width; int diff = 0; if (tabPlacement == SwingConstants.BOTTOM) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.x; } g.setColor(shadow); g.drawLine(x + 1, y + h - 1, startgap - diff, y + h - 1); g.drawLine(endgap - diff, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, startgap - diff, y + h); g.drawLine(endgap - diff, y + h, x + w, y + h); } else { g.setColor(shadow); g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } g.setColor(saved); }
11,994
protected void paintContentBorderBottomEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); int startgap = rects[selectedIndex].x; int endgap = rects[selectedIndex].x + rects[selectedIndex].width; int diff = 0; if (tabPlacement == SwingConstants.BOTTOM) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.x; } g.setColor(shadow); g.drawLine(x + 1, y + h - 1, startgap - diff, y + h - 1); g.drawLine(endgap - diff, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, startgap - diff, y + h); g.drawLine(endgap - diff, y + h, x + w, y + h); } else { g.setColor(shadow); g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } g.setColor(saved); }
protected void paintContentBorderBottomEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); int startgap = rects[selectedIndex].x; int endgap = rects[selectedIndex].x + rects[selectedIndex].width; int diff = 0; if (tabPlacement == SwingConstants.BOTTOM) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.x; } g.setColor(shadow); g.drawLine(x + 1, y + h - 1, startgap - diff, y + h - 1); g.drawLine(endgap - diff, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, startgap - diff, y + h); g.drawLine(endgap - diff, y + h, x + w, y + h); } else { g.setColor(shadow); g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } g.setColor(saved); }
11,995
protected void paintContentBorderBottomEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); int startgap = rects[selectedIndex].x; int endgap = rects[selectedIndex].x + rects[selectedIndex].width; int diff = 0; if (tabPlacement == SwingConstants.BOTTOM) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.x; } g.setColor(shadow); g.drawLine(x + 1, y + h - 1, startgap - diff, y + h - 1); g.drawLine(endgap - diff, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, startgap - diff, y + h); g.drawLine(endgap - diff, y + h, x + w, y + h); } else { g.setColor(shadow); g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } g.setColor(saved); }
protected void paintContentBorderBottomEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); int startgap = rects[selectedIndex].x; int endgap = rects[selectedIndex].x + rects[selectedIndex].width; int diff = 0; if (tabPlacement == SwingConstants.BOTTOM) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.x; } g.setColor(shadow); g.drawLine(x + 1, y + h - 1, startgap - diff, y + h - 1); g.drawLine(endgap - diff, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, startgap - diff, y + h); g.drawLine(endgap - diff, y + h, x + w, y + h); } else { g.setColor(shadow); g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } g.setColor(saved); }
11,996
protected void paintContentBorderBottomEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); int startgap = rects[selectedIndex].x; int endgap = rects[selectedIndex].x + rects[selectedIndex].width; int diff = 0; if (tabPlacement == SwingConstants.BOTTOM) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.x; } g.setColor(shadow); g.drawLine(x + 1, y + h - 1, startgap - diff, y + h - 1); g.drawLine(endgap - diff, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, startgap - diff, y + h); g.drawLine(endgap - diff, y + h, x + w, y + h); } else { g.setColor(shadow); g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } g.setColor(saved); }
protected void paintContentBorderBottomEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); int startgap = rects[selectedIndex].x; int endgap = rects[selectedIndex].x + rects[selectedIndex].width; int diff = 0; if (tabPlacement == SwingConstants.BOTTOM) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.x; } g.setColor(shadow); g.drawLine(x + 1, y + h - 1, startgap - diff, y + h - 1); g.drawLine(endgap - diff, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, startgap - diff, y + h); g.drawLine(endgap - diff, y + h, x + w, y + h); } else { g.setColor(shadow); g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } g.setColor(saved); }
11,997
protected void paintContentBorderBottomEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); int startgap = rects[selectedIndex].x; int endgap = rects[selectedIndex].x + rects[selectedIndex].width; int diff = 0; if (tabPlacement == SwingConstants.BOTTOM) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.x; } g.setColor(shadow); g.drawLine(x + 1, y + h - 1, startgap - diff, y + h - 1); g.drawLine(endgap - diff, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, startgap - diff, y + h); g.drawLine(endgap - diff, y + h, x + w, y + h); } else { g.setColor(shadow); g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } g.setColor(saved); }
protected void paintContentBorderBottomEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); int startgap = rects[selectedIndex].x; int endgap = rects[selectedIndex].x + rects[selectedIndex].width; int diff = 0; if (tabPlacement == SwingConstants.BOTTOM) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.x; } g.setColor(shadow); g.drawLine(x + 1, y + h - 1, startgap - diff, y + h - 1); g.drawLine(endgap - diff, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, startgap - diff, y + h); g.drawLine(endgap - diff, y + h, x + w, y + h); } else { g.setColor(shadow); g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } g.setColor(saved); }
11,998
protected void paintContentBorderBottomEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); int startgap = rects[selectedIndex].x; int endgap = rects[selectedIndex].x + rects[selectedIndex].width; int diff = 0; if (tabPlacement == SwingConstants.BOTTOM) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.x; } g.setColor(shadow); g.drawLine(x + 1, y + h - 1, startgap - diff, y + h - 1); g.drawLine(endgap - diff, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, startgap - diff, y + h); g.drawLine(endgap - diff, y + h, x + w, y + h); } else { g.setColor(shadow); g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } g.setColor(saved); }
protected void paintContentBorderBottomEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); int startgap = rects[selectedIndex].x; int endgap = rects[selectedIndex].x + rects[selectedIndex].width; int diff = 0; if (tabPlacement == SwingConstants.BOTTOM) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.x; } g.setColor(shadow); g.drawLine(x + 1, y + h - 1, startgap - diff, y + h - 1); g.drawLine(endgap - diff, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, startgap - diff, y + h); g.drawLine(endgap - diff, y + h, x + w, y + h); } else { g.setColor(shadow); g.drawLine(x + 1, y + h - 2, x + w - 1, y + h - 2); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } g.setColor(saved); }
11,999
protected void paintContentBorderBottomEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); int startgap = rects[selectedIndex].x; int endgap = rects[selectedIndex].x + rects[selectedIndex].width; int diff = 0; if (tabPlacement == SwingConstants.BOTTOM) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.x; } g.setColor(shadow); g.drawLine(x + 1, y + h - 1, startgap - diff, y + h - 1); g.drawLine(endgap - diff, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, startgap - diff, y + h); g.drawLine(endgap - diff, y + h, x + w, y + h); } else { g.setColor(shadow); g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } g.setColor(saved); }
protected void paintContentBorderBottomEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); int startgap = rects[selectedIndex].x; int endgap = rects[selectedIndex].x + rects[selectedIndex].width; int diff = 0; if (tabPlacement == SwingConstants.BOTTOM) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.x; } g.setColor(shadow); g.drawLine(x + 1, y + h - 1, startgap - diff, y + h - 1); g.drawLine(endgap - diff, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, startgap - diff, y + h); g.drawLine(endgap - diff, y + h, x + w, y + h); } else { g.setColor(shadow); g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h - 1, x + w - 1, y + h - 1); } g.setColor(saved); }
12,000