Tabnine Logo
ShortTextTitle
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: org.codehaus.jtstand/jtstand-chart

/**
 * Arranges the content for this title assuming no bounds on the width
 * or the height, and returns the required size.
 *
 * @param g2  the graphics target.
 *
 * @return The content size.
 */
protected Size2D arrangeNN(Graphics2D g2) {
  Range max = new Range(0.0, Float.MAX_VALUE);
  return arrangeRR(g2, max, max);
}
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;
}
origin: jfree/jfreechart

RectangleConstraint cc = toContentConstraint(constraint);
LengthConstraintType w = cc.getWidthConstraintType();
LengthConstraintType h = cc.getHeightConstraintType();
if (w == LengthConstraintType.NONE) {
  if (h == LengthConstraintType.NONE) {
    contentSize = arrangeNN(g2);
    contentSize = arrangeRN(g2, cc.getWidthRange());
    contentSize = arrangeRR(g2, cc.getWidthRange(),
        cc.getHeightRange());
    contentSize = arrangeFN(g2, cc.getWidth());
  return new Size2D(calculateTotalWidth(contentSize.getWidth()),
      calculateTotalHeight(contentSize.getHeight()));
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 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.codehaus.jtstand/jtstand-chart

RectangleConstraint cc = toContentConstraint(constraint);
LengthConstraintType w = cc.getWidthConstraintType();
LengthConstraintType h = cc.getHeightConstraintType();
if (w == LengthConstraintType.NONE) {
  if (h == LengthConstraintType.NONE) {
    contentSize = arrangeNN(g2);
    contentSize = arrangeRN(g2, cc.getWidthRange());
    contentSize = arrangeRR(g2, cc.getWidthRange(),
        cc.getHeightRange());
    contentSize = arrangeFN(g2, cc.getWidth());
  return new Size2D(calculateTotalWidth(contentSize.getWidth()),
      calculateTotalHeight(contentSize.getHeight()));
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: jfree/jfreechart

/**
 * 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.
 */
@Override
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/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: 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

/**
 * Arranges the content for this title assuming no bounds on the width
 * or the height, and returns the required size.
 *
 * @param g2  the graphics target.
 *
 * @return The content size.
 */
@Override
protected Size2D arrangeNN(Graphics2D g2) {
  Range max = new Range(0.0, Float.MAX_VALUE);
  return arrangeRR(g2, max, max);
}
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);
  }
}
org.jfree.chart.titleShortTextTitle

Javadoc

A text title that is only displayed if the entire text will be visible without line wrapping. It is only intended for use with short titles - for general purpose titles, you should use the TextTitle class.

Most used methods

  • 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
  • getFont
  • getPaint
  • getText
  • setText
  • toContentConstraint
  • setText,
  • toContentConstraint,
  • trimBorder,
  • trimMargin,
  • trimPadding,
  • <init>

Popular in Java

  • Creating JSON documents from java classes using gson
  • setContentView (Activity)
  • getApplicationContext (Context)
  • getContentResolver (Context)
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Best plugins for Eclipse
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