本文整理汇总了Java中java.awt.geom.RectangularShape.getHeight方法的典型用法代码示例。如果您正苦于以下问题:Java RectangularShape.getHeight方法的具体用法?Java RectangularShape.getHeight怎么用?Java RectangularShape.getHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.geom.RectangularShape
的用法示例。
在下文中一共展示了RectangularShape.getHeight方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: splitVerticalBar
import java.awt.geom.RectangularShape; //导入方法依赖的package包/类
/**
* Splits a bar into subregions (elsewhere, these subregions will have
* different gradients applied to them).
*
* @param bar the bar shape.
* @param a the first division.
* @param b the second division.
* @param c the third division.
*
* @return An array containing four subregions.
*/
private Rectangle2D[] splitVerticalBar(RectangularShape bar, double a,
double b, double c) {
Rectangle2D[] result = new Rectangle2D[4];
double x0 = bar.getMinX();
double x1 = Math.rint(x0 + (bar.getWidth() * a));
double x2 = Math.rint(x0 + (bar.getWidth() * b));
double x3 = Math.rint(x0 + (bar.getWidth() * c));
result[0] = new Rectangle2D.Double(bar.getMinX(), bar.getMinY(),
x1 - x0, bar.getHeight());
result[1] = new Rectangle2D.Double(x1, bar.getMinY(), x2 - x1,
bar.getHeight());
result[2] = new Rectangle2D.Double(x2, bar.getMinY(), x3 - x2,
bar.getHeight());
result[3] = new Rectangle2D.Double(x3, bar.getMinY(),
bar.getMaxX() - x3, bar.getHeight());
return result;
}
示例2: paintExample
import java.awt.geom.RectangularShape; //导入方法依赖的package包/类
@Override
public void paintExample(final Graphics2D g,
final RectangularShape bbox, final DataInfo di) {
final double s = cellSize();
double x = 0;
final Rectangle2D cur = new Rectangle2D.Double();
for(int k = 0; k < di.getFolds().size(); ++k) {
double y = 0;
for(final String n : getFS(di)) {
cur.setFrame(x, y, s, s);
g.setColor(Color.WHITE);
g.fill(cur);
g.setColor(Color.BLACK);
g.draw(cur);
StringDrawer.drawInto(g, n + k, PaintUtil.addPadding(cur, -1));
y += s;
}
if(y + s < bbox.getHeight()) {
cur.setFrame(x, y + s, s, bbox.getHeight() - y - s);
g.setColor(Color.LIGHT_GRAY);
g.fill(cur);
}
x += s;
}
}
示例3: paint
import java.awt.geom.RectangularShape; //导入方法依赖的package包/类
@Override
public void paint(final Graphics2D g, final double zoom, final RectangularShape rect,
final DataInfo di, final NodeFeature f, final boolean isSelected) {
final double s = cellSize();
double x = 0;
final Rectangle2D cur = new Rectangle2D.Double();
for(final FoldNode fn : getFolds(di)) {
double y = 0;
for(final FeatureSelectionNode fsn : getFS(fn)) {
cur.setFrame(x, y, s, s);
PaintUtil.drawShape(g, cur, zoom, Color.BLACK,
getColorForRank(fsn.getRank(f), di.getMaxRank()));
y += s;
}
if(y + s < rect.getHeight()) {
cur.setFrame(x, y + s, s, rect.getHeight() - y - s);
g.setColor(Color.LIGHT_GRAY);
g.fill(cur);
}
x += s;
}
g.setColor(Color.BLACK);
g.draw(rect);
}
示例4: calcRemainingDrawingArea
import java.awt.geom.RectangularShape; //导入方法依赖的package包/类
/**
* Calculates the remaining drawing area.
*
* @param available the available area.
* @param horizontal horizontal?
* @param inverted inverted?
* @param legendArea the legend area.
*
* @return The remaining drawing area.
*/
private Rectangle2D calcRemainingDrawingArea(Rectangle2D available,
boolean horizontal, boolean inverted, RectangularShape legendArea) {
if (horizontal) {
// The remaining drawing area bounding box will have the same
// x origin, width and height independent of the anchor's
// location. The variable is the y coordinate. If the anchor is
// SOUTH, the y coordinate is simply the original y coordinate
// of the available area. If it is NORTH, we adjust original y
// by the total height of the legend and the initial gap.
double yy = available.getY();
double yloc = (inverted) ? yy
: yy + legendArea.getHeight()
+ getOuterGap().getBottomSpace(available.getHeight());
// return the remaining available drawing area
return new Rectangle2D.Double(available.getX(), yloc, available.getWidth(),
available.getHeight() - legendArea.getHeight()
- getOuterGap().getTopSpace(available.getHeight())
- getOuterGap().getBottomSpace(available.getHeight()));
}
else {
// The remaining drawing area bounding box will have the same
// y origin, width and height independent of the anchor's
// location. The variable is the x coordinate. If the anchor is
// EAST, the x coordinate is simply the original x coordinate
// of the available area. If it is WEST, we adjust original x
// by the total width of the legend and the initial gap.
double xloc = (inverted) ? available.getX()
: available.getX()
+ legendArea.getWidth()
+ getOuterGap().getLeftSpace(available.getWidth())
+ getOuterGap().getRightSpace(available.getWidth());
// return the remaining available drawing area
return new Rectangle2D.Double(xloc, available.getY(),
available.getWidth() - legendArea.getWidth()
- getOuterGap().getLeftSpace(available.getWidth())
- getOuterGap().getRightSpace(available.getWidth()),
available.getHeight());
}
}
示例5: selectionShape
import java.awt.geom.RectangularShape; //导入方法依赖的package包/类
@Override
public Shape selectionShape(final RectangularShape bbox,
final double offX, final double offY) {
return new Ellipse2D.Double(bbox.getX() + offX, bbox.getY() + offY,
bbox.getWidth(), bbox.getHeight());
}
示例6: selectionShape
import java.awt.geom.RectangularShape; //导入方法依赖的package包/类
@Override
public Shape selectionShape(final RectangularShape bbox,
final double offX, final double offY) {
return new Rectangle2D.Double(bbox.getX() + offX, bbox.getY() + offY,
bbox.getWidth(), bbox.getHeight());
}