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


Java SynthPainter类代码示例

本文整理汇总了Java中javax.swing.plaf.synth.SynthPainter的典型用法代码示例。如果您正苦于以下问题:Java SynthPainter类的具体用法?Java SynthPainter怎么用?Java SynthPainter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: paintBackground

import javax.swing.plaf.synth.SynthPainter; //导入依赖的package包/类
@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);
    }
}
 
开发者ID:khuxtable,项目名称:seaglass,代码行数:9,代码来源:SeaGlassToggleButtonUI.java

示例2: getPainter

import javax.swing.plaf.synth.SynthPainter; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:khuxtable,项目名称:seaglass,代码行数:18,代码来源:SeaGlassContext.java

示例3: paintTabBackground

import javax.swing.plaf.synth.SynthPainter; //导入依赖的package包/类
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);
    }

}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:50,代码来源:GtkEditorTabCellRenderer.java

示例4: getPainter

import javax.swing.plaf.synth.SynthPainter; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public SynthPainter getPainter(SynthContext ctx) {
    return painter;
}
 
开发者ID:khuxtable,项目名称:seaglass,代码行数:8,代码来源:SeaGlassStyleWrapper.java

示例5: getPainter

import javax.swing.plaf.synth.SynthPainter; //导入依赖的package包/类
/**
 * {@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;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:NimbusStyle.java

示例6: getPainter

import javax.swing.plaf.synth.SynthPainter; //导入依赖的package包/类
/**
 * Returns a SynthPainter from the context's style. Fall-back to default if 
 * none available.
 * 
 * @param context SynthContext containing the style, must not be null.
 * @return a SynthPainter from the context's style, or a default if null.
 */
public static SynthPainter getPainter(SynthContext context) {
    SynthPainter painter = context.getStyle().getPainter(context);
    return painter != null ? painter : NULL_PAINTER;
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:12,代码来源:SynthUtils.java

示例7: getPainter

import javax.swing.plaf.synth.SynthPainter; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:khuxtable,项目名称:seaglass,代码行数:14,代码来源:SeaGlassStyle.java

示例8: getPainter

import javax.swing.plaf.synth.SynthPainter; //导入依赖的package包/类
/**
 * @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;
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:10,代码来源:NimbusStyle.java

示例9: getPainter

import javax.swing.plaf.synth.SynthPainter; //导入依赖的package包/类
/**
 * @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;
}
 
开发者ID:Depter,项目名称:JRLib,代码行数:10,代码来源:OpaqueNimbusStyle.java


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