com.miginfocom.util.gfx
Class DualArrowPainter

java.lang.Object
  extended by com.miginfocom.util.gfx.ScaleableImage
      extended by com.miginfocom.util.gfx.IconPainter
          extended by com.miginfocom.util.gfx.DualArrowPainter
All Implemented Interfaces:
java.awt.Transparency, javax.swing.Icon

public class DualArrowPainter
extends IconPainter

Paints an arrow facing any 90 degree direction.

See Also:
GfxUtil.drawArrow(java.awt.Graphics2D, int, int, int, int, int, java.awt.Color, java.awt.Color)

Field Summary
 
Fields inherited from interface java.awt.Transparency
BITMASK, OPAQUE, TRANSLUCENT
 
Constructor Summary
DualArrowPainter(int arrowSize, int gap, int firstDir, int secondDir)
          Creates a painter with button foreground for arrow color and no shadow.
DualArrowPainter(int arrowSize, int gap, int firstDir, int secondDir, java.awt.Color arrowColor, java.awt.Color shadowColor)
          Creates a painter.
 
Method Summary
 void drawImage(java.awt.Graphics2D g, int x, int y, int width, int height)
          Paints the internal buffered image (is loaded yet) scaled into the rectangle.
 
Methods inherited from class com.miginfocom.util.gfx.IconPainter
getIconHeight, getIconWidth, getTransparency, paintIcon
 
Methods inherited from class com.miginfocom.util.gfx.ScaleableImage
drawImage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DualArrowPainter

public DualArrowPainter(int arrowSize,
                        int gap,
                        int firstDir,
                        int secondDir)
Creates a painter with button foreground for arrow color and no shadow.

Parameters:
arrowSize - The size of the widest part of the arrow, excluding shadow (which adds 1 if set)
firstDir - Where the first (left or top) arrow should point. E.g. SwingConstants.NORTH.
This button will denote if there will he a horizontal or vertical layout split.
secondDir - Where the second (right or bottom) arrow should point. E.g. SwingConstants.SOUTH.

DualArrowPainter

public DualArrowPainter(int arrowSize,
                        int gap,
                        int firstDir,
                        int secondDir,
                        java.awt.Color arrowColor,
                        java.awt.Color shadowColor)
Creates a painter.

Parameters:
arrowSize - The size of the widest part of the arrow, excluding shadow (which adds 1 if set)
firstDir - Where the first (left or top) arrow should point. E.g. SwingConstants.NORTH.
This button will denote if there will he a horizontal or vertical layout split.
secondDir - Where the second (right or bottom) arrow should point. E.g. SwingConstants.SOUTH.
arrowColor - The normalt color to paint the arrow.
shadowColor - Optional shadow for the arrow. May be null.
Method Detail

drawImage

public void drawImage(java.awt.Graphics2D g,
                      int x,
                      int y,
                      int width,
                      int height)
Description copied from class: ScaleableImage
Paints the internal buffered image (is loaded yet) scaled into the rectangle. One cached image will be retained and used if the same width/height is used again. If the image hasn't been loaded yet nothing is drawn.

Specified by:
drawImage in class ScaleableImage
Parameters:
g - The Graphics object to draw in
x - Upper left corner.
y - Upper left corner.
width - The width. If -1 the image's width is used.
height - The height. If -1 the image's height is used.
See Also:
Icon.paintIcon(java.awt.Component, java.awt.Graphics, int, int)


Copyright © 2009 MiG InfoCom AB. All Rights Reserved.