public void controlResized(ControlEvent e) { try { resizing = true; Point size = getSize(); width = size.x; height = size.y; int count = channelArray.length; if (count == 0) { return; } int oldChannelHeight = channelHeight; if (oldChannelHeight == 0) { oldChannelHeight = 1; } channelHeight = height / (2 * count); int y = channelHeight; for (Channel channel : channelArray) { channel.resize(y, oldChannelHeight); y += channelHeight + channelHeight; } } finally { resizing = false; } }