protected void handleExpandStateChanged() {
		if (isExpanded()) {
			if (scrollpane.getParent() != this)
				add(scrollpane);
		} else {
			if (scrollpane.getParent() == this)
				remove(scrollpane);

			// collapse all pinnable palette stack children that aren't pinned
			for (Iterator iterator = getContentPane().getChildren().iterator(); iterator
					.hasNext();) {
				Object child = iterator.next();
				if (child instanceof PinnablePaletteStackFigure
						&& !((PinnablePaletteStackFigure) child).isPinnedOpen()) {
					((PinnablePaletteStackFigure) child).setExpanded(false);
				}
			}

		}

		if (pinFigure != null) {
			pinFigure.setVisible(isExpanded() && showPin);
		}
	}