@RunsInCurrentThread private static void validateCanClose(JInternalFrame internalFrame) { validateIsShowing(internalFrame); if (!internalFrame.isClosable()) throw new IllegalStateException( concat("The JInternalFrame <", format(internalFrame), "> is not closable")); }
@RunsInCurrentThread private static void validateCanMaximize(JInternalFrame internalFrame) { validateIsShowingOrIconified(internalFrame); if (!internalFrame.isMaximizable()) throw new IllegalStateException( concat("The JInternalFrame <", format(internalFrame), "> is not maximizable")); }
@RunsInCurrentThread private static Triple<Boolean, Container, Point> deiconifyInfo(JInternalFrame internalFrame) { boolean deiconified = !isIconified(internalFrame); if (deiconified) return new Triple<Boolean, Container, Point>(true, null, null); JDesktopIcon desktopIcon = internalFrame.getDesktopIcon(); return new Triple<Boolean, Container, Point>( deiconified, desktopIcon, iconifyLocationOf(desktopIcon)); }
@RunsInCurrentThread private static Pair<Boolean, Point> closeInfo(JInternalFrame internalFrame) { if (internalFrame.isClosed()) return new Pair<Boolean, Point>(true, null); return new Pair<Boolean, Point>(false, closeLocationOf(internalFrame)); }
@RunsInCurrentThread private static Point findIconifyLocation(JInternalFrame internalFrame) { return iconifyLocationOf(internalFrame.getDesktopIcon()); }
@RunsInCurrentThread private static Pair<Container, Point> findMaximizeLocation(JInternalFrame internalFrame) { Container clickTarget = internalFrame.isIcon() ? internalFrame.getDesktopIcon() : internalFrame; Point location = maximizeLocationOf(clickTarget); return new Pair<Container, Point>(clickTarget, location); }
@RunsInCurrentThread private static void validateIsShowingOrIconified(JInternalFrame internalFrame) { if (!internalFrame.isIcon()) validateIsShowing(internalFrame); }