Tabnine Logo
AttributeKeys.getPerpendicularFillGrowth
Code IndexAdd Tabnine to your IDE (free)

How to use
getPerpendicularFillGrowth
method
in
org.jhotdraw.draw.AttributeKeys

Best Java code snippets using org.jhotdraw.draw.AttributeKeys.getPerpendicularFillGrowth (Showing top 11 results out of 315)

origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

@Override
protected void drawFill(Graphics2D g) {
  Ellipse2D.Double r = (Ellipse2D.Double) ellipse.clone();
  double grow = AttributeKeys.getPerpendicularFillGrowth(this);
  r.x -= grow;
  r.y -= grow;
  r.width += grow * 2;
  r.height += grow * 2;
  if (r.width > 0 && r.height > 0) {
    g.fill(r);
  }
}
origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

@Override
protected void drawFill(Graphics2D g) {
  RoundRectangle2D.Double r = (RoundRectangle2D.Double) roundrect.clone();
  double grow = AttributeKeys.getPerpendicularFillGrowth(this);
  r.x -= grow;
  r.y -= grow;
  r.width += grow * 2;
  r.height += grow * 2;
  r.arcwidth += grow * 2;
  r.archeight += grow * 2;
  if (r.width > 0 && r.height > 0) {
    g.fill(r);
  }
}
origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

@Override
protected void drawFill(Graphics2D g) {
  Rectangle2D.Double r = (Rectangle2D.Double) rectangle.clone();
    double grow = AttributeKeys.getPerpendicularFillGrowth(this);
    Geom.grow(r, grow, grow);
  g.fill(r);
}

origin: net.imagej/imagej-ui-swing

@Override
protected void drawFill(final Graphics2D g) {
  final Rectangle2D.Double r = (Rectangle2D.Double) bounds.clone();
  final double grow = AttributeKeys.getPerpendicularFillGrowth(this);
  Geom.grow(r, grow, grow);
  g.fill(r);
}
origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

@Override
protected void drawFill(Graphics2D g) {
  Rectangle2D.Double r = (Rectangle2D.Double) rectangle.clone();
  double grow = AttributeKeys.getPerpendicularFillGrowth(this);
  Geom.grow(r, grow, grow);
  g.fill(r);
}
origin: net.imagej/ij-ui-swing

@Override
protected void drawFill(final Graphics2D g) {
  final Rectangle2D.Double r = (Rectangle2D.Double) bounds.clone();
  final double grow = AttributeKeys.getPerpendicularFillGrowth(this);
  Geom.grow(r, grow, grow);
  g.fill(r);
}
origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

@Override
protected void drawFill(Graphics2D g) {
  if (isClosed() || get(UNCLOSED_PATH_FILLED)) {
    double grow = AttributeKeys.getPerpendicularFillGrowth(this);
    if (grow == 0d) {
      g.fill(path);
    } else {
      GrowStroke gs = new GrowStroke(grow,
          AttributeKeys.getStrokeTotalWidth(this)
          * get(STROKE_MITER_LIMIT));
      g.fill(gs.createStrokedShape(path));
    }
  }
}
origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

  /**
   * Returns the distance, that a Rectangle needs to grow (or shrink) to
   * make hit detections on a shape as specified by the FILL_UNDER_STROKE and STROKE_POSITION
   * attributes of a figure.
   * The value returned is the number of units that need to be grown (or shrunk)
   * perpendicular to a stroke on an outline of the shape.
   */
  public static double getPerpendicularHitGrowth(Figure f) {
    double grow;
    if (f.get(STROKE_COLOR) == null) {
      grow = getPerpendicularFillGrowth(f);
    } else {
      double strokeWidth = AttributeKeys.getStrokeTotalWidth(f);
      grow = getPerpendicularDrawGrowth(f) + strokeWidth / 2d;
    }
    return grow;
  }
}
origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

@Override
protected void drawFill(Graphics2D g) {
  Shape triangle = getBezierPath();
  double grow = AttributeKeys.getPerpendicularFillGrowth(this);
  if (grow != 0d) {
    GrowStroke gs = new GrowStroke((float) grow,
        (float) (AttributeKeys.getStrokeTotalWidth(this) *
        get(STROKE_MITER_LIMIT))
        );
    triangle = gs.createStrokedShape(triangle);
  }
  
  g.fill(triangle);
}

origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

@Override
protected void drawFill(Graphics2D g) {
  Rectangle2D.Double r = (Rectangle2D.Double) rectangle.clone();
  if (get(IS_QUADRATIC)) {
    double side = Math.max(r.width, r.height);
    r.x -= (side - r.width) / 2;
    r.y -= (side - r.height) / 2;
    r.width = r.height = side;
  }
  double grow = AttributeKeys.getPerpendicularFillGrowth(this);
  if (grow != 0d) {
    double w = r.width / 2d;
    double h = r.height / 2d;
    double lineLength = Math.sqrt(w * w + h * h);
    double scale = grow / lineLength;
    double yb = scale * w;
    double xa = scale * h;
    double growx, growy;
    growx = ((yb * yb) / xa + xa);
    growy = ((xa * xa) / yb + yb);
    Geom.grow(r, growx, growy);
  }
  Path2D.Double diamond = new Path2D.Double();
  diamond.moveTo((r.x + r.width / 2), r.y);
  diamond.lineTo((r.x + r.width), (r.y + r.height / 2));
  diamond.lineTo((r.x + r.width / 2), (r.y + r.height));
  diamond.lineTo(r.x, (r.y + r.height / 2));
  diamond.closePath();
  g.fill(diamond);
}
origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

double grow = AttributeKeys.getPerpendicularFillGrowth(this);
if (grow != 0d) {
  double w = r.width / 2d;
org.jhotdraw.drawAttributeKeysgetPerpendicularFillGrowth

Javadoc

Returns the distance, that a Rectangle needs to grow (or shrink) to fill its shape as specified by the FILL_UNDER_STROKE and STROKE_POSITION attributes of a figure. The value returned is the number of units that need to be grown (or shrunk) perpendicular to a stroke on an outline of the shape.

Popular methods of AttributeKeys

  • getPerpendicularDrawGrowth
    Returns the distance, that a Rectangle needs to grow (or shrink) to draw (aka stroke) its shape as s
  • getPerpendicularHitGrowth
    Returns the distance, that a Rectangle needs to grow (or shrink) to make hit detections on a shape a
  • getFont
  • getFontStyle
  • getStroke
  • getStrokeTotalMiterLimit
    Convenience method for computing the total stroke miter limit from the STROKE_MITER_LIMIT, and IS_ST
  • getStrokeTotalWidth
    Convenience method for computing the total stroke width from the STROKE_WIDTH, STROKE_INNER_WIDTH an

Popular in Java

  • Parsing JSON documents to java classes using gson
  • findViewById (Activity)
  • runOnUiThread (Activity)
  • startActivity (Activity)
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Join (org.hibernate.mapping)
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now