Java Code Examples for org.jdesktop.swingx.JXTaskPane#isSpecial()

The following examples show how to use org.jdesktop.swingx.JXTaskPane#isSpecial() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DarkTaskPaneUI.java    From darklaf with MIT License 5 votes vote down vote up
@Override
protected void paintTitleBackground(final JXTaskPane group, final Graphics g2) {
    Graphics2D g = (Graphics2D) g2;
    int w = group.getWidth();
    int h = group.getHeight();
    if (group.isSpecial()) {
        g.setColor(specialTitleBackground);
    } else {
        g.setColor(titleBackgroundGradientStart);
    }
    if (isCollapsed()) {
        PaintUtil.fillRoundRect(g, 0, 0, w, h, getRoundHeight());
        g.setColor(borderColor);
        PaintUtil.paintLineBorder(g, 0, 0, w, h, getRoundHeight());
    } else {
        Rectangle clip = g.getClip().getBounds();
        g.setClip(0, 0, w, h / 2 + 1);

        PaintUtil.fillRoundRect(g, 0, 0, w, h, getRoundHeight());
        g.setClip(0, h / 2, w, h / 2);
        g.fillRect(0, 0, w, h);

        g.setColor(borderColor);
        g.setClip(0, 0, w, h / 2);
        PaintUtil.paintLineBorder(g, 0, 0, w, h, getRoundHeight());

        g.setClip(0, h / 2, w, h / 2);
        PaintUtil.drawRect(g, 0, 0, w, h, 1);
        g.setClip(clip);
    }
}
 
Example 2
Source File: MaterialTaskPaneUI.java    From material-ui-swing with MIT License 5 votes vote down vote up
protected void paintTitleBackground(JXTaskPane group, Graphics g) {
    MaterialDrawingUtils.getAliasedGraphics(g);
    this.label.setBackground(UIManager.getColor("TaskPane.background"));
    if (group.isSpecial()) {
        g.setColor(specialTitleBackground);
    } else {
        g.setColor(titleBackgroundGradientStart);
    }
    Graphics2D graphics2D = (Graphics2D) g;
    graphics2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
    g = graphics2D;
    g.fillRoundRect( -2, 0, group.getWidth(), group.getHeight(), 15, 15);
}