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


Java RectangularShape.getHeight方法代码示例

本文整理汇总了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;
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:29,代码来源:GradientXYBarPainter.java

示例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;
  }
}
 
开发者ID:nyuvis,项目名称:infuse-java,代码行数:26,代码来源:MatrixGlyph.java

示例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);
}
 
开发者ID:nyuvis,项目名称:infuse-java,代码行数:25,代码来源:MatrixGlyph.java

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

示例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());
}
 
开发者ID:nyuvis,项目名称:infuse-java,代码行数:7,代码来源:StarGlyph.java

示例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());
}
 
开发者ID:nyuvis,项目名称:infuse-java,代码行数:7,代码来源:MatrixGlyph.java


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