Codota Logo
Graphics.drawText
Code IndexAdd Codota to your IDE (free)

How to use
drawText
method
in
smile.plot.Graphics

Best Java code snippets using smile.plot.Graphics.drawText (Showing top 13 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
SimpleDateFormat s =
  • Codota IconString pattern;new SimpleDateFormat(pattern)
  • Codota IconString template;Locale locale;new SimpleDateFormat(template, locale)
  • Codota Iconnew SimpleDateFormat()
  • Smart code suggestions by Codota
}
origin: com.github.haifengl/smile-plot

/**
 * Draw a string. Reference point is the center of string. The coordinates
 * are logical coordinates.
 */
public void drawText(String label, double[] coord) {
  drawText(label, 0.5, 0.5, 0.0, coord);
}
origin: com.github.haifengl/smile-plot

/**
 * Draw a string with given rotation angle. Reference point is the center
 * of string. The coordinates are logical coordinates. The angle of rotation
 * is in radians.
 */
public void drawText(String label, double rotation, double[] coord) {
  drawText(label, 0.5, 0.5, rotation, coord);
}
origin: com.github.haifengl/smile-plot

/**
 * Draw a string with given reference point. (0.5, 0.5) is center, (0, 0) is
 * lower left, (0, 1) is upper left, etc. The coordinates are logical coordinates.
 */
public void drawText(String label, double horizontalReference, double verticalReference, double[] coord) {
  drawText(label, horizontalReference, verticalReference, 0.0, coord);
}
origin: stackoverflow.com

 public class MyBitmapField extends BitmapField {
//...       
protected void paintBitmap(Graphics g, int arg1, int arg2, int arg3,
    int arg4, Bitmap arg5, int arg6, int arg7) {            
  super.paintBitmap(g, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
  g.drawText("Your text", 5,5 );  
}

// ...

}
origin: stackoverflow.com

 public void drawMultipleLines(Graphics graphics, String text, int X, int Y, int XavailableSpace) {
  String[] texts = UiSpliter.split(text, " "); //UiSpliter is a class that will split the string into string array based on the ' ' character
  int x = X;
  int y = Y;
  for (int i = 0 ; i < texts.length ; i ++) {
    if (x + getFont().getAdvance(texts[i]) - X > XavailableSpace) {
      if (!(x == X)) {
        x = X;
        y = y + getFont().getHeight();
      }
    }
    graphics.drawText(texts[i] + " ", x, y);
    x += getFont().getAdvance(texts[i] + " ");
  }
}
origin: stackoverflow.com

 ObjectChoiceField choice = new ObjectChoiceField()
{      
 protected void paint(Graphics graphics)
 {
  // Get the current selected Choice
  Choice item = (Choice) this.getChoice(getSelectedIndex());

  int xOffset = 5; // 5 px padding on the left
  graphics.drawBitmap(xOffset, 0, 
            item.image.getWidth(), 
            item.image.getHeight(), 
            item.image, 
            0, 0);
  // Add text after the image and 10px padding.
  xOffset += item.image.getWidth() + 10; 
  graphics.drawText(item.label, xOfffset, 0);
 }            
};
origin: stackoverflow.com

graphics.drawText(currentText, 0, 0, DrawStyle.ELLIPSIS, 200);
super.paint(graphics);
origin: stackoverflow.com

g.drawText(text, 0, y, 0, w);
origin: stackoverflow.com

    .valueOf(mBooleanValues[node] ? 
    Characters.BALLOT_BOX_WITH_CHECK : Characters.BALLOT_BOX);
g.drawText(check, indent, y, DrawStyle.LEFT);
g.drawText(mStringValues[node], indent + 20, y, DrawStyle.RIGHT
    | ELLIPSIS);
origin: stackoverflow.com

g.drawText(rowString.toString(), 0, y, 0, -1);
origin: com.github.haifengl/smile-plot

@Override
public void paint(Graphics g) {
  Color c = g.getColor();
  g.setColor(getColor());
  if (labels != null) {
    for (int i = 0; i < data.length; i++) {
      g.drawText(labels[i], data[i]);
    }
  } else {
    if (y == null) {
      for (int i = 0; i < data.length; i++) {
        g.drawPoint(legend, data[i]);
      }
    } else {
      for (int i = 0; i < data.length; i++) {
        if (palette != null) {
          g.setColor(palette[classLookupTable.get(y[i])]);
        }
        
        if (legends != null) {
          g.drawPoint(legends[classLookupTable.get(y[i])], data[i]);
        } else {
          g.drawPoint(legend, data[i]);
        }
      }
    }
  }
  g.setColor(c);
}
origin: com.github.haifengl/smile-plot

@Override
public void paint(Graphics g) {
  Font f = g.getFont();
  if (font != null) {
    g.setFont(font);
  }
  Color c = g.getColor();
  g.setColor(getColor());
  g.drawText(text, horizontalReference, verticalReference, rotation, coord);
  g.setColor(c);
  if (font != null) {
    g.setFont(f);
  }
}
origin: stackoverflow.com

if(obj != null && obj instanceof MyItem) {
  MyItem item = (MyItem) obj;
  g.drawText(item.toString(), 20 * (1 + index), y);
} else if(index == 0) {
  g.drawText("ssssssss", 0, y);
smile.plotGraphicsdrawText

Javadoc

Draw a string with given reference point and rotation angle. (0.5, 0.5) is center, (0, 0) is lower left, (0, 1) is upper left, etc. The angle of rotation is in radians. The coordinates are logical coordinates.

Popular methods of Graphics

  • <init>
    Constructor.
  • clearClip
    Clear the restriction of the draw area.
  • clip
    Restrict the draw area to the valid base coordinate space.
  • drawBitmap
  • drawLine
    Draw poly line.
  • drawLineBaseRatio
    Draw poly line. The logical coordinates are proportional to the base coordinates.
  • drawPoint
    Draw a dot. The coordinates are in logical coordinates.
  • drawRect
    Draw the outline of the specified rectangle.
  • drawRectBaseRatio
    Draw the outline of the specified rectangle. The logical coordinates are proportional to the base co
  • drawTextBaseRatio
    Draw a string with given rotation angle. Reference point is the center of string. The logical coordi
  • fillPolygon
    Fill polygon. The coordinates are in logical coordinates.
  • fillRect
    Fill the specified rectangle.
  • fillPolygon,
  • fillRect,
  • fillRectBaseRatio,
  • getColor,
  • getFont,
  • getLowerBound,
  • getStroke,
  • getUpperBound,
  • rotate

Popular in Java

  • Finding current android device location
  • getExternalFilesDir (Context)
  • getSupportFragmentManager (FragmentActivity)
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • Path (java.nio.file)
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
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