类javax.swing.plaf.synth.SynthPainter源码实例Demo

下面列出了怎么用javax.swing.plaf.synth.SynthPainter的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: seaglass   文件: SeaGlassToggleButtonUI.java
@Override
void paintBackground(SeaGlassContext context, Graphics g, JComponent c) {
    if (((AbstractButton) c).isContentAreaFilled()) {
        int x = 0, y = 0, w = c.getWidth(), h = c.getHeight();
        SynthPainter painter = context.getPainter();
        painter.paintToggleButtonBackground(context, g, x, y, w, h);
    }
}
 
源代码2 项目: seaglass   文件: SeaGlassContext.java
/**
 * Convenience method to get the Painter from the current SynthStyle. This
 * will NEVER return null.
 *
 * @return the painter for the style and context, otherwise the empty
 *         painter.
 */
@SuppressWarnings("all")
public SynthPainter getPainter() {
    SynthPainter painter = getStyle().getPainter(this);

    if (painter != null) {
        return painter;
    }

    return EMPTY_PAINTER;
}
 
源代码3 项目: netbeans   文件: GtkEditorTabCellRenderer.java
private static void paintTabBackground (Graphics g, int index, int state,
int x, int y, int w, int h) {
    if (dummyTab == null) {
        dummyTab = new JTabbedPane();
    }
    Region region = Region.TABBED_PANE_TAB;
    if( !(UIManager.getLookAndFeel() instanceof SynthLookAndFeel) ) {
        return; //#215311 - unsupported L&F installed
    }
    SynthLookAndFeel laf = (SynthLookAndFeel) UIManager.getLookAndFeel();
    SynthStyleFactory sf = laf.getStyleFactory();
    SynthStyle style = sf.getStyle(dummyTab, region);
    SynthContext context =
        new SynthContext(dummyTab, region, style, 
            state == SynthConstants.FOCUSED ? SynthConstants.SELECTED : state);
    SynthPainter painter = style.getPainter(context);
    long t1, t2;
    if (state == SynthConstants.DEFAULT) {
        t1 = System.currentTimeMillis();
        painter.paintTabbedPaneTabBackground(context, g, x, y, w, h, index);
        t2 = System.currentTimeMillis();
        if ((t2 - t1) > 200) {
            LOG.log(Level.WARNING, "painter.paintTabbedPaneTabBackground1 takes too long"
            + " x=" + x + " y=" + y + " w=" + w + " h=" + h + " index:" + index
            + " Time=" + (t2 - t1));
        }
    } else {
        BufferedImage bufIm = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
        Graphics2D g2d = bufIm.createGraphics();
        g2d.setBackground(UIManager.getColor("Panel.background"));
        g2d.clearRect(0, 0, w, h);
        t1 = System.currentTimeMillis();
        painter.paintTabbedPaneTabBackground(context, g2d, 0, 0, w, h, index);
        t2 = System.currentTimeMillis();
        if ((t2 - t1) > 200) {
            LOG.log(Level.WARNING, "painter.paintTabbedPaneTabBackground1 takes too long"
            + " x=0" + " y=0" + " w=" + w + " h=" + h + " index:" + index
            + " Time=" + (t2 - t1));
        }
        // differentiate active and selected tabs, active tab made brighter,
        // selected tab darker
        RescaleOp op = state == SynthConstants.FOCUSED 
            ? new RescaleOp(1.08f, 0, null)
            : new RescaleOp(0.96f, 0, null); 
        BufferedImage img = op.filter(bufIm, null);
        g.drawImage(img, x, y, null);
    }

}
 
源代码4 项目: seaglass   文件: SeaGlassStyleWrapper.java
/**
 * {@inheritDoc}
 */
@Override
public SynthPainter getPainter(SynthContext ctx) {
    return painter;
}
 
源代码5 项目: jdk1.8-source-analysis   文件: NimbusStyle.java
/**
 * {@inheritDoc}
 *
 * Returns the SynthPainter for this style, which ends up delegating to
 * the Painters installed in this style.
 */
@Override public SynthPainter getPainter(SynthContext ctx) {
    return painter;
}
 
源代码6 项目: dragonwell8_jdk   文件: NimbusStyle.java
/**
 * {@inheritDoc}
 *
 * Returns the SynthPainter for this style, which ends up delegating to
 * the Painters installed in this style.
 */
@Override public SynthPainter getPainter(SynthContext ctx) {
    return painter;
}
 
源代码7 项目: TencentKona-8   文件: NimbusStyle.java
/**
 * {@inheritDoc}
 *
 * Returns the SynthPainter for this style, which ends up delegating to
 * the Painters installed in this style.
 */
@Override public SynthPainter getPainter(SynthContext ctx) {
    return painter;
}
 
源代码8 项目: jdk8u60   文件: NimbusStyle.java
/**
 * {@inheritDoc}
 *
 * Returns the SynthPainter for this style, which ends up delegating to
 * the Painters installed in this style.
 */
@Override public SynthPainter getPainter(SynthContext ctx) {
    return painter;
}
 
源代码9 项目: JDKSourceCode1.8   文件: NimbusStyle.java
/**
 * {@inheritDoc}
 *
 * Returns the SynthPainter for this style, which ends up delegating to
 * the Painters installed in this style.
 */
@Override public SynthPainter getPainter(SynthContext ctx) {
    return painter;
}
 
源代码10 项目: openjdk-jdk8u   文件: NimbusStyle.java
/**
 * {@inheritDoc}
 *
 * Returns the SynthPainter for this style, which ends up delegating to
 * the Painters installed in this style.
 */
@Override public SynthPainter getPainter(SynthContext ctx) {
    return painter;
}
 
源代码11 项目: openjdk-jdk8u-backup   文件: NimbusStyle.java
/**
 * {@inheritDoc}
 *
 * Returns the SynthPainter for this style, which ends up delegating to
 * the Painters installed in this style.
 */
@Override public SynthPainter getPainter(SynthContext ctx) {
    return painter;
}
 
源代码12 项目: Bytecoder   文件: NimbusStyle.java
/**
 * {@inheritDoc}
 *
 * Returns the SynthPainter for this style, which ends up delegating to
 * the Painters installed in this style.
 */
@Override public SynthPainter getPainter(SynthContext ctx) {
    return painter;
}
 
源代码13 项目: openjdk-jdk9   文件: NimbusStyle.java
/**
 * {@inheritDoc}
 *
 * Returns the SynthPainter for this style, which ends up delegating to
 * the Painters installed in this style.
 */
@Override public SynthPainter getPainter(SynthContext ctx) {
    return painter;
}
 
源代码14 项目: jdk8u-jdk   文件: NimbusStyle.java
/**
 * {@inheritDoc}
 *
 * Returns the SynthPainter for this style, which ends up delegating to
 * the Painters installed in this style.
 */
@Override public SynthPainter getPainter(SynthContext ctx) {
    return painter;
}
 
源代码15 项目: Java8CN   文件: NimbusStyle.java
/**
 * {@inheritDoc}
 *
 * Returns the SynthPainter for this style, which ends up delegating to
 * the Painters installed in this style.
 */
@Override public SynthPainter getPainter(SynthContext ctx) {
    return painter;
}
 
源代码16 项目: hottub   文件: NimbusStyle.java
/**
 * {@inheritDoc}
 *
 * Returns the SynthPainter for this style, which ends up delegating to
 * the Painters installed in this style.
 */
@Override public SynthPainter getPainter(SynthContext ctx) {
    return painter;
}
 
源代码17 项目: openjdk-8-source   文件: NimbusStyle.java
/**
 * {@inheritDoc}
 *
 * Returns the SynthPainter for this style, which ends up delegating to
 * the Painters installed in this style.
 */
@Override public SynthPainter getPainter(SynthContext ctx) {
    return painter;
}
 
源代码18 项目: openjdk-8   文件: NimbusStyle.java
/**
 * {@inheritDoc}
 *
 * Returns the SynthPainter for this style, which ends up delegating to
 * the Painters installed in this style.
 */
@Override public SynthPainter getPainter(SynthContext ctx) {
    return painter;
}
 
源代码19 项目: jdk8u_jdk   文件: NimbusStyle.java
/**
 * {@inheritDoc}
 *
 * Returns the SynthPainter for this style, which ends up delegating to
 * the Painters installed in this style.
 */
@Override public SynthPainter getPainter(SynthContext ctx) {
    return painter;
}
 
源代码20 项目: jdk8u-jdk   文件: NimbusStyle.java
/**
 * {@inheritDoc}
 *
 * Returns the SynthPainter for this style, which ends up delegating to
 * the Painters installed in this style.
 */
@Override public SynthPainter getPainter(SynthContext ctx) {
    return painter;
}
 
源代码21 项目: seaglass   文件: SeaGlassStyle.java
/**
 * Returns the <code>SynthPainter</code> that will be used for painting.
 * This ends up delegating to the Painters installed in this style. It may
 * return null;
 *
 * @param  ctx context SynthContext identifying requester
 *
 * @return SynthPainter to use
 */
@Override
public SynthPainter getPainter(SynthContext ctx) {
    return painter;
}
 
源代码22 项目: jdk8u-dev-jdk   文件: NimbusStyle.java
/**
 * {@inheritDoc}
 *
 * Returns the SynthPainter for this style, which ends up delegating to
 * the Painters installed in this style.
 */
@Override public SynthPainter getPainter(SynthContext ctx) {
    return painter;
}
 
 类所在包
 类方法
 同包方法