boolean isFullScreenEnabled(final Component currentRootComponent) { return currentRootComponent instanceof Frame && !((Frame) currentRootComponent).isResizable(); }
/** * Returns whether the applet is resizable. */ public boolean isResizable() { return environment.getAppletFrame().isResizable(); }
/** * Check if the given window object is resizeable. * * @note Only done for Frames and Dialogs. * * @param window The window instance to check. * @return true if the window is resizable, false otherwise. */ private static boolean isWindowResizeable(Window window) { return (window instanceof Frame && ((Frame) window).isResizable()) || (window instanceof Dialog && ((Dialog) window).isResizable()); }
private boolean isContainedInFullWindow() { final Component root = SwingUtilities.getRoot(component); return root instanceof Frame && !((Frame) root).isResizable(); }
/** * Checks whether the window supports resizing * @param window the {@code Window} to be checked * @return true if the window supports resizing */ public static boolean isResizable(Window window) { boolean resizable = true; if (window instanceof Frame) { resizable = ((Frame) window).isResizable(); } else if (window instanceof Dialog) { resizable = ((Dialog) window).isResizable(); } return resizable; }
/** * @see AbstractComponentProperty#getPropertyValueFromComponent() */ @Override protected Boolean getPropertyValueFromComponent() { Boolean value = null; if (component instanceof Frame) { value = ((Frame) component).isResizable(); } else if (component instanceof Dialog) { value = ((Dialog) component).isResizable(); } return value; }
/** * Checks whether the window supports resizing * @param window the {@code Window} to be checked * @return true if the window supports resizing */ protected static boolean isResizable(Window window) { boolean resizable = true; if (window instanceof Frame) { resizable = ((Frame) window).isResizable(); } else if (window instanceof Dialog) { resizable = ((Dialog) window).isResizable(); } return resizable; }
/** * Checks whether the window supports resizing * @param window the {@code Window} to be checked * @return true if the window supports resizing */ protected static boolean isResizable(Window window) { boolean resizable = true; if (window instanceof Frame) { resizable = ((Frame) window).isResizable(); } else if (window instanceof Dialog) { resizable = ((Dialog) window).isResizable(); } return resizable; }
/** * Checks whether the window supports resizing * * @param window the {@code Window} to be checked * @return true if the window supports resizing */ protected static boolean isResizable(Window window) { boolean resizable = true; if (window instanceof Frame) { resizable = ((Frame) window).isResizable(); } else if (window instanceof Dialog) { resizable = ((Dialog) window).isResizable(); } return resizable; }
public boolean isResizable() { if( f != null ) { return f.isResizable(); } else if( d != null ) { return d.isResizable(); } else if( jif != null ) { return jif.isResizable(); } else { throw new IllegalStateException(); } }
private void configureFrame() { Window window = SwingUtilities.windowForComponent(this); if (window instanceof Frame){ Frame frame = (Frame)window; ImageIcon mWindowIcon; mWindowIcon = new ImageIcon(getClass().getResource( "/images/Freeplane_frame_icon_64x64.png")); frame.setIconImage(mWindowIcon.getImage()); if (!frame.isResizable()){ frame.setResizable(true); } } }
/** Return whether it is possible for the user to resize the given component. */ protected boolean userResizable(Component comp) { if (comp instanceof Dialog) return ((Dialog)comp).isResizable(); if (comp instanceof Frame) return ((Frame)comp).isResizable(); // most X11 window managers allow arbitrary resizing return canResizeWindows(); }
@Override public Dimension getMaximumSize() { //return resizable ? super.getMaximumSize() : getPreferredSize(); return frame.isResizable() ? super.getMaximumSize() : getPreferredSize(); }
public void mouseClicked(MouseEvent ev) { Component w = (Window) ev.getSource(); if (w instanceof Frame) { Frame f = (Frame) w; JComponent titlePane = getTitlePane(); Point convertedPoint = SwingUtilities.convertPoint(w, ev.getPoint(), titlePane); int state = f.getExtendedState(); if (titlePane != null && titlePane.contains(convertedPoint) && ev.getClickCount() % 2 == 0 && (ev.getModifiers() & BUTTON1_MASK) != 0 && f.isResizable()) { f.setExtendedState((state & MAXIMIZED_BOTH) != 0 ? state & ~MAXIMIZED_BOTH : state | MAXIMIZED_BOTH); } } }
public void mouseClicked(MouseEvent ev) { if (ev.getSource() instanceof Window) { Window window = (Window) ev.getSource(); if (!(window instanceof Frame)) { return; } Frame frame = (Frame) window; Point convertedPoint = SwingUtilities.convertPoint(window, ev.getPoint(), internalGetTitlePane()); int state = DecorationHelper.getExtendedState(frame); if (titlePane != null && titlePane instanceof TitlePane && titlePane.contains(convertedPoint) && frame.isResizable()) { if ((ev.getClickCount() % 2) == 0 && ((ev.getModifiers() & InputEvent.BUTTON1_MASK) != 0)) { if ((state & BaseRootPaneUI.MAXIMIZED_BOTH) != 0) { ((TitlePane) titlePane).restore(); } else { ((TitlePane) titlePane).maximize(); } } } } }
void initialize() { super.initialize(); Frame target = (Frame)this.target; if (target.getTitle() != null) { setTitle(target.getTitle()); } setResizable(target.isResizable()); setState(target.getExtendedState()); }
void initialize() { Frame target = (Frame)this.target; setResizable(target.isResizable()); super.initialize(); if (target.getTitle() != null) { setTitle(target.getTitle()); } setState(target.getExtendedState()); }
/** * Refresh UI after LAF change or resizing */ public static final void refreshUI() { for (Window w : Window.getWindows()) { SwingUtilities.updateComponentTreeUI(w); if (w.isDisplayable() && (w instanceof Frame ? !((Frame)w).isResizable() : w instanceof Dialog ? !((Dialog)w).isResizable() : true)) { w.pack(); } } }
private void setScrollbarsVisiblilty() { final ViewController viewController = Controller.getCurrentController().getViewController(); boolean areScrollbarsVisible = viewController.areScrollbarsVisible(); setHorizontalScrollBarPolicy(areScrollbarsVisible ? JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS : JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); setVerticalScrollBarPolicy(areScrollbarsVisible ? JScrollPane.VERTICAL_SCROLLBAR_ALWAYS : JScrollPane.VERTICAL_SCROLLBAR_NEVER); final boolean isFullScreenEnabled = ! UITools.getCurrentFrame().isResizable(); setBorder(isFullScreenEnabled && ! areScrollbarsVisible ? null : defaultBorder); }
@Override public void windowAdded(final DockingWindow addedToWindow, final DockingWindow addedWindow) { if(addedWindow instanceof TabWindow) { final DockingWindowProperties windowProperties = addedWindow.getWindowProperties(); windowProperties.setDockEnabled(false); windowProperties.setUndockEnabled(false); if(UITools.getCurrentFrame().isResizable()) setTabAreaVisiblePolicy((TabWindow) addedWindow); else setTabAreaPolicy((TabWindow) addedWindow, TabAreaVisiblePolicy.NEVER); } else if(addedWindow instanceof FloatingWindow) { final Container topLevelAncestor = addedWindow.getTopLevelAncestor(); if(topLevelAncestor instanceof Window){ if(iconColorReplacer == null) iconColorReplacer = new IconColorReplacer(((Window) UITools.getMenuComponent()).getIconImages()); final List<Image> iconImages = iconColorReplacer.getNextIconImages(); ((Window)topLevelAncestor).setIconImages(iconImages); } } setTabPolicies(addedWindow); }