Examples of TextLayout


Examples of net.sf.jiga.xtended.impl.game.TextLayout

        g.translate(-translate.x, -translate.y);
        g.setColor(c);
        g.setStroke(s);
        cps = g.getComposite();
        g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.5f));
        TextLayout args = new TextLayout(new Point(0, 0), TextLayout.POS.LEFT, TextLayout.POS.TOP, 10, 10, new Rectangle(getSize()));
        GUIConsoleOutput._drawNewLine(args, g, new GUIConsoleOutput.LineBuffer("-RIGHT CLICK (CMD CLICK) for help-"), 0);
        g.setComposite(cps);
        g.setClip(clip);
        if (JXAenvUtils._debug) {
            System.err.println("MODELPANEL paint RECT'S completed");
View Full Code Here

Examples of org.eclipse.swt.graphics.TextLayout

     * Creates and initializes the text layout used to compute the size hint.
     *
     * @since 3.2
     */
    private void createTextLayout() {
        fTextLayout = new TextLayout(fBrowser.getDisplay());

        // Initialize fonts
        final String symbolicFontName = fSymbolicFontName == null ? JFaceResources.DIALOG_FONT
                : fSymbolicFontName;
        Font font = JFaceResources.getFont(symbolicFontName);
View Full Code Here

Examples of org.eclipse.swt.graphics.TextLayout

  }

  private TextLayout getSharedTextLayout(Display display) {
    if (cachedTextLayout == null) {
      int orientation = viewer.getControl().getStyle() & (SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT);
      cachedTextLayout = new TextLayout(display);
      cachedTextLayout.setOrientation(orientation);
    }
    return cachedTextLayout;
  }
View Full Code Here

Examples of org.eclipse.swt.graphics.TextLayout

      return;
   
    ViewerCell cell= getViewerCell(event, element);
    boolean applyColors = useColors(event);
   
    TextLayout layout = getSharedTextLayout(event.display);
   
    int textWidthDelta = deltaOfLastMeasure = updateTextLayout(layout, cell, applyColors);

    event.width += textWidthDelta;
  }
View Full Code Here

Examples of org.eclipse.swt.graphics.TextLayout

      }
    }

    Rectangle textBounds = cell.getTextBounds();
    if (textBounds != null) {
      TextLayout textLayout= getSharedTextLayout(event.display);
      // text layout already configured in measure(Event, Object)
     
      Rectangle layoutBounds = textLayout.getBounds();
 
      int x = textBounds.x;
      int y = textBounds.y
          + Math.max(0, (textBounds.height - layoutBounds.height) / 2);
 
      textLayout.draw(gc, x, y);
    }

    if (drawFocus(event)) {
      Rectangle focusBounds = cell.getViewerRow().getBounds();
      gc.drawFocus(focusBounds.x, focusBounds.y, focusBounds.width + deltaOfLastMeasure,
View Full Code Here

Examples of org.jboss.fresh.util.TextLayout

      if (params != null && !params.isEmpty()) {
          StringBuffer sb = new StringBuffer();
          for (String line = job.readLine(); line != null; line = job.readLine()) {
              sb.append(line).append("\r\n");             
          }
      TextLayout tl = new TextLayout("{","}");
      tl.setPattern(sb.toString());
      StringWriter sw = new StringWriter();
      tl.bind(sw, params);
      return new BufferedReader(new StringReader(sw.toString()));
      }
      return job;
  }
View Full Code Here

Examples of playn.core.TextLayout

        return this;
    }

    /** Adds a static label that spans the width of the HUD. */
    public void add (String label, final boolean header) {
        final TextLayout layout = graphics().layoutText(label, _fmt);
        _rows.add(new Row() {
            public void update () {} // noop
            public float labelWidth () { return 0; }
            public float width () { return layout.width(); }
            public float height() { return layout.height(); }
            public void render (Canvas canvas, float x, float y, float valueX) {
                if (header) canvas.drawLine(0, y-1, canvas.width(), y-1);
                canvas.fillText(layout, x, y);
                float by = y + layout.height();
                if (header) canvas.drawLine(0, by, canvas.width(), by);
            }
        });
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.