本文整理汇总了Java中org.jfree.util.UnitType类的典型用法代码示例。如果您正苦于以下问题:Java UnitType类的具体用法?Java UnitType怎么用?Java UnitType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
UnitType类属于org.jfree.util包,在下文中一共展示了UnitType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: Marker
import org.jfree.util.UnitType; //导入依赖的package包/类
/**
* Constructs a new marker.
*
* @param paint the paint (<code>null</code> not permitted).
* @param stroke the stroke (<code>null</code> not permitted).
* @param outlinePaint the outline paint (<code>null</code> permitted).
* @param outlineStroke the outline stroke (<code>null</code> permitted).
* @param alpha the alpha transparency.
*/
public Marker(Paint paint, Stroke stroke,
Paint outlinePaint, Stroke outlineStroke,
float alpha) {
if (paint == null) {
throw new IllegalArgumentException("Null 'paint' argument.");
}
if (stroke == null) {
throw new IllegalArgumentException("Null 'stroke' argument.");
}
this.paint = paint;
this.stroke = stroke;
this.outlinePaint = outlinePaint;
this.outlineStroke = outlineStroke;
this.alpha = alpha;
this.labelFont = new Font("SansSerif", Font.PLAIN, 9);
this.labelPaint = Color.black;
this.labelAnchor = RectangleAnchor.TOP_LEFT;
this.labelOffset = new RectangleInsets(UnitType.ABSOLUTE, 3.0, 3.0, 3.0, 3.0);
this.labelTextAnchor = TextAnchor.CENTER;
}
示例2: ThermometerPlot
import org.jfree.util.UnitType; //导入依赖的package包/类
/**
* Creates a new thermometer plot, using default attributes where necessary.
*
* @param dataset the data set.
*/
public ThermometerPlot(ValueDataset dataset) {
super();
this.padding = new RectangleInsets(UnitType.RELATIVE, 0.05, 0.05, 0.05,
0.05);
this.dataset = dataset;
if (dataset != null) {
dataset.addChangeListener(this);
}
NumberAxis axis = new NumberAxis(null);
axis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
axis.setAxisLineVisible(false);
setRangeAxis(axis);
setAxisRange();
}
示例3: testEquals
import org.jfree.util.UnitType; //导入依赖的package包/类
/**
* Confirm that the equals() method can distinguish all the required fields.
*/
@Test
public void testEquals() {
BlockBorder b1 = new BlockBorder(new RectangleInsets(1.0, 2.0, 3.0,
4.0), Color.red);
BlockBorder b2 = new BlockBorder(new RectangleInsets(1.0, 2.0, 3.0,
4.0), Color.red);
assertTrue(b1.equals(b2));
assertTrue(b2.equals(b2));
// insets
b1 = new BlockBorder(new RectangleInsets(UnitType.RELATIVE, 1.0, 2.0,
3.0, 4.0), Color.red);
assertFalse(b1.equals(b2));
b2 = new BlockBorder(new RectangleInsets(UnitType.RELATIVE, 1.0, 2.0,
3.0, 4.0), Color.red);
assertTrue(b1.equals(b2));
// paint
b1 = new BlockBorder(new RectangleInsets(1.0, 2.0, 3.0, 4.0),
Color.blue);
assertFalse(b1.equals(b2));
b2 = new BlockBorder(new RectangleInsets(1.0, 2.0, 3.0, 4.0),
Color.blue);
assertTrue(b1.equals(b2));
}
示例4: ThermometerPlot
import org.jfree.util.UnitType; //导入依赖的package包/类
/**
* Creates a new thermometer plot, using default attributes where necessary.
*
* @param dataset the data set.
*/
public ThermometerPlot(ValueDataset dataset) {
super();
this.padding = new RectangleInsets(UnitType.RELATIVE, 0.05, 0.05, 0.05,
0.05);
this.dataset = dataset;
if (dataset != null) {
dataset.addChangeListener(this);
}
NumberAxis axis = new NumberAxis(null);
axis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
axis.setAxisLineVisible(false);
axis.setPlot(this);
axis.addChangeListener(this);
this.rangeAxis = axis;
setAxisRange();
}
示例5: testSerialization
import org.jfree.util.UnitType; //导入依赖的package包/类
/**
* Serialize an instance, restore it, and check for identity.
*/
public void testSerialization() {
final RectangleInsets i1 = new RectangleInsets(
UnitType.ABSOLUTE, 1.0, 2.0, 3.0, 4.0
);
RectangleInsets i2 = null;
try {
final ByteArrayOutputStream buffer = new ByteArrayOutputStream();
final ObjectOutput out = new ObjectOutputStream(buffer);
out.writeObject(i1);
out.close();
final ObjectInput in = new ObjectInputStream(
new ByteArrayInputStream(buffer.toByteArray())
);
i2 = (RectangleInsets) in.readObject();
in.close();
}
catch (Exception e) {
System.out.println(e.toString());
}
assertTrue(i1.equals(i2));
}
示例6: configureChart
import org.jfree.util.UnitType; //导入依赖的package包/类
/**
*
*/
protected void configureChart(JFreeChart jfreeChart, JRChartPlot jrPlot) throws JRException
{
Integer defaultBaseFontSize = (Integer)getDefaultValue(defaultChartPropertiesMap, ChartThemesConstants.BASEFONT_SIZE);
setChartBackground(jfreeChart);
setChartTitle(jfreeChart, defaultBaseFontSize);
setChartSubtitles(jfreeChart, defaultBaseFontSize);
setChartLegend(jfreeChart, defaultBaseFontSize);
setChartBorder(jfreeChart);
Boolean isAntiAlias = (Boolean)getDefaultValue(defaultChartPropertiesMap, ChartThemesConstants.CHART_ANTI_ALIAS);
if (isAntiAlias != null)
jfreeChart.setAntiAlias(isAntiAlias.booleanValue());
Double padding = (Double)getDefaultValue(defaultChartPropertiesMap, ChartThemesConstants.CHART_PADDING);
UnitType unitType = (UnitType)getDefaultValue(defaultChartPropertiesMap, ChartThemesConstants.UNIT_TYPE);
if (padding != null && unitType != null)
{
double chartPadding = padding.doubleValue();
jfreeChart.setPadding(new RectangleInsets(unitType, chartPadding, chartPadding, chartPadding, chartPadding));
}
configurePlot(jfreeChart.getPlot(), jrPlot);
}
示例7: setGapThresholdType
import org.jfree.util.UnitType; //导入依赖的package包/类
/**
* Sets the gap threshold type.
*
* @param thresholdType the type (<code>null</code> not permitted).
*
* @see #getGapThresholdType()
*/
public void setGapThresholdType(UnitType thresholdType) {
if (thresholdType == null) {
throw new IllegalArgumentException(
"Null 'thresholdType' argument.");
}
this.gapThresholdType = thresholdType;
notifyListeners(new RendererChangeEvent(this));
}
示例8: RectangleInsets
import org.jfree.util.UnitType; //导入依赖的package包/类
/**
* Creates a new instance.
*
* @param unitType absolute or relative units (<code>null</code> not
* permitted).
* @param top the top insets.
* @param left the left insets.
* @param bottom the bottom insets.
* @param right the right insets.
*/
public RectangleInsets(final UnitType unitType,
final double top, final double left,
final double bottom, final double right) {
if (unitType == null) {
throw new IllegalArgumentException("Null 'unitType' argument.");
}
this.unitType = unitType;
this.top = top;
this.bottom = bottom;
this.left = left;
this.right = right;
}
示例9: calculateTopInset
import org.jfree.util.UnitType; //导入依赖的package包/类
/**
* Returns the top margin.
*
* @param height the height of the base rectangle.
*
* @return The top margin (in Java2D units).
*/
public double calculateTopInset(final double height) {
double result = this.top;
if (this.unitType == UnitType.RELATIVE) {
result = (this.top * height);
}
return result;
}
示例10: calculateTopOutset
import org.jfree.util.UnitType; //导入依赖的package包/类
/**
* Returns the top margin.
*
* @param height the height of the base rectangle.
*
* @return The top margin (in Java2D units).
*/
public double calculateTopOutset(final double height) {
double result = this.top;
if (this.unitType == UnitType.RELATIVE) {
result = (height / (1 - this.top - this.bottom)) * this.top;
}
return result;
}
示例11: calculateBottomInset
import org.jfree.util.UnitType; //导入依赖的package包/类
/**
* Returns the bottom margin.
*
* @param height the height of the base rectangle.
*
* @return The bottom margin (in Java2D units).
*/
public double calculateBottomInset(final double height) {
double result = this.bottom;
if (this.unitType == UnitType.RELATIVE) {
result = (this.bottom * height);
}
return result;
}
示例12: calculateBottomOutset
import org.jfree.util.UnitType; //导入依赖的package包/类
/**
* Returns the bottom margin.
*
* @param height the height of the base rectangle.
*
* @return The bottom margin (in Java2D units).
*/
public double calculateBottomOutset(final double height) {
double result = this.bottom;
if (this.unitType == UnitType.RELATIVE) {
result = (height / (1 - this.top - this.bottom)) * this.bottom;
}
return result;
}
示例13: calculateLeftInset
import org.jfree.util.UnitType; //导入依赖的package包/类
/**
* Returns the left margin.
*
* @param width the width of the base rectangle.
*
* @return The left margin (in Java2D units).
*/
public double calculateLeftInset(final double width) {
double result = this.left;
if (this.unitType == UnitType.RELATIVE) {
result = (this.left * width);
}
return result;
}
示例14: calculateLeftOutset
import org.jfree.util.UnitType; //导入依赖的package包/类
/**
* Returns the left margin.
*
* @param width the width of the base rectangle.
*
* @return The left margin (in Java2D units).
*/
public double calculateLeftOutset(final double width) {
double result = this.left;
if (this.unitType == UnitType.RELATIVE) {
result = (width / (1 - this.left - this.right)) * this.left;
}
return result;
}
示例15: calculateRightInset
import org.jfree.util.UnitType; //导入依赖的package包/类
/**
* Returns the right margin.
*
* @param width the width of the base rectangle.
*
* @return The right margin (in Java2D units).
*/
public double calculateRightInset(final double width) {
double result = this.right;
if (this.unitType == UnitType.RELATIVE) {
result = (this.right * width);
}
return result;
}