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


Java MattePainter类代码示例

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


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

示例1: addMetalDefaults

import org.jdesktop.swingx.painter.MattePainter; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void addMetalDefaults(LookAndFeelAddons addon, DefaultsList defaults) {
  super.addMetalDefaults(addon, defaults);

  if (isPlastic()) {
    defaults.add("JXTitledPanel.titleForeground", new ColorUIResource(Color.WHITE));
    defaults.add("JXTitledPanel.titlePainter", new PainterUIResource<JXTitledPanel>(
              new MattePainter(new GradientPaint(0, 0, new Color(49, 121, 242),
                  0, 1,  new Color(198, 211, 247)), true)));
  } else {
    defaults.add("JXTitledPanel.titleForeground", new ColorUIResource(Color.WHITE));
    defaults.add("JXTitledPanel.titlePainter", new PainterUIResource<JXTitledPanel>(
              new MattePainter(new GradientPaint(0, 0, 
                  MetalLookAndFeel.getCurrentTheme().getPrimaryControl(), 0, 1,
                  MetalLookAndFeel.getCurrentTheme().getPrimaryControlDarkShadow()),true)));
  }
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:21,代码来源:TitledPanelAddon.java

示例2: addWindowsDefaults

import org.jdesktop.swingx.painter.MattePainter; //导入依赖的package包/类
@Override
protected void addWindowsDefaults(LookAndFeelAddons addon, DefaultsList defaults) {
  super.addWindowsDefaults(addon, defaults);

  // JW: hot fix for #291-swingx
  // was tracked down by Neil Weber - the requested colors are not available in 
  // all LFs, so changed to fall-back to something real
  // don't understand why this has blown when trying to toggle to Metal...
  // definitely needs deeper digging 
  // kgs: moved to using getSafeXXX from UIManagerExt
  defaults.add("JXTitledPanel.titleForeground", UIManagerExt.getSafeColor(
          "InternalFrame.activeTitleForeground", new ColorUIResource(Color.WHITE)));
  defaults.add("JXTitledPanel.titlePainter", new PainterUIResource<JXTitledPanel>(
          new MattePainter(new GradientPaint(0, 0, UIManagerExt.getSafeColor(
                  "InternalFrame.inactiveTitleGradient", new ColorUIResource(49, 121, 242)),
                  0, 1, UIManagerExt.getSafeColor( "InternalFrame.activeTitleBackground",
                              new ColorUIResource(198, 211, 247))), true)));

}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:20,代码来源:TitledPanelAddon.java

示例3: interactiveStatusBarCheck

import org.jdesktop.swingx.painter.MattePainter; //导入依赖的package包/类
/**
 * SwingX Issue 1158
 */
public void interactiveStatusBarCheck() {
    final JXButton button = new JXButton("Sample");
    MattePainter p = new MattePainter(PaintUtils.BLUE_EXPERIENCE, true);
    button.setForegroundPainter(p);
    BufferedImage im;
    try {
        im = ImageIO.read(JXButton.class.getResource("plaf/basic/resources/error16.png"));
    } catch (IOException ignore) {
        System.out.println(ignore);
        im = null;
    }
    button.setIcon(new ImageIcon(im));
    
    JXFrame frame = wrapInFrame(button, "Painter testing");
    frame.setStatusBar(new JXStatusBar());
    show(frame);
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:21,代码来源:JXButtonVisualCheck.java

示例4: createRelativeGradientHighlighter

import org.jdesktop.swingx.painter.MattePainter; //导入依赖的package包/类
/**
 * @param right
 * @return
 */
private RelativePainterHighlighter createRelativeGradientHighlighter(
        HorizontalAlignment right, int column) {
    Color startColor = PaintUtils.setAlpha(Color.RED, 130);
    Color endColor = PaintUtils.setAlpha(Color.RED.brighter(), 0);
    boolean isRightAligned = HorizontalAlignment.RIGHT == right;
    GradientPaint paint = new GradientPaint(new Point2D.Double(0, 0),
            isRightAligned ? endColor : startColor, 
            new Point2D.Double(100, 0), 
            isRightAligned ? startColor : endColor);
    MattePainter painter = new MattePainter(paint);
    painter.setPaintStretched(true);
    RelativePainterHighlighter p = new RelativePainterHighlighter(painter);
    p.setHorizontalAlignment(right);
    p.setRelativizer(new NumberRelativizer(column, 100, 100));
    return p;
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:21,代码来源:HighlighterClientVisualCheck.java

示例5: setOverrideMode

import org.jdesktop.swingx.painter.MattePainter; //导入依赖的package包/类
public synchronized void setOverrideMode(boolean overrideMode, java.awt.Component c) {
    RootPaneContainer r = (RootPaneContainer)SwingUtilities.windowForComponent(c);
    if(overrideMode) {
        if(overrideImage == null) {
            overrideImage = new ImageIcon(getClass().getResource("/override_stamp.png"));
        }
        PainterGlasspane pg = new PainterGlasspane();
        MattePainter matte = new MattePainter(new Color(0xcc,0xcc, 0xcc, 120)) {
            protected  void doPaint(java.awt.Graphics2D g, java.lang.Object component, int width, int height) {
                super.doPaint(g, component, width, height);
                overrideImage.paintIcon(BaseForm.this, g, 0, 0);
                //g.drawImage(overrideImage.getImage(), width / 2 - overrideImage.getIconWidth() / 2, 0, BaseForm.this);
            }
        };
        pg.setPainter(matte);
        pg.addTarget(this);
        r.setGlassPane(pg);
        pg.setBounds(0, 0, r.getContentPane().getWidth(), r.getContentPane().getHeight());
        pg.setVisible(true);
    } else {
        r.setGlassPane(new JLabel());
    }
}
 
开发者ID:codenameone,项目名称:CodenameOne,代码行数:24,代码来源:BaseForm.java

示例6: WelcomePanel

import org.jdesktop.swingx.painter.MattePainter; //导入依赖的package包/类
/** Creates new form WelcomePanel */
public WelcomePanel() {
    initComponents();
    setOpaque(true);
    welcomeTooltipMap.put(jxHelpLabel, "<html> <h2 style='color:#953333; font-weight: bold;'>Integrierte Hilfe</h2> DS Workbench bietet eine umfangreiche Hilfe, die du im Programm jederzeit &uuml;ber <strong>F1</strong> aufrufen kannst. Dabei wird versucht, das passende Hilfethema f&uuml;r die Ansicht, in der du dich gerade befindest, auszuw&auml;hlen. Es schadet aber auch nicht, einfach mal so in der Hilfe zu st&ouml;bern um neue Funktionen zu entdecken. Einsteiger sollten in jedem Fall die ersten drei Kapitel der Wichtigen Grundlagen gelesen haben.</html>");
    welcomeTooltipMap.put(jxCommunityLabel, "<html> <h2 style='color:#953333; font-weight: bold;'>Die DS Workbench Community</h2> Nat&uuml;rlich gibt es neben dir noch eine Vielzahl anderer Spieler, die DS Workbench regelm&auml;&szlig;ig und intensiv benutzen. Einen perfekten Anlaufpunkt f&uuml;r alle Benutzer bietet das DS Workbench Forum, wo man immer jemanden trifft mit dem man Erfahrungen austauschen und wo man Fragen stellen kann.</html>");
    welcomeTooltipMap.put(jxIdeaLabel, "<html> <h2 style='color:#953333; font-weight: bold;'>Verbesserungen und Ideen </h2> Gibt es irgendwas wo du meinst, dass es in DS Workbench fehlt und was anderen Benutzern auch helfen k&ouml;nnte? Hast du eine Idee, wie man DS Workbench verbessern oder die Handhabung vereinfachen k&ouml;nnte? Dann bietet dieser Bereich im DS Workbench Forum die perfekte Anlaufstelle f&uuml;r dich. Trau dich und hilf mit, DS Workbench  zu verbessern. </html>");
    welcomeTooltipMap.put(jxFacebookLabel, "<html> <h2 style='color:#953333; font-weight: bold;'>DS Workbench @ Facebook</h2> Nat&uuml;rlich geh&ouml;rt es heutzutage fast zum guten Ton, bei Facebook in irgendeiner Art und Weise vertreten zu sein. Auch DS Workbench hat eine eigene Facebook Seite, mit deren Hilfe ihr euch jederzeit &uuml;ber aktuelle News oder Geschehnisse im Zusammenhang mit DS Workbench informieren k&ouml;nnt.</html>");
    welcomeTooltipMap.put(jContentLabel, "<html> <h2 style='color:#953333'>Willkommen bei DS Workbench</h2> Wenn du diese Seite siehst, dann hast du DS Workbench erfolgreich installiert und die ersten Schritte ebenso erfolgreich gemeistert. Eigentlich steht nun einer unbeschwerten Angriffsplanung und -durchf&uuml;hrung nichts mehr im Wege. Erlaube mir trotzdem kurz auf einige Dinge hinzuweisen, die dir m&ouml;glicherweise beim <b>Umgang mit DS Workbench helfen</b> oder aber dir die M&ouml;glichkeit geben, einen wichtigen Teil zur <b>Weiterentwicklung und stetigen Verbesserung</b> dieses Programms beizutragen. Fahre einfach mit der Maus &uuml;ber eins der vier Symbole in den Ecken, um hilfreiche und interessante Informationen rund um DS Workbench zu erfahren. Klicke auf ein Symbol, um direkt zum entsprechenden Ziel zu gelangen. Die Eintr&auml;ge findest du sp&auml;ter auch im Hauptmen&uuml; unter 'Sonstiges'. <br> <h3 style='color:#953333'> Nun aber viel Spa&szlig; mit DS Workbench.</h3> </html>");
    try {
        back = ImageIO.read(WelcomePanel.class.getResource("/images/c.gif"));
    } catch (Exception ignored) {
    }
    if (back != null) {
        setBackgroundPainter(new MattePainter(new TexturePaint(back, new Rectangle2D.Float(0, 0, 200, 20))));
    }
}
 
开发者ID:Torridity,项目名称:dsworkbench,代码行数:18,代码来源:WelcomePanel.java

示例7: createRelativeGradientHighlighter

import org.jdesktop.swingx.painter.MattePainter; //导入依赖的package包/类
/**
 * @param right
 * @return
 */
private RelativePainterHighlighter createRelativeGradientHighlighter(
        HorizontalAlignment right, Number max) {
    Color startColor = PaintUtils.setAlpha(Color.RED, 130);
    Color endColor = PaintUtils.setAlpha(Color.RED.brighter(), 0);
    boolean isRightAligned = HorizontalAlignment.RIGHT == right;
    GradientPaint paint = new GradientPaint(new Point2D.Double(0, 0),
            isRightAligned ? endColor : startColor, 
            new Point2D.Double(100, 0), 
            isRightAligned ? startColor : endColor);
    MattePainter painter = new MattePainter(paint);
    painter.setPaintStretched(true);
    RelativePainterHighlighter p = new RelativePainterHighlighter(painter);
    p.setHorizontalAlignment(right);
    p.setRelativizer(new NumberRelativizer(max));
    return p;
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:21,代码来源:PainterVisualCheck.java

示例8: testPainterHighlighterConstructors

import org.jdesktop.swingx.painter.MattePainter; //导入依赖的package包/类
@Test
 public void testPainterHighlighterConstructors() {
    PainterHighlighter hl = new PainterHighlighter();
    assertEquals(HighlightPredicate.ALWAYS, hl.getHighlightPredicate());
    assertNull(hl.getPainter());
    Painter<?> mattePainter = new MattePainter();
    PainterHighlighter withPainter = new PainterHighlighter(mattePainter);
    assertEquals(HighlightPredicate.ALWAYS, withPainter.getHighlightPredicate());
    assertEquals(mattePainter, withPainter.getPainter());
    PainterHighlighter withPredicate = new PainterHighlighter(HighlightPredicate.NEVER);
    assertEquals(HighlightPredicate.NEVER, withPredicate.getHighlightPredicate());
    assertEquals(null, withPredicate.getPainter());
    PainterHighlighter all = new PainterHighlighter(HighlightPredicate.NEVER, mattePainter);
    assertEquals(HighlightPredicate.NEVER, all.getHighlightPredicate());
    assertEquals(mattePainter, all.getPainter());
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:17,代码来源:HighlighterTest.java

示例9: createExtendedRolloverDecoration

import org.jdesktop.swingx.painter.MattePainter; //导入依赖的package包/类
private Highlighter createExtendedRolloverDecoration() {
    Color color = PaintUtils.setAlpha(Color.YELLOW, 100);
    final PainterHighlighter hl = new PainterHighlighter(HighlightPredicate.NEVER, 
            new MattePainter(color));
    // <snip> JXList rollover support
    // listen to changes of cell-rollover property
    // and set a Highlighters custom predicate accordingly
    PropertyChangeListener l = new PropertyChangeListener() {

        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            Point location = (Point) evt.getNewValue();
            int row = -1;
            if (location != null) {
                row = location.y;
            }
            hl.setHighlightPredicate(new MeritRangeHighlightPredicate(
                    row < 0 ? null : list.getElementAt(row))); 
        }
        
    };
    list.addPropertyChangeListener(RolloverProducer.ROLLOVER_KEY, l);
    // </snip>
    return hl;
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:26,代码来源:XListDemo.java

示例10: HighlighterControl

import org.jdesktop.swingx.painter.MattePainter; //导入依赖的package包/类
public HighlighterControl() {
    matte = new MattePainter(PaintUtils.setAlpha(base, 125));
    tableValueBasedHighlighter = new RelativePainterHighlighter(matte);
    table.addHighlighter(tableValueBasedHighlighter);
    treeTable.addHighlighter(tableValueBasedHighlighter);

    valueBasedHighlighter = new RelativePainterHighlighter(matte);
    list.addHighlighter(valueBasedHighlighter);
    tree.addHighlighter(valueBasedHighlighter);
    
    setSpreadColumns(false);
    
    BindingGroup group = new BindingGroup();
    group.addBinding(Bindings.createAutoBinding(READ, 
            extendedMarkerBox, BeanProperty.create("selected"),
            this, BeanProperty.create("spreadColumns")));
    group.bind();
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:19,代码来源:HighlighterExtDemo.java

示例11: createAnimatedPainter

import org.jdesktop.swingx.painter.MattePainter; //导入依赖的package包/类
/**
 * @return
 */
public static Painter createAnimatedPainter() {
    final AlphaPainter alpha = new AlphaPainter();
    alpha.setAlpha(1f);
    final PinstripePainter pinstripePainter = new PinstripePainter(PINSTRIPE_COLOR,45,3,3);
    alpha.setPainters(new MattePainter(MATCH_COLOR), pinstripePainter);
    ActionListener l = new ActionListener() {
        boolean add;
        public void actionPerformed(ActionEvent e) {
            float a = add ? (alpha.getAlpha() + 0.1f) : (alpha.getAlpha() - 0.1f);
            if (a > 1.0) {
                a = 1f;
                add = false;
            } else if (a < 0) {
                a = 0;
                add = true;
            }
            alpha.setAlpha(a);
            pinstripePainter.setAngle(pinstripePainter.getAngle()+10);
        }
        
    };
    new Timer(100, l).start();
    return alpha;
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:28,代码来源:DecoratorFactory.java

示例12: applyDefaults

import org.jdesktop.swingx.painter.MattePainter; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private void applyDefaults() {
    Color color = UIManager.getColor(SwingXSet.TITLE_GRADIENT_COLOR2_KEY);
    GradientPaint gradient = new GradientPaint(0f, 0f, UIManager
            .getColor(SwingXSet.TITLE_GRADIENT_COLOR1_KEY), 500f, 0f,
            PaintUtils.setAlpha(color, 0));
    Painter<?> matte = new MattePainter(gradient, true);
    setTitlePainter(matte); 

    setTitleFont(UIManager.getFont(SwingXSet.TITLE_FONT_KEY));
    Color bg = Utilities.deriveColorHSB(UIManager
            .getColor("Panel.background"), 0, 0, -.06f);
    setBackground(bg);
    setForeground(UIManager.getColor(SwingXSet.TITLE_FOREGROUND_KEY));
    if (demoPanel != null) {
        demoPanel.setBackground(Utilities.deriveColorHSB(bg, 0, 0, .04f));
    }
    if (descriptionArea != null) {
        descriptionArea.setBackground(bg);
    }
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:22,代码来源:LoadedXDemoPanel.java

示例13: actionPerformed

import org.jdesktop.swingx.painter.MattePainter; //导入依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {
    if (e.getActionCommand().equals("Find")) {
        BufferedImage back = ImageUtils.createCompatibleBufferedImage(3, 3, BufferedImage.TRANSLUCENT);
        Graphics g = back.getGraphics();
        g.setColor(new Color(120, 120, 120, 120));
        g.fillRect(0, 0, back.getWidth(), back.getHeight());
        g.setColor(new Color(120, 120, 120));
        g.drawLine(0, 0, 3, 3);
        g.dispose();
        TexturePaint paint = new TexturePaint(back, new Rectangle2D.Double(0, 0, back.getWidth(), back.getHeight()));
        jxFilterPane.setBackgroundPainter(new MattePainter(paint));
        DefaultListModel model = new DefaultListModel();

        for (int i = 0; i < jConquersTable.getColumnCount(); i++) {
            TableColumnExt col = jConquersTable.getColumnExt(i);
            if (col.isVisible() && !col.getTitle().equals("Entfernung") && !col.getTitle().equals("Dorfpunkte")) {
                model.addElement(col.getTitle());
            }
        }
        jXColumnList.setModel(model);
        jXColumnList.setSelectedIndex(0);
        jxFilterPane.setVisible(true);
    }
}
 
开发者ID:Torridity,项目名称:dsworkbench,代码行数:26,代码来源:DSWorkbenchConquersFrame.java

示例14: initClassDefaults

import org.jdesktop.swingx.painter.MattePainter; //导入依赖的package包/类
/**
 * Creates the mapping from UI class IDs to <code>ComponentUI</code> classes,
 * putting the ID-<code>ComponentUI</code> pairs in the passed-in defaults table.
 * Each <code>JComponent</code> class specifies its own UI class ID string.
 *
 * @param table UI Defaults
 */
@Override
protected void initClassDefaults(final UIDefaults table)
{	    
	super.initClassDefaults( table);
	
	//  Overwrite
	putDefault(table, AdempiereComboBoxUI.uiClassID, AdempiereComboBoxUI.class);
	putDefault(table, AdempiereLabelUI.uiClassID, AdempiereLabelUI.class);
	table.putDefaults(AdempiereTabbedPaneUI.getUIDefaults());
	putDefault(table, AdempiereEditorPaneUI.uiClassID, AdempiereEditorPaneUI.class);
	table.putDefaults(AdempiereSplitPaneUI.getUIDefaults());
	
	//
	// Task Pane UI:
	putDefault(table, JXTaskPane.uiClassID, AdempiereTaskPaneUI.class);
	table.put("TaskPaneContainer.backgroundPainter", new MattePainter(AdempierePLAF.getFormBackground()));
	table.put("TaskPane.background", new ColorUIResource(0xF4, 0xF4, 0xF4));

}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:27,代码来源:AdempiereLookAndFeel.java

示例15: TodayPanel

import org.jdesktop.swingx.painter.MattePainter; //导入依赖的package包/类
TodayPanel() {
    super(new FlowLayout());
    setBackgroundPainter(new MattePainter(new GradientPaint(0, 0, new Color(238, 238, 238), 0, 1, Color.WHITE)));
    todayAction = new TodayAction();
    todayLink = new JXHyperlink(todayAction);
    todayLink.addMouseListener(createDoubleClickListener());
    Color textColor = new Color(16, 66, 104);
    todayLink.setUnclickedColor(textColor);
    todayLink.setClickedColor(textColor);
    add(todayLink);
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:12,代码来源:JXDatePicker.java


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