congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
Size2D
Code IndexAdd Tabnine to your IDE (free)

How to use
Size2D
in
org.jfree.ui

Best Java code snippets using org.jfree.ui.Size2D (Showing top 20 results out of 315)

origin: org.codehaus.jtstand/jtstand-chart

/**
 * 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) {
  Size2D s = new Size2D(this.image.getWidth(null),
      this.image.getHeight(null));
  return new Size2D(calculateTotalWidth(s.getWidth()),
      calculateTotalHeight(s.getHeight()));
}
origin: org.jfree/jcommon

  anchor, d.getWidth(), d.getHeight()
);
final Rectangle2D bounds = new Rectangle2D.Double(
  anchorX + offsets[0], anchorY + offsets[1], 
  d.getWidth(), d.getHeight()
);
final Shape rotatedBounds = ShapeUtilities.rotateShape(
origin: org.codehaus.jtstand/jtstand-chart

    Block block = (Block) blocks.get(i);
    sizes[i] = block.arrange(g2, RectangleConstraint.NONE);
    height = height + sizes[i].getHeight();
    maxWidth = Math.max(sizes[i].width, maxWidth);
    block.setBounds(
return new Size2D(maxWidth, height);
origin: jfree/jcommon

/**
 * Calculates the dimensions of the text fragment.
 * 
 * @param g2  the graphics device.
 * 
 * @return The width and height of the text.
 */
public Size2D calculateDimensions(final Graphics2D g2) {
  final FontMetrics fm = g2.getFontMetrics(this.font);
  final Rectangle2D bounds = TextUtilities.getTextBounds(this.text, g2, 
      fm);
  final Size2D result = new Size2D(bounds.getWidth(), bounds.getHeight());
  return result;
}
 
origin: org.codehaus.jtstand/jtstand-chart

/**
 * Arranges the content for this title assuming a range constraint for the
 * width and no bounds on the height, and returns the required size.
 *
 * @param g2  the graphics target.
 * @param widthRange  the range for the width.
 *
 * @return The content size.
 */
protected Size2D arrangeRN(Graphics2D g2, Range widthRange) {
  Size2D s = arrangeNN(g2);
  if (widthRange.contains(s.getWidth())) {
    return s;
  }
  double ww = widthRange.constrain(s.getWidth());
  return arrangeFN(g2, ww);
}
origin: org.jfree/com.springsource.org.jfree

/**
 * Returns the height of the text box.
 * 
 * @param g2  the graphics device.
 * 
 * @return The height (in Java2D units).
 */
public double getHeight(final Graphics2D g2) {
  final Size2D d = this.textBlock.calculateDimensions(g2);
  return this.interiorGap.extendHeight(d.getHeight());
}
 
origin: org.codehaus.jtstand/jtstand-chart

    Block block = (Block) blocks.get(i);
    sizes[i] = block.arrange(g2, RectangleConstraint.NONE);
    width = width + sizes[i].getWidth();
    maxHeight = Math.max(sizes[i].height, maxHeight);
    block.setBounds(
return new Size2D(width, maxHeight);
origin: jfree/jcommon

final float[] offsets = calculateOffsets(anchor, d.getWidth(), 
    d.getHeight());
final Iterator iterator = this.lines.iterator();
float yCursor = 0.0f;
  float lineOffset = 0.0f;
  if (this.lineAlignment == HorizontalAlignment.CENTER) {
    lineOffset = (float) (d.getWidth() - dimension.getWidth()) 
      / 2.0f;   
    lineOffset = (float) (d.getWidth() - dimension.getWidth());   
    TextAnchor.TOP_LEFT, rotateX, rotateY, angle
  );
  yCursor = yCursor + (float) dimension.getHeight();
origin: org.jfree/jcommon

/**
 * Calculates the dimensions of the text fragment.
 * 
 * @param g2  the graphics device.
 * 
 * @return The width and height of the text.
 */
public Size2D calculateDimensions(final Graphics2D g2) {
  final FontMetrics fm = g2.getFontMetrics(this.font);
  final Rectangle2D bounds = TextUtilities.getTextBounds(this.text, g2, 
      fm);
  final Size2D result = new Size2D(bounds.getWidth(), bounds.getHeight());
  return result;
}
 
origin: org.codehaus.jtstand/jtstand-chart

Size2D contentSize = this.content.calculateDimensions(g2);
if (this.expandToFitSpace) {
  return new Size2D(maxWidth, contentSize.getHeight());
  return new Size2D(contentSize.getHeight(), maxWidth);
  return new Size2D(contentSize.height, contentSize.width);
origin: org.codehaus.jtstand/jtstand-chart

/**
 * Arranges the content for this title assuming a range constraint for the
 * width and no bounds on the height, and returns the required size.  This
 * will reflect the fact that a text title positioned on the left or right
 * of a chart will be rotated by 90 degrees.
 *
 * @param g2  the graphics target.
 * @param widthRange  the range for the width.
 *
 * @return The content size.
 *
 * @since 1.0.9
 */
protected Size2D arrangeRN(Graphics2D g2, Range widthRange) {
  Size2D s = arrangeNN(g2);
  if (widthRange.contains(s.getWidth())) {
    return s;
  }
  double ww = widthRange.constrain(s.getWidth());
  return arrangeFN(g2, ww);
}
origin: jfree/jcommon

/**
 * Returns the height of the text box.
 *
 * @param g2  the graphics device.
 *
 * @return The height (in Java2D units).
 */
public double getHeight(final Graphics2D g2) {
  final Size2D d = this.textBlock.calculateDimensions(g2);
  return this.interiorGap.extendHeight(d.getHeight());
}
origin: jfree/jcommon

/**
 * Calculates the width and height of the text line.
 * 
 * @param g2  the graphics device.
 * 
 * @return The width and height.
 */
public Size2D calculateDimensions(final Graphics2D g2) {
  double width = 0.0;
  double height = 0.0;
  final Iterator iterator = this.fragments.iterator();
  while (iterator.hasNext()) {
    final TextFragment fragment = (TextFragment) iterator.next();
    final Size2D dimension = fragment.calculateDimensions(g2);
    width = width + dimension.getWidth();
    height = Math.max(height, dimension.getHeight());
  }
  return new Size2D(width, height);
}
 
origin: org.jfree/com.springsource.org.jfree

  anchor, d.getWidth(), d.getHeight()
);
final Rectangle2D bounds = new Rectangle2D.Double(
  anchorX + offsets[0], anchorY + offsets[1], 
  d.getWidth(), d.getHeight()
);
final Shape rotatedBounds = ShapeUtilities.rotateShape(
origin: org.jfree/com.springsource.org.jfree

/**
 * Calculates the dimensions of the text fragment.
 * 
 * @param g2  the graphics device.
 * 
 * @return The width and height of the text.
 */
public Size2D calculateDimensions(final Graphics2D g2) {
  final FontMetrics fm = g2.getFontMetrics(this.font);
  final Rectangle2D bounds = TextUtilities.getTextBounds(this.text, g2, 
      fm);
  final Size2D result = new Size2D(bounds.getWidth(), bounds.getHeight());
  return result;
}
 
origin: org.codehaus.jtstand/jtstand-chart

Size2D contentSize = this.content.calculateDimensions(g2);
if (this.expandToFitSpace) {
  return new Size2D(maxWidth, contentSize.getHeight());
  return new Size2D(contentSize.getHeight(), maxWidth);
  return new Size2D(contentSize.height, contentSize.width);
origin: org.jfree/jcommon

float xAdj = 0.0f;
if (anchor.isHorizontalCenter()) {
  xAdj = (float) -dim.getWidth() / 2.0f;
  xAdj = (float) -dim.getWidth();
  fragment.draw(g2, x, anchorY + yOffset, TextAnchor.BASELINE_LEFT, 
      rotateX, rotateY, angle);
  x = x + (float) d.getWidth();
origin: org.jfree/jcommon

/**
 * Returns the height of the text box.
 *
 * @param g2  the graphics device.
 *
 * @return The height (in Java2D units).
 */
public double getHeight(final Graphics2D g2) {
  final Size2D d = this.textBlock.calculateDimensions(g2);
  return this.interiorGap.extendHeight(d.getHeight());
}
origin: jfree/jcommon

/**
 * Returns the width and height of the text block.
 * 
 * @param g2  the graphics device.
 * 
 * @return The width and height.
 */
public Size2D calculateDimensions(final Graphics2D g2) {
  double width = 0.0;
  double height = 0.0;
  final Iterator iterator = this.lines.iterator();
  while (iterator.hasNext()) {
    final TextLine line = (TextLine) iterator.next();
    final Size2D dimension = line.calculateDimensions(g2);
    width = Math.max(width, dimension.getWidth());
    height = height + dimension.getHeight();
  }
  return new Size2D(width, height);
}
 
origin: jfree/jcommon

  anchor, d.getWidth(), d.getHeight()
);
final Rectangle2D bounds = new Rectangle2D.Double(
  anchorX + offsets[0], anchorY + offsets[1], 
  d.getWidth(), d.getHeight()
);
final Shape rotatedBounds = ShapeUtilities.rotateShape(
org.jfree.uiSize2D

Javadoc

A simple class for representing the dimensions of an object. It would be better to use Dimension2D, but this class is broken on various JDK releases (particularly JDK 1.3.1, refer to bugs 4189446 and 4976448 on the Java bug parade).

Most used methods

  • <init>
    Creates a new instance with the specified width and height.
  • getHeight
    Returns the height.
  • getWidth
    Returns the width.

Popular in Java

  • Finding current android device location
  • startActivity (Activity)
  • findViewById (Activity)
  • getApplicationContext (Context)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Github Copilot alternatives
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