📄 basicinternalframeui.java
字号:
/** * This method creates a new LayoutManager for the JInternalFrame. * * @return A new LayoutManager for the JInternalFrame. */ protected LayoutManager createLayoutManager() { return new InternalFrameLayout(); } /** * This method creates a new PropertyChangeListener for the JInternalFrame. * * @return A new PropertyChangeListener for the JInternalFrame. */ protected PropertyChangeListener createPropertyChangeListener() { return new InternalFramePropertyChangeListener(); } /** * This method returns the preferred size of the given JComponent. * * @param x The JComponent to find a preferred size for. * * @return The preferred size. */ public Dimension getPreferredSize(JComponent x) { return internalFrameLayout.preferredLayoutSize(x); } /** * This method returns the minimum size of the given JComponent. * * @param x The JComponent to find a minimum size for. * * @return The minimum size. */ public Dimension getMinimumSize(JComponent x) { return internalFrameLayout.minimumLayoutSize(x); } /** * This method returns the maximum size of the given JComponent. * * @param x The JComponent to find a maximum size for. * * @return The maximum size. */ public Dimension getMaximumSize(JComponent x) { return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE); } /** * This method replaces the currentPane with the newPane. When replacing it * also removes the MouseHandlers for the old pane and installs them on * the new pane. * * @param currentPane The old pane to remove. * @param newPane The new pane to install. */ protected void replacePane(JComponent currentPane, JComponent newPane) { if (currentPane != null) { deinstallMouseHandlers(currentPane); frame.remove(currentPane); } if (newPane != null) { installMouseHandlers(newPane); frame.add(newPane); } } /** * This method removes the necessary MouseListeners from the given * JComponent. * * @param c The JComponent to remove MouseListeners from. */ protected void deinstallMouseHandlers(JComponent c) { c.removeMouseListener(borderListener); c.removeMouseMotionListener(borderListener); } /** * This method installs the necessary MouseListeners from the given * JComponent. * * @param c The JComponent to install MouseListeners on. */ protected void installMouseHandlers(JComponent c) { c.addMouseListener(borderListener); c.addMouseMotionListener(borderListener); } /** * This method creates the north pane used in the JInternalFrame. * * @param w The JInternalFrame to create a north pane for. * * @return The north pane. */ protected JComponent createNorthPane(JInternalFrame w) { titlePane = new BasicInternalFrameTitlePane(w); return titlePane; } /** * This method creates the west pane used in the JInternalFrame. * * @param w The JInternalFrame to create a west pane for. * * @return The west pane. */ protected JComponent createWestPane(JInternalFrame w) { return null; } /** * This method creates the south pane used in the JInternalFrame. * * @param w The JInternalFrame to create a south pane for. * * @return The south pane. */ protected JComponent createSouthPane(JInternalFrame w) { return null; } /** * This method creates the east pane used in the JInternalFrame. * * @param w The JInternalFrame to create an east pane for. * * @return The east pane. */ protected JComponent createEastPane(JInternalFrame w) { return null; } /** * This method returns a new BorderListener for the given JInternalFrame. * * @param w The JIntenalFrame to create a BorderListener for. * * @return A new BorderListener. */ protected MouseInputAdapter createBorderListener(JInternalFrame w) { return new BorderListener(); } /** * This method creates a new InternalFrameListener for the JInternalFrame. */ protected void createInternalFrameListener() { internalFrameListener = new BasicInternalFrameListener(); } /** * DOCUMENT ME! * * @return DOCUMENT ME! */ protected final boolean isKeyBindingRegistered() { // FIXME: Implement. return false; } /** * DOCUMENT ME! * * @param b DOCUMENT ME! */ protected final void setKeyBindingRegistered(boolean b) { // FIXME: Implement. } /** * DOCUMENT ME! * * @return DOCUMENT ME! */ public final boolean isKeyBindingActive() { // FIXME: Implement. return false; } /** * DOCUMENT ME! * * @param b DOCUMENT ME! */ protected final void setKeyBindingActive(boolean b) { // FIXME: Implement. } /** * DOCUMENT ME! */ protected void setupMenuOpenKey() { // FIXME: Implement. } /** * DOCUMENT ME! */ protected void setupMenuCloseKey() { // FIXME: Implement. } /** * This method returns the north pane. * * @return The north pane. */ public JComponent getNorthPane() { return northPane; } /** * This method sets the north pane to be the given JComponent. * * @param c The new north pane. */ public void setNorthPane(JComponent c) { replacePane(northPane, c); northPane = c; } /** * This method returns the south pane. * * @return The south pane. */ public JComponent getSouthPane() { return southPane; } /** * This method sets the south pane to be the given JComponent. * * @param c The new south pane. */ public void setSouthPane(JComponent c) { replacePane(southPane, c); southPane = c; } /** * This method sets the east pane to be the given JComponent. * * @param c The new east pane. */ public void setEastPane(JComponent c) { replacePane(eastPane, c); eastPane = c; } /** * This method returns the east pane. * * @return The east pane. */ public JComponent getEastPane() { return eastPane; } /** * This method sets the west pane to be the given JComponent. * * @param c The new west pane. */ public void setWestPane(JComponent c) { replacePane(westPane, c); westPane = c; } /** * This method returns the west pane. * * @return The west pane. */ public JComponent getWestPane() { return westPane; } /** * This method returns the DesktopManager to use with the JInternalFrame. * * @return The DesktopManager to use with the JInternalFrame. */ protected DesktopManager getDesktopManager() { DesktopManager value = null; JDesktopPane pane = frame.getDesktopPane(); if (pane != null) value = frame.getDesktopPane().getDesktopManager(); if (value == null) value = createDesktopManager(); return value; } /** * This method returns a default DesktopManager that can be used with this * JInternalFrame. * * @return A default DesktopManager that can be used with this * JInternalFrame. */ protected DesktopManager createDesktopManager() { return new DefaultDesktopManager(); } /** * This is a convenience method that closes the JInternalFrame. * * @param f The JInternalFrame to close. */ protected void closeFrame(JInternalFrame f) { getDesktopManager().closeFrame(f); } /** * This is a convenience method that maximizes the JInternalFrame. * * @param f The JInternalFrame to maximize. */ protected void maximizeFrame(JInternalFrame f) { getDesktopManager().maximizeFrame(f); } /** * This is a convenience method that minimizes the JInternalFrame. * * @param f The JInternalFrame to minimize. */ protected void minimizeFrame(JInternalFrame f) { getDesktopManager().minimizeFrame(f); } /** * This is a convenience method that iconifies the JInternalFrame. * * @param f The JInternalFrame to iconify. */ protected void iconifyFrame(JInternalFrame f) { getDesktopManager().iconifyFrame(f); } /** * This is a convenience method that deiconifies the JInternalFrame. * * @param f The JInternalFrame to deiconify. */ protected void deiconifyFrame(JInternalFrame f) { getDesktopManager().deiconifyFrame(f); } /** * This is a convenience method that activates the JInternalFrame. * * @param f The JInternalFrame to activate. */ protected void activateFrame(JInternalFrame f) { getDesktopManager().activateFrame(f); } /** * This is a convenience method that deactivates the JInternalFrame. * * @param f the JInternalFrame to deactivate */ protected void deactivateFrame(JInternalFrame f) { getDesktopManager().deactivateFrame(f); } /** * This method returns a new ComponentListener for the JDesktopPane. * * @return A new ComponentListener. */ protected ComponentListener createComponentListener() { return new ComponentHandler(); } /** * This method returns a new GlassPaneDispatcher. * * @return A new GlassPaneDispatcher. */ protected MouseInputListener createGlassPaneDispatcher() { return new GlassPaneDispatcher(); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -