當前位置: 首頁>>代碼示例>>Java>>正文


Java JInternalFrame類代碼示例

本文整理匯總了Java中javax.swing.JInternalFrame的典型用法代碼示例。如果您正苦於以下問題:Java JInternalFrame類的具體用法?Java JInternalFrame怎麽用?Java JInternalFrame使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


JInternalFrame類屬於javax.swing包,在下文中一共展示了JInternalFrame類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createInstanceImpl

import javax.swing.JInternalFrame; //導入依賴的package包/類
protected JInternalFrame createInstanceImpl() {
    JInternalFrame frame = new JInternalFrame(title, resizable, closable, maximizable, iconable) {
        protected JRootPane createRootPane() {
            return _rootPane == null ? null : _rootPane.createInstance();
        }
        public void addNotify() {
            try {
                // Doesn't seem to work correctly
                setClosed(_isClosed);
                setMaximum(_isMaximum);
                setIcon(_isIcon);
                setSelected(_isSelected);
            } catch (PropertyVetoException ex) {}
        }
    };
    return frame;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:18,代碼來源:WindowBuilders.java

示例2: getDump

import javax.swing.JInternalFrame; //導入依賴的package包/類
/**
 * Returns information about component.
 */
@Override
public Hashtable<String, Object> getDump() {
    Hashtable<String, Object> result = super.getDump();
    result.put(TITLE_DPROP, ((JInternalFrame) getSource()).getTitle());
    String state = STATE_NORMAL_DPROP_VALUE;
    if (((JInternalFrame) getSource()).isClosed()) {
        state = STATE_CLOSED_DPROP_VALUE;
    } else if (((JInternalFrame) getSource()).isIcon()) {
        state = STATE_ICONIFIED_DPROP_VALUE;
    } else if (((JInternalFrame) getSource()).isMaximum()) {
        state = STATE_MAXIMAZED_DPROP_VALUE;
    }
    result.put(STATE_DPROP, state);
    result.put(IS_RESIZABLE_DPROP, ((JInternalFrame) getSource()).isResizable() ? "true" : "false");
    result.put(IS_SELECTED_DPROP, ((JInternalFrame) getSource()).isSelected() ? "true" : "false");
    return result;
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:21,代碼來源:JInternalFrameOperator.java

示例3: setDataModelNotification

import javax.swing.JInternalFrame; //導入依賴的package包/類
/**
	 * Sets the data model update.
	 * @param dataModelNotification the new data model update
	 */
	public void setDataModelNotification(final DataModelNotification dataModelNotification) {
		
//		SwingUtilities.invokeLater(new Runnable() {
//			@Override
//			public void run() {

				Vector<String> internalFramesTitles = new Vector<String>(getHashMapEditorFrames().keySet());
				for (String internalFrameTitles : internalFramesTitles) {
					JInternalFrame internalFrame = getHashMapEditorFrames().get(internalFrameTitles);
					if (internalFrame instanceof BasicGraphGuiProperties) {
						// --- Put notification into the property dialog ---- 
						BasicGraphGuiProperties basicProperties = (BasicGraphGuiProperties) internalFrame;
						if (basicProperties.setDataModelNotification(dataModelNotification)==true) return; // --- Done ! ---
					}
				}			
			
//			}
//		});
		
	}
 
開發者ID:EnFlexIT,項目名稱:AgentWorkbench,代碼行數:25,代碼來源:BasicGraphGuiJDesktopPane.java

示例4: removeFromCanvas

import javax.swing.JInternalFrame; //導入依賴的package包/類
/**
 * Removes the given component from this canvas.
 *
 * @param comp The {@code Component} to remove.
 */
public void removeFromCanvas(Component comp) {
    if (comp == null) return;

    final Rectangle updateBounds = comp.getBounds();
    final JInternalFrame frame = getInternalFrame(comp);
    notifyClose(comp, frame);
    if (frame != null && frame != comp) {
        frame.dispose();
    } else {
        // Java 1.7.0 as seen on Fedora with:
        //   Java version: 1.7.0_40
        //   Java WM version: 24.0-b56
        // crashes here deep in the java libraries.
        try {
            super.remove(comp);
        } catch (Exception e) {
            logger.log(Level.WARNING, "Java crash", e);
        }
    }
    repaint(updateBounds.x, updateBounds.y,
            updateBounds.width, updateBounds.height);
}
 
開發者ID:wintertime,項目名稱:FreeCol,代碼行數:28,代碼來源:Canvas.java

示例5: closePanel

import javax.swing.JInternalFrame; //導入依賴的package包/類
/**
 * Close a panel by class name.
 *
 * @param panel The panel to close.
 */
public void closePanel(String panel) {
    if (panel.endsWith("Panel")) {
        for (Component c1 : getComponents()) {
            if (c1 instanceof JInternalFrame) {
                for (Component c2 : ((JInternalFrame)c1).getContentPane()
                         .getComponents()) {
                    if (panel.equals(c2.getClass().getName())) {
                        notifyClose(c2, (JInternalFrame)c1);
                        return;
                    }
                }
            }
        }
    } else if (panel.endsWith("Dialog")) {
        for (FreeColDialog<?> fcd : dialogs) {
            if (panel.equals(fcd.getClass().getName())) {
                dialogs.remove(fcd);
                fcd.dispose();
                return;
            }
        }
    }        
}
 
開發者ID:wintertime,項目名稱:FreeCol,代碼行數:29,代碼來源:Canvas.java

示例6: isProbablyAContainer

import javax.swing.JInternalFrame; //導入依賴的package包/類
/**
 * Return true if the given component is likely to be a container such the each
 * component within the container should be be considered as a user input.
 * 
 * @param c
 * @return true if the component children should have this listener added.
 */
protected boolean isProbablyAContainer (Component c) {
    boolean result = extListener != null ? extListener.isContainer(c) : false;
    if (!result) {
        boolean isSwing = isSwingClass(c);
        if (isSwing) {
           result = c instanceof JPanel || c instanceof JSplitPane || c instanceof
                   JToolBar || c instanceof JViewport || c instanceof JScrollPane ||
                   c instanceof JFrame || c instanceof JRootPane || c instanceof
                   Window || c instanceof Frame || c instanceof Dialog ||
                   c instanceof JTabbedPane || c instanceof JInternalFrame ||
                   c instanceof JDesktopPane || c instanceof JLayeredPane;
        } else {
            result = c instanceof Container;
        }
    }
    return result;
}
 
開發者ID:ajmath,項目名稱:VASSAL-src,代碼行數:25,代碼來源:GenericListener.java

示例7: getExistingFreeColPanel

import javax.swing.JInternalFrame; //導入依賴的package包/類
/**
 * Gets a currently displayed FreeColPanel of a given type.
 *
 * @param <T> The actual panel type.
 * @param type The type of {@code FreeColPanel} to look for.
 * @return A currently displayed {@code FreeColPanel} of the
 *     requested type, or null if none found.
 */
private <T extends FreeColPanel> T getExistingFreeColPanel(Class<T> type) {
    for (Component c1 : getComponents()) {
        if (c1 instanceof JInternalFrame) {
            for (Component c2 : ((JInternalFrame)c1).getContentPane()
                     .getComponents()) {
                try {
                    T ret = type.cast(c2);
                    if (ret != null) {
                        final JInternalFrame jif = (JInternalFrame)c1;
                        SwingUtilities.invokeLater(() -> {
                                jif.toFront();
                                jif.repaint();
                            });
                        return ret;
                    }
                } catch (ClassCastException cce) {}
            }
        }
    }
    return null;
}
 
開發者ID:FreeCol,項目名稱:freecol,代碼行數:30,代碼來源:Canvas.java

示例8: createUI

import javax.swing.JInternalFrame; //導入依賴的package包/類
private static void createUI() {
    frame = new JFrame();
    frame.setUndecorated(true);
    frame.setSize(300, 300);
    frame.setLocationRelativeTo(null);
    final JDesktopPane pane = new JDesktopPane();
    final JPanel panel = new JPanel() {
        @Override
        protected void paintComponent(Graphics g) {
            g.setColor(color);
            g.fillRect(0, 0, getWidth(), getHeight());
        }
    };
    jif = new JInternalFrame();
    jif.add(panel);
    jif.setVisible(true);
    jif.setSize(300, 300);
    pane.add(jif);
    frame.add(pane);
    frame.setVisible(true);
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:22,代碼來源:DockIconRepaint.java

示例9: Test6505027

import javax.swing.JInternalFrame; //導入依賴的package包/類
public Test6505027(JFrame main) {
    Container container = main;
    if (INTERNAL) {
        JInternalFrame frame = new JInternalFrame();
        frame.setBounds(OFFSET, OFFSET, WIDTH, HEIGHT);
        frame.setVisible(true);

        JDesktopPane desktop = new JDesktopPane();
        desktop.add(frame, new Integer(1));

        container.add(desktop);
        container = frame;
    }
    if (TERMINATE) {
        this.table.putClientProperty(KEY, Boolean.TRUE);
    }
    TableColumn column = this.table.getColumn(COLUMNS[1]);
    column.setCellEditor(new DefaultCellEditor(new JComboBox(ITEMS)));

    container.add(BorderLayout.NORTH, new JTextField());
    container.add(BorderLayout.CENTER, new JScrollPane(this.table));
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:23,代碼來源:Test6505027.java

示例10: getDesktopIcon

import javax.swing.JInternalFrame; //導入依賴的package包/類
/**
 * Maps {@code JInternalFrame.getDesktopIcon()} through queue
 */
public JDesktopIcon getDesktopIcon() {
    return (runMapping(new MapAction<JDesktopIcon>("getDesktopIcon") {
        @Override
        public JDesktopIcon map() {
            return ((JInternalFrame) getSource()).getDesktopIcon();
        }
    }));
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:12,代碼來源:JInternalFrameOperator.java

示例11: setGlassPane

import javax.swing.JInternalFrame; //導入依賴的package包/類
/**
 * Maps {@code JInternalFrame.setGlassPane(Component)} through queue
 */
public void setGlassPane(final Component component) {
    runMapping(new MapVoidAction("setGlassPane") {
        @Override
        public void map() {
            ((JInternalFrame) getSource()).setGlassPane(component);
        }
    });
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:12,代碼來源:JInternalFrameOperator.java

示例12: getProgressMonitorContainer

import javax.swing.JInternalFrame; //導入依賴的package包/類
/**
 * Returns the progress monitor container that is either a JDialog or a JInternFrame.
 * @return the progress monitor container
 */
private Container getProgressMonitorContainer() {
	if (progressMonitorContainer==null) {
		
		Dimension defaultSize = new Dimension(570, 188);
		if (this.parentDesktopPane==null) {
			JDialog jDialog = new JDialog(this.owner);	
			jDialog.setSize(defaultSize);
			jDialog.setResizable(false);
			if (this.owner==null) {
				jDialog.setAlwaysOnTop(true);
			}
			jDialog.setTitle(this.windowTitle);
			if (this.iconImage!=null) {
				jDialog.setIconImage(this.iconImage.getImage());	
			}
			jDialog.setContentPane(this.getJContentPane());
			jDialog.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
			
			this.progressMonitorContainer = jDialog; 
			this.setLookAndFeel();	
				
		} else {
			JInternalFrame jInternalFrame = new JInternalFrame();
			jInternalFrame.setSize(defaultSize);
			jInternalFrame.setResizable(false);
			
			jInternalFrame.setTitle(this.windowTitle);
			if (this.iconImage!=null) {
				jInternalFrame.setFrameIcon(this.iconImage);	
			}
			jInternalFrame.setContentPane(this.getJContentPane());
			jInternalFrame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
			
			this.progressMonitorContainer = jInternalFrame;
		}
		
	}
	return progressMonitorContainer;
}
 
開發者ID:EnFlexIT,項目名稱:AgentWorkbench,代碼行數:44,代碼來源:ProgressMonitor.java

示例13: setFrameIcon

import javax.swing.JInternalFrame; //導入依賴的package包/類
/**
 * Maps {@code JInternalFrame.setFrameIcon(Icon)} through queue
 */
public void setFrameIcon(final Icon icon) {
    runMapping(new MapVoidAction("setFrameIcon") {
        @Override
        public void map() {
            ((JInternalFrame) getSource()).setFrameIcon(icon);
        }
    });
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:12,代碼來源:JInternalFrameOperator.java

示例14: getHashMapEditorFrames

import javax.swing.JInternalFrame; //導入依賴的package包/類
/**
 * Returns a HashMap with all open editor windows.
 * @return the local a HashMap with all open property windows
 */
public HashMap<String, JInternalFrame> getHashMapEditorFrames() {
	if (this.editorFrames==null) {
		editorFrames = new HashMap<String, JInternalFrame>();
	}
	return editorFrames;
}
 
開發者ID:EnFlexIT,項目名稱:AgentWorkbench,代碼行數:11,代碼來源:BasicGraphGuiJDesktopPane.java

示例15: notifyClose

import javax.swing.JInternalFrame; //導入依賴的package包/類
/**
 * A component is closing.  Some components need position and size
 * to be saved.
 *
 * @param c The closing {@code Component}.
 * @param frame The enclosing {@code JInternalFrame}.
 */
private void notifyClose(Component c, JInternalFrame frame) {
    if (frame == null) return;

    if (c instanceof FreeColPanel) {
        FreeColPanel fcp = (FreeColPanel)c;
        fcp.firePropertyChange("closing", false, true);
        
        savePosition(fcp, frame.getLocation());
        saveSize(fcp, fcp.getSize());
    }
}
 
開發者ID:wintertime,項目名稱:FreeCol,代碼行數:19,代碼來源:Canvas.java


注:本文中的javax.swing.JInternalFrame類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。