Package limelight.util

Examples of limelight.util.Box


    half = new PercentageYCoordinateValue(50.0);
  }

  public void testGetY() throws Exception
  {
    assertEquals(10, dime.getY(0, new Box(0, 0, 100, 100)));
    assertEquals(15, dime.getY(0, new Box(0, 5, 100, 100)));
    assertEquals(50, dime.getY(0, new Box(0, 0, 100, 500)));

    assertEquals(50, half.getY(0, new Box(0, 0, 100, 100)));
    assertEquals(55, half.getY(0, new Box(0, 5, 100, 100)));
    assertEquals(250, half.getY(0, new Box(0, 0, 100, 500)));
  }
View Full Code Here


    fifty = new StaticYCoordinateValue(50);
  }

  public void testGetY() throws Exception
  {
    assertEquals(10, ten.getY(0, new Box(0, 0, 100, 100)));
    assertEquals(15, ten.getY(0, new Box(0, 5, 100, 100)));
    assertEquals(10, ten.getY(-1, new Box(0, 0, 100, 100)));

    assertEquals(50, fifty.getY(0, new Box(0, 0, 100, 100)));
  }
View Full Code Here

  public void doFinalization(Panel thePanel)
  {
    PanelBase panel = (PanelBase)thePanel;
    if(panel.isFloater())
    {
      Box area = panel.getParent().getChildConsumableBounds();
      int newX = panel.getStyle().getCompiledX().getX(0, area);
      int newY = panel.getStyle().getCompiledY().getY(0, area);
      panel.markAsDirty();
      panel.setLocation(newX, newY);
      panel.markAsDirty();
View Full Code Here

    composite = rootGraphics.getComposite();
  }

  public void paint(Panel panel)
  {
    Box panelBounds = panel.getAbsoluteBounds();
    int x = panelBounds.x - clip.x;
    int y = panelBounds.y - clip.y;

    Graphics2D graphics = (Graphics2D) rootGraphics.create(x, y, panel.getWidth(), panel.getHeight());
    paint(panel, graphics);
View Full Code Here

    return rootGraphics;
  }

  public boolean panelIsInClip(Panel panel)
  {
    Box panelClip = panel.getAbsoluteBounds();
    return panelClip != null && clip.intersects(panelClip);
  }
View Full Code Here

  public void paintChildren(ParentPanelBase panel, Graphics2D graphics)
  {
    if(panel.hasChildren())
    {
      Box innards = panel instanceof PropPanel ? ((PropPanel)panel).getPaddedBounds() :  panel.getChildConsumableBounds() ;
      graphics.clipRect(innards.x, innards.y, innards.width, innards.height);
      for(Panel child : panel.getChildren())
        if(!child.isFloater())
          paintChild(graphics, child);
      for(Panel child : panel.getChildren())
View Full Code Here

  }

  public Box getBounds()
  {
    if(boundingBox == null)
      boundingBox = new Box(getX(), getY(), getWidth(), getHeight());
    return boundingBox;
  }
View Full Code Here

  public Box getAbsoluteBounds()
  {
    if(absoluteBounds == null)
    {
      Point absoluteLocation = getAbsoluteLocation();
      absoluteBounds = new Box(absoluteLocation.x, absoluteLocation.y, getWidth(), getHeight());
    }
    return absoluteBounds;
  }
View Full Code Here

    return ancestor;
  }

  public Graphics2D getGraphics()
  {
    Box bounds = getAbsoluteBounds();
    return (Graphics2D) getRoot().getGraphics().create(bounds.x, bounds.y, bounds.width, bounds.height);
  }
View Full Code Here

  @Override
  public void doExpansion(Panel thePanel)
  {
    ImagePanel panel = (ImagePanel) thePanel;
    Box consumableArea = panel.getParent().getChildConsumableBounds();
    if(panel.getImage() == null)
      return;


    Dimension size;
View Full Code Here

TOP

Related Classes of limelight.util.Box

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.