sk.upjs.fontmapper
Class BinaryPacker.Node

java.lang.Object
  extended by sk.upjs.fontmapper.BinaryPacker.Node
Enclosing class:
BinaryPacker

private class BinaryPacker.Node
extends java.lang.Object

Node of the binary tree that can specify space taken by a texture or contain more nodes.


Field Summary
 java.awt.Rectangle bounds
          Area belonging to the node.
private  BinaryPacker.Node child_a_
          Child nodes, if any.
private  BinaryPacker.Node child_b_
           
private  boolean full_
          Is this node taken by a texture?
 
Constructor Summary
BinaryPacker.Node(java.awt.Rectangle b)
          Constructs a node containing specified space.
 
Method Summary
 BinaryPacker.Node insert(java.awt.Dimension size)
          Try to insert a texture space with given size to the node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bounds

public java.awt.Rectangle bounds
Area belonging to the node.


child_a_

private BinaryPacker.Node child_a_
Child nodes, if any.


child_b_

private BinaryPacker.Node child_b_

full_

private boolean full_
Is this node taken by a texture?

Constructor Detail

BinaryPacker.Node

public BinaryPacker.Node(java.awt.Rectangle b)
Constructs a node containing specified space.

Method Detail

insert

public BinaryPacker.Node insert(java.awt.Dimension size)
Try to insert a texture space with given size to the node.

Parameters:
size - Size of the space needed.
Returns:
node with space for the texture on success.