gt:                 List<String> tips = Splitter.on("\n").splitToList(tooltip);
context: package us.ichun.mods.ichunutil.client.gui.window;
  
  import com.google.common.base.Splitter;
  import net.minecraft.client.gui.FontRenderer;
  import net.minecraft.client.gui.GuiScreen;
  import net.minecraft.client.renderer.GlStateManager;
  import net.minecraft.util.StatCollector;
  import org.lwjgl.input.Keyboard;
  import org.lwjgl.input.Mouse;
  import us.ichun.mods.ichunutil.client.gui.Theme;
  import us.ichun.mods.ichunutil.client.gui.window.element.Element;
  import us.ichun.mods.ichunutil.client.gui.window.element.ElementWindow;
  import us.ichun.mods.ichunutil.client.gui.window.element.ITextInput;
  import us.ichun.mods.ichunutil.client.render.RendererHelper;
  
  import java.util.ArrayList;
  import java.util.List;
  
  public abstract class IWorkspace extends GuiScreen
  {
      public int oldWidth;
      public int oldHeight;
  
      public int liveTime;
      public boolean resize;
  
      public Element elementHovered;
      public int hoverTime;
      public boolean hovering;
      public int tooltipTime = 20;
  
      public Element elementDragged;
      public int elementDragX;
      public int elementDragY;
  
      public Element elementSelected;
      public int selectedMouseX;
      public int selectedMouseY;
  
      public Window windowDragged;
      public int dragType; //1 = title drag, 2 >= border drag.
  
      public boolean mouseLeftDown;
      public boolean mouseRightDown;
      public boolean mouseMiddleDown;
  
      public int VARIABLE_LEVEL = 4;
  
      public int TOP_DOCK_HEIGHT = 19;
  
      public Theme currentTheme = Theme.copyInstance();
  
      public ArrayList<ArrayList<Window>> levels = new ArrayList<ArrayList<Window>>();
  
      public abstract boolean canClickOnElement(Window window, Element element);
  
      public FontRenderer getFontRenderer()
      {
          return fontRendererObj;
      }
  
      @Override
      public void initGui()
      {
          super.initGui();
          resize = true;
          screenResize();
  
          Keyboard.enableRepeatEvents(true);
      }
  
      @Override
      public void updateScreen()
      {
          if(resize)
          {
              resize = false;
              screenResize();
          }
          if(elementHovered != null)
          {
              hoverTime++;
          }
          for(int i = levels.size() - 1; i >= 0; i--)//clean up empty levels.
          {
              if(levels.get(i).isEmpty()&& i >= VARIABLE_LEVEL)
              {
                  levels.remove(i);
              }
              else
              {
                  for(int j = levels.get(i).size() - 1; j >= 0; j--)
                  {
                      levels.get(i).get(j).update();
                  }
              }
          }
          liveTime++;
      }
  
      public boolean drawWindows(int mouseX, int mouseY) //returns true if mouse is on a window
      {
          hovering = false;
          boolean hasClicked = false;
          boolean onWindow = false;
          Element prevElementSelected = elementSelected;
          elementSelected = null;
  
          GlStateManager.enableDepth();
          GlStateManager.depthMask(true);
          GlStateManager.translate(0F, 0F, 100F);
          for(int i = levels.size() - 1; i >= 0 ; i--)
          {
              for(int j = levels.get(i).size() - 1; j >= 0; j--)
              {
                  Window window = levels.get(i).get(j);
                  if(mouseX >= window.posX && mouseX <= window.posX + window.getWidth() && mouseY >= window.posY && mouseY <= window.posY + window.getHeight())
                  {
                      onWindow = true;
                      if(!hasClicked && liveTime > 5)
                      {
                          if(Mouse.isButtonDown(0) && !mouseLeftDown)
                          {
                              windowDragged = window;
                              dragType = window.onClick(mouseX - window.posX, mouseY - window.posY, 0);
                              hasClicked = true;
                          }
                          if(Mouse.isButtonDown(1) && !mouseRightDown)
                          {
                              windowDragged = window;
                              dragType = window.onClick(mouseX - window.posX, mouseY - window.posY, 1);
                              hasClicked = true;
                          }
                          if(Mouse.isButtonDown(2) && !mouseMiddleDown)
                          {
                              windowDragged = window;
                              dragType = window.onClick(mouseX - window.posX, mouseY - window.posY, 2);
                              hasClicked = true;
                          }
                      }
                  }
                  window.draw(mouseX - window.posX, mouseY - window.posY);
              }
              GlStateManager.translate(0F, 0F, -10F);
          }
          RendererHelper.endGlScissor();//end scissor in case any window does it incorrectly.
  
          if(!hasClicked)
          {
              if((Mouse.isButtonDown(0) && !mouseLeftDown || Mouse.isButtonDown(1) && !mouseRightDown || Mouse.isButtonDown(2) && !mouseMiddleDown) && prevElementSelected != null && !(mouseX >= prevElementSelected.getPosX() && mouseX <= prevElementSelected.getPosX() + prevElementSelected.width && mouseY >= prevElementSelected.getPosY() && mouseY <= prevElementSelected.getPosY() + prevElementSelected.height))
              {
                  prevElementSelected.deselected();
              }
              else
              {
                  elementSelected = prevElementSelected;
              }
          }
          else if(elementSelected != prevElementSelected)
          {
              if(elementSelected != null)
              {
                  elementSelected.selected();
                  if(elementSelected instanceof ITextInput)
                  {
                      elementSelected.onClick(selectedMouseX, selectedMouseY, 0);
                  }
              }
              if(prevElementSelected != null)
              {
                  prevElementSelected.deselected();
              }
          }
          else
          {
              elementSelected = prevElementSelected;
          }
          return onWindow;
      }
  
      public void updateElementHovered(int mouseX, int mouseY, int scroll)
      {
          if(!hovering)
          {
              elementHovered = null;
              hoverTime = 0;
          }
          else if(elementHovered != null)
          {
              boolean activated = false;
              if(scroll != 0)//scroll up
              {
                  activated = elementHovered.mouseScroll(mouseX - elementHovered.parent.posX, mouseY - elementHovered.parent.posY, (int)Math.round(scroll / 120));
              }
              if(activated)
              {
                  if(elementSelected != null)
                  {
                      elementSelected.deselected();
                  }
                  elementHovered.onClick(mouseX - elementHovered.parent.posX, mouseY - elementHovered.parent.posY, 2);
                  elementSelected = elementHovered;
              }
              String tooltip = elementHovered.tooltip();
              if(hoverTime > tooltipTime && tooltip != null) //1s to draw tooltip
              {
                  GlStateManager.translate(0F, 0F, 20F * levels.size());
  