de.javasoft.plaf.synthetica
Class GraphicsUtils

java.lang.Object
  extended by javax.swing.plaf.synth.SynthGraphicsUtils
      extended by de.javasoft.plaf.synthetica.GraphicsUtils

public class GraphicsUtils
extends javax.swing.plaf.synth.SynthGraphicsUtils

Common graphic operations and enhancements.

Version:
1.70, 14.01.2013

Constructor Summary
GraphicsUtils()
           
 
Method Summary
 void drawLine(javax.swing.plaf.synth.SynthContext sc, java.lang.Object paintKey, java.awt.Graphics g, int x1, int y1, int x2, int y2)
          Overwrites drawLine to draw Tree lines in a separate color using a specified line type.
protected  boolean getPaintMnemonics()
           
static java.awt.Image iconToImage(javax.swing.plaf.synth.SynthContext sc, javax.swing.Icon icon)
          Converts icon to image.
 java.lang.String layoutText(javax.swing.plaf.synth.SynthContext sc, java.awt.FontMetrics fm, java.lang.String text, javax.swing.Icon icon, int hAlign, int vAlign, int hTextPosition, int vTextPosition, java.awt.Rectangle viewR, java.awt.Rectangle iconR, java.awt.Rectangle textR, int iconTextGap)
           
 void paintListCellRendererSelectionBackground(javax.swing.JList list, java.awt.Component renderer, java.awt.Graphics g, int x, int y, int w, int h)
           
 void paintTableCellRendererSelectionBackground(javax.swing.JTable table, java.awt.Component renderer, java.awt.Graphics g, int x, int y, int w, int h)
           
 void paintText(javax.swing.plaf.synth.SynthContext sc, java.awt.Graphics g, java.lang.String text, javax.swing.Icon icon, int align, int align2, int textPosition, int textPosition2, int iconTextGap, int mnemonicIndex, int textOffset)
           
 void paintText(javax.swing.plaf.synth.SynthContext sc, java.awt.Graphics g, java.lang.String text, int x, int y, int mnemonicIndex)
          Override paintText to enable/disable anti-alias.
protected  void paintTextShadow(javax.swing.JComponent c, java.awt.Graphics g, int x, int y, java.lang.String text, boolean highQuality, int size, int distance, float opacity, java.awt.Color color, int xOffset, int yOffset, boolean useGraphicsFont, int mnemonicIndex)
           
 void paintTreeCellRendererSelectionBackground(javax.swing.JTree tree, java.awt.Component renderer, java.awt.Graphics g, int x, int y, int w, int h)
           
 
Methods inherited from class javax.swing.plaf.synth.SynthGraphicsUtils
computeStringWidth, drawLine, getMaximumCharHeight, getMaximumSize, getMinimumSize, getPreferredSize, paintText
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphicsUtils

public GraphicsUtils()
Method Detail

paintText

public void paintText(javax.swing.plaf.synth.SynthContext sc,
                      java.awt.Graphics g,
                      java.lang.String text,
                      int x,
                      int y,
                      int mnemonicIndex)
Override paintText to enable/disable anti-alias.

Overrides:
paintText in class javax.swing.plaf.synth.SynthGraphicsUtils

paintText

public void paintText(javax.swing.plaf.synth.SynthContext sc,
                      java.awt.Graphics g,
                      java.lang.String text,
                      javax.swing.Icon icon,
                      int align,
                      int align2,
                      int textPosition,
                      int textPosition2,
                      int iconTextGap,
                      int mnemonicIndex,
                      int textOffset)
Overrides:
paintText in class javax.swing.plaf.synth.SynthGraphicsUtils

getPaintMnemonics

protected boolean getPaintMnemonics()

drawLine

public void drawLine(javax.swing.plaf.synth.SynthContext sc,
                     java.lang.Object paintKey,
                     java.awt.Graphics g,
                     int x1,
                     int y1,
                     int x2,
                     int y2)
Overwrites drawLine to draw Tree lines in a separate color using a specified line type.

Overrides:
drawLine in class javax.swing.plaf.synth.SynthGraphicsUtils

layoutText

public java.lang.String layoutText(javax.swing.plaf.synth.SynthContext sc,
                                   java.awt.FontMetrics fm,
                                   java.lang.String text,
                                   javax.swing.Icon icon,
                                   int hAlign,
                                   int vAlign,
                                   int hTextPosition,
                                   int vTextPosition,
                                   java.awt.Rectangle viewR,
                                   java.awt.Rectangle iconR,
                                   java.awt.Rectangle textR,
                                   int iconTextGap)
Overrides:
layoutText in class javax.swing.plaf.synth.SynthGraphicsUtils

iconToImage

public static java.awt.Image iconToImage(javax.swing.plaf.synth.SynthContext sc,
                                         javax.swing.Icon icon)
Converts icon to image.

Parameters:
sc - SynthContext - can be null
icon - The icon to convert
Returns:
Converted icon as image

paintListCellRendererSelectionBackground

public void paintListCellRendererSelectionBackground(javax.swing.JList list,
                                                     java.awt.Component renderer,
                                                     java.awt.Graphics g,
                                                     int x,
                                                     int y,
                                                     int w,
                                                     int h)

paintTreeCellRendererSelectionBackground

public void paintTreeCellRendererSelectionBackground(javax.swing.JTree tree,
                                                     java.awt.Component renderer,
                                                     java.awt.Graphics g,
                                                     int x,
                                                     int y,
                                                     int w,
                                                     int h)

paintTableCellRendererSelectionBackground

public void paintTableCellRendererSelectionBackground(javax.swing.JTable table,
                                                      java.awt.Component renderer,
                                                      java.awt.Graphics g,
                                                      int x,
                                                      int y,
                                                      int w,
                                                      int h)

paintTextShadow

protected void paintTextShadow(javax.swing.JComponent c,
                               java.awt.Graphics g,
                               int x,
                               int y,
                               java.lang.String text,
                               boolean highQuality,
                               int size,
                               int distance,
                               float opacity,
                               java.awt.Color color,
                               int xOffset,
                               int yOffset,
                               boolean useGraphicsFont,
                               int mnemonicIndex)


Copyright © 2004-2011 Jyloo Software. All Rights Reserved.