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


Java LengthConstraintType.RANGE属性代码示例

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


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

示例1: computeLegendHeight

private int computeLegendHeight(final JFreeChart chart, final int imageWidth) {
	if (chart.getSubtitleCount() == 0) {
		return 0;
	}

	BufferedImage image = new BufferedImage(imageWidth, IMAGE_HEIGHT, BufferedImage.TYPE_INT_ARGB);
	Graphics2D g2 = image.createGraphics();
	RectangleConstraint constraint = new RectangleConstraint(
			imageWidth, new Range(0.0, imageWidth), LengthConstraintType.RANGE,
			0.0, null, LengthConstraintType.NONE
	);
	int height = 0;
	for (int i = 0; i < chart.getSubtitleCount(); i++) {
		final Title subtitle = chart.getSubtitle(i);
		final Size2D arrange = subtitle.arrange(g2, constraint);
		height += arrange.getHeight();
	}
	return height;
}
 
开发者ID:jenkinsci,项目名称:neoload-plugin,代码行数:19,代码来源:NeoloadGraphXPathStat.java

示例2: arrange

/**
 * Arranges the contents of the block, within the given constraints, and 
 * returns the block size.
 * 
 * @param g2  the graphics device.
 * @param constraint  the constraint (<code>null</code> not permitted).
 * 
 * @return The block size (in Java2D units, never <code>null</code>).
 */
public Size2D arrange(Graphics2D g2, RectangleConstraint constraint) {
    RectangleConstraint cc = toContentConstraint(constraint);
    LengthConstraintType w = cc.getWidthConstraintType();
    LengthConstraintType h = cc.getHeightConstraintType();
    Size2D contentSize = null;
    if (w == LengthConstraintType.NONE) {
        if (h == LengthConstraintType.NONE) {
            throw new RuntimeException("Not yet implemented."); 
        }
        else if (h == LengthConstraintType.RANGE) {
            throw new RuntimeException("Not yet implemented."); 
        }
        else if (h == LengthConstraintType.FIXED) {
            throw new RuntimeException("Not yet implemented.");                 
        }            
    }
    else if (w == LengthConstraintType.RANGE) {
        if (h == LengthConstraintType.NONE) {
            throw new RuntimeException("Not yet implemented."); 
        }
        else if (h == LengthConstraintType.RANGE) {
            contentSize = arrangeRR(g2, cc.getWidthRange(), 
                    cc.getHeightRange()); 
        }
        else if (h == LengthConstraintType.FIXED) {
            throw new RuntimeException("Not yet implemented.");                 
        }
    }
    else if (w == LengthConstraintType.FIXED) {
        if (h == LengthConstraintType.NONE) {
            throw new RuntimeException("Not yet implemented."); 
        }
        else if (h == LengthConstraintType.RANGE) {
            throw new RuntimeException("Not yet implemented."); 
        }
        else if (h == LengthConstraintType.FIXED) {
            throw new RuntimeException("Not yet implemented.");                 
        }
    }
    return new Size2D(calculateTotalWidth(contentSize.getWidth()),
            calculateTotalHeight(contentSize.getHeight()));
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:51,代码来源:TextTitle.java

示例3: arrange

/**
 * Arranges the contents of the block, within the given constraints, and
 * returns the block size.
 *
 * @param g2  the graphics device.
 * @param constraint  the constraint (<code>null</code> not permitted).
 *
 * @return The block size (in Java2D units, never <code>null</code>).
 */
public Size2D arrange(Graphics2D g2, RectangleConstraint constraint) {
    RectangleConstraint contentConstraint = toContentConstraint(constraint);
    LengthConstraintType w = contentConstraint.getWidthConstraintType();
    LengthConstraintType h = contentConstraint.getHeightConstraintType();
    Size2D contentSize = null;
    if (w == LengthConstraintType.NONE) {
        if (h == LengthConstraintType.NONE) {
            contentSize = arrangeNN(g2);
        }
        else if (h == LengthConstraintType.RANGE) {
            throw new RuntimeException("Not yet implemented.");
        }
        else if (h == LengthConstraintType.FIXED) {
            throw new RuntimeException("Not yet implemented.");
        }
    }
    else if (w == LengthConstraintType.RANGE) {
        if (h == LengthConstraintType.NONE) {
            throw new RuntimeException("Not yet implemented.");
        }
        else if (h == LengthConstraintType.RANGE) {
            throw new RuntimeException("Not yet implemented.");
        }
        else if (h == LengthConstraintType.FIXED) {
            throw new RuntimeException("Not yet implemented.");
        }
    }
    else if (w == LengthConstraintType.FIXED) {
        if (h == LengthConstraintType.NONE) {
            throw new RuntimeException("Not yet implemented.");
        }
        else if (h == LengthConstraintType.RANGE) {
            throw new RuntimeException("Not yet implemented.");
        }
        else if (h == LengthConstraintType.FIXED) {
            contentSize = new Size2D(
                contentConstraint.getWidth(),
                contentConstraint.getHeight()
            );
        }
    }
    return new Size2D(
        calculateTotalWidth(contentSize.getWidth()),
        calculateTotalHeight(contentSize.getHeight())
    );
}
 
开发者ID:SOCR,项目名称:HTML5_WebSite,代码行数:55,代码来源:LegendGraphic.java

示例4: arrange

/**
 * Arranges the contents of the block, within the given constraints, and
 * returns the block size.
 *
 * @param g2  the graphics device.
 * @param constraint  the constraint (<code>null</code> not permitted).
 *
 * @return The block size (in Java2D units, never <code>null</code>).
 */
public Size2D arrange(Graphics2D g2, RectangleConstraint constraint) {
    RectangleConstraint cc = toContentConstraint(constraint);
    LengthConstraintType w = cc.getWidthConstraintType();
    LengthConstraintType h = cc.getHeightConstraintType();
    Size2D contentSize = null;
    if (w == LengthConstraintType.NONE) {
        if (h == LengthConstraintType.NONE) {
            contentSize = arrangeNN(g2);
        }
        else if (h == LengthConstraintType.RANGE) {
            throw new RuntimeException("Not yet implemented.");
        }
        else if (h == LengthConstraintType.FIXED) {
            throw new RuntimeException("Not yet implemented.");
        }
    }
    else if (w == LengthConstraintType.RANGE) {
        if (h == LengthConstraintType.NONE) {
            contentSize = arrangeRN(g2, cc.getWidthRange());
        }
        else if (h == LengthConstraintType.RANGE) {
            contentSize = arrangeRR(g2, cc.getWidthRange(),
                    cc.getHeightRange());
        }
        else if (h == LengthConstraintType.FIXED) {
            throw new RuntimeException("Not yet implemented.");
        }
    }
    else if (w == LengthConstraintType.FIXED) {
        if (h == LengthConstraintType.NONE) {
            contentSize = arrangeFN(g2, cc.getWidth());
        }
        else if (h == LengthConstraintType.RANGE) {
            throw new RuntimeException("Not yet implemented.");
        }
        else if (h == LengthConstraintType.FIXED) {
            throw new RuntimeException("Not yet implemented.");
        }
    }
    return new Size2D(calculateTotalWidth(contentSize.getWidth()),
            calculateTotalHeight(contentSize.getHeight()));
}
 
开发者ID:SOCR,项目名称:HTML5_WebSite,代码行数:51,代码来源:TextTitle.java

示例5: arrange

/**
 * Performs a layout for this title, subject to the supplied constraint,
 * and returns the dimensions required for the title (if the title
 * cannot be displayed in the available space, this method will return
 * zero width and height for the dimensions).
 *
 * @param g2  the graphics target.
 * @param constraint  the layout constraints.
 *
 * @return The dimensions for the title.
 */
public Size2D arrange(Graphics2D g2, RectangleConstraint constraint) {
    RectangleConstraint cc = toContentConstraint(constraint);
    LengthConstraintType w = cc.getWidthConstraintType();
    LengthConstraintType h = cc.getHeightConstraintType();
    Size2D contentSize = null;
    if (w == LengthConstraintType.NONE) {
        if (h == LengthConstraintType.NONE) {
            contentSize = arrangeNN(g2);
        }
        else if (h == LengthConstraintType.RANGE) {
            throw new RuntimeException("Not yet implemented.");
        }
        else if (h == LengthConstraintType.FIXED) {
            throw new RuntimeException("Not yet implemented.");
        }
    }
    else if (w == LengthConstraintType.RANGE) {
        if (h == LengthConstraintType.NONE) {
            contentSize = arrangeRN(g2, cc.getWidthRange());
        }
        else if (h == LengthConstraintType.RANGE) {
            contentSize = arrangeRR(g2, cc.getWidthRange(),
                    cc.getHeightRange());
        }
        else if (h == LengthConstraintType.FIXED) {
            throw new RuntimeException("Not yet implemented.");
        }
    }
    else if (w == LengthConstraintType.FIXED) {
        if (h == LengthConstraintType.NONE) {
            contentSize = arrangeFN(g2, cc.getWidth());
        }
        else if (h == LengthConstraintType.RANGE) {
            throw new RuntimeException("Not yet implemented.");
        }
        else if (h == LengthConstraintType.FIXED) {
            throw new RuntimeException("Not yet implemented.");
        }
    }
    if (contentSize.width <= 0.0 || contentSize.height <= 0.0) {
        return new Size2D(0.0, 0.0);
    }
    else {
        return new Size2D(calculateTotalWidth(contentSize.getWidth()),
                calculateTotalHeight(contentSize.getHeight()));
    }
}
 
开发者ID:SOCR,项目名称:HTML5_WebSite,代码行数:58,代码来源:ShortTextTitle.java

示例6: arrange

/**
 * Arranges the contents of the block, within the given constraints, and
 * returns the block size.
 *
 * @param g2  the graphics device.
 * @param constraint  the constraint (<code>null</code> not permitted).
 *
 * @return The block size (in Java2D units, never <code>null</code>).
 */
public Size2D arrange(Graphics2D g2, RectangleConstraint constraint) {
    RectangleConstraint cc = toContentConstraint(constraint);
    LengthConstraintType w = cc.getWidthConstraintType();
    LengthConstraintType h = cc.getHeightConstraintType();
    Size2D contentSize = null;
    if (w == LengthConstraintType.NONE) {
        if (h == LengthConstraintType.NONE) {
            contentSize = new Size2D(getWidth(), getHeight());
        }
        else if (h == LengthConstraintType.RANGE) {
            throw new RuntimeException("Not yet implemented.");
        }
        else if (h == LengthConstraintType.FIXED) {
            throw new RuntimeException("Not yet implemented.");
        }
    }
    else if (w == LengthConstraintType.RANGE) {
        if (h == LengthConstraintType.NONE) {
            throw new RuntimeException("Not yet implemented.");
        }
        else if (h == LengthConstraintType.RANGE) {
            contentSize = arrangeRR(g2, cc.getWidthRange(),
                    cc.getHeightRange());
        }
        else if (h == LengthConstraintType.FIXED) {
            throw new RuntimeException("Not yet implemented.");
        }
    }
    else if (w == LengthConstraintType.FIXED) {
        if (h == LengthConstraintType.NONE) {
            throw new RuntimeException("Not yet implemented.");
        }
        else if (h == LengthConstraintType.RANGE) {
            throw new RuntimeException("Not yet implemented.");
        }
        else if (h == LengthConstraintType.FIXED) {
            throw new RuntimeException("Not yet implemented.");
        }
    }
    return new Size2D(calculateTotalWidth(contentSize.getWidth()),
            calculateTotalHeight(contentSize.getHeight()));
}
 
开发者ID:SOCR,项目名称:HTML5_WebSite,代码行数:51,代码来源:PaintScaleLegend.java

示例7: arrange

/**
 * Arranges the contents of the block, within the given constraints, and 
 * returns the block size.
 * 
 * @param g2  the graphics device.
 * @param constraint  the constraint (<code>null</code> not permitted).
 * 
 * @return The block size (in Java2D units, never <code>null</code>).
 */
public Size2D arrange(Graphics2D g2, RectangleConstraint constraint) {
    RectangleConstraint contentConstraint = toContentConstraint(constraint);
    LengthConstraintType w = contentConstraint.getWidthConstraintType();
    LengthConstraintType h = contentConstraint.getHeightConstraintType();
    Size2D contentSize = null;
    if (w == LengthConstraintType.NONE) {
        if (h == LengthConstraintType.NONE) {
            contentSize = arrangeNN(g2);
        }
        else if (h == LengthConstraintType.RANGE) {
            throw new RuntimeException("Not yet implemented.");
        }
        else if (h == LengthConstraintType.FIXED) {
            throw new RuntimeException("Not yet implemented.");
        }
    }
    else if (w == LengthConstraintType.RANGE) {
        if (h == LengthConstraintType.NONE) {
            throw new RuntimeException("Not yet implemented.");
        }
        else if (h == LengthConstraintType.RANGE) {
            throw new RuntimeException("Not yet implemented.");
        }
        else if (h == LengthConstraintType.FIXED) {
            throw new RuntimeException("Not yet implemented.");
        }
    }
    else if (w == LengthConstraintType.FIXED) {
        if (h == LengthConstraintType.NONE) {
            throw new RuntimeException("Not yet implemented.");
        }
        else if (h == LengthConstraintType.RANGE) {
            throw new RuntimeException("Not yet implemented.");
        }
        else if (h == LengthConstraintType.FIXED) {   
            contentSize = new Size2D(
                contentConstraint.getWidth(),
                contentConstraint.getHeight()
            );
        }            
    }
    return new Size2D(
        calculateTotalWidth(contentSize.getWidth()), 
        calculateTotalHeight(contentSize.getHeight())
    );
}
 
开发者ID:nologic,项目名称:nabs,代码行数:55,代码来源:LegendGraphic.java

示例8: arrange

/**
 * Arranges the contents of the block, within the given constraints, and 
 * returns the block size.
 * 
 * @param g2  the graphics device.
 * @param constraint  the constraint (<code>null</code> not permitted).
 * 
 * @return The block size (in Java2D units, never <code>null</code>).
 */
public Size2D arrange(Graphics2D g2, RectangleConstraint constraint) {
    RectangleConstraint cc = toContentConstraint(constraint);
    LengthConstraintType w = cc.getWidthConstraintType();
    LengthConstraintType h = cc.getHeightConstraintType();
    Size2D contentSize = null;
    if (w == LengthConstraintType.NONE) {
        if (h == LengthConstraintType.NONE) {
            contentSize = new Size2D(getWidth(), getHeight()); 
        }
        else if (h == LengthConstraintType.RANGE) {
            throw new RuntimeException("Not yet implemented."); 
        }
        else if (h == LengthConstraintType.FIXED) {
            throw new RuntimeException("Not yet implemented.");                 
        }            
    }
    else if (w == LengthConstraintType.RANGE) {
        if (h == LengthConstraintType.NONE) {
            throw new RuntimeException("Not yet implemented."); 
        }
        else if (h == LengthConstraintType.RANGE) {
            contentSize = arrangeRR(g2, cc.getWidthRange(), 
                    cc.getHeightRange()); 
        }
        else if (h == LengthConstraintType.FIXED) {
            throw new RuntimeException("Not yet implemented.");                 
        }
    }
    else if (w == LengthConstraintType.FIXED) {
        if (h == LengthConstraintType.NONE) {
            throw new RuntimeException("Not yet implemented."); 
        }
        else if (h == LengthConstraintType.RANGE) {
            throw new RuntimeException("Not yet implemented."); 
        }
        else if (h == LengthConstraintType.FIXED) {
            throw new RuntimeException("Not yet implemented.");                 
        }
    }
    return new Size2D(calculateTotalWidth(contentSize.getWidth()),
            calculateTotalHeight(contentSize.getHeight()));
}
 
开发者ID:nologic,项目名称:nabs,代码行数:51,代码来源:PaintScaleLegend.java


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