当前位置: 首页>>代码示例>>Java>>正文


Java UnitType.RELATIVE属性代码示例

本文整理汇总了Java中org.jfree.util.UnitType.RELATIVE属性的典型用法代码示例。如果您正苦于以下问题:Java UnitType.RELATIVE属性的具体用法?Java UnitType.RELATIVE怎么用?Java UnitType.RELATIVE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.jfree.util.UnitType的用法示例。


在下文中一共展示了UnitType.RELATIVE属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ThermometerPlot

/**
 * 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();
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:22,代码来源:ThermometerPlot.java

示例2: testEquals

/**
 * 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));
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:28,代码来源:BlockBorderTest.java

示例3: ThermometerPlot

/**
 * 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();
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:23,代码来源:ThermometerPlot.java

示例4: calculateTopInset

/**
 * 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;
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:14,代码来源:RectangleInsets.java

示例5: calculateTopOutset

/**
 * 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;
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:14,代码来源:RectangleInsets.java

示例6: calculateBottomInset

/**
 * 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;
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:14,代码来源:RectangleInsets.java

示例7: calculateBottomOutset

/**
 * 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;
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:14,代码来源:RectangleInsets.java

示例8: calculateLeftInset

/**
 * 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;
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:14,代码来源:RectangleInsets.java

示例9: calculateLeftOutset

/**
 * 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;
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:14,代码来源:RectangleInsets.java

示例10: calculateRightInset

/**
 * 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;
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:14,代码来源:RectangleInsets.java

示例11: calculateRightOutset

/**
 * Returns the right margin.
 * 
 * @param width  the width of the base rectangle.
 * 
 * @return The right margin (in Java2D units).
 */
public double calculateRightOutset(final double width) {
    double result = this.right;
    if (this.unitType == UnitType.RELATIVE) {
        result = (width / (1 - this.left - this.right)) * this.right;
    }
    return result;
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:14,代码来源:RectangleInsets.java

示例12: testEquals

/**
 * Test the equals() method.
 */
public void testEquals() {
    RectangleInsets i1 = new RectangleInsets(
        UnitType.ABSOLUTE, 1.0, 2.0, 3.0, 4.0
    );
    RectangleInsets i2 = new RectangleInsets(
        UnitType.ABSOLUTE, 1.0, 2.0, 3.0, 4.0
    );
    assertTrue(i1.equals(i2));
    assertTrue(i2.equals(i1));
    
    i1 = new RectangleInsets(UnitType.RELATIVE, 1.0, 2.0, 3.0, 4.0);
    assertFalse(i1.equals(i2));
    i2 = new RectangleInsets(UnitType.RELATIVE, 1.0, 2.0, 3.0, 4.0);
    assertTrue(i1.equals(i2));

    i1 = new RectangleInsets(UnitType.RELATIVE, 0.0, 2.0, 3.0, 4.0);
    assertFalse(i1.equals(i2));
    i2 = new RectangleInsets(UnitType.RELATIVE, 0.0, 2.0, 3.0, 4.0);
    assertTrue(i1.equals(i2));
    
    i1 = new RectangleInsets(UnitType.RELATIVE, 0.0, 0.0, 3.0, 4.0);
    assertFalse(i1.equals(i2));
    i2 = new RectangleInsets(UnitType.RELATIVE, 0.0, 0.0, 3.0, 4.0);
    assertTrue(i1.equals(i2));
    
    i1 = new RectangleInsets(UnitType.RELATIVE, 0.0, 0.0, 0.0, 4.0);
    assertFalse(i1.equals(i2));
    i2 = new RectangleInsets(UnitType.RELATIVE, 0.0, 0.0, 0.0, 4.0);
    assertTrue(i1.equals(i2));
    
    i1 = new RectangleInsets(UnitType.RELATIVE, 0.0, 0.0, 0.0, 0.0);
    assertFalse(i1.equals(i2));
    i2 = new RectangleInsets(UnitType.RELATIVE, 0.0, 0.0, 0.0, 0.0);
    assertTrue(i1.equals(i2));
    
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:39,代码来源:RectangleInsetsTest.java

示例13: convertUponSet

@Override
public Object convertUponSet(Object value)
{
	if (value == null)
	{
		return null;
	}
	return 
		UnitType.RELATIVE.toString().equals(value) 
		? UnitType.RELATIVE 
		: UnitType.ABSOLUTE.toString().equals(value)
		? UnitType.ABSOLUTE : null;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:13,代码来源:UnitTypeFieldHandler.java

示例14: PiePlot

/**
 * Creates a plot that will draw a pie chart for the specified dataset.
 *
 * @param dataset  the dataset (<code>null</code> permitted).
 */
public PiePlot(PieDataset dataset) {
    super();
    this.dataset = dataset;
    if (dataset != null) {
        dataset.addChangeListener(this);
    }
    this.pieIndex = 0;

    this.interiorGap = DEFAULT_INTERIOR_GAP;
    this.circular = true;
    this.startAngle = DEFAULT_START_ANGLE;
    this.direction = Rotation.CLOCKWISE;
    this.minimumArcAngleToDraw = DEFAULT_MINIMUM_ARC_ANGLE_TO_DRAW;

    this.sectionPaint = null;
    this.sectionPaintMap = new PaintMap();
    this.baseSectionPaint = Color.gray;
    this.autoPopulateSectionPaint = true;

    this.sectionOutlinesVisible = true;
    this.sectionOutlinePaint = null;
    this.sectionOutlinePaintMap = new PaintMap();
    this.baseSectionOutlinePaint = DEFAULT_OUTLINE_PAINT;
    this.autoPopulateSectionOutlinePaint = false;

    this.sectionOutlineStroke = null;
    this.sectionOutlineStrokeMap = new StrokeMap();
    this.baseSectionOutlineStroke = DEFAULT_OUTLINE_STROKE;
    this.autoPopulateSectionOutlineStroke = false;

    this.explodePercentages = new TreeMap();

    this.labelGenerator = new StandardPieSectionLabelGenerator();
    this.labelFont = DEFAULT_LABEL_FONT;
    this.labelPaint = DEFAULT_LABEL_PAINT;
    this.labelBackgroundPaint = DEFAULT_LABEL_BACKGROUND_PAINT;
    this.labelOutlinePaint = DEFAULT_LABEL_OUTLINE_PAINT;
    this.labelOutlineStroke = DEFAULT_LABEL_OUTLINE_STROKE;
    this.labelShadowPaint = DEFAULT_LABEL_SHADOW_PAINT;
    this.labelLinksVisible = true;
    this.labelDistributor = new PieLabelDistributor(0);

    this.simpleLabels = false;
    this.simpleLabelOffset = new RectangleInsets(UnitType.RELATIVE, 0.18,
            0.18, 0.18, 0.18);
    this.labelPadding = new RectangleInsets(2, 2, 2, 2);

    this.toolTipGenerator = null;
    this.urlGenerator = null;
    this.legendLabelGenerator = new StandardPieSectionLabelGenerator();
    this.legendLabelToolTipGenerator = null;
    this.legendLabelURLGenerator = null;
    this.legendItemShape = Plot.DEFAULT_LEGEND_ITEM_CIRCLE;

    this.ignoreNullValues = false;
    this.ignoreZeroValues = false;

    this.shadowGenerator = null;
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:64,代码来源:PiePlot.java

示例15: PiePlot

/**
 * Creates a plot that will draw a pie chart for the specified dataset.
 *
 * @param dataset  the dataset (<code>null</code> permitted).
 */
public PiePlot(PieDataset dataset) {
    super();
    this.dataset = dataset;
    if (dataset != null) {
        dataset.addChangeListener(this);
    }
    this.pieIndex = 0;

    this.interiorGap = DEFAULT_INTERIOR_GAP;
    this.circular = true;
    this.startAngle = DEFAULT_START_ANGLE;
    this.direction = Rotation.CLOCKWISE;
    this.minimumArcAngleToDraw = DEFAULT_MINIMUM_ARC_ANGLE_TO_DRAW;

    this.sectionPaint = null;
    this.sectionPaintMap = new PaintMap();
    this.baseSectionPaint = Color.gray;
    this.autoPopulateSectionPaint = true;

    this.sectionOutlinesVisible = true;
    this.sectionOutlinePaint = null;
    this.sectionOutlinePaintMap = new PaintMap();
    this.baseSectionOutlinePaint = DEFAULT_OUTLINE_PAINT;
    this.autoPopulateSectionOutlinePaint = false;

    this.sectionOutlineStroke = null;
    this.sectionOutlineStrokeMap = new StrokeMap();
    this.baseSectionOutlineStroke = DEFAULT_OUTLINE_STROKE;
    this.autoPopulateSectionOutlineStroke = false;

    this.explodePercentages = new TreeMap();

    this.labelGenerator = new StandardPieSectionLabelGenerator();
    this.labelFont = DEFAULT_LABEL_FONT;
    this.labelPaint = DEFAULT_LABEL_PAINT;
    this.labelBackgroundPaint = DEFAULT_LABEL_BACKGROUND_PAINT;
    this.labelOutlinePaint = DEFAULT_LABEL_OUTLINE_PAINT;
    this.labelOutlineStroke = DEFAULT_LABEL_OUTLINE_STROKE;
    this.labelShadowPaint = DEFAULT_LABEL_SHADOW_PAINT;
    this.labelLinksVisible = true;
    this.labelDistributor = new PieLabelDistributor(0);

    this.simpleLabels = false;
    this.simpleLabelOffset = new RectangleInsets(UnitType.RELATIVE, 0.18,
            0.18, 0.18, 0.18);
    this.labelPadding = new RectangleInsets(2, 2, 2, 2);

    this.toolTipGenerator = null;
    this.urlGenerator = null;
    this.legendLabelGenerator = new StandardPieSectionLabelGenerator();
    this.legendLabelToolTipGenerator = null;
    this.legendLabelURLGenerator = null;
    this.legendItemShape = Plot.DEFAULT_LEGEND_ITEM_CIRCLE;

    this.ignoreNullValues = false;
    this.ignoreZeroValues = false;
}
 
开发者ID:SOCR,项目名称:HTML5_WebSite,代码行数:62,代码来源:PiePlot.java


注:本文中的org.jfree.util.UnitType.RELATIVE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。