当前位置: 首页>>代码示例>>Java>>正文


Java JXTaskPane.isSpecial方法代码示例

本文整理汇总了Java中org.jdesktop.swingx.JXTaskPane.isSpecial方法的典型用法代码示例。如果您正苦于以下问题:Java JXTaskPane.isSpecial方法的具体用法?Java JXTaskPane.isSpecial怎么用?Java JXTaskPane.isSpecial使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jdesktop.swingx.JXTaskPane的用法示例。


在下文中一共展示了JXTaskPane.isSpecial方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getPaintColor

import org.jdesktop.swingx.JXTaskPane; //导入方法依赖的package包/类
/**
 * Gets current paint color.
 * 
 * @param group
 *            Selected group.
 * @return Color to be used for painting provided group.
 */
protected Color getPaintColor(JXTaskPane group) {
    Color paintColor;
    if (isMouseOverBorder()) {
        if (mouseOver) {
            if (group.isSpecial()) {
                paintColor = specialTitleOver;
            } else {
                paintColor = titleOver;
            }
        } else {
            if (group.isSpecial()) {
                paintColor = specialTitleForeground;
            } else {
                paintColor = group.getForeground() == null || group.getForeground() instanceof ColorUIResource ? titleForeground : group.getForeground();
            }
        }
    } else {
        if (group.isSpecial()) {
            paintColor = specialTitleForeground;
        } else {
            paintColor = group.getForeground() == null || group.getForeground() instanceof ColorUIResource ? titleForeground : group.getForeground();
        }
    }
    return paintColor;
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:33,代码来源:BasicTaskPaneUI.java

示例2: paintTitleBackground

import org.jdesktop.swingx.JXTaskPane; //导入方法依赖的package包/类
@Override
protected void paintTitleBackground(JXTaskPane group, Graphics g) {

        Paint oldPaint = ((Graphics2D) g).getPaint();

        roundHeight = 7;

        if (group.isSpecial()) {
                g.setColor(specialTitleBackground);

                g.fillRoundRect(0, 0, group.getWidth(), getRoundHeight() * 2,
                                getRoundHeight(), getRoundHeight());
                g.fillRect(0, getRoundHeight(), group.getWidth(),
                                getTitleHeight(group) - getRoundHeight());

        } else {
                Color[] colors = { titleBackgroundGradientStart,
                                titleBackgroundGradientEnd };

                float[] fractions = { 0.0f, 1.0f };

                LinearGradientPaint gradient = new LinearGradientPaint(group
                                .getWidth() / 2, 0.0f, group.getWidth() / 2,
                                getTitleHeight(group), fractions, colors);

                ((Graphics2D) g).setPaint(gradient);

                ((Graphics2D) g).setRenderingHint(
                                RenderingHints.KEY_COLOR_RENDERING,
                                RenderingHints.VALUE_COLOR_RENDER_QUALITY);
                ((Graphics2D) g).setRenderingHint(
                                RenderingHints.KEY_INTERPOLATION,
                                RenderingHints.VALUE_INTERPOLATION_BILINEAR);
                ((Graphics2D) g).setRenderingHint(RenderingHints.KEY_RENDERING,
                                RenderingHints.VALUE_RENDER_QUALITY);
                ((Graphics2D) g).setRenderingHint(
                                RenderingHints.KEY_ANTIALIASING,
                                RenderingHints.VALUE_ANTIALIAS_ON);

                g.fillRoundRect(0, 0, group.getWidth(),
                                getTitleHeight(group) / 2, getRoundHeight(),
                                getRoundHeight());

                g.fillRect(0, getRoundHeight(), group.getWidth(),
                                getTitleHeight(group) - getRoundHeight());

        }

        // draw the border around the title area
        g.setColor(borderColor);

        g.drawRoundRect(0, 0, group.getWidth() - 1, getTitleHeight(group)
                        + getRoundHeight(), getRoundHeight(), getRoundHeight());
        g.drawLine(0, getTitleHeight(group) - 1, group.getWidth(),
                        getTitleHeight(group) - 1);

        ((Graphics2D) g).setPaint(oldPaint);
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:59,代码来源:NimbusTaskPaneUI.java

示例3: paintTitleBackground

import org.jdesktop.swingx.JXTaskPane; //导入方法依赖的package包/类
@Override
protected void paintTitleBackground(JXTaskPane group, Graphics g) {
  if (group.isSpecial()) {
    g.setColor(specialTitleBackground);
    g.fillRoundRect(
      0,
      0,
      group.getWidth(),
      getRoundHeight() * 2,
      getRoundHeight(),
      getRoundHeight());
    g.fillRect(
      0,
      getRoundHeight(),
      group.getWidth(),
      getTitleHeight(group) - getRoundHeight());
  } else {
    Paint oldPaint = ((Graphics2D)g).getPaint();
    GradientPaint gradient =
      new GradientPaint(
        0f,
        0f, //group.getWidth() / 2,
        titleBackgroundGradientStart,
        0f, //group.getWidth(),
        getTitleHeight(group),
        titleBackgroundGradientEnd);
            
    ((Graphics2D)g).setRenderingHint(
      RenderingHints.KEY_COLOR_RENDERING,
      RenderingHints.VALUE_COLOR_RENDER_QUALITY);
    ((Graphics2D)g).setRenderingHint(
      RenderingHints.KEY_INTERPOLATION,
      RenderingHints.VALUE_INTERPOLATION_BILINEAR);
    ((Graphics2D)g).setRenderingHint(
      RenderingHints.KEY_RENDERING,
      RenderingHints.VALUE_RENDER_QUALITY);
    ((Graphics2D)g).setPaint(gradient);
    
    g.fillRoundRect(
      0,
      0,
      group.getWidth(),
      getRoundHeight() * 2,
      getRoundHeight(),
      getRoundHeight());
    g.fillRect(
      0,
      getRoundHeight(),
      group.getWidth(),
      getTitleHeight(group) - getRoundHeight());
    ((Graphics2D)g).setPaint(oldPaint);
  }
  
  g.setColor(borderColor);
  g.drawRoundRect(
    0,
    0,
    group.getWidth() - 1,
    getTitleHeight(group) + getRoundHeight(),
    getRoundHeight(),
    getRoundHeight());
  g.drawLine(0, getTitleHeight(group) - 1, group.getWidth(), getTitleHeight(group) - 1);
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:64,代码来源:GlossyTaskPaneUI.java

示例4: paintTitleBackground

import org.jdesktop.swingx.JXTaskPane; //导入方法依赖的package包/类
@Override
protected void paintTitleBackground(JXTaskPane group, Graphics g) {
  if (group.isSpecial()) {
    g.setColor(specialTitleBackground);
    g.fillRoundRect(
      0,
      0,
      group.getWidth(),
      getRoundHeight() * 2,
      getRoundHeight(),
      getRoundHeight());
    g.fillRect(
      0,
      getRoundHeight(),
      group.getWidth(),
      getTitleHeight(group) - getRoundHeight());
  } else {
    Paint oldPaint = ((Graphics2D)g).getPaint();
    GradientPaint gradient = new GradientPaint(
      0f,
      group.getWidth() / 2,
      group.getComponentOrientation().isLeftToRight()?
        titleBackgroundGradientStart
        :titleBackgroundGradientEnd,
      group.getWidth(),
      getTitleHeight(group),
      group.getComponentOrientation().isLeftToRight()?
        titleBackgroundGradientEnd
        :titleBackgroundGradientStart);
    
    ((Graphics2D)g).setRenderingHint(
      RenderingHints.KEY_COLOR_RENDERING,
      RenderingHints.VALUE_COLOR_RENDER_QUALITY);
    ((Graphics2D)g).setRenderingHint(
      RenderingHints.KEY_INTERPOLATION,
      RenderingHints.VALUE_INTERPOLATION_BILINEAR);
    ((Graphics2D)g).setRenderingHint(
      RenderingHints.KEY_RENDERING,
      RenderingHints.VALUE_RENDER_QUALITY);
    ((Graphics2D)g).setPaint(gradient);
    g.fillRoundRect(
      0,
      0,
      group.getWidth(),
      getRoundHeight() * 2,
      getRoundHeight(),
      getRoundHeight());
    g.fillRect(
      0,
      getRoundHeight(),
      group.getWidth(),
      getTitleHeight(group) - getRoundHeight());
    ((Graphics2D)g).setPaint(oldPaint);
  }
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:56,代码来源:WindowsTaskPaneUI.java

示例5: paintTitleBackground

import org.jdesktop.swingx.JXTaskPane; //导入方法依赖的package包/类
@Override
protected void paintTitleBackground(JXTaskPane group, Graphics g)
{
	if (group.isSpecial())
	{
		g.setColor(specialTitleBackground);
		g.fillRoundRect(
				0,
				0,
				group.getWidth(),
				getRoundHeight() * 2,
				getRoundHeight(),
				getRoundHeight());
		g.fillRect(
				0,
				getRoundHeight(),
				group.getWidth(),
				getTitleHeight(group) - getRoundHeight());
	}
	else
	{
		Paint oldPaint = ((Graphics2D)g).getPaint();
		GradientPaint gradient = new GradientPaint(
				0f,
				group.getWidth() / 2,
				group.getComponentOrientation().isLeftToRight() ? titleBackgroundGradientStart : titleBackgroundGradientEnd,
				group.getWidth(),
				getTitleHeight(group),
				group.getComponentOrientation().isLeftToRight() ? titleBackgroundGradientEnd : titleBackgroundGradientStart);

		((Graphics2D)g).setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_QUALITY);
		((Graphics2D)g).setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
		((Graphics2D)g).setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
		((Graphics2D)g).setPaint(gradient);
		g.fillRoundRect(
				0,
				0,
				group.getWidth(),
				getRoundHeight() * 2,
				getRoundHeight(),
				getRoundHeight());
		g.fillRect(
				0,
				getRoundHeight(),
				group.getWidth(),
				getTitleHeight(group) - getRoundHeight());
		((Graphics2D)g).setPaint(oldPaint);
	}
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:50,代码来源:AdempiereTaskPaneUI.java

示例6: paintTitleBackground

import org.jdesktop.swingx.JXTaskPane; //导入方法依赖的package包/类
protected void paintTitleBackground(JXTaskPane group, Graphics g) {
  if (group.isSpecial()) {
    g.setColor(specialTitleBackground);
    g.fillRoundRect(
      0,
      0,
      group.getWidth(),
      getRoundHeight() * 2,
      getRoundHeight(),
      getRoundHeight());
    g.fillRect(
      0,
      getRoundHeight(),
      group.getWidth(),
      getTitleHeight(group) - getRoundHeight());
  } else {
    Paint oldPaint = ((Graphics2D)g).getPaint();
    GradientPaint gradient =
      new GradientPaint(
        0f,
        0f, //group.getWidth() / 2,
        titleBackgroundGradientStart,
        0f, //group.getWidth(),
        getTitleHeight(group),
        titleBackgroundGradientEnd);
            
    ((Graphics2D)g).setRenderingHint(
      RenderingHints.KEY_COLOR_RENDERING,
      RenderingHints.VALUE_COLOR_RENDER_QUALITY);
    ((Graphics2D)g).setRenderingHint(
      RenderingHints.KEY_INTERPOLATION,
      RenderingHints.VALUE_INTERPOLATION_BILINEAR);
    ((Graphics2D)g).setRenderingHint(
      RenderingHints.KEY_RENDERING,
      RenderingHints.VALUE_RENDER_QUALITY);
    ((Graphics2D)g).setPaint(gradient);
    
    g.fillRoundRect(
      0,
      0,
      group.getWidth(),
      getRoundHeight() * 2,
      getRoundHeight(),
      getRoundHeight());
    g.fillRect(
      0,
      getRoundHeight(),
      group.getWidth(),
      getTitleHeight(group) - getRoundHeight());
    ((Graphics2D)g).setPaint(oldPaint);
  }
  
  g.setColor(borderColor);
  g.drawRoundRect(
    0,
    0,
    group.getWidth() - 1,
    getTitleHeight(group) + getRoundHeight(),
    getRoundHeight(),
    getRoundHeight());
  g.drawLine(0, getTitleHeight(group) - 1, group.getWidth(), getTitleHeight(group) - 1);
}
 
开发者ID:sing-group,项目名称:aibench-project,代码行数:63,代码来源:GlossyTaskPaneUI.java

示例7: paintTitleBackground

import org.jdesktop.swingx.JXTaskPane; //导入方法依赖的package包/类
protected void paintTitleBackground(JXTaskPane group, Graphics g) {
  if (group.isSpecial()) {
    g.setColor(specialTitleBackground);
    g.fillRoundRect(
      0,
      0,
      group.getWidth(),
      getRoundHeight() * 2,
      getRoundHeight(),
      getRoundHeight());
    g.fillRect(
      0,
      getRoundHeight(),
      group.getWidth(),
      getTitleHeight(group) - getRoundHeight());
  } else {
    Paint oldPaint = ((Graphics2D)g).getPaint();
    GradientPaint gradient = new GradientPaint(
      0f,
      group.getWidth() / 2,
      group.getComponentOrientation().isLeftToRight()?
        titleBackgroundGradientStart
        :titleBackgroundGradientEnd,
      group.getWidth(),
      getTitleHeight(group),
      group.getComponentOrientation().isLeftToRight()?
        titleBackgroundGradientEnd
        :titleBackgroundGradientStart);
    
    ((Graphics2D)g).setRenderingHint(
      RenderingHints.KEY_COLOR_RENDERING,
      RenderingHints.VALUE_COLOR_RENDER_QUALITY);
    ((Graphics2D)g).setRenderingHint(
      RenderingHints.KEY_INTERPOLATION,
      RenderingHints.VALUE_INTERPOLATION_BILINEAR);
    ((Graphics2D)g).setRenderingHint(
      RenderingHints.KEY_RENDERING,
      RenderingHints.VALUE_RENDER_QUALITY);
    ((Graphics2D)g).setPaint(gradient);
    g.fillRoundRect(
      0,
      0,
      group.getWidth(),
      getRoundHeight() * 2,
      getRoundHeight(),
      getRoundHeight());
    g.fillRect(
      0,
      getRoundHeight(),
      group.getWidth(),
      getTitleHeight(group) - getRoundHeight());
    ((Graphics2D)g).setPaint(oldPaint);
  }
}
 
开发者ID:sing-group,项目名称:aibench-project,代码行数:55,代码来源:WindowsTaskPaneUI.java

示例8: paintTitleBackground

import org.jdesktop.swingx.JXTaskPane; //导入方法依赖的package包/类
/**
 * Paints background of the title. This may differ based on properties
 * of the group.
 * 
 * @param group
 *            Selected group.
 * @param g
 *            Target graphics.
 */
protected void paintTitleBackground(JXTaskPane group, Graphics g) {
    if (group.isSpecial()) {
        g.setColor(specialTitleBackground);
    } else {
        g.setColor(titleBackgroundGradientStart);
    }
    g.fillRect(0, 0, group.getWidth(), getTitleHeight(group) - 1);
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:18,代码来源:BasicTaskPaneUI.java

示例9: paintOvalAroundControls

import org.jdesktop.swingx.JXTaskPane; //导入方法依赖的package包/类
/**
 * Paints oval 'border' area around the control itself.
 * 
 * @param group
 *            Expanded group.
 * @param g
 *            Target graphics.
 * @param x
 *            X coordinate of the top left corner.
 * @param y
 *            Y coordinate of the top left corner.
 * @param width
 *            Width of the box.
 * @param height
 *            Height of the box.
 */
protected void paintOvalAroundControls(JXTaskPane group, Graphics g,
        int x, int y, int width, int height) {
    if (group.isSpecial()) {
        g.setColor(specialTitleBackground.brighter());
        g.drawOval(x, y, width, height);
    } else {
        g.setColor(titleBackgroundGradientStart);
        g.fillOval(x, y, width, height);

        g.setColor(titleBackgroundGradientEnd.darker());
        g.drawOval(x, y, width, width);
    }
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:30,代码来源:BasicTaskPaneUI.java


注:本文中的org.jdesktop.swingx.JXTaskPane.isSpecial方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。