Codota Logo
ShortTextTitle.getFont
Code IndexAdd Codota to your IDE (free)

How to use
getFont
method
in
org.jfree.chart.title.ShortTextTitle

Best Java code snippets using org.jfree.chart.title.ShortTextTitle.getFont (Showing top 6 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
StringBuilder s =
  • Codota Iconnew StringBuilder()
  • Codota Iconnew StringBuilder(32)
  • Codota IconString str;new StringBuilder(str)
  • Smart code suggestions by Codota
}
origin: jfree/jfreechart

/**
 * Arranges the content for this title assuming a fixed 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 w  the width.
 *
 * @return The content size.
 */
@Override
protected Size2D arrangeFN(Graphics2D g2, double w) {
  g2.setFont(getFont());
  FontMetrics fm = g2.getFontMetrics(getFont());
  Rectangle2D bounds = TextUtils.getTextBounds(getText(), g2, fm);
  if (bounds.getWidth() <= w) {
    return new Size2D(w, bounds.getHeight());
  }
  else {
    return new Size2D(0.0, 0.0);
  }
}
origin: org.codehaus.jtstand/jtstand-chart

/**
 * Arranges the content for this title assuming a fixed 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 w  the width.
 *
 * @return The content size.
 */
protected Size2D arrangeFN(Graphics2D g2, double w) {
  g2.setFont(getFont());
  FontMetrics fm = g2.getFontMetrics(getFont());
  Rectangle2D bounds = TextUtilities.getTextBounds(getText(), g2, fm);
  if (bounds.getWidth() <= w) {
    return new Size2D(w, bounds.getHeight());
  }
  else {
    return new Size2D(0.0, 0.0);
  }
}
origin: org.codehaus.jtstand/jtstand-chart

/**
 * Returns the content size for the title.
 *
 * @param g2  the graphics device.
 * @param widthRange  the width range.
 * @param heightRange  the height range.
 *
 * @return The content size.
 */
protected Size2D arrangeRR(Graphics2D g2, Range widthRange,
    Range heightRange) {
  g2.setFont(getFont());
  FontMetrics fm = g2.getFontMetrics(getFont());
  Rectangle2D bounds = TextUtilities.getTextBounds(getText(), g2, fm);
  if (bounds.getWidth() <= widthRange.getUpperBound()
      && bounds.getHeight() <= heightRange.getUpperBound()) {
    return new Size2D(bounds.getWidth(), bounds.getHeight());
  }
  else {
    return new Size2D(0.0, 0.0);
  }
}
origin: jfree/jfreechart

/**
 * Returns the content size for the title.
 *
 * @param g2  the graphics device.
 * @param widthRange  the width range.
 * @param heightRange  the height range.
 *
 * @return The content size.
 */
@Override
protected Size2D arrangeRR(Graphics2D g2, Range widthRange,
    Range heightRange) {
  g2.setFont(getFont());
  FontMetrics fm = g2.getFontMetrics(getFont());
  Rectangle2D bounds = TextUtils.getTextBounds(getText(), g2, fm);
  if (bounds.getWidth() <= widthRange.getUpperBound()
      && bounds.getHeight() <= heightRange.getUpperBound()) {
    return new Size2D(bounds.getWidth(), bounds.getHeight());
  }
  else {
    return new Size2D(0.0, 0.0);
  }
}
origin: jfree/jfreechart

/**
 * Draws the title using the current font and paint.
 *
 * @param g2  the graphics target.
 * @param area  the title area.
 * @param params  optional parameters (ignored here).
 *
 * @return {@code null}.
 */
@Override
public Object draw(Graphics2D g2, Rectangle2D area, Object params) {
  if (area.isEmpty()) {
    return null;
  }
  area = trimMargin(area);
  drawBorder(g2, area);
  area = trimBorder(area);
  area = trimPadding(area);
  g2.setFont(getFont());
  g2.setPaint(getPaint());
  TextUtils.drawAlignedString(getText(), g2, (float) area.getMinX(),
      (float) area.getMinY(), TextAnchor.TOP_LEFT);
  return null;
}
origin: org.codehaus.jtstand/jtstand-chart

/**
 * Draws the title using the current font and paint.
 *
 * @param g2  the graphics target.
 * @param area  the title area.
 * @param params  optional parameters (ignored here).
 *
 * @return <code>null</code>.
 */
public Object draw(Graphics2D g2, Rectangle2D area, Object params) {
  if (area.isEmpty()) {
    return null;
  }
  area = trimMargin(area);
  drawBorder(g2, area);
  area = trimBorder(area);
  area = trimPadding(area);
  g2.setFont(getFont());
  g2.setPaint(getPaint());
  TextUtilities.drawAlignedString(getText(), g2, (float) area.getMinX(),
      (float) area.getMinY(), TextAnchor.TOP_LEFT);
  return null;
}
org.jfree.chart.titleShortTextTitlegetFont

Popular methods of ShortTextTitle

  • arrangeFN
    Arranges the content for this title assuming a fixed width and no bounds on the height, and returns
  • arrangeNN
    Arranges the content for this title assuming no bounds on the width or the height, and returns the r
  • arrangeRN
    Arranges the content for this title assuming a range constraint for the width and no bounds on the h
  • arrangeRR
    Returns the content size for the title.
  • calculateTotalHeight
  • calculateTotalWidth
  • drawBorder
  • getPaint
  • getText
  • setText
  • toContentConstraint
  • trimBorder
  • toContentConstraint,
  • trimBorder,
  • trimMargin,
  • trimPadding,
  • <init>

Popular in Java

  • Reading from database using SQL prepared statement
  • scheduleAtFixedRate (ScheduledExecutorService)
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • getSharedPreferences (Context)
  • ObjectMapper (com.fasterxml.jackson.databind)
    This mapper (or, data binder, or codec) provides functionality for converting between Java objects (
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • Dictionary (java.util)
    The Dictionary class is the abstract parent of any class, such as Hashtable, which maps keys to valu
  • HashSet (java.util)
    This class implements the Set interface, backed by a hash table (actually a HashMap instance). It m
  • JFileChooser (javax.swing)
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now