com.alee.extended.painter
Class DashedBorderPainter<E extends javax.swing.JComponent>

java.lang.Object
  extended by com.alee.extended.painter.AbstractPainter<E>
      extended by com.alee.extended.painter.BorderPainter<E>
          extended by com.alee.extended.painter.DashedBorderPainter<E>
Type Parameters:
E - component type
All Implemented Interfaces:
Painter<E>

public class DashedBorderPainter<E extends javax.swing.JComponent>
extends BorderPainter<E>

Dashed border painter.

Author:
Mikle Garin
See Also:
BorderPainter, AbstractPainter, Painter

Field Summary
 
Fields inherited from class com.alee.extended.painter.BorderPainter
color, round, stroke, width
 
Fields inherited from class com.alee.extended.painter.AbstractPainter
listeners, margin, opaque, preferredSize
 
Constructor Summary
DashedBorderPainter()
          Constructs default dashed border painter.
DashedBorderPainter(float[] dash)
          Constructs dashed border painter with specified dashing pattern.
DashedBorderPainter(float[] dash, float dashPhase)
          Constructs dashed border painter with specified dashing pattern and offset.
 
Method Summary
 float[] getDash()
          Returns dashing pattern.
 float getDashPhase()
          Returns dashing pattern offset.
 void setDash(float[] dash)
          Sets dashing pattern.
 void setDashPhase(float dashPhase)
          Sets dashing pattern offset.
protected  void updateStroke()
          Updates border stroke depending on painter settings.
 
Methods inherited from class com.alee.extended.painter.BorderPainter
getBorderShape, getColor, getMargin, getPreferredSize, getRound, getStroke, getWidth, paint, setColor, setRound, setStroke, setWidth
 
Methods inherited from class com.alee.extended.painter.AbstractPainter
addPainterListener, install, isOpaque, p, removePainterListener, repaint, repaint, repaint, revalidate, setMargin, setMargin, setMargin, setOpaque, setPreferredSize, uninstall, updateAll, updateOpacity
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DashedBorderPainter

public DashedBorderPainter()
Constructs default dashed border painter.


DashedBorderPainter

public DashedBorderPainter(float[] dash)
Constructs dashed border painter with specified dashing pattern.

Parameters:
dash - dashing pattern

DashedBorderPainter

public DashedBorderPainter(float[] dash,
                           float dashPhase)
Constructs dashed border painter with specified dashing pattern and offset.

Parameters:
dash - dashing pattern
dashPhase - dashing pattern offset
Method Detail

getDash

public float[] getDash()
Returns dashing pattern.

Returns:
dashing pattern

setDash

public void setDash(float[] dash)
Sets dashing pattern. This will also force stroke to update and overwrite old stroke value.

Parameters:
dash - new dashing pattern

getDashPhase

public float getDashPhase()
Returns dashing pattern offset.

Returns:
dashing pattern offset

setDashPhase

public void setDashPhase(float dashPhase)
Sets dashing pattern offset. This will also force stroke to update and overwrite old stroke value.

Parameters:
dashPhase - new dashing pattern offset

updateStroke

protected void updateStroke()
Updates border stroke depending on painter settings.

Overrides:
updateStroke in class BorderPainter<E extends javax.swing.JComponent>