congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
Graphics.drawText
Code IndexAdd Tabnine 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)

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
  • notifyDataSetChanged (ArrayAdapter)
  • runOnUiThread (Activity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • Notification (javax.management)
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Top PhpStorm plugins
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