本文整理汇总了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)));
}
}
示例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)));
}
示例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);
}
示例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;
}
示例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());
}
}
示例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 über <strong>F1</strong> aufrufen kannst. Dabei wird versucht, das passende Hilfethema für die Ansicht, in der du dich gerade befindest, auszuwählen. Es schadet aber auch nicht, einfach mal so in der Hilfe zu stö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ürlich gibt es neben dir noch eine Vielzahl anderer Spieler, die DS Workbench regelmäßig und intensiv benutzen. Einen perfekten Anlaufpunkt fü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önnte? Hast du eine Idee, wie man DS Workbench verbessern oder die Handhabung vereinfachen könnte? Dann bietet dieser Bereich im DS Workbench Forum die perfekte Anlaufstelle fü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ürlich gehö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 über aktuelle News oder Geschehnisse im Zusammenhang mit DS Workbench informieren kö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ührung nichts mehr im Wege. Erlaube mir trotzdem kurz auf einige Dinge hinzuweisen, die dir möglicherweise beim <b>Umgang mit DS Workbench helfen</b> oder aber dir die Möglichkeit geben, einen wichtigen Teil zur <b>Weiterentwicklung und stetigen Verbesserung</b> dieses Programms beizutragen. Fahre einfach mit der Maus ü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äge findest du später auch im Hauptmenü unter 'Sonstiges'. <br> <h3 style='color:#953333'> Nun aber viel Spaß 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))));
}
}
示例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;
}
示例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());
}
示例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;
}
示例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();
}
示例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;
}
示例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);
}
}
示例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);
}
}
示例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));
}
示例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);
}