com.ijchart.xychart.util
Class StrokeUtil

java.lang.Object
  extended by com.ijchart.xychart.util.StrokeUtil

public abstract class StrokeUtil
extends java.lang.Object

Title: IJChart

Description: a chart library for the Java(tm) platform.

Nice static helpers for working with Stroke.

Copyright: Copyright (c) 2013

Company:

Version:
1.0
Author:
zhang feng min,shanghai china. Contract me by email.

Constructor Summary
StrokeUtil()
           
 
Method Summary
static float getStrokeWidth(java.awt.Stroke stroke)
           Returns the width of stroke shape.If stroke instanceof BasicStroke return BasicStroke.getLineWidth(),otherwise return 1.
static java.awt.Shape lineToRectangle(java.awt.geom.Line2D line, java.awt.Stroke stroke, double rotate)
           Returns the high-precision bounding box of this Line2D.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StrokeUtil

public StrokeUtil()
Method Detail

getStrokeWidth

public static float getStrokeWidth(java.awt.Stroke stroke)
Returns the width of stroke shape.If stroke instanceof BasicStroke return BasicStroke.getLineWidth(),otherwise return 1.

Parameters:
stroke - Stroke The Stroke object.
Returns:
float The stroke width.

lineToRectangle

public static java.awt.Shape lineToRectangle(java.awt.geom.Line2D line,
                                             java.awt.Stroke stroke,
                                             double rotate)
Returns the high-precision bounding box of this Line2D.

Parameters:
line - Line2D The line (null permitted).
stroke - Stroke The stroke object (null permitted).
rotate - double The rotate angle.
Returns:
Shape The shape.