gt: 	protected boolean shouldSkipPaint() {
context: package sporemodder.extras.spuieditor.components;
  
  import java.awt.Color;
  import java.awt.Graphics2D;
  import java.awt.Point;
  import java.awt.Rectangle;
  import java.io.IOException;
  import java.util.ArrayList;
  import java.util.Collections;
  import java.util.List;
  import java.util.ListIterator;
  
  import javax.swing.JSpinner;
  import javax.swing.JTree;
  import javax.swing.tree.DefaultMutableTreeNode;
  import javax.swing.tree.DefaultTreeModel;
  import javax.swing.tree.MutableTreeNode;
  import javax.swing.tree.TreePath;
  
  import sporemodder.extras.spuieditor.ComponentChooser;
  import sporemodder.extras.spuieditor.ComponentChooser.ComponentChooserCallback;
  import sporemodder.extras.spuieditor.PanelUtils;
  import sporemodder.extras.spuieditor.PanelUtils.PropertyInfo;
  import sporemodder.extras.spuieditor.PropertiesPanel;
  import sporemodder.extras.spuieditor.RemoveComponentAction;
  import sporemodder.extras.spuieditor.ResourceLoader;
  import sporemodder.extras.spuieditor.SPUIViewer;
  import sporemodder.extras.spuieditor.StyleSheet;
  import sporemodder.extras.spuieditor.StyleSheetInstance;
  import sporemodder.extras.spuieditor.uidesigner.DesignerClass.DesignerClassDelegate;
  import sporemodder.extras.spuieditor.uidesigner.DesignerElement;
  import sporemodder.extras.spuieditor.uidesigner.DesignerProperty;
  import sporemodder.files.formats.LocalizedText;
  import sporemodder.files.formats.spui.InvalidBlockException;
  import sporemodder.files.formats.spui.SPUIBlock;
  import sporemodder.files.formats.spui.SPUIBuilder;
  import sporemodder.files.formats.spui.SPUIComplexSections.SectionText;
  import sporemodder.files.formats.spui.SPUINumberSections.SectionInt;
  import sporemodder.files.formats.spui.SPUINumberSections.SectionIntName;
  import sporemodder.files.formats.spui.SPUINumberSections.SectionShort;
  import sporemodder.files.formats.spui.SPUIObject;
  import sporemodder.files.formats.spui.SPUIVectorSections.SectionVec4;
  import sporemodder.userinterface.JLabelLink;
  import sporemodder.utilities.Hasher;
  
  public class Window extends SPUIDefaultComponent implements WinComponent {
  	
  	public static final int TYPE = 0x4EC1B8D8;
  	
  	protected String name;  // originally an int, we'll convert back when setting the block
  	protected int flags;
  	protected Color tintColor = Color.white;
  	protected Color backgroundColor = new Color(0, 0, 0, 0);
  	protected final Rectangle bounds = new Rectangle();
  	protected final Rectangle realBounds = new Rectangle();
  	protected LocalizedText caption;
  	
  	protected StyleSheetInstance style;
  	protected String styleName;
  	
  	protected WinComponent parent;
  	protected final List<WinComponent> children = new ArrayList<WinComponent>();
  	protected final List<SPUIWinProc> modifiers = new ArrayList<SPUIWinProc>();
  	protected SPUIDrawable drawable;
  	
  	protected PropertyInfo[] areaProperties;
  	
  	private boolean isLayoutWindow;
  	
  	public Window(SPUIBlock block) throws InvalidBlockException, IOException {
  		super(block);
  		
  		if (block == null) {
  			return;
  		}
  		
  		// TODO Auto-generated constructor stub
  		
  		flags = SectionInt.getValues(block, 0xEEC1B000, new int[] { 0 }, 1)[0];
  		name = SectionIntName.getValues(block, 0xEEC1B001, new String[] { null }, 1)[0];
  		if (name != null) {
  			if (name.equals("0") || name.length() == 0) {
  				// no text looks better
  				name = null;
  			}
  			else if (name.startsWith("$")) {
  				name = name.substring(1);
  			}
  		}
  		tintColor = PanelUtils.decodeColor(SectionInt.getValues(block, 0xEEC1B004, new int[] { 0 }, 1)[0]);
  		backgroundColor = decodeColor(SectionInt.getValues(block, 0xEEC1B006, new int[] { 0 }, 1)[0]);
  		
  		caption = SectionText.getValues(block.getSection(0xEEC1B00A, SectionText.class), new LocalizedText[] { null }, 1)[0];
  		
  		int styleID = SectionInt.getValues(block, 0xEEC1B00E, new int[] { 0 }, 1)[0];
  		style = StyleSheet.getActiveStyleSheet().getInstance(styleID);
  		styleName = style == null ? Hasher.getFileName(styleID) : style.getName();
  		
  		float[] boundCoords = SectionVec4.getValues(block.getSection(0xEEC1B005, SectionVec4.class), new float[][] { new float[] {0, 0, 0, 0} }, 1)[0];
  		bounds.x = (int) boundCoords[0];
  		bounds.y = (int) boundCoords[1];
  		bounds.width = (int) (boundCoords[2] - boundCoords[0]);
  		bounds.height = (int) (boundCoords[3] - boundCoords[1]);
  		
  		short[] childrenIndices = SectionShort.getValues(block.getSection(0xEEC1B00B, SectionShort.class), new short[] {}, -1);
  		
  		for (short index : childrenIndices) {
  			WinComponent win = (WinComponent) ResourceLoader.getComponent(block.getParent().get(index));
  			if (win != null) {
  				children.add(win);
  				win.setParent(this);
  				win.setSPUIViewer(viewer);
  			}
  		}
  		
  		short[] modifierIndices = SectionShort.getValues(block.getSection(0xEEC1B00C, SectionShort.class), new short[] {}, -1);
  		
  		for (short index : modifierIndices) {
  			SPUIWinProc mod = (SPUIWinProc) ResourceLoader.getComponent(block.getParent().get(index));
  			if (mod != null) {
  				modifiers.add(mod);
  				mod.setParent(this);
  				mod.setSPUIViewer(viewer);
  			}
  		}
  		
  		short drawableIndex = SectionShort.getValues(block.getSection(0xEEC1B007, SectionShort.class), new short[] {-1}, 1)[0];
  		if (drawableIndex != -1) {
  			drawable = (SPUIDrawable) ResourceLoader.getComponent(block.getParent().get(drawableIndex)); 
  			if (drawable != null) {
  				drawable.setSPUIViewer(viewer);
  			}
  		}
  		
  		addUnassignedIntName(block, 0xEEC1B002, null);
  		addUnassignedInt(block, 0xEEC1B003);
  		addUnassignedInt(block, 0xEEC1B009);
  	}
  	
  	public Window(SPUIViewer viewer) {
  		super(viewer);
  		flags = FLAG_VISIBLE | FLAG_ENABLED;
  		bounds.width = 100;
  		bounds.height = 100;
  		realBounds.setBounds(bounds);
  		tintColor = Color.white;
  		backgroundColor = new Color(0, 0, 0, 0);
  		styleName = "DefaultStyle";
  		style = StyleSheet.getActiveStyleSheet().getInstance(styleName);
  		
  		unassignedProperties.put(0xEEC1B002, null);
  		unassignedProperties.put(0xEEC1B003, 0);
  		unassignedProperties.put(0xEEC1B009, 0);
  	}
  	
  	public Window(SPUIViewer viewer, boolean isLayoutWindow) {
  		super(viewer);
  		this.isLayoutWindow = isLayoutWindow;
  	}
  	
  	@Override
  	public boolean isLayoutWindow() {
  		return isLayoutWindow;
  	}
  
  	public void setLayoutWindow(boolean isLayoutWindow) {
  		this.isLayoutWindow = isLayoutWindow;
  	}
  
  	@Override
  	public List<WinComponent> getChildren() {
  		return children;
  	}
  
  	@Override
  	public List<SPUIWinProc> getModifiers() {
  		return modifiers;
  	}
  	
  	@Override
  	public SPUIBlock saveComponent(SPUIBuilder builder) {
  		
  		SPUIBlock block = (SPUIBlock) super.saveComponent(builder);
  		
  		if (parent == null || (parent instanceof Window && ((Window) parent).isLayoutWindow)) {
  			block.setIsRoot(true);
  		}
  		
  		builder.addInt(block, 0xEEC1B000, new int[] {flags});
  		//builder.addInt(block, 0xEEC1B001, new int[] {name == null ? 0 : Hasher.getFileHash(name)});
  		builder.addIntName(block, 0xEEC1B001, new String[] {name});
  		
  		saveIntName(builder, block, 0xEEC1B002);
  		if (unassignedProperties.containsKey(0xEEC1B003)) {
  			saveInt(builder, block, 0xEEC1B003);
  		}
  		
  		builder.addVec4(block, 0xEEC1B005, new float[][] {new float[] {bounds.x, bounds.y, bounds.x + bounds.width, bounds.y + bounds.height}});
  		if (caption != null) {
  			builder.addText(block, 0xEEC1B00A, new LocalizedText[] {caption});
  		}
  		builder.addInt(block, 0xEEC1B006, new int[] {PanelUtils.encodeColor(backgroundColor)});
  		builder.addInt(block, 0xEEC1B004, new int[] {PanelUtils.encodeColor(tintColor)});
  		if (drawable != null) {
  			builder.addReference(block, 0xEEC1B007, new SPUIObject[] {builder.addComponent(drawable)});
  		}
  		
  		if (unassignedProperties.containsKey(0xEEC1B009)) {
  			saveInt(builder, block, 0xEEC1B009);
  		}
  		
  		builder.addInt(block, 0xEEC1B00E, new int[] {style == null ? Hasher.getFileHash(styleName) : style.getStyleID()});
  		
  		if (!modifiers.isEmpty()) {
  			SPUIObject[] savedModifiers = new SPUIObject[modifiers.size()];
  			for (int i = 0; i < savedModifiers.length; i++) {
  				if (modifiers.get(i) != null) {
  					savedModifiers[i] = builder.addComponent(modifiers.get(i));
  				}
  			}
  			builder.addReference(block, 0xEEC1B00C, savedModifiers);
  		}
  		if (!children.isEmpty()) {
  			SPUIObject[] savedChildren = new SPUIObject[children.size()];
  			for (int i = 0; i < savedChildren.length; i++) {
  				if (children.get(i) != null) {
  					savedChildren[i] = builder.addComponent(children.get(i));;
  				}
  			}
  			builder.addReference(block, 0xEEC1B00B, savedChildren);
  		}
  		
  		return block;
  	}
  	
  	protected Window() {
  		super();
  	}
  	
  	protected void copyComponent(Window other, boolean propagateIndependent) {
  		super.copyComponent(other, propagateIndependent);
  		other.flags = flags;
  		other.name = name;
  		other.viewer = viewer;
  		if (caption != null) {
  			other.caption = new LocalizedText(caption);
  		}
  		other.bounds.setRect(bounds);
  		other.realBounds.setRect(realBounds);
  		other.tintColor = new Color(tintColor.getRed(), tintColor.getGreen(), tintColor.getBlue(), tintColor.getAlpha());
  		other.backgroundColor = new Color(backgroundColor.getRed(), backgroundColor.getGreen(), backgroundColor.getBlue(), backgroundColor.getAlpha());
  		other.style = style;
  		other.styleName = styleName;
  		
  		for (WinComponent child : children) {
  			WinComponent copy = child.copyComponent(propagateIndependent);
  			copy.setParent(other);
  			other.children.add(copy);
  		}
  		for (SPUIWinProc mod : modifiers) {
  			SPUIWinProc copy = mod.copyComponent(propagateIndependent);
  			copy.setParent(other);
  			other.modifiers.add(copy);
  		}
  		if (drawable != null) {
  			other.drawable = propagateIndependent ? drawable.copyComponent(propagateIndependent) : drawable;
  		}
  	}
  	
  	@Override
  	public Window copyComponent(boolean propagateIndependent) {
  		Window other = new Window();
  		
  		copyComponent(other, propagateIndependent);
  		
  		return other;
  	}
  	
  	@Override
  	public boolean isMoveable() {
  		return !viewer.isPreview();
  	}
  	
  