Package limelight.styles

Examples of limelight.styles.ScreenableStyle


      final String text = panel.getText();

      if(text == null || text.length() == 0)
        return;

      final ScreenableStyle style = panel.getStyle();
      graphics.setColor(style.getCompiledTextColor().getColor());

      TextLayout textLayout = new TextLayout(text, Fonts.fromStyle(style), TextPanel.getRenderContext());
      int height = (int) ((textLayout.getAscent() + textLayout.getDescent() + textLayout.getLeading()) + 0.5);
      int width = (int) (textLayout.getBounds().getWidth() + textLayout.getBounds().getX() + 0.5);
      final Dimension textDimensions = new Dimension(width, height);

      int textX = style.getCompiledHorizontalAlignment().getX(textDimensions.width, panel.getBounds());
      float textY = style.getCompiledVerticalAlignment().getY(textDimensions.height, panel.getBounds()) + textLayout.getAscent();
      textLayout.draw(graphics, textX, textY + 1);
    }
View Full Code Here


  public int paintIndex;
  public boolean consumableAreaChangedCalled;

  public MockParentPanel()
  {
    style = new ScreenableStyle();
  }
View Full Code Here

  public boolean consumableAreaChangedCalled;
  public boolean markedAsDirty;

  public MockPanel()
  {
    style = new ScreenableStyle();
    canBeBuffered = true;
  }
View Full Code Here

TOP

Related Classes of limelight.styles.ScreenableStyle

Copyright © 2018 www.massapicom. 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.