javax.swing.JButton.paint()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(7.2k)|赞(0)|评价(0)|浏览(186)

本文整理了Java中javax.swing.JButton.paint()方法的一些代码示例,展示了JButton.paint()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JButton.paint()方法的具体详情如下:
包路径:javax.swing.JButton
类名称:JButton
方法名:paint

JButton.paint介绍

暂无

代码示例

代码示例来源:origin: net.sf.squirrel-sql/squirrel-sql

  1. public void paint(Graphics g)
  2. {
  3. super.paint(g);
  4. // paintNumWaitingGC(g);
  5. }
  6. };

代码示例来源:origin: realXuJiang/bigtable-sql

  1. public void paint(Graphics g)
  2. {
  3. super.paint(g);
  4. // paintNumWaitingGC(g);
  5. }
  6. };

代码示例来源:origin: com.eas.platypus/platypus-js-calendar-widget

  1. @Override
  2. public void paint(Graphics g) {
  3. if (g instanceof Graphics2D) {
  4. Graphics2D g2d = (Graphics2D) g;
  5. g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
  6. }
  7. super.paint(g);
  8. }

代码示例来源:origin: org.bitbucket.goalhub.simpleide/jedit

  1. public void paint(Graphics g)
  2. {
  3. if(isEnabled())
  4. super.paint(g);
  5. else
  6. {
  7. Graphics2D g2 = (Graphics2D)g;
  8. g2.setComposite(c);
  9. super.paint(g2);
  10. }
  11. } //}}}

代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-bu

  1. public void paint(Graphics _g)
  2. {
  3. BuLib.setAntialiasing(this,_g);
  4. super.paint(_g);
  5. }

代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-bu

  1. public void paint(Graphics _g)
  2. {
  3. BuLib.setAntialiasing(this,_g);
  4. super.paint(_g);
  5. }

代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-bu

  1. public void paint(Graphics _g)
  2. {
  3. BuLib.setAntialiasing(this,_g);
  4. super.paint(_g);
  5. }

代码示例来源:origin: com.jtattoo/JTattoo

  1. public void paint(Graphics g) {
  2. super.paint(g);
  3. // Draw the arrow
  4. int w = getSize().width;
  5. int h = getSize().height;
  6. int size = Math.min((h - 4) / 3, (w - 4) / 3);
  7. size = Math.max(size, 2);
  8. paintTriangle(g, (w - size) / 2 + 1, (h - size) / 2 + 1, size);
  9. }

代码示例来源:origin: Spoutcraft/LegacyLauncher

  1. @Override
  2. public void paint(Graphics g) {
  3. g = transparency.setup(g);
  4. super.paint(g);
  5. transparency.cleanup(g);
  6. }

代码示例来源:origin: org.jspresso/jspresso-swing-components

  1. @Override
  2. public void paint(Graphics g) {
  3. super.paint(g);
  4. if (value != null) {
  5. g.setColor(value);
  6. Rectangle r = getBounds();
  7. r.grow(-5, -5);
  8. g.fill3DRect(r.x, r.y, r.width, r.height, true);
  9. }
  10. }
  11. };

代码示例来源:origin: org.jspresso.framework/jspresso-swing-components

  1. @Override
  2. public void paint(Graphics g) {
  3. super.paint(g);
  4. if (value != null) {
  5. g.setColor(value);
  6. Rectangle r = getBounds();
  7. r.grow(-5, -5);
  8. g.fill3DRect(r.x, r.y, r.width, r.height, true);
  9. }
  10. }
  11. };

代码示例来源:origin: org.netbeans.api/org-openide-explorer

  1. public BufferedImage getSnapshot() {
  2. if (snapshot == null) {
  3. snapshot = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice()
  4. .getDefaultConfiguration().createCompatibleImage(getWidth(), getHeight());
  5. if (log) {
  6. PropUtils.log(ButtonPanel.class, "Created " + snapshot + " custom editor button backing image");
  7. }
  8. if (snapshot.getAlphaRaster() == null) {
  9. //Alpha not supported, could cause corruption (issue
  10. //39280) - use a bufferedImage which will support alpha,
  11. //although less efficient to blit
  12. snapshot = new BufferedImage(getWidth(), getHeight(), BufferedImage.TYPE_INT_ARGB);
  13. }
  14. Graphics g = snapshot.getGraphics();
  15. super.paint(g);
  16. }
  17. return snapshot;
  18. }
  19. }

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-team-commons

  1. @Override
  2. public void paint(Graphics g) {
  3. super.paint(g);
  4. if( underline && isEnabled() ) {
  5. Font f = getFont();
  6. FontMetrics fm = getFontMetrics(f);
  7. int iconWidth = 0;
  8. if( null != getIcon() ) {
  9. iconWidth = getIcon().getIconWidth()+getIconTextGap();
  10. }
  11. int x1 = iconWidth;
  12. int y1 = fm.getHeight();
  13. int x2 = fm.stringWidth(getText()) + iconWidth;
  14. if( getText().length() > 0 )
  15. g.drawLine(x1, y1, x2, y1);
  16. }
  17. }

代码示例来源:origin: org.java.net.substance/substance

  1. @Override
  2. public void paint(Graphics g) {
  3. Graphics2D g2d = (Graphics2D) g.create();
  4. int componentFontSize = SubstanceSizeUtils.getComponentFontSize(this);
  5. int width = getWidth();
  6. int height = getHeight();
  7. int clipDelta = (int) SubstanceSizeUtils
  8. .getBorderStrokeWidth(componentFontSize);
  9. if (this.getComponentOrientation().isLeftToRight()) {
  10. g2d.clipRect(clipDelta, 0, width - clipDelta, height);
  11. } else {
  12. g2d.clipRect(0, 0, width - clipDelta, height);
  13. }
  14. super.paint(g2d);
  15. g2d.dispose();
  16. }
  17. }

代码示例来源:origin: com.github.insubstantial/substance

  1. @Override
  2. public void paint(Graphics g) {
  3. Graphics2D g2d = (Graphics2D) g.create();
  4. int componentFontSize = SubstanceSizeUtils.getComponentFontSize(this);
  5. int width = getWidth();
  6. int height = getHeight();
  7. int clipDelta = (int) SubstanceSizeUtils
  8. .getBorderStrokeWidth(componentFontSize);
  9. if (this.getComponentOrientation().isLeftToRight()) {
  10. g2d.clipRect(clipDelta, 0, width - clipDelta, height);
  11. } else {
  12. g2d.clipRect(0, 0, width - clipDelta, height);
  13. }
  14. super.paint(g2d);
  15. g2d.dispose();
  16. }
  17. }

代码示例来源:origin: com.github.insubstantial/substance

  1. @Override
  2. public void paint(Graphics g) {
  3. Graphics2D g2d = (Graphics2D) g.create();
  4. int componentFontSize = SubstanceSizeUtils.getComponentFontSize(this);
  5. int width = getWidth();
  6. int height = getHeight();
  7. int clipDelta = (int) SubstanceSizeUtils
  8. .getBorderStrokeWidth(componentFontSize);
  9. if (this.getComponentOrientation().isLeftToRight()) {
  10. g2d.clipRect(clipDelta, 0, width - clipDelta, height);
  11. } else {
  12. g2d.clipRect(0, 0, width - clipDelta, height);
  13. }
  14. super.paint(g2d);
  15. g2d.dispose();
  16. }
  17. }

代码示例来源:origin: org.java.net.substance/substance

  1. @Override
  2. public void paint(Graphics g) {
  3. Graphics2D g2d = (Graphics2D) g.create();
  4. int componentFontSize = SubstanceSizeUtils.getComponentFontSize(this);
  5. int width = getWidth();
  6. int height = getHeight();
  7. int clipDelta = (int) SubstanceSizeUtils
  8. .getBorderStrokeWidth(componentFontSize);
  9. if (this.getComponentOrientation().isLeftToRight()) {
  10. g2d.clipRect(clipDelta, 0, width - clipDelta, height);
  11. } else {
  12. g2d.clipRect(0, 0, width - clipDelta, height);
  13. }
  14. super.paint(g2d);
  15. g2d.dispose();
  16. }
  17. }

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

  1. public void paint (Graphics g) {
  2. if (PropUtils.useOptimizedCustomButtonPainting() && !hasFocus()) {
  3. if (log) {
  4. PropUtils.log (ButtonPanel.class, "Blitting custom editor "+
  5. "button backing store for button at " + getBounds() + " in " +
  6. (getParent() == null ? " null parent" : getParent() +
  7. "editor=" + inplace)); //NOI18N
  8. }
  9. ((Graphics2D)g).drawRenderedImage(getSnapshot(), at);
  10. } else {
  11. if (log) {
  12. PropUtils.log (ButtonPanel.class, "Painting unoptimized custom editor "+
  13. "button button at " + getBounds() + " in " +
  14. (getParent() == null ? " null parent" : getParent() +
  15. "editor=" + inplace)); //NOI18N
  16. }
  17. super.paint(g);
  18. }
  19. }

代码示例来源:origin: org.netbeans.api/org-openide-explorer

  1. public void paint(Graphics g) {
  2. if (PropUtils.useOptimizedCustomButtonPainting() && !hasFocus()) {
  3. if (log) {
  4. PropUtils.log(
  5. ButtonPanel.class,
  6. "Blitting custom editor " + "button backing store for button at " + getBounds() + " in " +
  7. ((getParent() == null) ? " null parent" : (getParent() + "editor=" + inplace))
  8. ); //NOI18N
  9. }
  10. ((Graphics2D) g).drawRenderedImage(getSnapshot(), at);
  11. } else {
  12. if (log) {
  13. PropUtils.log(
  14. ButtonPanel.class,
  15. "Painting unoptimized custom editor " + "button button at " + getBounds() + " in " +
  16. ((getParent() == null) ? " null parent" : (getParent() + "editor=" + inplace))
  17. ); //NOI18N
  18. }
  19. super.paint(g);
  20. }
  21. }

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

  1. public void paint (Graphics g) {
  2. if (PropUtils.useOptimizedCustomButtonPainting() && !hasFocus()) {
  3. if (log) {
  4. PropUtils.log (ButtonPanel.class, "Blitting custom editor "+
  5. "button backing store for button at " + getBounds() + " in " +
  6. (getParent() == null ? " null parent" : getParent() +
  7. "editor=" + inplace)); //NOI18N
  8. }
  9. ((Graphics2D)g).drawRenderedImage(getSnapshot(), at);
  10. } else {
  11. if (log) {
  12. PropUtils.log (ButtonPanel.class, "Painting unoptimized custom editor "+
  13. "button button at " + getBounds() + " in " +
  14. (getParent() == null ? " null parent" : getParent() +
  15. "editor=" + inplace)); //NOI18N
  16. }
  17. super.paint(g);
  18. }
  19. }

相关文章

JButton类方法