/** * Returns the <code>JComponent</code> to render the window decoration * style. * * @param root * Root pane. * @return The title pane component. */ protected JComponent createTitlePane(JRootPane root) { return new SubstanceTitlePane(root, this); }
int decorationStyle = this.getWindowDecorationStyle(); if (decorationStyle == JRootPane.FRAME) { this.createActions(); this.menuBar = this.createMenuBar(); if (this.menuBar != null) { this.add(this.menuBar); this.createButtons(); this.add(this.minimizeButton); this.add(this.toggleButton); this.add(this.closeButton); this.markExtraComponent(this.heapStatusPanel, ExtraComponentKind.TRAILING); this.add(this.heapStatusPanel); boolean isHeapStatusPanelShowing = SubstanceWidgetManager .getInstance().isAllowed(rootPane, this.heapStatusPanel.setVisible(isHeapStatusPanelShowing); this.heapStatusPanel.setPreferredSize(new Dimension(80, this .getPreferredSize().height)); this.heapStatusPanel.setToolTipText(SubstanceCoreUtilities .getResourceBundle(rootPane).getString( || (decorationStyle == JRootPane.QUESTION_DIALOG) || (decorationStyle == JRootPane.WARNING_DIALOG)) { this.createActions(); this.menuBar = this.createMenuBar(); if (this.menuBar != null) {
/** * Returns the <code>JMenu</code> displaying the appropriate menu items for * manipulating the Frame. * * @return <code>JMenu</code> displaying the appropriate menu items for * manipulating the Frame. */ private JMenu createMenu() { JMenu menu = new JMenu(""); menu.setOpaque(false); menu.setBackground(null); if (this.getWindowDecorationStyle() == JRootPane.FRAME) { this.addMenuItems(menu); } return menu; }
/** * Creates a new title pane. * * @param root * Root pane. * @param ui * Root pane UI. */ public SubstanceTitlePane(JRootPane root, SubstanceRootPaneUI ui) { this.rootPane = root; this.rootPaneUI = ui; this.state = -1; this.installSubcomponents(); this.installDefaults(); this.setLayout(this.createLayout()); this.setToolTipText(this.getTitle()); SubstanceLookAndFeel.setDecorationType(this, DecorationAreaType.PRIMARY_TITLE_PANE); this.setForeground(SubstanceColorUtilities .getForegroundColor(SubstanceCoreUtilities.getSkin(this) .getBackgroundColorScheme( DecorationAreaType.PRIMARY_TITLE_PANE))); // SubstanceColorSchemeUtilities // .getColorScheme(this, ComponentState.ACTIVE))); }
Window w = this.getWindow(); if ((w != null) && (this.getWindowDecorationStyle() == JRootPane.FRAME)) { if ((this.state == state) && !updateRegardless) { return; Frame frame = this.getFrame(); final JRootPane rootPane = this.getRootPane(); .updateToggleButton(this.restoreAction, restoreIcon); this.toggleButton.setToolTipText(SubstanceCoreUtilities this.updateToggleButton(this.maximizeAction, maxIcon); this.toggleButton.setToolTipText(SubstanceCoreUtilities .getResourceBundle(rootPane).getString( this.add(this.toggleButton); this.add(this.minimizeButton); this.revalidate(); this.repaint(); this.restoreAction.setEnabled(false); if (this.toggleButton.getParent() != null) { this.remove(this.toggleButton); this.revalidate(); this.repaint();
this.closeButton = this.createTitleButton(); this.closeButton.setAction(this.closeAction); this.closeButton.setText(null); SubstanceButtonUI.IS_TITLE_CLOSE_BUTTON, Boolean.TRUE); if (this.getWindowDecorationStyle() == JRootPane.FRAME) { this.minimizeButton = this.createTitleButton(); this.minimizeButton.setAction(this.iconifyAction); this.minimizeButton.setText(null); .getString("SystemMenu.iconify")); this.toggleButton = this.createTitleButton(); this.toggleButton.setAction(this.restoreAction); this.toggleButton.setBorder(null); syncCloseButtonTooltip();
/** * Returns the <code>JMenuBar</code> displaying the appropriate system menu * items. * * @return <code>JMenuBar</code> displaying the appropriate system menu * items. */ protected JMenuBar createMenuBar() { this.menuBar = new SubstanceMenuBar(); this.menuBar.setFocusable(false); this.menuBar.setBorderPainted(true); this.menuBar.add(this.createMenu()); this.menuBar.setOpaque(false); // support for RTL this.menuBar.applyComponentOrientation(this.rootPane .getComponentOrientation()); this.markExtraComponent(this.menuBar, ExtraComponentKind.LEADING); return this.menuBar; }
private void propagateModificationState() { JComponent titlePane = getTitlePane(); if (titlePane instanceof SubstanceTitlePane) { ((SubstanceTitlePane) titlePane) .getCloseButton() .putClientProperty( SubstanceLookAndFeel.WINDOW_MODIFIED, root .getClientProperty(SubstanceLookAndFeel.WINDOW_MODIFIED)); return; } JInternalFrame jif = (JInternalFrame) SwingUtilities .getAncestorOfClass(JInternalFrame.class, this.root); if (jif != null) { SubstanceInternalFrameUI internalFrameUI = (SubstanceInternalFrameUI) jif .getUI(); internalFrameUI.setWindowModified(Boolean.TRUE.equals(root .getClientProperty(SubstanceLookAndFeel.WINDOW_MODIFIED))); } }
/** * Returns the <code>JMenu</code> displaying the appropriate menu items for * manipulating the Frame. * * @return <code>JMenu</code> displaying the appropriate menu items for * manipulating the Frame. */ private JMenu createMenu() { JMenu menu = new JMenu(""); menu.setOpaque(false); menu.setBackground(null); //if (this.getWindowDecorationStyle() == JRootPane.FRAME) { this.addMenuItems(menu); //} menu.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { if (e.getClickCount() > 1) { closeAction.actionPerformed(new ActionEvent(e.getSource(), ActionEvent.ACTION_PERFORMED, null, EventQueue.getMostRecentEventTime(), e.getModifiers())); } } }); return menu; }
Window w = this.getWindow(); if ((w != null) && (this.getWindowDecorationStyle() == JRootPane.FRAME)) { if ((this.state == state) && !updateRegardless) { return; Frame frame = this.getFrame(); final JRootPane rootPane = this.getRootPane(); .updateToggleButton(this.restoreAction, restoreIcon); this.toggleButton.setToolTipText(SubstanceCoreUtilities this.updateToggleButton(this.maximizeAction, maxIcon); this.toggleButton.setToolTipText(SubstanceCoreUtilities .getResourceBundle(rootPane).getString( this.add(this.toggleButton); this.add(this.minimizeButton); this.revalidate(); this.repaint(); this.restoreAction.setEnabled(false); if (this.toggleButton.getParent() != null) { this.remove(this.toggleButton); this.revalidate(); this.repaint();
/** * Creates a new title pane. * * @param root * Root pane. * @param ui * Root pane UI. */ public SubstanceTitlePane(JRootPane root, SubstanceRootPaneUI ui) { this.rootPane = root; this.rootPaneUI = ui; this.state = -1; this.installSubcomponents(); this.installDefaults(); this.setLayout(this.createLayout()); this.setToolTipText(this.getTitle()); SubstanceLookAndFeel.setDecorationType(this, DecorationAreaType.PRIMARY_TITLE_PANE); this.setForeground(SubstanceColorUtilities .getForegroundColor(SubstanceCoreUtilities.getSkin(this) .getBackgroundColorScheme( DecorationAreaType.PRIMARY_TITLE_PANE))); // SubstanceColorSchemeUtilities // .getColorScheme(this, ComponentState.ACTIVE))); }
this.closeButton = this.createTitleButton(); this.closeButton.setAction(this.closeAction); this.closeButton.setText(null); SubstanceButtonUI.IS_TITLE_CLOSE_BUTTON, Boolean.TRUE); if (this.getWindowDecorationStyle() == JRootPane.FRAME) { this.minimizeButton = this.createTitleButton(); this.minimizeButton.setAction(this.iconifyAction); this.minimizeButton.setText(null); .getString("SystemMenu.iconify")); this.toggleButton = this.createTitleButton(); this.toggleButton.setAction(this.restoreAction); this.toggleButton.setBorder(null); syncCloseButtonTooltip();
/** * Returns the <code>JMenuBar</code> displaying the appropriate system menu * items. * * @return <code>JMenuBar</code> displaying the appropriate system menu * items. */ protected JMenuBar createMenuBar() { this.menuBar = new SubstanceMenuBar(); this.menuBar.setFocusable(false); this.menuBar.setBorderPainted(true); this.menuBar.add(this.createMenu()); this.menuBar.setOpaque(false); // support for RTL this.menuBar.applyComponentOrientation(this.rootPane .getComponentOrientation()); this.markExtraComponent(this.menuBar, ExtraComponentKind.LEADING); return this.menuBar; }
private void propagateModificationState() { JComponent titlePane = getTitlePane(); if (titlePane instanceof SubstanceTitlePane) { ((SubstanceTitlePane) titlePane) .getCloseButton() .putClientProperty( SubstanceLookAndFeel.WINDOW_MODIFIED, root .getClientProperty(SubstanceLookAndFeel.WINDOW_MODIFIED)); return; } JInternalFrame jif = (JInternalFrame) SwingUtilities .getAncestorOfClass(JInternalFrame.class, this.root); if (jif != null) { SubstanceInternalFrameUI internalFrameUI = (SubstanceInternalFrameUI) jif .getUI(); internalFrameUI.setWindowModified(Boolean.TRUE.equals(root .getClientProperty(SubstanceLookAndFeel.WINDOW_MODIFIED))); } }
int decorationStyle = this.getWindowDecorationStyle(); if (decorationStyle == JRootPane.FRAME) { this.createActions(); this.menuBar = this.createMenuBar(); if (this.menuBar != null) { this.add(this.menuBar); this.createButtons(); this.add(this.minimizeButton); this.add(this.toggleButton); this.add(this.closeButton); this.markExtraComponent(this.heapStatusPanel, ExtraComponentKind.TRAILING); this.add(this.heapStatusPanel); boolean isHeapStatusPanelShowing = SubstanceWidgetManager .getInstance().isAllowed(rootPane, this.heapStatusPanel.setVisible(isHeapStatusPanelShowing); this.heapStatusPanel.setPreferredSize(new Dimension(80, this .getPreferredSize().height)); this.heapStatusPanel.setToolTipText(SubstanceCoreUtilities .getResourceBundle(rootPane).getString( || (decorationStyle == JRootPane.QUESTION_DIALOG) || (decorationStyle == JRootPane.WARNING_DIALOG)) { this.createActions(); this.createButtons(); this.add(this.closeButton);
/** * Returns the <code>JComponent</code> to render the window decoration * style. * * @param root * Root pane. * @return The title pane component. */ protected JComponent createTitlePane(JRootPane root) { return new SubstanceTitlePane(root, this); }