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.

处理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)
          计算stroke的宽度.如果stroke是BasicStroke,返回BasicStroke.getLineWidth(),否则返回1.
static java.awt.Shape lineToRectangle(java.awt.geom.Line2D line, java.awt.Stroke stroke, double rotate)
          根据直线和绘制直线的画笔(stroke),计算包含此直线的矩形.
 
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)
计算stroke的宽度.如果stroke是BasicStroke,返回BasicStroke.getLineWidth(),否则返回1.

Parameters:
stroke - Stroke Stroke对象.
Returns:
float stroke的宽度.

lineToRectangle

public static java.awt.Shape lineToRectangle(java.awt.geom.Line2D line,
                                             java.awt.Stroke stroke,
                                             double rotate)
根据直线和绘制直线的画笔(stroke),计算包含此直线的矩形.

Parameters:
line - Line2D 直线 (可为null).
stroke - Stroke 画笔 (可为null).
rotate - double 旋转的弧度.
Returns:
Shape 图形.