本文整理汇总了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;
}
示例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);
}
示例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);
}
示例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);
}
}
示例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);
}
}
示例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);
}
示例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);
}
}
示例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);
}
示例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);
}
}