Package limelight.styles

Examples of limelight.styles.Style


    if(!model.hasText())
      return;

    float y = model.getYOffset();

    Style style = model.getContainer().getStyle();
    graphics.setColor(style.getCompiledTextColor().getColor());

    for(TypedLayout line : model.getLines())
    {
      int x = model.getXOffset(line);
      y += line.getAscent();
View Full Code Here


    panel.markAsDirty();
  }

  public void layoutRows(PropPanel panel, Dimension consumeDimension, LinkedList<Row> rows, int dx, int dy)
  {
    Style style = panel.getStyle();
    int y = style.getCompiledVerticalAlignment().getY(consumeDimension.height, panel.getChildConsumableBounds());
    y = Math.max(0, y);
    y -= dy;
    for(Row row : rows)
    {
      int x = style.getCompiledHorizontalAlignment().getX(row.width, panel.getChildConsumableBounds());
      x = Math.max(0, x);
      x -= dx;
      row.layoutComponents(x, y, style.getCompiledVerticalAlignment());
      y += row.height;
    }
  }
View Full Code Here

  public void observerAddedForLineStyling() throws Exception
  {
    panel.setText("some text", parent);
    panel.buildLines();

    Style style = panel.getTextChunks().get(0).getStyle();
    assertEquals(true, style.hasObserver(panel));
  }
View Full Code Here

  }

  @Test
  public void hasDropDownPopupList() throws Exception
  {
    Style popup = styles.get("limelight_builtin_drop_down_popup_list");

    assertNotNull(popup);
    assertEquals("on", popup.getFloat());
  }
View Full Code Here

  }

  @Test
  public void hasDropDownListItem() throws Exception
  {
    Style popup = styles.get("limelight_builtin_drop_down_popup_list_item");

    assertNotNull(popup);
    assertEquals("10", popup.getLeftPadding());

    Style hover = styles.get("limelight_builtin_drop_down_popup_list_item_selected");
    assertEquals(Colors.toString(Colors.resolve("white")), hover.getTextColor());
  }
View Full Code Here

  }

  @Test
  public void hasCurtains() throws Exception
  {
    Style curtains = styles.get("limelight_builtin_curtains");

    assertNotNull(curtains);
    assertEquals("on", curtains.getFloat());
  }
View Full Code Here

    }
  }

  public void applyAlphaCompositeFor(Panel panel, Graphics2D graphics)
  {
    Style style = panel.getStyle();
    double alphaPercentage = style.getCompiledTransparency().getPercentage();
    if(alphaPercentage > 0)
    {
      float alpha = (float) (1.0f - (alphaPercentage / 100.0f));

      Composite alphaComposite = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, alpha);
View Full Code Here

    }
  }

  private void handleAutoDimensions(ImagePanel panel, Dimension size)
  {
    Style style = panel.getStyle();
    boolean autoWidth = style.getCompiledWidth() instanceof AutoDimensionValue;
    boolean autoHeight = style.getCompiledHeight() instanceof AutoDimensionValue;
    if(autoWidth && autoHeight)
    {
      size.width = (int) (panel.getRotatedWidth() + 0.5);
      size.height = (int) (panel.getRotatedHeight() + 0.5);
    }
View Full Code Here

  {
  }

  public void paint(Graphics2D graphics, PaintablePanel panel)
  {
    Style style = panel.getStyle();
    Border border = panel.getBorderShaper();
    Shape insideBorder = border.getShapeInsideBorder();

    Color backgroundColor = style.getCompiledBackgroundColor().getColor();

    if(style.getCompiledGradient().isOn())
      GradientPainter.instance.paint(graphics, panel);
    else
    {
      if(backgroundColor.getAlpha() > 0)
      {
        graphics.setColor(backgroundColor);
        graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
        graphics.fill(insideBorder);
        graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
      }
    }

    NoneableValue<StringValue> backgroundImageAttribute = style.getCompiledBackgroundImage();
    if (!backgroundImageAttribute.isNone())
    {
      try
      {
        Box borderFrame = panel.getBorderedBounds();
        Scene rootPanel = panel.getRoot();

        // TODO MDM - getting a NullPointer here. The Panel was removed from the scene in between the start of the paint cycle and here.
        if(rootPanel == null)
          return;

        ImageCache cache = rootPanel.getImageCache();
        Image image = cache.getImage(backgroundImageAttribute.getAttribute().getValue());
        Graphics2D borderedGraphics = (Graphics2D) graphics.create(borderFrame.x, borderFrame.y, borderFrame.width, borderFrame.height);
        style.getCompiledBackgroundImageFillStrategy().fill(borderedGraphics, image, style.getCompiledBackgroundImageX(), style.getCompiledBackgroundImageY());
      }
      catch (IOException e)
      {
        e.printStackTrace();
      }
View Full Code Here

  {
  }

  public void paint(Graphics2D graphics, PaintablePanel panel)
  {
    Style style = panel.getStyle();
    Box r = panel.getBorderedBounds();
    Color color1 = style.getCompiledBackgroundColor().getColor();
    Color color2 = style.getCompiledSecondaryBackgroundColor().getColor();
    int angle = style.getCompiledGradientAngle().getDegrees();
    double penetration = style.getCompiledGradientPenetration().getPercentage();
    boolean cyclic = style.getCompiledCyclicGradient().isOn();
    int x1, y1, x2, y2;
    if(angle == 90)
    {
      x1 = x2 = r.width / 2;
      y1 = r.height;
View Full Code Here

TOP

Related Classes of limelight.styles.Style

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.