本文整理了Java中javax.swing.JTabbedPane.getHeight()
方法的一些代码示例,展示了JTabbedPane.getHeight()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTabbedPane.getHeight()
方法的具体详情如下:
包路径:javax.swing.JTabbedPane
类名称:JTabbedPane
方法名:getHeight
暂无
代码示例来源:origin: com.eas.platypus/platypus-js-forms
@ScriptFunction(jsDoc = HEIGHT_JSDOC)
@Override
public int getHeight() {
return super.getHeight();
}
代码示例来源:origin: edu.toronto.cs.medsavant/medsavant-client
private void checkRollOver() {
int currentRollOver = getRolloverTab();
if (currentRollOver != lastRollOverTab) {
lastRollOverTab = currentRollOver;
Rectangle tabsRect = new Rectangle(0, 0, tabPane.getWidth(), tabPane.getHeight());
tabPane.repaint(tabsRect);
}
}
}
代码示例来源:origin: edu.toronto.cs.medsavant/medsavant-client
protected void paintTabArea(Graphics g, int tabPlacement, int selectedIndex) {
Graphics2D g2d = (Graphics2D) g;
g2d.setColor(defaultColorSet);
g2d.fillRect(0, 0, tabPane.getWidth(), tabPane.getHeight());
super.paintTabArea(g, tabPlacement, selectedIndex);
g2d.setColor(lineColor);
g2d.drawLine(0, tabHeight-1, tabPane.getWidth() - 1, tabHeight);
}
代码示例来源:origin: edu.toronto.cs.medsavant/medsavant-client
private void checkRollOver() {
int currentRollOver = getRolloverTab();
if (currentRollOver != lastRollOverTab) {
lastRollOverTab = currentRollOver;
Rectangle tabsRect = new Rectangle(0, 0, tabPane.getWidth(), tabPane.getHeight());
tabPane.repaint(tabsRect);
}
}
}
代码示例来源:origin: khuxtable/seaglass
/**
* Set the position of the tab container that is used to layout custom tab components.
*/
private void setTabContainerBounds() {
Component tabContainer = getTabContainer();
if (tabContainer != null) {
int tabContainerX = tabPlacement == RIGHT ? contentRect.width : 0;
int tabContainerY = tabPlacement == BOTTOM ? contentRect.height : 0;
int tabContainerWidth = tabPlacement == LEFT || tabPlacement == RIGHT ? tabPane.getWidth() - contentRect.width : contentRect.width;
int tabContainerHeight = tabPlacement == TOP || tabPlacement == BOTTOM ? tabPane.getHeight() - contentRect.height : contentRect.height;
tabContainer.setBounds(tabContainerX, tabContainerY, tabContainerWidth, tabContainerHeight);
}
}
代码示例来源:origin: edu.toronto.cs.medsavant/medsavant-client
protected void paintTabArea(Graphics g, int tabPlacement, int selectedIndex) {
Graphics2D g2d = (Graphics2D) g;
g2d.setColor(unselectedColor);
g2d.fillRect(0, 0, tabPane.getWidth(), tabPane.getHeight());
super.paintTabArea(g, tabPlacement, selectedIndex);
g2d.setColor(lineColor);
g2d.drawLine(0, tabHeight-1, tabPane.getWidth() - 1, tabHeight);
}
代码示例来源:origin: com.jtattoo/JTattoo
protected int calculateTabAreaHeight(int tabPlacement, int horizRunCount, int maxTabHeight) {
if (tabPlacement == JTabbedPane.TOP || tabPlacement == JTabbedPane.BOTTOM) {
Insets insets = getTabAreaInsets(tabPlacement);
int overlay = getTabRunOverlay(tabPlacement);
return (horizRunCount > 0 ? horizRunCount * (maxTabHeight - overlay) + overlay + insets.top + insets.bottom : 0);
} else {
return tabPane.getHeight();
}
}
代码示例来源:origin: datacleaner/DataCleaner
/**
* Paints the border for the tab's content, ie. the area below the tabs
*/
@Override
protected void paintContentBorder(final Graphics g, final int tabPlacement, final int tabIndex) {
final int w = tabPane.getWidth();
final int h = tabPane.getHeight();
final Insets tabAreaInsets = getTabAreaInsets(tabPlacement);
final int x = 0;
final int y = calculateTabAreaHeight(tabPlacement, runCount, maxTabHeight) + tabAreaInsets.bottom;
g.setColor(_tabSelectedBackgroundColor);
g.fillRect(x, y, w, h);
g.setColor(_tabBorderColor);
// top line, except below selected tab
final Rectangle selectTabBounds = getTabBounds(tabPane, tabIndex);
g.drawLine(x, y, selectTabBounds.x, y);
g.drawLine(selectTabBounds.x + selectTabBounds.width, y, x + w, y);
}
代码示例来源:origin: org.java.net.substance/substance
@Override
protected void paintTabArea(Graphics g, int tabPlacement, int selectedIndex) {
if (this.substanceContentOpaque) {
int width = calculateTabAreaWidth(tabPlacement, runCount,
maxTabWidth);
if ((tabPlacement == SwingConstants.TOP)
|| (tabPlacement == SwingConstants.BOTTOM))
width = Math.max(width, tabPane.getWidth());
int height = calculateTabAreaHeight(tabPlacement, runCount,
maxTabHeight);
if (toRotateTabsOnPlacement(tabPlacement))
height = Math.max(height, tabPane.getHeight());
// restrict the painting to the tab area only
Graphics2D g2d = (Graphics2D) g.create(0, 0, width, height);
BackgroundPaintingUtils.update(g2d, this.tabPane, true);
g2d.dispose();
}
super.paintTabArea(g, tabPlacement, selectedIndex);
}
代码示例来源:origin: com.github.insubstantial/substance
@Override
protected void paintTabArea(Graphics g, int tabPlacement, int selectedIndex) {
if (this.substanceContentOpaque) {
int width = calculateTabAreaWidth(tabPlacement, runCount,
maxTabWidth);
if ((tabPlacement == SwingConstants.TOP)
|| (tabPlacement == SwingConstants.BOTTOM))
width = Math.max(width, tabPane.getWidth());
int height = calculateTabAreaHeight(tabPlacement, runCount,
maxTabHeight);
if (toRotateTabsOnPlacement(tabPlacement))
height = Math.max(height, tabPane.getHeight());
// restrict the painting to the tab area only
Graphics2D g2d = (Graphics2D) g.create(0, 0, width, height);
BackgroundPaintingUtils.update(g2d, this.tabPane, true);
g2d.dispose();
}
super.paintTabArea(g, tabPlacement, selectedIndex);
}
代码示例来源:origin: UNIVALI-LITE/Portugol-Studio
@Override
protected void paintContentBorder(Graphics g, int tabPlacement, int selectedIndex) {
// super.paintContentBorder(g, tabPlacement, selectedIndex);
int width = tabPane.getWidth();
int height = tabPane.getHeight();
Insets insets = tabPane.getInsets();
Insets tabAreaInsets = getTabAreaInsets(tabPlacement);
int x = insets.left;
int y = insets.top;
int w = width - insets.right - insets.left;
int h = height - insets.top - insets.bottom;
y += calculateTabAreaHeight(tabPlacement, runCount, maxTabHeight);
y -= tabAreaInsets.bottom;
h -= (y - insets.top);
if ( tabPane.getTabCount() > 0) {
// Fill region behind content area
g.setColor(ColorController.COR_PRINCIPAL);
g.fillRect(x,y,w,h);
}
}
代码示例来源:origin: UNIVALI-LITE/Portugol-Studio
@Override
protected void paintContentBorder(Graphics g, int tabPlacement, int selectedIndex) {
// super.paintContentBorder(g, tabPlacement, selectedIndex);
int width = tabPane.getWidth();
int height = tabPane.getHeight();
Insets insets = tabPane.getInsets();
Insets tabAreaInsets = getTabAreaInsets(tabPlacement);
int x = insets.left;
int y = insets.top;
int w = width - insets.right - insets.left;
int h = height - insets.top - insets.bottom;
y += calculateTabAreaHeight(tabPlacement, runCount, maxTabHeight);
y -= tabAreaInsets.bottom;
h -= (y - insets.top);
if ( tabPane.getTabCount() > 0) {
// Fill region behind content area
g.setColor(ColorController.COR_CONSOLE);
g.fillRect(x,y,w,h);
}
}
代码示例来源:origin: UNIVALI-LITE/Portugol-Studio
public Shape getContentClip ()
{
Shape clip = null;
final int tabPlacement = tabPane.getTabPlacement ();
final int tabAreaLength = getTabAreaLength ( tabPlacement );
final Insets insets = tabPane.getInsets ();
if ( tabPlacement == JTabbedPane.TOP )
{
clip = new RoundRectangle2D.Double ( insets.left, insets.top + tabAreaLength, tabPane.getWidth () - insets.left - insets.right,
tabPane.getHeight () - insets.top - tabAreaLength - insets.bottom, round * 2, round * 2 );
}
else if ( tabPlacement == JTabbedPane.BOTTOM )
{
clip = new RoundRectangle2D.Double ( insets.left, insets.top, tabPane.getWidth () - insets.left - insets.right,
tabPane.getHeight () - insets.top - tabAreaLength - insets.bottom, round * 2, round * 2 );
}
else if ( tabPlacement == JTabbedPane.LEFT )
{
clip = new RoundRectangle2D.Double ( insets.left + tabAreaLength, insets.top,
tabPane.getWidth () - insets.left - tabAreaLength - insets.right, tabPane.getHeight () - insets.top - insets.bottom,
round * 2, round * 2 );
}
else if ( tabPlacement == JTabbedPane.RIGHT )
{
clip = new RoundRectangle2D.Double ( insets.left, insets.top, tabPane.getWidth () - insets.left - tabAreaLength - insets.right,
tabPane.getHeight () - insets.top - insets.bottom, round * 2, round * 2 );
}
return clip;
}
代码示例来源:origin: freeplane/freeplane
public void install(final URL url) {
if (addOnInstallerPanel.isShowing()) {
addOnInstallerPanel.getUrlField().setText(url.toString());
tabbedPane.paintImmediately(0, 0, tabbedPane.getWidth(), tabbedPane.getHeight());
addOnInstallerPanel.getInstallButton().doClick();
}
else {
addOnInstallerPanel.addHierarchyListener(new HierarchyListener() {
public void hierarchyChanged(HierarchyEvent e) {
if (addOnInstallerPanel.isShowing()) {
addOnInstallerPanel.removeHierarchyListener(this);
install(url);
}
}
});
tabbedPane.setSelectedComponent(addOnInstallerPanel);
if (!isVisible())
setVisible(true);
}
}
}
代码示例来源:origin: net.sf.squirrel-sql/squirrel-sql
static void initGlassPane(Point tabPt, DnDTabbedPaneData localDnDTabbedPaneData, DnDTabbedPaneData outerDnDTabbedPaneData, GhostGlassPane localGlassPane)
{
localDnDTabbedPaneData.getTabbedPane().getRootPane().setGlassPane(localGlassPane);
if (localDnDTabbedPaneData.isHasGhost())
{
Rectangle rect = outerDnDTabbedPaneData.getTabbedPane().getBoundsAt(outerDnDTabbedPaneData.getDragTabIndex());
BufferedImage image = new BufferedImage(outerDnDTabbedPaneData.getTabbedPane().getWidth(), outerDnDTabbedPaneData.getTabbedPane().getHeight(), BufferedImage.TYPE_INT_ARGB);
Graphics g = image.getGraphics();
outerDnDTabbedPaneData.getTabbedPane().paint(g);
rect.x = rect.x < 0 ? 0 : rect.x;
rect.y = rect.y < 0 ? 0 : rect.y;
// When scrollable tabbed panes are used tabs might be displayed in part.
rect.width = Math.min(rect.width, outerDnDTabbedPaneData.getTabbedPane().getWidth() - rect.x);
image = image.getSubimage(rect.x, rect.y, rect.width, rect.height);
localGlassPane.setImage(image);
}
Point glassPt = SwingUtilities.convertPoint(localDnDTabbedPaneData.getTabbedPane(), tabPt, localGlassPane);
localGlassPane.setPoint(glassPt);
localGlassPane.setVisible(true);
}
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/toniclf
protected void paintContentBorder(Graphics g, int tabPlacement, int selectedIndex)
int height= tabPane.getHeight();
Insets insets= tabPane.getInsets();
代码示例来源:origin: com.github.insubstantial/substance
int height = tabPane.getHeight();
Insets insets = tabPane.getInsets();
代码示例来源:origin: org.java.net.substance/substance
int height = tabPane.getHeight();
Insets insets = tabPane.getInsets();
代码示例来源:origin: realXuJiang/bigtable-sql
static void initGlassPane(Point tabPt, DnDTabbedPaneData localDnDTabbedPaneData, DnDTabbedPaneData outerDnDTabbedPaneData, GhostGlassPane localGlassPane)
{
localDnDTabbedPaneData.getTabbedPane().getRootPane().setGlassPane(localGlassPane);
if (localDnDTabbedPaneData.isHasGhost())
{
Rectangle rect = outerDnDTabbedPaneData.getTabbedPane().getBoundsAt(outerDnDTabbedPaneData.getDragTabIndex());
BufferedImage image = new BufferedImage(outerDnDTabbedPaneData.getTabbedPane().getWidth(), outerDnDTabbedPaneData.getTabbedPane().getHeight(), BufferedImage.TYPE_INT_ARGB);
Graphics g = image.getGraphics();
outerDnDTabbedPaneData.getTabbedPane().paint(g);
rect.x = rect.x < 0 ? 0 : rect.x;
rect.y = rect.y < 0 ? 0 : rect.y;
// When scrollable tabbed panes are used tabs might be displayed in part.
rect.width = Math.min(rect.width, outerDnDTabbedPaneData.getTabbedPane().getWidth() - rect.x);
image = image.getSubimage(rect.x, rect.y, rect.width, rect.height);
localGlassPane.setImage(image);
}
Point glassPt = SwingUtilities.convertPoint(localDnDTabbedPaneData.getTabbedPane(), tabPt, localGlassPane);
localGlassPane.setPoint(glassPt);
localGlassPane.setVisible(true);
}
代码示例来源:origin: khuxtable/seaglass
int height = tabPane.getHeight();
Insets insets = tabPane.getInsets();
内容来源于网络,如有侵权,请联系作者删除!