bugged
stringlengths 6
599k
| fixed
stringlengths 6
40.8M
| __index_level_0__
int64 0
3.24M
|
|---|---|---|
public void paint(Graphics g, JComponent c) { JTree tree = (JTree) c; TreeModel mod = tree.getModel(); Object root = mod.getRoot(); if (!tree.isRootVisible()) tree.expandPath(new TreePath(((DefaultMutableTreeNode) root) .getPath())); paintRecursive(g, 0, 0, 0, 0, tree, mod, root); if (hasControlIcons()) paintControlIcons(g, 0, 0, 0, 0, tree, mod, root); TreePath lead = tree.getLeadSelectionPath(); if (lead != null && tree.isPathSelected(lead)) { Rectangle cell = getPathBounds(tree, lead); g.setColor(UIManager.getLookAndFeelDefaults().getColor( "Tree.selectionBorderColor")); g.drawRect(cell.x + rightChildIndent - 4, cell.y, cell.width + 4, cell.height); } }
|
public void paint(Graphics g, JComponent c) { JTree tree = (JTree) c; TreeModel mod = tree.getModel(); Object root = mod.getRoot(); if (!tree.isRootVisible()) tree.expandPath(new TreePath(((DefaultMutableTreeNode) root) .getPath())); paintRecursive(g, 0, 0, 0, 0, tree, mod, root); if (hasControlIcons()) paintControlIcons(g, 0, 0, 0, 0, tree, mod, root); TreePath lead = tree.getLeadSelectionPath(); if (lead != null && tree.isPathSelected(lead)) { Rectangle cell = getPathBounds(tree, lead); g.setColor(UIManager.getLookAndFeelDefaults().getColor( "Tree.selectionBorderColor")); g.drawRect(cell.x + rightChildIndent - 4, cell.y, cell.width + 4, cell.height); } }
| 12,942
|
void paintNode(Graphics g, int x, int y, JTree tree, Object node, boolean isLeaf) { TreePath curr = new TreePath(((DefaultMutableTreeNode) node).getPath()); boolean selected = tree.isPathSelected(curr); boolean expanded = false; if (tree.isVisible(curr)) { DefaultTreeCellRenderer dtcr = (DefaultTreeCellRenderer) tree .getCellRenderer(); if (!isLeaf) expanded = tree.isExpanded(curr); Component c = dtcr.getTreeCellRendererComponent(tree, node, selected, expanded, isLeaf, 0, false); if (selected) { Rectangle cell = getPathBounds(tree, curr); g.setColor(dtcr.getBackgroundSelectionColor()); g.fillRect(cell.x + rightChildIndent - 4, cell.y, cell.width + 4, cell.height); } g.translate(x, y); c.paint(g); g.translate(-x, -y); } }
|
void paintNode(Graphics g, int x, int y, JTree tree, Object node, boolean isLeaf) { TreePath curr = new TreePath(((DefaultMutableTreeNode) node).getPath()); boolean selected = tree.isPathSelected(curr); boolean expanded = false; if (tree.isVisible(curr)) { DefaultTreeCellRenderer dtcr = (DefaultTreeCellRenderer) tree .getCellRenderer(); if (!isLeaf) expanded = tree.isExpanded(curr); Component c = dtcr.getTreeCellRendererComponent(tree, node, selected, expanded, isLeaf, 0, false); if (selected) { Rectangle cell = getPathBounds(tree, curr); g.setColor(dtcr.getBackgroundSelectionColor()); g.fillRect(cell.x + icon.getIconWidth()/2, cell.y, cell.width, cell.height); } g.translate(x, y); c.paint(g); g.translate(-x, -y); } }
| 12,943
|
protected void uninstallListeners() { tree.removePropertyChangeListener(propertyChangeListener); tree.removeFocusListener(focusListener); tree.removeTreeSelectionListener(treeSelectionListener); tree.removeMouseListener(mouseInputListener); tree.removeKeyListener(keyListener); tree.removePropertyChangeListener(selectionModelPropertyChangeListener); tree.removeComponentListener(componentListener); tree.getCellEditor().removeCellEditorListener(cellEditorListener); tree.removeTreeExpansionListener(treeExpansionListener); tree.getModel().removeTreeModelListener(treeModelListener); }
|
protected void uninstallListeners() { tree.removePropertyChangeListener(propertyChangeListener); tree.removeFocusListener(focusListener); tree.removeTreeSelectionListener(treeSelectionListener); tree.removeMouseListener(mouseInputListener); tree.removeKeyListener(keyListener); tree.removePropertyChangeListener(selectionModelPropertyChangeListener); tree.removeComponentListener(componentListener); tree.getCellEditor().removeCellEditorListener(cellEditorListener); tree.removeTreeExpansionListener(treeExpansionListener); tree.getModel().removeTreeModelListener(treeModelListener); }
| 12,945
|
protected void uninstallListeners() { tree.removePropertyChangeListener(propertyChangeListener); tree.removeFocusListener(focusListener); tree.removeTreeSelectionListener(treeSelectionListener); tree.removeMouseListener(mouseInputListener); tree.removeKeyListener(keyListener); tree.removePropertyChangeListener(selectionModelPropertyChangeListener); tree.removeComponentListener(componentListener); tree.getCellEditor().removeCellEditorListener(cellEditorListener); tree.removeTreeExpansionListener(treeExpansionListener); tree.getModel().removeTreeModelListener(treeModelListener); }
|
protected void uninstallListeners() { tree.removePropertyChangeListener(propertyChangeListener); tree.removeFocusListener(focusListener); tree.removeTreeSelectionListener(treeSelectionListener); tree.removeMouseListener(mouseInputListener); tree.removeKeyListener(keyListener); tree.removePropertyChangeListener(selectionModelPropertyChangeListener); tree.removeComponentListener(componentListener); tree.getCellEditor().removeCellEditorListener(cellEditorListener); tree.removeTreeExpansionListener(treeExpansionListener); tree.getModel().removeTreeModelListener(treeModelListener); }
| 12,946
|
public static NotFound extract(Any a) { try { return ((NotFoundHolder) a.extract_Streamable()).value; } catch (ClassCastException ex) { throw new BAD_OPERATION(); } }
|
public static NotFound extract(Any a) { try { return ((NotFoundHolder) a.extract_Streamable()).value; } catch (ClassCastException ex) { BAD_OPERATION bad = new BAD_OPERATION(); bad.initCause(ex); bad.minor = Minor.Any; throw bad; } }
| 12,947
|
public Object getCellEditorValue() { // TODO: should be getting the updated value from the editorComp return value; } // getCellEditorValue()
|
publicObjectgetCellEditorValue(){//TODO:shouldbegettingtheupdatedvaluefromtheeditorCompreturnvalue; }//getCellEditorValue()
| 12,949
|
public Object getCellEditorValue() { // TODO: should be getting the updated value from the editorComp return value; } // getCellEditorValue()
|
public Object getCellEditorValue() { // TODO: should be getting the updated value from the editorComp return value; } // getCellEditorValue()
| 12,950
|
public void setValue(Object value) { // TODO: should be setting the value in the editorComp this.value = value; }
|
public void setValue(Object aValue) { // TODO: should be setting the value in the editorComp this.value = value; }
| 12,951
|
public void setValue(Object value) { // TODO: should be setting the value in the editorComp this.value = value; }
|
public void setValue(Object value) { // TODO: should be setting the value in the editorComp value = aValue; }
| 12,952
|
public boolean shouldSelectCell(EventObject event) { // return true to indicate that the editing cell may be selected return true; } // shouldSelectCell()
|
public boolean shouldSelectCell(EventObject event) { // return true to indicate that the editing cell may be selected return true; } // shouldSelectCell()
| 12,953
|
public DefaultCellEditor(JTextField textfield) { editorComponent = textfield; clickCountToStart = 3; } // DefaultCellEditor()
|
public DefaultCellEditor(JTextField textfield) { editorComponent = textfield; clickCountToStart = 3; } // DefaultCellEditor()
| 12,954
|
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { // NOTE: as specified by Sun, we don't call new() everytime, we return // editorComponent on each call to getTableCellEditorComponent or // getTreeCellEditorComponent. However, currently JTextFields have a // problem with getting rid of old text, so without calling new() there // are some strange results. If you edit more than one cell in the table // text from previously edited cells may unexpectedly show up in the // cell you are currently editing. This will be fixed automatically // when JTextField is fixed. if (editorComponent instanceof JTextField) { ((JTextField)editorComponent).setText(value.toString()); delegate = new EditorDelegate(); ((JTextField)editorComponent).addActionListener(delegate); } else { // TODO } return editorComponent; } // getTableCellEditorComponent()
|
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { // NOTE: as specified by Sun, we don't call new() everytime, we return // editorComponent on each call to getTableCellEditorComponent or // getTreeCellEditorComponent. However, currently JTextFields have a // problem with getting rid of old text, so without calling new() there // are some strange results. If you edit more than one cell in the table // text from previously edited cells may unexpectedly show up in the // cell you are currently editing. This will be fixed automatically // when JTextField is fixed. if (editorComponent instanceof JTextField) { ((JTextField)editorComponent).setText(value.toString()); delegate = new EditorDelegate(); ((JTextField)editorComponent).addActionListener(delegate); } else { // TODO } return editorComponent; } // getTableCellEditorComponent()
| 12,955
|
String getDTDType();
|
String getDTDType();
| 12,956
|
public Object[] getSelectedValues() { int [] idx = getSelectedIndices(); Object [] v = new Object[idx.length]; for (int i = 0; i < idx.length; ++i) v[i] = getModel().getElementAt(i); return v; }
|
public Object[] getSelectedValues() { int [] idx = getSelectedIndices(); Object [] v = new Object[idx.length]; for (int i = 0; i < idx.length; ++i) v[i] = getModel().getElementAt(i); return v; }
| 12,957
|
public Object[] getSelectedValues() { int [] idx = getSelectedIndices(); Object [] v = new Object[idx.length]; for (int i = 0; i < idx.length; ++i) v[i] = getModel().getElementAt(i); return v; }
|
public Object[] getSelectedValues() { int [] idx = getSelectedIndices(); Object [] v = new Object[idx.length]; for (int i = 0; i < idx.length; ++i) v[i] = getModel().getElementAt(idx[i]); return v; }
| 12,958
|
public void editingCanceled(ChangeEvent e) { editingPath = null; editingRow = -1; stopEditingInCompleteEditing = false; if (editingComponent != null) tree.remove(editingComponent.getParent()); editingComponent = null; if (cellEditor != null) { if (cellEditor instanceof DefaultTreeCellEditor) tree.removeTreeSelectionListener((DefaultTreeCellEditor) cellEditor); cellEditor.removeCellEditorListener(cellEditorListener); setCellEditor(null); createdCellEditor = false; } tree.requestFocusInWindow(false); editorTimer.stop(); isEditing = false; validCachedPreferredSize = false; tree.revalidate(); tree.repaint(); }
|
public void editingCanceled(ChangeEvent e) { editingPath = null; editingRow = -1; stopEditingInCompleteEditing = false; if (editingComponent != null) tree.remove(editingComponent.getParent()); editingComponent = null; if (cellEditor != null) { if (cellEditor instanceof DefaultTreeCellEditor) tree.removeTreeSelectionListener((DefaultTreeCellEditor) cellEditor); cellEditor.removeCellEditorListener(cellEditorListener); setCellEditor(null); createdCellEditor = false; } tree.requestFocusInWindow(false); editorTimer.stop(); isEditing = false; validCachedPreferredSize = false; tree.repaint(); }
| 12,959
|
public void editingStopped(ChangeEvent e) { editingPath = null; editingRow = -1; stopEditingInCompleteEditing = false; if (editingComponent != null) { tree.remove(editingComponent.getParent()); editingComponent = null; } if (cellEditor != null) { newVal = ((JTextField) getCellEditor().getCellEditorValue()).getText(); completeEditing(false, false, true); if (cellEditor instanceof DefaultTreeCellEditor) tree.removeTreeSelectionListener((DefaultTreeCellEditor) cellEditor); cellEditor.removeCellEditorListener(cellEditorListener); setCellEditor(null); createdCellEditor = false; } isEditing = false; tree.requestFocusInWindow(false); editorTimer.stop(); validCachedPreferredSize = false; tree.revalidate(); tree.repaint(); }
|
public void editingStopped(ChangeEvent e) { editingPath = null; editingRow = -1; stopEditingInCompleteEditing = false; if (editingComponent != null) { tree.remove(editingComponent.getParent()); editingComponent = null; } if (cellEditor != null) { newVal = ((JTextField) getCellEditor().getCellEditorValue()).getText(); completeEditing(false, false, true); if (cellEditor instanceof DefaultTreeCellEditor) tree.removeTreeSelectionListener((DefaultTreeCellEditor) cellEditor); cellEditor.removeCellEditorListener(cellEditorListener); setCellEditor(null); createdCellEditor = false; } isEditing = false; tree.requestFocusInWindow(false); editorTimer.stop(); validCachedPreferredSize = false; tree.repaint(); }
| 12,960
|
public void propertyChange(PropertyChangeEvent event) { if ((event.getPropertyName()).equals("rootVisible")) { validCachedPreferredSize = false; updateCurrentVisiblePath(); tree.revalidate(); tree.repaint(); } }
|
public void propertyChange(PropertyChangeEvent event) { if ((event.getPropertyName()).equals("rootVisible")) { validCachedPreferredSize = false; updateCurrentVisiblePath(); tree.revalidate(); tree.repaint(); } }
| 12,961
|
public void treeCollapsed(TreeExpansionEvent event) { validCachedPreferredSize = false; updateCurrentVisiblePath(); tree.revalidate(); tree.repaint(); }
|
public void treeCollapsed(TreeExpansionEvent event) { validCachedPreferredSize = false; updateCurrentVisiblePath(); tree.revalidate(); tree.repaint(); }
| 12,962
|
public void treeExpanded(TreeExpansionEvent event) { validCachedPreferredSize = false; updateCurrentVisiblePath(); tree.revalidate(); tree.repaint(); }
|
public void treeExpanded(TreeExpansionEvent event) { validCachedPreferredSize = false; updateCurrentVisiblePath(); tree.revalidate(); tree.repaint(); }
| 12,963
|
public void treeNodesChanged(TreeModelEvent e) { validCachedPreferredSize = false; updateCurrentVisiblePath(); tree.revalidate(); tree.repaint(); }
|
public void treeNodesChanged(TreeModelEvent e) { validCachedPreferredSize = false; updateCurrentVisiblePath(); tree.revalidate(); tree.repaint(); }
| 12,964
|
public void treeNodesInserted(TreeModelEvent e) { validCachedPreferredSize = false; updateCurrentVisiblePath(); tree.revalidate(); tree.repaint(); }
|
public void treeNodesInserted(TreeModelEvent e) { validCachedPreferredSize = false; updateCurrentVisiblePath(); tree.revalidate(); tree.repaint(); }
| 12,965
|
public void treeNodesRemoved(TreeModelEvent e) { validCachedPreferredSize = false; updateCurrentVisiblePath(); tree.revalidate(); tree.repaint(); }
|
public void treeNodesRemoved(TreeModelEvent e) { validCachedPreferredSize = false; updateCurrentVisiblePath(); tree.revalidate(); tree.repaint(); }
| 12,966
|
public void treeStructureChanged(TreeModelEvent e) { if (e.getPath().length == 1 && !e.getPath()[0].equals(treeModel.getRoot())) tree.expandPath(new TreePath(treeModel.getRoot())); updateCurrentVisiblePath(); validCachedPreferredSize = false; tree.revalidate(); tree.repaint(); }
|
public void treeStructureChanged(TreeModelEvent e) { if (e.getPath().length == 1 && !e.getPath()[0].equals(treeModel.getRoot())) tree.expandPath(new TreePath(treeModel.getRoot())); validCachedPreferredSize = false; tree.revalidate(); tree.repaint(); }
| 12,967
|
public void treeStructureChanged(TreeModelEvent e) { if (e.getPath().length == 1 && !e.getPath()[0].equals(treeModel.getRoot())) tree.expandPath(new TreePath(treeModel.getRoot())); updateCurrentVisiblePath(); validCachedPreferredSize = false; tree.revalidate(); tree.repaint(); }
|
public void treeStructureChanged(TreeModelEvent e) { if (e.getPath().length == 1 && !e.getPath()[0].equals(treeModel.getRoot())) tree.expandPath(new TreePath(treeModel.getRoot())); updateCurrentVisiblePath(); validCachedPreferredSize = false; tree.repaint(); }
| 12,968
|
public void installUI(JComponent c) { tree = (JTree) c; prepareForUIInstall(); super.installUI(c); installDefaults(); installComponents(); installKeyboardActions(); installListeners(); setCellEditor(createDefaultCellEditor()); createdCellEditor = true; isEditing = false; TreeModel mod = tree.getModel(); setModel(mod); if (mod != null) { TreePath path = new TreePath(mod.getRoot()); if (!tree.isExpanded(path)) toggleExpandState(path); } treeSelectionModel = tree.getSelectionModel(); completeUIInstall(); }
|
public void installUI(JComponent c) { tree = (JTree) c; prepareForUIInstall(); super.installUI(c); installDefaults(); installComponents(); installKeyboardActions(); installListeners(); setCellEditor(createDefaultCellEditor()); createdCellEditor = true; isEditing = false; TreeModel mod = tree.getModel(); setModel(mod); if (mod != null) { Object root = mod.getRoot(); if (root != null) { TreePath path = new TreePath(root); if (!tree.isExpanded(path)) toggleExpandState(path); } treeSelectionModel = tree.getSelectionModel(); completeUIInstall(); }
| 12,969
|
public void paint(Graphics g, JComponent c) { JTree tree = (JTree) c; if (currentVisiblePath == null) updateCurrentVisiblePath(); Rectangle clip = g.getClipBounds(); Insets insets = tree.getInsets(); if (clip != null && treeModel != null && currentVisiblePath != null) { int startIndex = tree.getClosestRowForLocation(clip.x, clip.y); int endIndex = tree.getClosestRowForLocation(clip.x + clip.width, clip.y + clip.height); paintVerticalPartOfLeg(g, clip, insets, currentVisiblePath); for (int i = startIndex; i <= endIndex; i++) { Object curr = currentVisiblePath.getPathComponent(i); boolean isLeaf = treeModel.isLeaf(curr); TreePath path = new TreePath(getPathToRoot(curr, 0)); boolean isExpanded = tree.isExpanded(path); Rectangle bounds = getPathBounds(tree, path); paintHorizontalPartOfLeg(g, clip, insets, bounds, path, i, isExpanded, false, isLeaf); paintRow(g, clip, insets, bounds, path, i, isExpanded, false, isLeaf); } } }
|
public void paint(Graphics g, JComponent c) { JTree tree = (JTree) c; updateCurrentVisiblePath(); Rectangle clip = g.getClipBounds(); Insets insets = tree.getInsets(); if (clip != null && treeModel != null && currentVisiblePath != null) { int startIndex = tree.getClosestRowForLocation(clip.x, clip.y); int endIndex = tree.getClosestRowForLocation(clip.x + clip.width, clip.y + clip.height); paintVerticalPartOfLeg(g, clip, insets, currentVisiblePath); for (int i = startIndex; i <= endIndex; i++) { Object curr = currentVisiblePath.getPathComponent(i); boolean isLeaf = treeModel.isLeaf(curr); TreePath path = new TreePath(getPathToRoot(curr, 0)); boolean isExpanded = tree.isExpanded(path); Rectangle bounds = getPathBounds(tree, path); paintHorizontalPartOfLeg(g, clip, insets, bounds, path, i, isExpanded, false, isLeaf); paintRow(g, clip, insets, bounds, path, i, isExpanded, false, isLeaf); } } }
| 12,971
|
protected void pathWasCollapsed(TreePath path) { validCachedPreferredSize = false; tree.revalidate(); tree.repaint(); }
|
protected void pathWasCollapsed(TreePath path) { validCachedPreferredSize = false; tree.repaint(); }
| 12,972
|
protected void pathWasExpanded(TreePath path) { validCachedPreferredSize = false; tree.revalidate(); tree.repaint(); }
|
protected void pathWasExpanded(TreePath path) { validCachedPreferredSize = false; tree.repaint(); }
| 12,973
|
protected boolean startEditing(TreePath path, MouseEvent event) { int x; int y; if (event == null) { Rectangle bounds = getPathBounds(tree, path); x = bounds.x; y = bounds.y; } else { x = event.getX(); y = event.getY(); } updateCellEditor(); TreeCellEditor ed = getCellEditor(); if (ed != null && ed.shouldSelectCell(event) && ed.isCellEditable(event)) { editingPath = path; editingRow = tree.getRowForPath(editingPath); Object val = editingPath.getLastPathComponent(); cellEditor.addCellEditorListener(cellEditorListener); stopEditingInCompleteEditing = false; boolean expanded = tree.isExpanded(editingPath); isEditing = true; editingComponent = ed.getTreeCellEditorComponent(tree, val, true, expanded, isLeaf(editingRow), editingRow); editingComponent.getParent().setVisible(true); editingComponent.getParent().validate(); tree.add(editingComponent.getParent()); editingComponent.getParent().validate(); validCachedPreferredSize = false; tree.revalidate(); ((JTextField) editingComponent).requestFocusInWindow(false); editorTimer.start(); return true; } return false; }
|
protected boolean startEditing(TreePath path, MouseEvent event) { int x; int y; if (event == null) { Rectangle bounds = getPathBounds(tree, path); x = bounds.x; y = bounds.y; } else { x = event.getX(); y = event.getY(); } updateCellEditor(); TreeCellEditor ed = getCellEditor(); if (ed != null && ed.shouldSelectCell(event) && ed.isCellEditable(event)) { editingPath = path; editingRow = tree.getRowForPath(editingPath); Object val = editingPath.getLastPathComponent(); cellEditor.addCellEditorListener(cellEditorListener); stopEditingInCompleteEditing = false; boolean expanded = tree.isExpanded(editingPath); isEditing = true; editingComponent = ed.getTreeCellEditorComponent(tree, val, true, expanded, isLeaf(editingRow), editingRow); editingComponent.getParent().setVisible(true); editingComponent.getParent().validate(); tree.add(editingComponent.getParent()); editingComponent.getParent().validate(); validCachedPreferredSize = false; ((JTextField) editingComponent).requestFocusInWindow(false); editorTimer.start(); return true; } return false; }
| 12,974
|
protected void toggleExpandState(TreePath path) { if (tree.isExpanded(path)) tree.collapsePath(path); else tree.expandPath(path); updateCurrentVisiblePath(); }
|
protected void toggleExpandState(TreePath path) { if (tree.isExpanded(path)) tree.collapsePath(path); else tree.expandPath(path); }
| 12,975
|
protected void installDefaults() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); toolBar.setBorder(new ToolBarBorder()); toolBar.setBackground(defaults.getColor("ToolBar.background")); toolBar.setForeground(defaults.getColor("ToolBar.foreground")); toolBar.setFont(defaults.getFont("ToolBar.font")); dockingBorderColor = defaults.getColor("ToolBar.dockingForeground"); dockingColor = defaults.getColor("ToolBar.dockingBackground"); floatingBorderColor = defaults.getColor("ToolBar.floatingForeground"); floatingColor = defaults.getColor("ToolBar.floatingBackground"); }
|
protected void installDefaults() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); toolBar.setBorder(defaults.getBorder("ToolBar.border")); toolBar.setBackground(defaults.getColor("ToolBar.background")); toolBar.setForeground(defaults.getColor("ToolBar.foreground")); toolBar.setFont(defaults.getFont("ToolBar.font")); dockingBorderColor = defaults.getColor("ToolBar.dockingForeground"); dockingColor = defaults.getColor("ToolBar.dockingBackground"); floatingBorderColor = defaults.getColor("ToolBar.floatingForeground"); floatingColor = defaults.getColor("ToolBar.floatingBackground"); }
| 12,977
|
public void invoke(String cmdLineStr) { final CommandLine cmdLine = new CommandLine(cmdLineStr); if (!cmdLine.hasNext()) return; String cmdName = cmdLine.next(); commandShell.addCommandToHistory(cmdLineStr); // System.err.println("Got command: "+cmdLineStr+", name="+cmdName); try { Class cmdClass = commandShell.getCommandClass(cmdName); // System.err.println("CmdClass="+cmdClass); final Method main = cmdClass.getMethod("main", MAIN_ARG_TYPES); // System.err.println("main="+main); try { // System.err.println("Invoking..."); try { final Object[] args = new Object[] { cmdLine.getRemainder() .toStringArray()}; AccessController.doPrivileged(new InvokeAction(main, null, args)); } catch (PrivilegedActionException ex) { throw ex.getException(); } //main.invoke(null, ); // System.err.println("Finished invoke."); } catch (InvocationTargetException ex) { Throwable tex = ex.getTargetException(); if (tex instanceof SyntaxError) { Help.getInfo(cmdClass).usage(); err.println(tex.getMessage()); } else { err.println("Exception in command"); tex.printStackTrace(err); } } catch (Exception ex) { err.println("Exception in command"); ex.printStackTrace(err); } catch (Error ex) { err.println("Fatal error in command"); ex.printStackTrace(err); } } catch (NoSuchMethodException ex) { err.println("Alias class has no main method " + cmdName); } catch (ClassNotFoundException ex) { err.println("Unknown alias class " + ex.getMessage()); } catch (ClassCastException ex) { err.println("Invalid command " + cmdName); } catch (Exception ex) { err.println("I FOUND AN ERROR: " + ex); } }
|
public void invoke(String cmdLineStr) { final CommandLine cmdLine = new CommandLine(cmdLineStr); if (!cmdLine.hasNext()) return; String cmdName = cmdLine.next(); commandShell.addCommandToHistory(cmdLineStr); // System.err.println("Got command: "+cmdLineStr+", name="+cmdName); try { Class cmdClass = commandShell.getCommandClass(cmdName); // System.err.println("CmdClass="+cmdClass); final Method main = cmdClass.getMethod("main", MAIN_ARG_TYPES); // System.err.println("main="+main); try { // System.err.println("Invoking..."); try { final Object[] args = new Object[] { cmdLine.getRemainder() .toStringArray()}; AccessController.doPrivileged(new InvokeAction(main, null, args)); } catch (PrivilegedActionException ex) { throw ex.getException(); } //main.invoke(null, ); // System.err.println("Finished invoke."); } catch (InvocationTargetException ex) { Throwable tex = ex.getTargetException(); if (tex instanceof SyntaxErrorException) { Help.getInfo(cmdClass).usage(); err.println(tex.getMessage()); } else { err.println("Exception in command"); tex.printStackTrace(err); } } catch (Exception ex) { err.println("Exception in command"); ex.printStackTrace(err); } catch (Error ex) { err.println("Fatal error in command"); ex.printStackTrace(err); } } catch (NoSuchMethodException ex) { err.println("Alias class has no main method " + cmdName); } catch (ClassNotFoundException ex) { err.println("Unknown alias class " + ex.getMessage()); } catch (ClassCastException ex) { err.println("Invalid command " + cmdName); } catch (Exception ex) { err.println("I FOUND AN ERROR: " + ex); } }
| 12,978
|
private boolean loadConfig(String name) throws Exception {// boolean rc = false;// SMTPProperties = new java.util.Properties();// if (name == null || name == "")// name = ConfigureFactory.getInstance().settingsDirectory()// + "SMTPProperties.cfg";//// try {// FileInputStream in = new FileInputStream(name);//// SMTPProperties.load(in);// rc = true;// }// catch (IOException ioe) {System.out.println(ioe.getMessage());}// catch (SecurityException se) {// System.out.println(se.getMessage());// }// SMTPProperties = ConfigureFactory.getInstance().getProperties("smtp", "SMTPProperties.cfg"); if (SMTPProperties.size() > 0) return true; else return false; }
|
private boolean loadConfig(String name) throws Exception {// boolean rc = false;// SMTPProperties = new java.util.Properties();// if (name == null || name == "")// name = ConfigureFactory.getInstance().settingsDirectory()//+ "SMTPProperties.cfg";//// try {// FileInputStream in = new FileInputStream(name);//// SMTPProperties.load(in);// rc = true;// }// catch (IOException ioe) {System.out.println(ioe.getMessage());}// catch (SecurityException se) {// System.out.println(se.getMessage());// }// SMTPProperties = ConfigureFactory.getInstance().getProperties("smtp", "SMTPProperties.cfg"); if (SMTPProperties.size() > 0) return true; else return false; }
| 12,979
|
public boolean send() throws Exception { try { if(!loadConfig(configFile)) return false; Session session = Session.getDefaultInstance(SMTPProperties, null); session.setDebug(false); // create the Multipart and its parts to it Multipart mp = new MimeMultipart(); Message msg = new MimeMessage(session); InternetAddress[] toAddrs = null, ccAddrs = null; toAddrs = InternetAddress.parse(to, false); msg.setRecipients(Message.RecipientType.TO, toAddrs); if (cc != null) { ccAddrs = InternetAddress.parse(cc, false); msg.setRecipients(Message.RecipientType.CC, ccAddrs); } if (subject != null) msg.setSubject(subject.trim()); if (from != null && from.length() > 0) msg.setFrom(new InternetAddress(from)); if (message != null && message.length() > 0) { // create and fill the attachment message part MimeBodyPart mbp = new MimeBodyPart(); mbp.setText(message,"us-ascii"); mp.addBodyPart(mbp); } msg.setSentDate(new Date()); if (attachment != null && attachment.length() > 0) { // create and fill the attachment message part MimeBodyPart abp = new MimeBodyPart(); abp.setText(attachment,"us-ascii"); if (attachmentName == null || attachmentName.length() == 0) abp.setFileName("tn5250j.txt"); else abp.setFileName(attachmentName); mp.addBodyPart(abp); } if (fileName != null && fileName.length() > 0) { // create and fill the attachment message part MimeBodyPart fbp = new MimeBodyPart(); fbp.setText("File sent using tn5250j","us-ascii"); if (attachmentName == null || attachmentName.length() == 0) fbp.setFileName("tn5250j.txt"); else fbp.setFileName(attachmentName); // Get the attachment DataSource source = new FileDataSource(fileName); // Set the data handler to the attachment fbp.setDataHandler(new DataHandler(source)); mp.addBodyPart(fbp); } // add the Multipart to the message msg.setContent(mp); // send the message Transport.send(msg); return true; } catch (SendFailedException sfe) { showFailedException(sfe); }// catch (AddressException ae) {//// }// catch ( MessagingException me) {//// } return false; }
|
public boolean send() throws Exception { try { if(!loadConfig(configFile)) return false; Session session = Session.getDefaultInstance(SMTPProperties, null); session.setDebug(false); // create the Multipart and its parts to it Multipart mp = new MimeMultipart(); Message msg = new MimeMessage(session); InternetAddress[] toAddrs = null, ccAddrs = null; toAddrs = InternetAddress.parse(to, false); msg.setRecipients(Message.RecipientType.TO, toAddrs); if (cc != null) { ccAddrs = InternetAddress.parse(cc, false); msg.setRecipients(Message.RecipientType.CC, ccAddrs); } if (subject != null) msg.setSubject(subject.trim()); if (from != null && from.length() > 0) msg.setFrom(new InternetAddress(from)); if (message != null && message.length() > 0) { // create and fill the attachment message part MimeBodyPart mbp = new MimeBodyPart(); mbp.setText(message,"us-ascii"); mp.addBodyPart(mbp); } msg.setSentDate(new Date()); if (attachment != null && attachment.length() > 0) { // create and fill the attachment message part MimeBodyPart abp = new MimeBodyPart(); abp.setText(attachment,"us-ascii"); if (attachmentName == null || attachmentName.length() == 0) abp.setFileName("tn5250j.txt"); else abp.setFileName(attachmentName); mp.addBodyPart(abp); } if (fileName != null && fileName.length() > 0) { // create and fill the attachment message part MimeBodyPart fbp = new MimeBodyPart(); fbp.setText("File sent using tn5250j","us-ascii"); if (attachmentName == null || attachmentName.length() == 0) fbp.setFileName("tn5250j.txt"); else fbp.setFileName(attachmentName); // Get the attachment DataSource source = new FileDataSource(fileName); // Set the data handler to the attachment fbp.setDataHandler(new DataHandler(source)); mp.addBodyPart(fbp); } // add the Multipart to the message msg.setContent(mp); // send the message Transport.send(msg); return true; } catch (SendFailedException sfe) { showFailedException(sfe); }// catch (AddressException ae) {//// }// catch ( MessagingException me) {//// } return false; }
| 12,980
|
public boolean send() throws Exception { try { if(!loadConfig(configFile)) return false; Session session = Session.getDefaultInstance(SMTPProperties, null); session.setDebug(false); // create the Multipart and its parts to it Multipart mp = new MimeMultipart(); Message msg = new MimeMessage(session); InternetAddress[] toAddrs = null, ccAddrs = null; toAddrs = InternetAddress.parse(to, false); msg.setRecipients(Message.RecipientType.TO, toAddrs); if (cc != null) { ccAddrs = InternetAddress.parse(cc, false); msg.setRecipients(Message.RecipientType.CC, ccAddrs); } if (subject != null) msg.setSubject(subject.trim()); if (from != null && from.length() > 0) msg.setFrom(new InternetAddress(from)); if (message != null && message.length() > 0) { // create and fill the attachment message part MimeBodyPart mbp = new MimeBodyPart(); mbp.setText(message,"us-ascii"); mp.addBodyPart(mbp); } msg.setSentDate(new Date()); if (attachment != null && attachment.length() > 0) { // create and fill the attachment message part MimeBodyPart abp = new MimeBodyPart(); abp.setText(attachment,"us-ascii"); if (attachmentName == null || attachmentName.length() == 0) abp.setFileName("tn5250j.txt"); else abp.setFileName(attachmentName); mp.addBodyPart(abp); } if (fileName != null && fileName.length() > 0) { // create and fill the attachment message part MimeBodyPart fbp = new MimeBodyPart(); fbp.setText("File sent using tn5250j","us-ascii"); if (attachmentName == null || attachmentName.length() == 0) fbp.setFileName("tn5250j.txt"); else fbp.setFileName(attachmentName); // Get the attachment DataSource source = new FileDataSource(fileName); // Set the data handler to the attachment fbp.setDataHandler(new DataHandler(source)); mp.addBodyPart(fbp); } // add the Multipart to the message msg.setContent(mp); // send the message Transport.send(msg); return true; } catch (SendFailedException sfe) { showFailedException(sfe); }// catch (AddressException ae) {//// }// catch ( MessagingException me) {//// } return false; }
|
public boolean send() throws Exception {try { if(!loadConfig(configFile))return false; Session session = Session.getDefaultInstance(SMTPProperties, null); session.setDebug(false); // create the Multipart and its parts to it Multipart mp = new MimeMultipart(); Message msg = new MimeMessage(session); InternetAddress[] toAddrs = null, ccAddrs = null; toAddrs = InternetAddress.parse(to, false); msg.setRecipients(Message.RecipientType.TO, toAddrs); if (cc != null) {ccAddrs = InternetAddress.parse(cc, false);msg.setRecipients(Message.RecipientType.CC, ccAddrs); } if (subject != null)msg.setSubject(subject.trim()); if (from != null && from.length() > 0)msg.setFrom(new InternetAddress(from)); if (message != null && message.length() > 0) {// create and fill the attachment message partMimeBodyPart mbp = new MimeBodyPart();mbp.setText(message,"us-ascii");mp.addBodyPart(mbp); } msg.setSentDate(new Date()); if (attachment != null && attachment.length() > 0) {// create and fill the attachment message partMimeBodyPart abp = new MimeBodyPart();abp.setText(attachment,"us-ascii");if (attachmentName == null || attachmentName.length() == 0) abp.setFileName("tn5250j.txt");else abp.setFileName(attachmentName);mp.addBodyPart(abp); } if (fileName != null && fileName.length() > 0) {// create and fill the attachment message partMimeBodyPart fbp = new MimeBodyPart();fbp.setText("File sent using tn5250j","us-ascii");if (attachmentName == null || attachmentName.length() == 0) fbp.setFileName("tn5250j.txt");else fbp.setFileName(attachmentName); // Get the attachment DataSource source = new FileDataSource(fileName); // Set the data handler to the attachment fbp.setDataHandler(new DataHandler(source));mp.addBodyPart(fbp); } // add the Multipart to the message msg.setContent(mp); // send the message Transport.send(msg); return true;}catch (SendFailedException sfe) { showFailedException(sfe);}//catch (AddressException ae) {////}//catch ( MessagingException me) {////}return false; }
| 12,981
|
private void showFailedException(SendFailedException sfe) { String error = sfe.getMessage() + "\n"; Address[] ia = sfe.getInvalidAddresses(); for (int x = 0; x < ia.length; x++) { error += "Invalid Address: " + ia[x].toString() + "\n"; } JTextArea ea = new JTextArea(error,6,50); JScrollPane errorScrollPane = new JScrollPane(ea); errorScrollPane.setHorizontalScrollBarPolicy( JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); errorScrollPane.setVerticalScrollBarPolicy( JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); JOptionPane.showMessageDialog(null, errorScrollPane, LangTool.getString("em.titleConfirmation"), JOptionPane.ERROR_MESSAGE); }
|
private void showFailedException(SendFailedException sfe) { String error = sfe.getMessage() + "\n"; Address[] ia = sfe.getInvalidAddresses(); for (int x = 0; x < ia.length; x++) { error += "Invalid Address: " + ia[x].toString() + "\n"; } JTextArea ea = new JTextArea(error,6,50); JScrollPane errorScrollPane = new JScrollPane(ea); errorScrollPane.setHorizontalScrollBarPolicy( JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); errorScrollPane.setVerticalScrollBarPolicy( JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); JOptionPane.showMessageDialog(null, errorScrollPane, LangTool.getString("em.titleConfirmation"), JOptionPane.ERROR_MESSAGE); }
| 12,982
|
public HostNameArgument(String _name, String _description) { super(_name, _description); }
|
public HostNameArgument(String _name, String _description, boolean _multi) { super(_name, _description); }
| 12,983
|
public HostNameArgument(String _name, String _description) { super(_name, _description); }
|
public HostNameArgument(String _name, String _description) { super(_name, _description); }
| 12,984
|
public void mouseDragged(MouseEvent e) { // If the frame is maximized, there is nothing that // can be dragged around. if (frame.isMaximum()) return; DesktopManager dm = getDesktopManager(); Rectangle b = frame.getBounds(); Dimension min = frame.getMinimumSize(); if (min == null) min = new Dimension(0, 0); Insets insets = frame.getInsets(); int x = e.getX(); int y = e.getY(); if (e.getSource() == frame && frame.isResizable()) { switch (direction) { case NORTH: cacheRect.setBounds(b.x, Math.min(b.y + y, b.y + b.height - min.height), b.width, b.height - y); break; case NORTH_EAST: cacheRect.setBounds(b.x, Math.min(b.y + y, b.y + b.height - min.height), x, b.height - y); break; case EAST: cacheRect.setBounds(b.x, b.y, x, b.height); break; case SOUTH_EAST: cacheRect.setBounds(b.x, b.y, x, y); break; case SOUTH: cacheRect.setBounds(b.x, b.y, b.width, y); break; case SOUTH_WEST: cacheRect.setBounds(Math.min(b.x + x, b.x + b.width - min.width), b.y, b.width - x, y); break; case WEST: cacheRect.setBounds(Math.min(b.x + x, b.x + b.width - min.width), b.y, b.width - x, b.height); break; case NORTH_WEST: cacheRect.setBounds(Math.min(b.x + x, b.x + b.width - min.width), Math.min(b.y + y, b.y + b.height - min.height), b.width - x, b.height - y); break; } dm.resizeFrame(frame, cacheRect.x, cacheRect.y, Math.max(min.width, cacheRect.width), Math.max(min.height, cacheRect.height)); } else if (e.getSource() == titlePane) { Rectangle fBounds = frame.getBounds(); dm.dragFrame(frame, e.getX() - xOffset + b.x, e.getY() - yOffset + b.y); } }
|
public void mouseDragged(MouseEvent e) { // If the frame is maximized, there is nothing that // can be dragged around. if (frame.isMaximum()) return; DesktopManager dm = getDesktopManager(); Rectangle b = frame.getBounds(); Dimension min = frame.getMinimumSize(); if (min == null) min = new Dimension(0, 0); Insets insets = frame.getInsets(); int x = e.getX(); int y = e.getY(); if (e.getSource() == frame && frame.isResizable()) { switch (direction) { case NORTH: cacheRect.setBounds(b.x, Math.min(b.y + y, b.y + b.height - min.height), b.width, b.height - y); break; case NORTH_EAST: cacheRect.setBounds(b.x, Math.min(b.y + y, b.y + b.height - min.height), x, b.height - y); break; case EAST: cacheRect.setBounds(b.x, b.y, x, b.height); break; case SOUTH_EAST: cacheRect.setBounds(b.x, b.y, x, y); break; case SOUTH: cacheRect.setBounds(b.x, b.y, b.width, y); break; case SOUTH_WEST: cacheRect.setBounds(Math.min(b.x + x, b.x + b.width - min.width), b.y, b.width - x, y); break; case WEST: cacheRect.setBounds(Math.min(b.x + x, b.x + b.width - min.width), b.y, b.width - x, b.height); break; case NORTH_WEST: cacheRect.setBounds(Math.min(b.x + x, b.x + b.width - min.width), Math.min(b.y + y, b.y + b.height - min.height), b.width - x, b.height - y); break; } dm.resizeFrame(frame, cacheRect.x, cacheRect.y, Math.max(min.width, cacheRect.width), Math.max(min.height, cacheRect.height)); } else if (e.getSource() == titlePane) { Rectangle fBounds = frame.getBounds(); dm.dragFrame(frame, e.getX() - xOffset + b.x, e.getY() - yOffset + b.y); } }
| 12,985
|
public void mouseDragged(MouseEvent e) { // If the frame is maximized, there is nothing that // can be dragged around. if (frame.isMaximum()) return; DesktopManager dm = getDesktopManager(); Rectangle b = frame.getBounds(); Dimension min = frame.getMinimumSize(); if (min == null) min = new Dimension(0, 0); Insets insets = frame.getInsets(); int x = e.getX(); int y = e.getY(); if (e.getSource() == frame && frame.isResizable()) { switch (direction) { case NORTH: cacheRect.setBounds(b.x, Math.min(b.y + y, b.y + b.height - min.height), b.width, b.height - y); break; case NORTH_EAST: cacheRect.setBounds(b.x, Math.min(b.y + y, b.y + b.height - min.height), x, b.height - y); break; case EAST: cacheRect.setBounds(b.x, b.y, x, b.height); break; case SOUTH_EAST: cacheRect.setBounds(b.x, b.y, x, y); break; case SOUTH: cacheRect.setBounds(b.x, b.y, b.width, y); break; case SOUTH_WEST: cacheRect.setBounds(Math.min(b.x + x, b.x + b.width - min.width), b.y, b.width - x, y); break; case WEST: cacheRect.setBounds(Math.min(b.x + x, b.x + b.width - min.width), b.y, b.width - x, b.height); break; case NORTH_WEST: cacheRect.setBounds(Math.min(b.x + x, b.x + b.width - min.width), Math.min(b.y + y, b.y + b.height - min.height), b.width - x, b.height - y); break; } dm.resizeFrame(frame, cacheRect.x, cacheRect.y, Math.max(min.width, cacheRect.width), Math.max(min.height, cacheRect.height)); } else if (e.getSource() == titlePane) { Rectangle fBounds = frame.getBounds(); dm.dragFrame(frame, e.getX() - xOffset + b.x, e.getY() - yOffset + b.y); } }
|
public void mouseDragged(MouseEvent e) { // If the frame is maximized, there is nothing that // can be dragged around. if (frame.isMaximum()) return; DesktopManager dm = getDesktopManager(); Rectangle b = frame.getBounds(); Dimension min = frame.getMinimumSize(); if (min == null) min = new Dimension(0, 0); Insets insets = frame.getInsets(); int x = e.getX(); int y = e.getY(); if (e.getSource() == frame && frame.isResizable()) { switch (direction) { case NORTH: cacheRect.setBounds(b.x, Math.min(b.y + y, b.y + b.height - min.height), b.width, b.height - y); break; case NORTH_EAST: cacheRect.setBounds(b.x, Math.min(b.y + y, b.y + b.height - min.height), x, b.height - y); break; case EAST: cacheRect.setBounds(b.x, b.y, x, b.height); break; case SOUTH_EAST: cacheRect.setBounds(b.x, b.y, x, y); break; case SOUTH: cacheRect.setBounds(b.x, b.y, b.width, y); break; case SOUTH_WEST: cacheRect.setBounds(Math.min(b.x + x, b.x + b.width - min.width), b.y, b.width - x, y); break; case WEST: cacheRect.setBounds(Math.min(b.x + x, b.x + b.width - min.width), b.y, b.width - x, b.height); break; case NORTH_WEST: cacheRect.setBounds(Math.min(b.x + x, b.x + b.width - min.width), Math.min(b.y + y, b.y + b.height - min.height), b.width - x, b.height - y); break; } dm.resizeFrame(frame, cacheRect.x, cacheRect.y, Math.max(min.width, cacheRect.width), Math.max(min.height, cacheRect.height)); } else if (e.getSource() == titlePane) { Rectangle fBounds = frame.getBounds(); dm.dragFrame(frame, e.getX() - xOffset + b.x, e.getY() - yOffset + b.y); } }
| 12,986
|
public void mouseDragged(MouseEvent e) { // If the frame is maximized, there is nothing that // can be dragged around. if (frame.isMaximum()) return; DesktopManager dm = getDesktopManager(); Rectangle b = frame.getBounds(); Dimension min = frame.getMinimumSize(); if (min == null) min = new Dimension(0, 0); Insets insets = frame.getInsets(); int x = e.getX(); int y = e.getY(); if (e.getSource() == frame && frame.isResizable()) { switch (direction) { case NORTH: cacheRect.setBounds(b.x, Math.min(b.y + y, b.y + b.height - min.height), b.width, b.height - y); break; case NORTH_EAST: cacheRect.setBounds(b.x, Math.min(b.y + y, b.y + b.height - min.height), x, b.height - y); break; case EAST: cacheRect.setBounds(b.x, b.y, x, b.height); break; case SOUTH_EAST: cacheRect.setBounds(b.x, b.y, x, y); break; case SOUTH: cacheRect.setBounds(b.x, b.y, b.width, y); break; case SOUTH_WEST: cacheRect.setBounds(Math.min(b.x + x, b.x + b.width - min.width), b.y, b.width - x, y); break; case WEST: cacheRect.setBounds(Math.min(b.x + x, b.x + b.width - min.width), b.y, b.width - x, b.height); break; case NORTH_WEST: cacheRect.setBounds(Math.min(b.x + x, b.x + b.width - min.width), Math.min(b.y + y, b.y + b.height - min.height), b.width - x, b.height - y); break; } dm.resizeFrame(frame, cacheRect.x, cacheRect.y, Math.max(min.width, cacheRect.width), Math.max(min.height, cacheRect.height)); } else if (e.getSource() == titlePane) { Rectangle fBounds = frame.getBounds(); dm.dragFrame(frame, e.getX() - xOffset + b.x, e.getY() - yOffset + b.y); } }
|
public void mouseDragged(MouseEvent e) { // If the frame is maximized, there is nothing that // can be dragged around. if (frame.isMaximum()) return; DesktopManager dm = getDesktopManager(); Rectangle b = frame.getBounds(); Dimension min = frame.getMinimumSize(); if (min == null) min = new Dimension(0, 0); Insets insets = frame.getInsets(); int x = e.getX(); int y = e.getY(); if (e.getSource() == frame && frame.isResizable()) { switch (direction) { case NORTH: cacheRect.setBounds(b.x, Math.min(b.y + y, b.y + b.height - min.height), b.width, b.height - y); break; case NORTH_EAST: cacheRect.setBounds(b.x, Math.min(b.y + y, b.y + b.height - min.height), x, b.height - y); break; case EAST: cacheRect.setBounds(b.x, b.y, x, b.height); break; case SOUTH_EAST: cacheRect.setBounds(b.x, b.y, x, y); break; case SOUTH: cacheRect.setBounds(b.x, b.y, b.width, y); break; case SOUTH_WEST: cacheRect.setBounds(Math.min(b.x + x, b.x + b.width - min.width), b.y, b.width - x, y); break; case WEST: cacheRect.setBounds(Math.min(b.x + x, b.x + b.width - min.width), b.y, b.width - x, b.height); break; case NORTH_WEST: cacheRect.setBounds(Math.min(b.x + x, b.x + b.width - min.width), Math.min(b.y + y, b.y + b.height - min.height), b.width - x, b.height - y); break; } dm.resizeFrame(frame, cacheRect.x, cacheRect.y, Math.max(min.width, cacheRect.width), Math.max(min.height, cacheRect.height)); } else if (e.getSource() == titlePane) { Rectangle fBounds = frame.getBounds(); dm.dragFrame(frame, e.getX() - xOffset + b.x, e.getY() - yOffset + b.y); } }
| 12,987
|
public void mouseDragged(MouseEvent e) { // If the frame is maximized, there is nothing that // can be dragged around. if (frame.isMaximum()) return; DesktopManager dm = getDesktopManager(); Rectangle b = frame.getBounds(); Dimension min = frame.getMinimumSize(); if (min == null) min = new Dimension(0, 0); Insets insets = frame.getInsets(); int x = e.getX(); int y = e.getY(); if (e.getSource() == frame && frame.isResizable()) { switch (direction) { case NORTH: cacheRect.setBounds(b.x, Math.min(b.y + y, b.y + b.height - min.height), b.width, b.height - y); break; case NORTH_EAST: cacheRect.setBounds(b.x, Math.min(b.y + y, b.y + b.height - min.height), x, b.height - y); break; case EAST: cacheRect.setBounds(b.x, b.y, x, b.height); break; case SOUTH_EAST: cacheRect.setBounds(b.x, b.y, x, y); break; case SOUTH: cacheRect.setBounds(b.x, b.y, b.width, y); break; case SOUTH_WEST: cacheRect.setBounds(Math.min(b.x + x, b.x + b.width - min.width), b.y, b.width - x, y); break; case WEST: cacheRect.setBounds(Math.min(b.x + x, b.x + b.width - min.width), b.y, b.width - x, b.height); break; case NORTH_WEST: cacheRect.setBounds(Math.min(b.x + x, b.x + b.width - min.width), Math.min(b.y + y, b.y + b.height - min.height), b.width - x, b.height - y); break; } dm.resizeFrame(frame, cacheRect.x, cacheRect.y, Math.max(min.width, cacheRect.width), Math.max(min.height, cacheRect.height)); } else if (e.getSource() == titlePane) { Rectangle fBounds = frame.getBounds(); dm.dragFrame(frame, e.getX() - xOffset + b.x, e.getY() - yOffset + b.y); } }
|
public void mouseDragged(MouseEvent e) { // If the frame is maximized, there is nothing that // can be dragged around. if (frame.isMaximum()) return; DesktopManager dm = getDesktopManager(); Rectangle b = frame.getBounds(); Dimension min = frame.getMinimumSize(); if (min == null) min = new Dimension(0, 0); Insets insets = frame.getInsets(); int x = e.getX(); int y = e.getY(); if (e.getSource() == frame && frame.isResizable()) { switch (direction) { case NORTH: cacheRect.setBounds(b.x, Math.min(b.y + y, b.y + b.height - min.height), b.width, b.height - y); break; case NORTH_EAST: cacheRect.setBounds(b.x, Math.min(b.y + y, b.y + b.height - min.height), x, b.height - y); break; case EAST: cacheRect.setBounds(b.x, b.y, x, b.height); break; case SOUTH_EAST: cacheRect.setBounds(b.x, b.y, x, y); break; case SOUTH: cacheRect.setBounds(b.x, b.y, b.width, y); break; case SOUTH_WEST: cacheRect.setBounds(Math.min(b.x + x, b.x + b.width - min.width), b.y, b.width - x, y); break; case WEST: cacheRect.setBounds(Math.min(b.x + x, b.x + b.width - min.width), b.y, b.width - x, b.height); break; case NORTH_WEST: cacheRect.setBounds(Math.min(b.x + x, b.x + b.width - min.width), Math.min(b.y + y, b.y + b.height - min.height), b.width - x, b.height - y); break; } dm.resizeFrame(frame, cacheRect.x, cacheRect.y, Math.max(min.width, cacheRect.width), Math.max(min.height, cacheRect.height)); } else if (e.getSource() == titlePane) { Rectangle fBounds = frame.getBounds(); dm.dragFrame(frame, e.getX() - xOffset + b.x, e.getY() - yOffset + b.y); } }
| 12,988
|
public void mouseDragged(MouseEvent e) { // If the frame is maximized, there is nothing that // can be dragged around. if (frame.isMaximum()) return; DesktopManager dm = getDesktopManager(); Rectangle b = frame.getBounds(); Dimension min = frame.getMinimumSize(); if (min == null) min = new Dimension(0, 0); Insets insets = frame.getInsets(); int x = e.getX(); int y = e.getY(); if (e.getSource() == frame && frame.isResizable()) { switch (direction) { case NORTH: cacheRect.setBounds(b.x, Math.min(b.y + y, b.y + b.height - min.height), b.width, b.height - y); break; case NORTH_EAST: cacheRect.setBounds(b.x, Math.min(b.y + y, b.y + b.height - min.height), x, b.height - y); break; case EAST: cacheRect.setBounds(b.x, b.y, x, b.height); break; case SOUTH_EAST: cacheRect.setBounds(b.x, b.y, x, y); break; case SOUTH: cacheRect.setBounds(b.x, b.y, b.width, y); break; case SOUTH_WEST: cacheRect.setBounds(Math.min(b.x + x, b.x + b.width - min.width), b.y, b.width - x, y); break; case WEST: cacheRect.setBounds(Math.min(b.x + x, b.x + b.width - min.width), b.y, b.width - x, b.height); break; case NORTH_WEST: cacheRect.setBounds(Math.min(b.x + x, b.x + b.width - min.width), Math.min(b.y + y, b.y + b.height - min.height), b.width - x, b.height - y); break; } dm.resizeFrame(frame, cacheRect.x, cacheRect.y, Math.max(min.width, cacheRect.width), Math.max(min.height, cacheRect.height)); } else if (e.getSource() == titlePane) { Rectangle fBounds = frame.getBounds(); dm.dragFrame(frame, e.getX() - xOffset + b.x, e.getY() - yOffset + b.y); } }
|
public void mouseDragged(MouseEvent e) { // If the frame is maximized, there is nothing that // can be dragged around. if (frame.isMaximum()) return; DesktopManager dm = getDesktopManager(); Rectangle b = frame.getBounds(); Dimension min = frame.getMinimumSize(); if (min == null) min = new Dimension(0, 0); Insets insets = frame.getInsets(); int x = e.getX(); int y = e.getY(); if (e.getSource() == frame && frame.isResizable()) { switch (direction) { case NORTH: cacheRect.setBounds(b.x, Math.min(b.y + y, b.y + b.height - min.height), b.width, b.height - y); break; case NORTH_EAST: cacheRect.setBounds(b.x, Math.min(b.y + y, b.y + b.height - min.height), x, b.height - y); break; case EAST: cacheRect.setBounds(b.x, b.y, x, b.height); break; case SOUTH_EAST: cacheRect.setBounds(b.x, b.y, x, y); break; case SOUTH: cacheRect.setBounds(b.x, b.y, b.width, y); break; case SOUTH_WEST: cacheRect.setBounds(Math.min(b.x + x, b.x + b.width - min.width), b.y, b.width - x, y); break; case WEST: cacheRect.setBounds(Math.min(b.x + x, b.x + b.width - min.width), b.y, b.width - x, b.height); break; case NORTH_WEST: cacheRect.setBounds(Math.min(b.x + x, b.x + b.width - min.width), Math.min(b.y + y, b.y + b.height - min.height), b.width - x, b.height - y); break; } dm.resizeFrame(frame, cacheRect.x, cacheRect.y, Math.max(min.width, cacheRect.width), Math.max(min.height, cacheRect.height)); } else if (e.getSource() == titlePane) { Rectangle fBounds = frame.getBounds(); dm.dragFrame(frame, e.getX() - xOffset + b.x, e.getY() - yOffset + b.y); } }
| 12,989
|
public void mouseDragged(MouseEvent e) { // If the frame is maximized, there is nothing that // can be dragged around. if (frame.isMaximum()) return; DesktopManager dm = getDesktopManager(); Rectangle b = frame.getBounds(); Dimension min = frame.getMinimumSize(); if (min == null) min = new Dimension(0, 0); Insets insets = frame.getInsets(); int x = e.getX(); int y = e.getY(); if (e.getSource() == frame && frame.isResizable()) { switch (direction) { case NORTH: cacheRect.setBounds(b.x, Math.min(b.y + y, b.y + b.height - min.height), b.width, b.height - y); break; case NORTH_EAST: cacheRect.setBounds(b.x, Math.min(b.y + y, b.y + b.height - min.height), x, b.height - y); break; case EAST: cacheRect.setBounds(b.x, b.y, x, b.height); break; case SOUTH_EAST: cacheRect.setBounds(b.x, b.y, x, y); break; case SOUTH: cacheRect.setBounds(b.x, b.y, b.width, y); break; case SOUTH_WEST: cacheRect.setBounds(Math.min(b.x + x, b.x + b.width - min.width), b.y, b.width - x, y); break; case WEST: cacheRect.setBounds(Math.min(b.x + x, b.x + b.width - min.width), b.y, b.width - x, b.height); break; case NORTH_WEST: cacheRect.setBounds(Math.min(b.x + x, b.x + b.width - min.width), Math.min(b.y + y, b.y + b.height - min.height), b.width - x, b.height - y); break; } dm.resizeFrame(frame, cacheRect.x, cacheRect.y, Math.max(min.width, cacheRect.width), Math.max(min.height, cacheRect.height)); } else if (e.getSource() == titlePane) { Rectangle fBounds = frame.getBounds(); dm.dragFrame(frame, e.getX() - xOffset + b.x, e.getY() - yOffset + b.y); } }
|
public void mouseDragged(MouseEvent e) { // If the frame is maximized, there is nothing that // can be dragged around. if (frame.isMaximum()) return; DesktopManager dm = getDesktopManager(); Rectangle b = frame.getBounds(); Dimension min = frame.getMinimumSize(); if (min == null) min = new Dimension(0, 0); Insets insets = frame.getInsets(); int x = e.getX(); int y = e.getY(); if (e.getSource() == frame && frame.isResizable()) { switch (direction) { case NORTH: cacheRect.setBounds(b.x, Math.min(b.y + y, b.y + b.height - min.height), b.width, b.height - y); break; case NORTH_EAST: cacheRect.setBounds(b.x, Math.min(b.y + y, b.y + b.height - min.height), x, b.height - y); break; case EAST: cacheRect.setBounds(b.x, b.y, x, b.height); break; case SOUTH_EAST: cacheRect.setBounds(b.x, b.y, x, y); break; case SOUTH: cacheRect.setBounds(b.x, b.y, b.width, y); break; case SOUTH_WEST: cacheRect.setBounds(Math.min(b.x + x, b.x + b.width - min.width), b.y, b.width - x, y); break; case WEST: cacheRect.setBounds(Math.min(b.x + x, b.x + b.width - min.width), b.y, b.width - x, b.height); break; case NORTH_WEST: cacheRect.setBounds(Math.min(b.x + x, b.x + b.width - min.width), Math.min(b.y + y, b.y + b.height - min.height), b.width - x, b.height - y); break; } dm.resizeFrame(frame, cacheRect.x, cacheRect.y, Math.max(min.width, cacheRect.width), Math.max(min.height, cacheRect.height)); } else if (e.getSource() == titlePane) { Rectangle fBounds = frame.getBounds(); dm.dragFrame(frame, e.getX() - xOffset + b.x, e.getY() - yOffset + b.y); } }
| 12,990
|
public void mousePressed(MouseEvent e) { activateFrame(frame); DesktopManager dm = getDesktopManager(); int x = e.getX(); int y = e.getY(); Insets insets = frame.getInsets(); if (e.getSource() == frame && frame.isResizable()) { direction = sectionOfClick(x, y); dm.beginResizingFrame(frame, direction); } else if (e.getSource() == titlePane) { Rectangle tBounds = titlePane.getBounds(); xOffset = e.getX() - tBounds.x + insets.left; yOffset = e.getY() - tBounds.y + insets.top; dm.beginDraggingFrame(frame); } }
|
public void mousePressed(MouseEvent e) { activateFrame(frame); DesktopManager dm = getDesktopManager(); int x = e.getX(); int y = e.getY(); Insets insets = frame.getInsets(); if (e.getSource() == frame && frame.isResizable()) { direction = sectionOfClick(x, y); dm.beginResizingFrame(frame, direction); } else if (e.getSource() == titlePane) { Rectangle tBounds = titlePane.getBounds(); xOffset = e.getX() - tBounds.x + insets.left; yOffset = e.getY() - tBounds.y + insets.top; dm.beginDraggingFrame(frame); } }
| 12,991
|
public void mousePressed(MouseEvent e) { activateFrame(frame); DesktopManager dm = getDesktopManager(); int x = e.getX(); int y = e.getY(); Insets insets = frame.getInsets(); if (e.getSource() == frame && frame.isResizable()) { direction = sectionOfClick(x, y); dm.beginResizingFrame(frame, direction); } else if (e.getSource() == titlePane) { Rectangle tBounds = titlePane.getBounds(); xOffset = e.getX() - tBounds.x + insets.left; yOffset = e.getY() - tBounds.y + insets.top; dm.beginDraggingFrame(frame); } }
|
public void mousePressed(MouseEvent e) { activateFrame(frame); DesktopManager dm = getDesktopManager(); int x = e.getX(); int y = e.getY(); Insets insets = frame.getInsets(); if (e.getSource() == frame && frame.isResizable()) { direction = sectionOfClick(x, y); dm.beginResizingFrame(frame, direction); } else if (e.getSource() == titlePane) { Rectangle tBounds = titlePane.getBounds(); xOffset = e.getX() - tBounds.x + insets.left; yOffset = e.getY() - tBounds.y + insets.top; dm.beginDraggingFrame(frame); } }
| 12,992
|
public void mousePressed(MouseEvent e) { activateFrame(frame); DesktopManager dm = getDesktopManager(); int x = e.getX(); int y = e.getY(); Insets insets = frame.getInsets(); if (e.getSource() == frame && frame.isResizable()) { direction = sectionOfClick(x, y); dm.beginResizingFrame(frame, direction); } else if (e.getSource() == titlePane) { Rectangle tBounds = titlePane.getBounds(); xOffset = e.getX() - tBounds.x + insets.left; yOffset = e.getY() - tBounds.y + insets.top; dm.beginDraggingFrame(frame); } }
|
public void mousePressed(MouseEvent e) { activateFrame(frame); DesktopManager dm = getDesktopManager(); int x = e.getX(); int y = e.getY(); Insets insets = frame.getInsets(); if (e.getSource() == frame && frame.isResizable()) { direction = sectionOfClick(x, y); dm.beginResizingFrame(frame, direction); } else if (e.getSource() == titlePane) { Rectangle tBounds = titlePane.getBounds(); xOffset = e.getX() - tBounds.x + insets.left; yOffset = e.getY() - tBounds.y + insets.top; dm.beginDraggingFrame(frame); } }
| 12,993
|
public void mousePressed(MouseEvent e) { activateFrame(frame); DesktopManager dm = getDesktopManager(); int x = e.getX(); int y = e.getY(); Insets insets = frame.getInsets(); if (e.getSource() == frame && frame.isResizable()) { direction = sectionOfClick(x, y); dm.beginResizingFrame(frame, direction); } else if (e.getSource() == titlePane) { Rectangle tBounds = titlePane.getBounds(); xOffset = e.getX() - tBounds.x + insets.left; yOffset = e.getY() - tBounds.y + insets.top; dm.beginDraggingFrame(frame); } }
|
public void mousePressed(MouseEvent e) { activateFrame(frame); DesktopManager dm = getDesktopManager(); int x = e.getX(); int y = e.getY(); Insets insets = frame.getInsets(); if (e.getSource() == frame && frame.isResizable()) { direction = sectionOfClick(x, y); dm.beginResizingFrame(frame, direction); } else if (e.getSource() == titlePane) { Rectangle tBounds = titlePane.getBounds(); xOffset = e.getX() - tBounds.x + insets.left; yOffset = e.getY() - tBounds.y + insets.top; dm.beginDraggingFrame(frame); } }
| 12,994
|
public void mouseReleased(MouseEvent e) { DesktopManager dm = getDesktopManager(); xOffset = 0; yOffset = 0; if (e.getSource() == frame && frame.isResizable()) dm.endResizingFrame(frame); else if (e.getSource() == titlePane) dm.endDraggingFrame(frame); }
|
public void mouseReleased(MouseEvent e) { DesktopManager dm = getDesktopManager(); xOffset = 0; yOffset = 0; if (e.getSource() == frame && frame.isResizable()) dm.endResizingFrame(frame); else if (e.getSource() == titlePane) dm.endDraggingFrame(frame); }
| 12,995
|
public void mouseReleased(MouseEvent e) { DesktopManager dm = getDesktopManager(); xOffset = 0; yOffset = 0; if (e.getSource() == frame && frame.isResizable()) dm.endResizingFrame(frame); else if (e.getSource() == titlePane) dm.endDraggingFrame(frame); }
|
public void mouseReleased(MouseEvent e) { DesktopManager dm = getDesktopManager(); xOffset = 0; yOffset = 0; if (e.getSource() == frame && frame.isResizable()) dm.endResizingFrame(frame); else if (e.getSource() == titlePane) dm.endDraggingFrame(frame); }
| 12,996
|
private int sectionOfClick(int x, int y) { Insets insets = frame.getInsets(); Rectangle b = frame.getBounds(); if (x < insets.left && y < insets.top) return NORTH_WEST; else if (x > b.width - insets.right && y < insets.top) return NORTH_EAST; else if (x > b.width - insets.right && y > b.height - insets.bottom) return SOUTH_EAST; else if (x < insets.left && y > b.height - insets.bottom) return SOUTH_WEST; else if (y < insets.top) return NORTH; else if (x < insets.left) return WEST; else if (y > b.height - insets.bottom) return SOUTH; else if (x > b.width - insets.right) return EAST; return -1; }
|
private int sectionOfClick(int x, int y) { Insets insets = frame.getInsets(); Rectangle b = frame.getBounds(); if (x < insets.left && y < insets.top) return NORTH_WEST; else if (x > b.width - insets.right && y < insets.top) return NORTH_EAST; else if (x > b.width - insets.right && y > b.height - insets.bottom) return SOUTH_EAST; else if (x < insets.left && y > b.height - insets.bottom) return SOUTH_WEST; else if (y < insets.top) return NORTH; else if (x < insets.left) return WEST; else if (y > b.height - insets.bottom) return SOUTH; else if (x > b.width - insets.right) return EAST; return -1; }
| 12,997
|
private int sectionOfClick(int x, int y) { Insets insets = frame.getInsets(); Rectangle b = frame.getBounds(); if (x < insets.left && y < insets.top) return NORTH_WEST; else if (x > b.width - insets.right && y < insets.top) return NORTH_EAST; else if (x > b.width - insets.right && y > b.height - insets.bottom) return SOUTH_EAST; else if (x < insets.left && y > b.height - insets.bottom) return SOUTH_WEST; else if (y < insets.top) return NORTH; else if (x < insets.left) return WEST; else if (y > b.height - insets.bottom) return SOUTH; else if (x > b.width - insets.right) return EAST; return -1; }
|
private int sectionOfClick(int x, int y) { Insets insets = frame.getInsets(); Rectangle b = frame.getBounds(); if (x < insets.left && y < insets.top) return NORTH_WEST; else if (x > b.width - insets.right && y < insets.top) return NORTH_EAST; else if (x > b.width - insets.right && y > b.height - insets.bottom) return SOUTH_EAST; else if (x < insets.left && y > b.height - insets.bottom) return SOUTH_WEST; else if (y < insets.top) return NORTH; else if (x < insets.left) return WEST; else if (y > b.height - insets.bottom) return SOUTH; else if (x > b.width - insets.right) return EAST; return -1; }
| 12,998
|
private int sectionOfClick(int x, int y) { Insets insets = frame.getInsets(); Rectangle b = frame.getBounds(); if (x < insets.left && y < insets.top) return NORTH_WEST; else if (x > b.width - insets.right && y < insets.top) return NORTH_EAST; else if (x > b.width - insets.right && y > b.height - insets.bottom) return SOUTH_EAST; else if (x < insets.left && y > b.height - insets.bottom) return SOUTH_WEST; else if (y < insets.top) return NORTH; else if (x < insets.left) return WEST; else if (y > b.height - insets.bottom) return SOUTH; else if (x > b.width - insets.right) return EAST; return -1; }
|
private int sectionOfClick(int x, int y) { Insets insets = frame.getInsets(); Rectangle b = frame.getBounds(); if (x < insets.left && y < insets.top) return NORTH_WEST; else if (x > b.width - insets.right && y < insets.top) return NORTH_EAST; else if (x > b.width - insets.right && y > b.height - insets.bottom) return SOUTH_EAST; else if (x < insets.left && y > b.height - insets.bottom) return SOUTH_WEST; else if (y < insets.top) return NORTH; else if (x < insets.left) return WEST; else if (y > b.height - insets.bottom) return SOUTH; else if (x > b.width - insets.right) return EAST; return -1; }
| 12,999
|
private int sectionOfClick(int x, int y) { Insets insets = frame.getInsets(); Rectangle b = frame.getBounds(); if (x < insets.left && y < insets.top) return NORTH_WEST; else if (x > b.width - insets.right && y < insets.top) return NORTH_EAST; else if (x > b.width - insets.right && y > b.height - insets.bottom) return SOUTH_EAST; else if (x < insets.left && y > b.height - insets.bottom) return SOUTH_WEST; else if (y < insets.top) return NORTH; else if (x < insets.left) return WEST; else if (y > b.height - insets.bottom) return SOUTH; else if (x > b.width - insets.right) return EAST; return -1; }
|
private int sectionOfClick(int x, int y) { Insets insets = frame.getInsets(); Rectangle b = frame.getBounds(); if (x < insets.left && y < insets.top) return NORTH_WEST; else if (x > b.width - insets.right && y < insets.top) return NORTH_EAST; else if (x > b.width - insets.right && y > b.height - insets.bottom) return SOUTH_EAST; else if (x < insets.left && y > b.height - insets.bottom) return SOUTH_WEST; else if (y < insets.top) return NORTH; else if (x < insets.left) return WEST; else if (y > b.height - insets.bottom) return SOUTH; else if (x > b.width - insets.right) return EAST; return -1; }
| 13,000
|
private int sectionOfClick(int x, int y) { Insets insets = frame.getInsets(); Rectangle b = frame.getBounds(); if (x < insets.left && y < insets.top) return NORTH_WEST; else if (x > b.width - insets.right && y < insets.top) return NORTH_EAST; else if (x > b.width - insets.right && y > b.height - insets.bottom) return SOUTH_EAST; else if (x < insets.left && y > b.height - insets.bottom) return SOUTH_WEST; else if (y < insets.top) return NORTH; else if (x < insets.left) return WEST; else if (y > b.height - insets.bottom) return SOUTH; else if (x > b.width - insets.right) return EAST; return -1; }
|
private int sectionOfClick(int x, int y) { Insets insets = frame.getInsets(); Rectangle b = frame.getBounds(); if (x < insets.left && y < insets.top) return NORTH_WEST; else if (x > b.width - insets.right && y < insets.top) return NORTH_EAST; else if (x > b.width - insets.right && y > b.height - insets.bottom) return SOUTH_EAST; else if (x < insets.left && y > b.height - insets.bottom) return SOUTH_WEST; else if (y < insets.top) return NORTH; else if (x < insets.left) return WEST; else if (y > b.height - insets.bottom) return SOUTH; else if (x > b.width - insets.right) return EAST; return -1; }
| 13,001
|
private int sectionOfClick(int x, int y) { Insets insets = frame.getInsets(); Rectangle b = frame.getBounds(); if (x < insets.left && y < insets.top) return NORTH_WEST; else if (x > b.width - insets.right && y < insets.top) return NORTH_EAST; else if (x > b.width - insets.right && y > b.height - insets.bottom) return SOUTH_EAST; else if (x < insets.left && y > b.height - insets.bottom) return SOUTH_WEST; else if (y < insets.top) return NORTH; else if (x < insets.left) return WEST; else if (y > b.height - insets.bottom) return SOUTH; else if (x > b.width - insets.right) return EAST; return -1; }
|
private int sectionOfClick(int x, int y) { Insets insets = frame.getInsets(); Rectangle b = frame.getBounds(); if (x < insets.left && y < insets.top) return NORTH_WEST; else if (x > b.width - insets.right && y < insets.top) return NORTH_EAST; else if (x > b.width - insets.right && y > b.height - insets.bottom) return SOUTH_EAST; else if (x < insets.left && y > b.height - insets.bottom) return SOUTH_WEST; else if (y < insets.top) return NORTH; else if (x < insets.left) return WEST; else if (y > b.height - insets.bottom) return SOUTH; else if (x > b.width - insets.right) return EAST; return -1; }
| 13,002
|
private int sectionOfClick(int x, int y) { Insets insets = frame.getInsets(); Rectangle b = frame.getBounds(); if (x < insets.left && y < insets.top) return NORTH_WEST; else if (x > b.width - insets.right && y < insets.top) return NORTH_EAST; else if (x > b.width - insets.right && y > b.height - insets.bottom) return SOUTH_EAST; else if (x < insets.left && y > b.height - insets.bottom) return SOUTH_WEST; else if (y < insets.top) return NORTH; else if (x < insets.left) return WEST; else if (y > b.height - insets.bottom) return SOUTH; else if (x > b.width - insets.right) return EAST; return -1; }
|
private int sectionOfClick(int x, int y) { Insets insets = frame.getInsets(); Rectangle b = frame.getBounds(); if (x < insets.left && y < insets.top) return NORTH_WEST; else if (x > b.width - insets.right && y < insets.top) return NORTH_EAST; else if (x > b.width - insets.right && y > b.height - insets.bottom) return SOUTH_EAST; else if (x < insets.left && y > b.height - insets.bottom) return SOUTH_WEST; else if (y < insets.top) return NORTH; else if (x < insets.left) return WEST; else if (y > b.height - insets.bottom) return SOUTH; else if (x > b.width - insets.right) return EAST; return -1; }
| 13,003
|
private int sectionOfClick(int x, int y) { Insets insets = frame.getInsets(); Rectangle b = frame.getBounds(); if (x < insets.left && y < insets.top) return NORTH_WEST; else if (x > b.width - insets.right && y < insets.top) return NORTH_EAST; else if (x > b.width - insets.right && y > b.height - insets.bottom) return SOUTH_EAST; else if (x < insets.left && y > b.height - insets.bottom) return SOUTH_WEST; else if (y < insets.top) return NORTH; else if (x < insets.left) return WEST; else if (y > b.height - insets.bottom) return SOUTH; else if (x > b.width - insets.right) return EAST; return -1; }
|
private int sectionOfClick(int x, int y) { Insets insets = frame.getInsets(); Rectangle b = frame.getBounds(); if (x < insets.left && y < insets.top) return NORTH_WEST; else if (x > b.width - insets.right && y < insets.top) return NORTH_EAST; else if (x > b.width - insets.right && y > b.height - insets.bottom) return SOUTH_EAST; else if (x < insets.left && y > b.height - insets.bottom) return SOUTH_WEST; else if (y < insets.top) return NORTH; else if (x < insets.left) return WEST; else if (y > b.height - insets.bottom) return SOUTH; else if (x > b.width - insets.right) return EAST; return -1; }
| 13,004
|
public void componentResized(ComponentEvent e) { if (frame.isMaximum()) { JDesktopPane pane = (JDesktopPane) e.getSource(); Insets insets = pane.getInsets(); Rectangle bounds = pane.getBounds(); frame.setBounds(bounds.x + insets.left, bounds.y + insets.top, bounds.width - insets.left - insets.right, bounds.height - insets.top - insets.bottom); frame.revalidate(); frame.repaint(); } // Sun also resizes the icons. but it doesn't seem to do anything. }
|
public void componentResized(ComponentEvent e) { if (frame.isMaximum()) { JDesktopPane pane = (JDesktopPane) e.getSource(); Insets insets = pane.getInsets(); Rectangle bounds = pane.getBounds(); frame.setBounds(bounds.x + insets.left, bounds.y + insets.top, bounds.width - insets.left - insets.right, bounds.height - insets.top - insets.bottom); frame.revalidate(); frame.repaint(); } // Sun also resizes the icons. but it doesn't seem to do anything. }
| 13,005
|
public void componentResized(ComponentEvent e) { if (frame.isMaximum()) { JDesktopPane pane = (JDesktopPane) e.getSource(); Insets insets = pane.getInsets(); Rectangle bounds = pane.getBounds(); frame.setBounds(bounds.x + insets.left, bounds.y + insets.top, bounds.width - insets.left - insets.right, bounds.height - insets.top - insets.bottom); frame.revalidate(); frame.repaint(); } // Sun also resizes the icons. but it doesn't seem to do anything. }
|
public void componentResized(ComponentEvent e) { if (frame.isMaximum()) { JDesktopPane pane = (JDesktopPane) e.getSource(); Insets insets = pane.getInsets(); Rectangle bounds = pane.getBounds(); frame.setBounds(bounds.x + insets.left, bounds.y + insets.top, bounds.width - insets.left - insets.right, bounds.height - insets.top - insets.bottom); frame.revalidate(); frame.repaint(); } // Sun also resizes the icons. but it doesn't seem to do anything. }
| 13,006
|
private void acquireComponentForMouseEvent(MouseEvent me) { int x = me.getX(); int y = me.getY(); // Find the candidate which should receive this event. Component parent = frame.getContentPane(); if (parent == null) return; Component candidate = null; Point p = me.getPoint(); while (candidate == null && parent != null) { candidate = SwingUtilities.getDeepestComponentAt(parent, p.x, p.y); if (candidate == null) { p = SwingUtilities.convertPoint(parent, p.x, p.y, parent.getParent()); parent = parent.getParent(); } } // If the only candidate we found was the native container itself, // don't dispatch any event at all. We only care about the lightweight // children here. if (candidate == frame.getContentPane()) candidate = null; // If our candidate is new, inform the old target we're leaving. if (lastComponentEntered != null && lastComponentEntered.isShowing() && lastComponentEntered != candidate) { Point tp = SwingUtilities.convertPoint(frame.getContentPane(), x, y, lastComponentEntered); MouseEvent exited = new MouseEvent(lastComponentEntered, MouseEvent.MOUSE_EXITED, me.getWhen(), me.getModifiersEx(), tp.x, tp.y, me.getClickCount(), me.isPopupTrigger(), me.getButton()); tempComponent = lastComponentEntered; lastComponentEntered = null; tempComponent.dispatchEvent(exited); } // If we have a candidate, maybe enter it. if (candidate != null) { mouseEventTarget = candidate; if (candidate.isLightweight() && candidate.isShowing() && candidate != frame.getContentPane() && candidate != lastComponentEntered) { lastComponentEntered = mouseEventTarget; Point cp = SwingUtilities.convertPoint(frame.getContentPane(), x, y, lastComponentEntered); MouseEvent entered = new MouseEvent(lastComponentEntered, MouseEvent.MOUSE_ENTERED, me.getWhen(), me.getModifiersEx(), cp.x, cp.y, me.getClickCount(), me.isPopupTrigger(), me.getButton()); lastComponentEntered.dispatchEvent(entered); } } if (me.getID() == MouseEvent.MOUSE_RELEASED || me.getID() == MouseEvent.MOUSE_PRESSED && pressCount > 0 || me.getID() == MouseEvent.MOUSE_DRAGGED) // If any of the following events occur while a button is held down, // they should be dispatched to the same component to which the // original MOUSE_PRESSED event was dispatched: // - MOUSE_RELEASED // - MOUSE_PRESSED: another button pressed while the first is held down // - MOUSE_DRAGGED mouseEventTarget = pressedComponent; else if (me.getID() == MouseEvent.MOUSE_CLICKED) { // Don't dispatch CLICKED events whose target is not the same as the // target for the original PRESSED event. if (candidate != pressedComponent) mouseEventTarget = null; else if (pressCount == 0) pressedComponent = null; } }
|
private void acquireComponentForMouseEvent(MouseEvent me) { int x = me.getX(); int y = me.getY(); // Find the candidate which should receive this event. Component parent = frame.getContentPane(); if (parent == null) return; Component candidate = null; Point p = me.getPoint(); while (candidate == null && parent != null) { candidate = SwingUtilities.getDeepestComponentAt(parent, p.x, p.y); if (candidate == null) { p = SwingUtilities.convertPoint(parent, p.x, p.y, parent.getParent()); parent = parent.getParent(); } } // If the only candidate we found was the native container itself, // don't dispatch any event at all. We only care about the lightweight // children here. if (candidate == frame.getContentPane()) candidate = null; // If our candidate is new, inform the old target we're leaving. if (lastComponentEntered != null && lastComponentEntered.isShowing() && lastComponentEntered != candidate) { Point tp = SwingUtilities.convertPoint(frame.getContentPane(), x, y, lastComponentEntered); MouseEvent exited = new MouseEvent(lastComponentEntered, MouseEvent.MOUSE_EXITED, me.getWhen(), me.getModifiersEx(), tp.x, tp.y, me.getClickCount(), me.isPopupTrigger(), me.getButton()); tempComponent = lastComponentEntered; lastComponentEntered = null; tempComponent.dispatchEvent(exited); } // If we have a candidate, maybe enter it. if (candidate != null) { mouseEventTarget = candidate; if (candidate.isLightweight() && candidate.isShowing() && candidate != frame.getContentPane() && candidate != lastComponentEntered) { lastComponentEntered = mouseEventTarget; Point cp = SwingUtilities.convertPoint(frame.getContentPane(), x, y, lastComponentEntered); MouseEvent entered = new MouseEvent(lastComponentEntered, MouseEvent.MOUSE_ENTERED, me.getWhen(), me.getModifiersEx(), cp.x, cp.y, me.getClickCount(), me.isPopupTrigger(), me.getButton()); lastComponentEntered.dispatchEvent(entered); } } if (me.getID() == MouseEvent.MOUSE_RELEASED || me.getID() == MouseEvent.MOUSE_PRESSED && pressCount > 0 || me.getID() == MouseEvent.MOUSE_DRAGGED) // If any of the following events occur while a button is held down, // they should be dispatched to the same component to which the // original MOUSE_PRESSED event was dispatched: // - MOUSE_RELEASED // - MOUSE_PRESSED: another button pressed while the first is held down // - MOUSE_DRAGGED mouseEventTarget = pressedComponent; else if (me.getID() == MouseEvent.MOUSE_CLICKED) { // Don't dispatch CLICKED events whose target is not the same as the // target for the original PRESSED event. if (candidate != pressedComponent) mouseEventTarget = null; else if (pressCount == 0) pressedComponent = null; } }
| 13,007
|
private void acquireComponentForMouseEvent(MouseEvent me) { int x = me.getX(); int y = me.getY(); // Find the candidate which should receive this event. Component parent = frame.getContentPane(); if (parent == null) return; Component candidate = null; Point p = me.getPoint(); while (candidate == null && parent != null) { candidate = SwingUtilities.getDeepestComponentAt(parent, p.x, p.y); if (candidate == null) { p = SwingUtilities.convertPoint(parent, p.x, p.y, parent.getParent()); parent = parent.getParent(); } } // If the only candidate we found was the native container itself, // don't dispatch any event at all. We only care about the lightweight // children here. if (candidate == frame.getContentPane()) candidate = null; // If our candidate is new, inform the old target we're leaving. if (lastComponentEntered != null && lastComponentEntered.isShowing() && lastComponentEntered != candidate) { Point tp = SwingUtilities.convertPoint(frame.getContentPane(), x, y, lastComponentEntered); MouseEvent exited = new MouseEvent(lastComponentEntered, MouseEvent.MOUSE_EXITED, me.getWhen(), me.getModifiersEx(), tp.x, tp.y, me.getClickCount(), me.isPopupTrigger(), me.getButton()); tempComponent = lastComponentEntered; lastComponentEntered = null; tempComponent.dispatchEvent(exited); } // If we have a candidate, maybe enter it. if (candidate != null) { mouseEventTarget = candidate; if (candidate.isLightweight() && candidate.isShowing() && candidate != frame.getContentPane() && candidate != lastComponentEntered) { lastComponentEntered = mouseEventTarget; Point cp = SwingUtilities.convertPoint(frame.getContentPane(), x, y, lastComponentEntered); MouseEvent entered = new MouseEvent(lastComponentEntered, MouseEvent.MOUSE_ENTERED, me.getWhen(), me.getModifiersEx(), cp.x, cp.y, me.getClickCount(), me.isPopupTrigger(), me.getButton()); lastComponentEntered.dispatchEvent(entered); } } if (me.getID() == MouseEvent.MOUSE_RELEASED || me.getID() == MouseEvent.MOUSE_PRESSED && pressCount > 0 || me.getID() == MouseEvent.MOUSE_DRAGGED) // If any of the following events occur while a button is held down, // they should be dispatched to the same component to which the // original MOUSE_PRESSED event was dispatched: // - MOUSE_RELEASED // - MOUSE_PRESSED: another button pressed while the first is held down // - MOUSE_DRAGGED mouseEventTarget = pressedComponent; else if (me.getID() == MouseEvent.MOUSE_CLICKED) { // Don't dispatch CLICKED events whose target is not the same as the // target for the original PRESSED event. if (candidate != pressedComponent) mouseEventTarget = null; else if (pressCount == 0) pressedComponent = null; } }
|
private void acquireComponentForMouseEvent(MouseEvent me) { int x = me.getX(); int y = me.getY(); // Find the candidate which should receive this event. Component parent = frame.getContentPane(); if (parent == null) return; Component candidate = null; Point p = me.getPoint(); while (candidate == null && parent != null) { candidate = SwingUtilities.getDeepestComponentAt(parent, p.x, p.y); if (candidate == null) { p = SwingUtilities.convertPoint(parent, p.x, p.y, parent.getParent()); parent = parent.getParent(); } } // If the only candidate we found was the native container itself, // don't dispatch any event at all. We only care about the lightweight // children here. if (candidate == frame.getContentPane()) candidate = null; // If our candidate is new, inform the old target we're leaving. if (lastComponentEntered != null && lastComponentEntered.isShowing() && lastComponentEntered != candidate) { Point tp = SwingUtilities.convertPoint(frame.getContentPane(), x, y, lastComponentEntered); MouseEvent exited = new MouseEvent(lastComponentEntered, MouseEvent.MOUSE_EXITED, me.getWhen(), me.getModifiersEx(), tp.x, tp.y, me.getClickCount(), me.isPopupTrigger(), me.getButton()); tempComponent = lastComponentEntered; lastComponentEntered = null; tempComponent.dispatchEvent(exited); } // If we have a candidate, maybe enter it. if (candidate != null) { mouseEventTarget = candidate; if (candidate.isLightweight() && candidate.isShowing() && candidate != frame.getContentPane() && candidate != lastComponentEntered) { lastComponentEntered = mouseEventTarget; Point cp = SwingUtilities.convertPoint(frame.getContentPane(), x, y, lastComponentEntered); MouseEvent entered = new MouseEvent(lastComponentEntered, MouseEvent.MOUSE_ENTERED, me.getWhen(), me.getModifiersEx(), cp.x, cp.y, me.getClickCount(), me.isPopupTrigger(), me.getButton()); lastComponentEntered.dispatchEvent(entered); } } if (me.getID() == MouseEvent.MOUSE_RELEASED || me.getID() == MouseEvent.MOUSE_PRESSED && pressCount > 0 || me.getID() == MouseEvent.MOUSE_DRAGGED) // If any of the following events occur while a button is held down, // they should be dispatched to the same component to which the // original MOUSE_PRESSED event was dispatched: // - MOUSE_RELEASED // - MOUSE_PRESSED: another button pressed while the first is held down // - MOUSE_DRAGGED mouseEventTarget = pressedComponent; else if (me.getID() == MouseEvent.MOUSE_CLICKED) { // Don't dispatch CLICKED events whose target is not the same as the // target for the original PRESSED event. if (candidate != pressedComponent) mouseEventTarget = null; else if (pressCount == 0) pressedComponent = null; } }
| 13,008
|
private void acquireComponentForMouseEvent(MouseEvent me) { int x = me.getX(); int y = me.getY(); // Find the candidate which should receive this event. Component parent = frame.getContentPane(); if (parent == null) return; Component candidate = null; Point p = me.getPoint(); while (candidate == null && parent != null) { candidate = SwingUtilities.getDeepestComponentAt(parent, p.x, p.y); if (candidate == null) { p = SwingUtilities.convertPoint(parent, p.x, p.y, parent.getParent()); parent = parent.getParent(); } } // If the only candidate we found was the native container itself, // don't dispatch any event at all. We only care about the lightweight // children here. if (candidate == frame.getContentPane()) candidate = null; // If our candidate is new, inform the old target we're leaving. if (lastComponentEntered != null && lastComponentEntered.isShowing() && lastComponentEntered != candidate) { Point tp = SwingUtilities.convertPoint(frame.getContentPane(), x, y, lastComponentEntered); MouseEvent exited = new MouseEvent(lastComponentEntered, MouseEvent.MOUSE_EXITED, me.getWhen(), me.getModifiersEx(), tp.x, tp.y, me.getClickCount(), me.isPopupTrigger(), me.getButton()); tempComponent = lastComponentEntered; lastComponentEntered = null; tempComponent.dispatchEvent(exited); } // If we have a candidate, maybe enter it. if (candidate != null) { mouseEventTarget = candidate; if (candidate.isLightweight() && candidate.isShowing() && candidate != frame.getContentPane() && candidate != lastComponentEntered) { lastComponentEntered = mouseEventTarget; Point cp = SwingUtilities.convertPoint(frame.getContentPane(), x, y, lastComponentEntered); MouseEvent entered = new MouseEvent(lastComponentEntered, MouseEvent.MOUSE_ENTERED, me.getWhen(), me.getModifiersEx(), cp.x, cp.y, me.getClickCount(), me.isPopupTrigger(), me.getButton()); lastComponentEntered.dispatchEvent(entered); } } if (me.getID() == MouseEvent.MOUSE_RELEASED || me.getID() == MouseEvent.MOUSE_PRESSED && pressCount > 0 || me.getID() == MouseEvent.MOUSE_DRAGGED) // If any of the following events occur while a button is held down, // they should be dispatched to the same component to which the // original MOUSE_PRESSED event was dispatched: // - MOUSE_RELEASED // - MOUSE_PRESSED: another button pressed while the first is held down // - MOUSE_DRAGGED mouseEventTarget = pressedComponent; else if (me.getID() == MouseEvent.MOUSE_CLICKED) { // Don't dispatch CLICKED events whose target is not the same as the // target for the original PRESSED event. if (candidate != pressedComponent) mouseEventTarget = null; else if (pressCount == 0) pressedComponent = null; } }
|
private void acquireComponentForMouseEvent(MouseEvent me) { int x = me.getX(); int y = me.getY(); // Find the candidate which should receive this event. Component parent = frame.getContentPane(); if (parent == null) return; Component candidate = null; Point p = me.getPoint(); while (candidate == null && parent != null) { candidate = SwingUtilities.getDeepestComponentAt(parent, p.x, p.y); if (candidate == null) { p = SwingUtilities.convertPoint(parent, p.x, p.y, parent.getParent()); parent = parent.getParent(); } } // If the only candidate we found was the native container itself, // don't dispatch any event at all. We only care about the lightweight // children here. if (candidate == frame.getContentPane()) candidate = null; // If our candidate is new, inform the old target we're leaving. if (lastComponentEntered != null && lastComponentEntered.isShowing() && lastComponentEntered != candidate) { Point tp = SwingUtilities.convertPoint(frame.getContentPane(), x, y, lastComponentEntered); MouseEvent exited = new MouseEvent(lastComponentEntered, MouseEvent.MOUSE_EXITED, me.getWhen(), me.getModifiersEx(), tp.x, tp.y, me.getClickCount(), me.isPopupTrigger(), me.getButton()); tempComponent = lastComponentEntered; lastComponentEntered = null; tempComponent.dispatchEvent(exited); } // If we have a candidate, maybe enter it. if (candidate != null) { mouseEventTarget = candidate; if (candidate.isLightweight() && candidate.isShowing() && candidate != frame.getContentPane() && candidate != lastComponentEntered) { lastComponentEntered = mouseEventTarget; Point cp = SwingUtilities.convertPoint(frame.getContentPane(), x, y, lastComponentEntered); MouseEvent entered = new MouseEvent(lastComponentEntered, MouseEvent.MOUSE_ENTERED, me.getWhen(), me.getModifiersEx(), cp.x, cp.y, me.getClickCount(), me.isPopupTrigger(), me.getButton()); lastComponentEntered.dispatchEvent(entered); } } if (me.getID() == MouseEvent.MOUSE_RELEASED || me.getID() == MouseEvent.MOUSE_PRESSED && pressCount > 0 || me.getID() == MouseEvent.MOUSE_DRAGGED) // If any of the following events occur while a button is held down, // they should be dispatched to the same component to which the // original MOUSE_PRESSED event was dispatched: // - MOUSE_RELEASED // - MOUSE_PRESSED: another button pressed while the first is held down // - MOUSE_DRAGGED mouseEventTarget = pressedComponent; else if (me.getID() == MouseEvent.MOUSE_CLICKED) { // Don't dispatch CLICKED events whose target is not the same as the // target for the original PRESSED event. if (candidate != pressedComponent) mouseEventTarget = null; else if (pressCount == 0) pressedComponent = null; } }
| 13,009
|
private void acquireComponentForMouseEvent(MouseEvent me) { int x = me.getX(); int y = me.getY(); // Find the candidate which should receive this event. Component parent = frame.getContentPane(); if (parent == null) return; Component candidate = null; Point p = me.getPoint(); while (candidate == null && parent != null) { candidate = SwingUtilities.getDeepestComponentAt(parent, p.x, p.y); if (candidate == null) { p = SwingUtilities.convertPoint(parent, p.x, p.y, parent.getParent()); parent = parent.getParent(); } } // If the only candidate we found was the native container itself, // don't dispatch any event at all. We only care about the lightweight // children here. if (candidate == frame.getContentPane()) candidate = null; // If our candidate is new, inform the old target we're leaving. if (lastComponentEntered != null && lastComponentEntered.isShowing() && lastComponentEntered != candidate) { Point tp = SwingUtilities.convertPoint(frame.getContentPane(), x, y, lastComponentEntered); MouseEvent exited = new MouseEvent(lastComponentEntered, MouseEvent.MOUSE_EXITED, me.getWhen(), me.getModifiersEx(), tp.x, tp.y, me.getClickCount(), me.isPopupTrigger(), me.getButton()); tempComponent = lastComponentEntered; lastComponentEntered = null; tempComponent.dispatchEvent(exited); } // If we have a candidate, maybe enter it. if (candidate != null) { mouseEventTarget = candidate; if (candidate.isLightweight() && candidate.isShowing() && candidate != frame.getContentPane() && candidate != lastComponentEntered) { lastComponentEntered = mouseEventTarget; Point cp = SwingUtilities.convertPoint(frame.getContentPane(), x, y, lastComponentEntered); MouseEvent entered = new MouseEvent(lastComponentEntered, MouseEvent.MOUSE_ENTERED, me.getWhen(), me.getModifiersEx(), cp.x, cp.y, me.getClickCount(), me.isPopupTrigger(), me.getButton()); lastComponentEntered.dispatchEvent(entered); } } if (me.getID() == MouseEvent.MOUSE_RELEASED || me.getID() == MouseEvent.MOUSE_PRESSED && pressCount > 0 || me.getID() == MouseEvent.MOUSE_DRAGGED) // If any of the following events occur while a button is held down, // they should be dispatched to the same component to which the // original MOUSE_PRESSED event was dispatched: // - MOUSE_RELEASED // - MOUSE_PRESSED: another button pressed while the first is held down // - MOUSE_DRAGGED mouseEventTarget = pressedComponent; else if (me.getID() == MouseEvent.MOUSE_CLICKED) { // Don't dispatch CLICKED events whose target is not the same as the // target for the original PRESSED event. if (candidate != pressedComponent) mouseEventTarget = null; else if (pressCount == 0) pressedComponent = null; } }
|
private void acquireComponentForMouseEvent(MouseEvent me) { int x = me.getX(); int y = me.getY(); // Find the candidate which should receive this event. Component parent = frame.getContentPane(); if (parent == null) return; Component candidate = null; Point p = me.getPoint(); while (candidate == null && parent != null) { candidate = SwingUtilities.getDeepestComponentAt(parent, p.x, p.y); if (candidate == null) { p = SwingUtilities.convertPoint(parent, p.x, p.y, parent.getParent()); parent = parent.getParent(); } } // If the only candidate we found was the native container itself, // don't dispatch any event at all. We only care about the lightweight // children here. if (candidate == frame.getContentPane()) candidate = null; // If our candidate is new, inform the old target we're leaving. if (lastComponentEntered != null && lastComponentEntered.isShowing() && lastComponentEntered != candidate) { Point tp = SwingUtilities.convertPoint(frame.getContentPane(), x, y, lastComponentEntered); MouseEvent exited = new MouseEvent(lastComponentEntered, MouseEvent.MOUSE_EXITED, me.getWhen(), me.getModifiersEx(), tp.x, tp.y, me.getClickCount(), me.isPopupTrigger(), me.getButton()); tempComponent = lastComponentEntered; lastComponentEntered = null; tempComponent.dispatchEvent(exited); } // If we have a candidate, maybe enter it. if (candidate != null) { mouseEventTarget = candidate; if (candidate.isLightweight() && candidate.isShowing() && candidate != frame.getContentPane() && candidate != lastComponentEntered) { lastComponentEntered = mouseEventTarget; Point cp = SwingUtilities.convertPoint(frame.getContentPane(), x, y, lastComponentEntered); MouseEvent entered = new MouseEvent(lastComponentEntered, MouseEvent.MOUSE_ENTERED, me.getWhen(), me.getModifiersEx(), cp.x, cp.y, me.getClickCount(), me.isPopupTrigger(), me.getButton()); lastComponentEntered.dispatchEvent(entered); } } if (me.getID() == MouseEvent.MOUSE_RELEASED || me.getID() == MouseEvent.MOUSE_PRESSED && pressCount > 0 || me.getID() == MouseEvent.MOUSE_DRAGGED) // If any of the following events occur while a button is held down, // they should be dispatched to the same component to which the // original MOUSE_PRESSED event was dispatched: // - MOUSE_RELEASED // - MOUSE_PRESSED: another button pressed while the first is held down // - MOUSE_DRAGGED mouseEventTarget = pressedComponent; else if (me.getID() == MouseEvent.MOUSE_CLICKED) { // Don't dispatch CLICKED events whose target is not the same as the // target for the original PRESSED event. if (candidate != pressedComponent) mouseEventTarget = null; else if (pressCount == 0) pressedComponent = null; } }
| 13,010
|
private void acquireComponentForMouseEvent(MouseEvent me) { int x = me.getX(); int y = me.getY(); // Find the candidate which should receive this event. Component parent = frame.getContentPane(); if (parent == null) return; Component candidate = null; Point p = me.getPoint(); while (candidate == null && parent != null) { candidate = SwingUtilities.getDeepestComponentAt(parent, p.x, p.y); if (candidate == null) { p = SwingUtilities.convertPoint(parent, p.x, p.y, parent.getParent()); parent = parent.getParent(); } } // If the only candidate we found was the native container itself, // don't dispatch any event at all. We only care about the lightweight // children here. if (candidate == frame.getContentPane()) candidate = null; // If our candidate is new, inform the old target we're leaving. if (lastComponentEntered != null && lastComponentEntered.isShowing() && lastComponentEntered != candidate) { Point tp = SwingUtilities.convertPoint(frame.getContentPane(), x, y, lastComponentEntered); MouseEvent exited = new MouseEvent(lastComponentEntered, MouseEvent.MOUSE_EXITED, me.getWhen(), me.getModifiersEx(), tp.x, tp.y, me.getClickCount(), me.isPopupTrigger(), me.getButton()); tempComponent = lastComponentEntered; lastComponentEntered = null; tempComponent.dispatchEvent(exited); } // If we have a candidate, maybe enter it. if (candidate != null) { mouseEventTarget = candidate; if (candidate.isLightweight() && candidate.isShowing() && candidate != frame.getContentPane() && candidate != lastComponentEntered) { lastComponentEntered = mouseEventTarget; Point cp = SwingUtilities.convertPoint(frame.getContentPane(), x, y, lastComponentEntered); MouseEvent entered = new MouseEvent(lastComponentEntered, MouseEvent.MOUSE_ENTERED, me.getWhen(), me.getModifiersEx(), cp.x, cp.y, me.getClickCount(), me.isPopupTrigger(), me.getButton()); lastComponentEntered.dispatchEvent(entered); } } if (me.getID() == MouseEvent.MOUSE_RELEASED || me.getID() == MouseEvent.MOUSE_PRESSED && pressCount > 0 || me.getID() == MouseEvent.MOUSE_DRAGGED) // If any of the following events occur while a button is held down, // they should be dispatched to the same component to which the // original MOUSE_PRESSED event was dispatched: // - MOUSE_RELEASED // - MOUSE_PRESSED: another button pressed while the first is held down // - MOUSE_DRAGGED mouseEventTarget = pressedComponent; else if (me.getID() == MouseEvent.MOUSE_CLICKED) { // Don't dispatch CLICKED events whose target is not the same as the // target for the original PRESSED event. if (candidate != pressedComponent) mouseEventTarget = null; else if (pressCount == 0) pressedComponent = null; } }
|
private void acquireComponentForMouseEvent(MouseEvent me) { int x = me.getX(); int y = me.getY(); // Find the candidate which should receive this event. Component parent = frame.getContentPane(); if (parent == null) return; Component candidate = null; Point p = me.getPoint(); while (candidate == null && parent != null) { candidate = SwingUtilities.getDeepestComponentAt(parent, p.x, p.y); if (candidate == null) { p = SwingUtilities.convertPoint(parent, p.x, p.y, parent.getParent()); parent = parent.getParent(); } } // If the only candidate we found was the native container itself, // don't dispatch any event at all. We only care about the lightweight // children here. if (candidate == frame.getContentPane()) candidate = null; // If our candidate is new, inform the old target we're leaving. if (lastComponentEntered != null && lastComponentEntered.isShowing() && lastComponentEntered != candidate) { Point tp = SwingUtilities.convertPoint(frame.getContentPane(), x, y, lastComponentEntered); MouseEvent exited = new MouseEvent(lastComponentEntered, MouseEvent.MOUSE_EXITED, me.getWhen(), me.getModifiersEx(), tp.x, tp.y, me.getClickCount(), me.isPopupTrigger(), me.getButton()); tempComponent = lastComponentEntered; lastComponentEntered = null; tempComponent.dispatchEvent(exited); } // If we have a candidate, maybe enter it. if (candidate != null) { mouseEventTarget = candidate; if (candidate.isLightweight() && candidate.isShowing() && candidate != frame.getContentPane() && candidate != lastComponentEntered) { lastComponentEntered = mouseEventTarget; Point cp = SwingUtilities.convertPoint(frame.getContentPane(), x, y, lastComponentEntered); MouseEvent entered = new MouseEvent(lastComponentEntered, MouseEvent.MOUSE_ENTERED, me.getWhen(), me.getModifiersEx(), cp.x, cp.y, me.getClickCount(), me.isPopupTrigger(), me.getButton()); lastComponentEntered.dispatchEvent(entered); } } if (me.getID() == MouseEvent.MOUSE_RELEASED || me.getID() == MouseEvent.MOUSE_PRESSED && pressCount > 0 || me.getID() == MouseEvent.MOUSE_DRAGGED) // If any of the following events occur while a button is held down, // they should be dispatched to the same component to which the // original MOUSE_PRESSED event was dispatched: // - MOUSE_RELEASED // - MOUSE_PRESSED: another button pressed while the first is held down // - MOUSE_DRAGGED mouseEventTarget = pressedComponent; else if (me.getID() == MouseEvent.MOUSE_CLICKED) { // Don't dispatch CLICKED events whose target is not the same as the // target for the original PRESSED event. if (candidate != pressedComponent) mouseEventTarget = null; else if (pressCount == 0) pressedComponent = null; } }
| 13,011
|
private void acquireComponentForMouseEvent(MouseEvent me) { int x = me.getX(); int y = me.getY(); // Find the candidate which should receive this event. Component parent = frame.getContentPane(); if (parent == null) return; Component candidate = null; Point p = me.getPoint(); while (candidate == null && parent != null) { candidate = SwingUtilities.getDeepestComponentAt(parent, p.x, p.y); if (candidate == null) { p = SwingUtilities.convertPoint(parent, p.x, p.y, parent.getParent()); parent = parent.getParent(); } } // If the only candidate we found was the native container itself, // don't dispatch any event at all. We only care about the lightweight // children here. if (candidate == frame.getContentPane()) candidate = null; // If our candidate is new, inform the old target we're leaving. if (lastComponentEntered != null && lastComponentEntered.isShowing() && lastComponentEntered != candidate) { Point tp = SwingUtilities.convertPoint(frame.getContentPane(), x, y, lastComponentEntered); MouseEvent exited = new MouseEvent(lastComponentEntered, MouseEvent.MOUSE_EXITED, me.getWhen(), me.getModifiersEx(), tp.x, tp.y, me.getClickCount(), me.isPopupTrigger(), me.getButton()); tempComponent = lastComponentEntered; lastComponentEntered = null; tempComponent.dispatchEvent(exited); } // If we have a candidate, maybe enter it. if (candidate != null) { mouseEventTarget = candidate; if (candidate.isLightweight() && candidate.isShowing() && candidate != frame.getContentPane() && candidate != lastComponentEntered) { lastComponentEntered = mouseEventTarget; Point cp = SwingUtilities.convertPoint(frame.getContentPane(), x, y, lastComponentEntered); MouseEvent entered = new MouseEvent(lastComponentEntered, MouseEvent.MOUSE_ENTERED, me.getWhen(), me.getModifiersEx(), cp.x, cp.y, me.getClickCount(), me.isPopupTrigger(), me.getButton()); lastComponentEntered.dispatchEvent(entered); } } if (me.getID() == MouseEvent.MOUSE_RELEASED || me.getID() == MouseEvent.MOUSE_PRESSED && pressCount > 0 || me.getID() == MouseEvent.MOUSE_DRAGGED) // If any of the following events occur while a button is held down, // they should be dispatched to the same component to which the // original MOUSE_PRESSED event was dispatched: // - MOUSE_RELEASED // - MOUSE_PRESSED: another button pressed while the first is held down // - MOUSE_DRAGGED mouseEventTarget = pressedComponent; else if (me.getID() == MouseEvent.MOUSE_CLICKED) { // Don't dispatch CLICKED events whose target is not the same as the // target for the original PRESSED event. if (candidate != pressedComponent) mouseEventTarget = null; else if (pressCount == 0) pressedComponent = null; } }
|
private void acquireComponentForMouseEvent(MouseEvent me) { int x = me.getX(); int y = me.getY(); // Find the candidate which should receive this event. Component parent = frame.getContentPane(); if (parent == null) return; Component candidate = null; Point p = me.getPoint(); while (candidate == null && parent != null) { candidate = SwingUtilities.getDeepestComponentAt(parent, p.x, p.y); if (candidate == null) { p = SwingUtilities.convertPoint(parent, p.x, p.y, parent.getParent()); parent = parent.getParent(); } } // If the only candidate we found was the native container itself, // don't dispatch any event at all. We only care about the lightweight // children here. if (candidate == frame.getContentPane()) candidate = null; // If our candidate is new, inform the old target we're leaving. if (lastComponentEntered != null && lastComponentEntered.isShowing() && lastComponentEntered != candidate) { Point tp = SwingUtilities.convertPoint(frame.getContentPane(), x, y, lastComponentEntered); MouseEvent exited = new MouseEvent(lastComponentEntered, MouseEvent.MOUSE_EXITED, me.getWhen(), me.getModifiersEx(), tp.x, tp.y, me.getClickCount(), me.isPopupTrigger(), me.getButton()); tempComponent = lastComponentEntered; lastComponentEntered = null; tempComponent.dispatchEvent(exited); } // If we have a candidate, maybe enter it. if (candidate != null) { mouseEventTarget = candidate; if (candidate.isLightweight() && candidate.isShowing() && candidate != frame.getContentPane() && candidate != lastComponentEntered) { lastComponentEntered = mouseEventTarget; Point cp = SwingUtilities.convertPoint(frame.getContentPane(), x, y, lastComponentEntered); MouseEvent entered = new MouseEvent(lastComponentEntered, MouseEvent.MOUSE_ENTERED, me.getWhen(), me.getModifiersEx(), cp.x, cp.y, me.getClickCount(), me.isPopupTrigger(), me.getButton()); lastComponentEntered.dispatchEvent(entered); } } if (me.getID() == MouseEvent.MOUSE_RELEASED || me.getID() == MouseEvent.MOUSE_PRESSED && pressCount > 0 || me.getID() == MouseEvent.MOUSE_DRAGGED) // If any of the following events occur while a button is held down, // they should be dispatched to the same component to which the // original MOUSE_PRESSED event was dispatched: // - MOUSE_RELEASED // - MOUSE_PRESSED: another button pressed while the first is held down // - MOUSE_DRAGGED mouseEventTarget = pressedComponent; else if (me.getID() == MouseEvent.MOUSE_CLICKED) { // Don't dispatch CLICKED events whose target is not the same as the // target for the original PRESSED event. if (candidate != pressedComponent) mouseEventTarget = null; else if (pressCount == 0) pressedComponent = null; } }
| 13,012
|
private void acquireComponentForMouseEvent(MouseEvent me) { int x = me.getX(); int y = me.getY(); // Find the candidate which should receive this event. Component parent = frame.getContentPane(); if (parent == null) return; Component candidate = null; Point p = me.getPoint(); while (candidate == null && parent != null) { candidate = SwingUtilities.getDeepestComponentAt(parent, p.x, p.y); if (candidate == null) { p = SwingUtilities.convertPoint(parent, p.x, p.y, parent.getParent()); parent = parent.getParent(); } } // If the only candidate we found was the native container itself, // don't dispatch any event at all. We only care about the lightweight // children here. if (candidate == frame.getContentPane()) candidate = null; // If our candidate is new, inform the old target we're leaving. if (lastComponentEntered != null && lastComponentEntered.isShowing() && lastComponentEntered != candidate) { Point tp = SwingUtilities.convertPoint(frame.getContentPane(), x, y, lastComponentEntered); MouseEvent exited = new MouseEvent(lastComponentEntered, MouseEvent.MOUSE_EXITED, me.getWhen(), me.getModifiersEx(), tp.x, tp.y, me.getClickCount(), me.isPopupTrigger(), me.getButton()); tempComponent = lastComponentEntered; lastComponentEntered = null; tempComponent.dispatchEvent(exited); } // If we have a candidate, maybe enter it. if (candidate != null) { mouseEventTarget = candidate; if (candidate.isLightweight() && candidate.isShowing() && candidate != frame.getContentPane() && candidate != lastComponentEntered) { lastComponentEntered = mouseEventTarget; Point cp = SwingUtilities.convertPoint(frame.getContentPane(), x, y, lastComponentEntered); MouseEvent entered = new MouseEvent(lastComponentEntered, MouseEvent.MOUSE_ENTERED, me.getWhen(), me.getModifiersEx(), cp.x, cp.y, me.getClickCount(), me.isPopupTrigger(), me.getButton()); lastComponentEntered.dispatchEvent(entered); } } if (me.getID() == MouseEvent.MOUSE_RELEASED || me.getID() == MouseEvent.MOUSE_PRESSED && pressCount > 0 || me.getID() == MouseEvent.MOUSE_DRAGGED) // If any of the following events occur while a button is held down, // they should be dispatched to the same component to which the // original MOUSE_PRESSED event was dispatched: // - MOUSE_RELEASED // - MOUSE_PRESSED: another button pressed while the first is held down // - MOUSE_DRAGGED mouseEventTarget = pressedComponent; else if (me.getID() == MouseEvent.MOUSE_CLICKED) { // Don't dispatch CLICKED events whose target is not the same as the // target for the original PRESSED event. if (candidate != pressedComponent) mouseEventTarget = null; else if (pressCount == 0) pressedComponent = null; } }
|
private void acquireComponentForMouseEvent(MouseEvent me) { int x = me.getX(); int y = me.getY(); // Find the candidate which should receive this event. Component parent = frame.getContentPane(); if (parent == null) return; Component candidate = null; Point p = me.getPoint(); while (candidate == null && parent != null) { candidate = SwingUtilities.getDeepestComponentAt(parent, p.x, p.y); if (candidate == null) { p = SwingUtilities.convertPoint(parent, p.x, p.y, parent.getParent()); parent = parent.getParent(); } } // If the only candidate we found was the native container itself, // don't dispatch any event at all. We only care about the lightweight // children here. if (candidate == frame.getContentPane()) candidate = null; // If our candidate is new, inform the old target we're leaving. if (lastComponentEntered != null && lastComponentEntered.isShowing() && lastComponentEntered != candidate) { Point tp = SwingUtilities.convertPoint(frame.getContentPane(), x, y, lastComponentEntered); MouseEvent exited = new MouseEvent(lastComponentEntered, MouseEvent.MOUSE_EXITED, me.getWhen(), me.getModifiersEx(), tp.x, tp.y, me.getClickCount(), me.isPopupTrigger(), me.getButton()); tempComponent = lastComponentEntered; lastComponentEntered = null; tempComponent.dispatchEvent(exited); } // If we have a candidate, maybe enter it. if (candidate != null) { mouseEventTarget = candidate; if (candidate.isLightweight() && candidate.isShowing() && candidate != frame.getContentPane() && candidate != lastComponentEntered) { lastComponentEntered = mouseEventTarget; Point cp = SwingUtilities.convertPoint(frame.getContentPane(), x, y, lastComponentEntered); MouseEvent entered = new MouseEvent(lastComponentEntered, MouseEvent.MOUSE_ENTERED, me.getWhen(), me.getModifiersEx(), cp.x, cp.y, me.getClickCount(), me.isPopupTrigger(), me.getButton()); lastComponentEntered.dispatchEvent(entered); } } if (me.getID() == MouseEvent.MOUSE_RELEASED || me.getID() == MouseEvent.MOUSE_PRESSED && pressCount > 0 || me.getID() == MouseEvent.MOUSE_DRAGGED) // If any of the following events occur while a button is held down, // they should be dispatched to the same component to which the // original MOUSE_PRESSED event was dispatched: // - MOUSE_RELEASED // - MOUSE_PRESSED: another button pressed while the first is held down // - MOUSE_DRAGGED mouseEventTarget = pressedComponent; else if (me.getID() == MouseEvent.MOUSE_CLICKED) { // Don't dispatch CLICKED events whose target is not the same as the // target for the original PRESSED event. if (candidate != pressedComponent) mouseEventTarget = null; else if (pressCount == 0) pressedComponent = null; } }
| 13,013
|
private void acquireComponentForMouseEvent(MouseEvent me) { int x = me.getX(); int y = me.getY(); // Find the candidate which should receive this event. Component parent = frame.getContentPane(); if (parent == null) return; Component candidate = null; Point p = me.getPoint(); while (candidate == null && parent != null) { candidate = SwingUtilities.getDeepestComponentAt(parent, p.x, p.y); if (candidate == null) { p = SwingUtilities.convertPoint(parent, p.x, p.y, parent.getParent()); parent = parent.getParent(); } } // If the only candidate we found was the native container itself, // don't dispatch any event at all. We only care about the lightweight // children here. if (candidate == frame.getContentPane()) candidate = null; // If our candidate is new, inform the old target we're leaving. if (lastComponentEntered != null && lastComponentEntered.isShowing() && lastComponentEntered != candidate) { Point tp = SwingUtilities.convertPoint(frame.getContentPane(), x, y, lastComponentEntered); MouseEvent exited = new MouseEvent(lastComponentEntered, MouseEvent.MOUSE_EXITED, me.getWhen(), me.getModifiersEx(), tp.x, tp.y, me.getClickCount(), me.isPopupTrigger(), me.getButton()); tempComponent = lastComponentEntered; lastComponentEntered = null; tempComponent.dispatchEvent(exited); } // If we have a candidate, maybe enter it. if (candidate != null) { mouseEventTarget = candidate; if (candidate.isLightweight() && candidate.isShowing() && candidate != frame.getContentPane() && candidate != lastComponentEntered) { lastComponentEntered = mouseEventTarget; Point cp = SwingUtilities.convertPoint(frame.getContentPane(), x, y, lastComponentEntered); MouseEvent entered = new MouseEvent(lastComponentEntered, MouseEvent.MOUSE_ENTERED, me.getWhen(), me.getModifiersEx(), cp.x, cp.y, me.getClickCount(), me.isPopupTrigger(), me.getButton()); lastComponentEntered.dispatchEvent(entered); } } if (me.getID() == MouseEvent.MOUSE_RELEASED || me.getID() == MouseEvent.MOUSE_PRESSED && pressCount > 0 || me.getID() == MouseEvent.MOUSE_DRAGGED) // If any of the following events occur while a button is held down, // they should be dispatched to the same component to which the // original MOUSE_PRESSED event was dispatched: // - MOUSE_RELEASED // - MOUSE_PRESSED: another button pressed while the first is held down // - MOUSE_DRAGGED mouseEventTarget = pressedComponent; else if (me.getID() == MouseEvent.MOUSE_CLICKED) { // Don't dispatch CLICKED events whose target is not the same as the // target for the original PRESSED event. if (candidate != pressedComponent) mouseEventTarget = null; else if (pressCount == 0) pressedComponent = null; } }
|
private void acquireComponentForMouseEvent(MouseEvent me) { int x = me.getX(); int y = me.getY(); // Find the candidate which should receive this event. Component parent = frame.getContentPane(); if (parent == null) return; Component candidate = null; Point p = me.getPoint(); while (candidate == null && parent != null) { candidate = SwingUtilities.getDeepestComponentAt(parent, p.x, p.y); if (candidate == null) { p = SwingUtilities.convertPoint(parent, p.x, p.y, parent.getParent()); parent = parent.getParent(); } } // If the only candidate we found was the native container itself, // don't dispatch any event at all. We only care about the lightweight // children here. if (candidate == frame.getContentPane()) candidate = null; // If our candidate is new, inform the old target we're leaving. if (lastComponentEntered != null && lastComponentEntered.isShowing() && lastComponentEntered != candidate) { Point tp = SwingUtilities.convertPoint(frame.getContentPane(), x, y, lastComponentEntered); MouseEvent exited = new MouseEvent(lastComponentEntered, MouseEvent.MOUSE_EXITED, me.getWhen(), me.getModifiersEx(), tp.x, tp.y, me.getClickCount(), me.isPopupTrigger(), me.getButton()); tempComponent = lastComponentEntered; lastComponentEntered = null; tempComponent.dispatchEvent(exited); } // If we have a candidate, maybe enter it. if (candidate != null) { mouseEventTarget = candidate; if (candidate.isLightweight() && candidate.isShowing() && candidate != frame.getContentPane() && candidate != lastComponentEntered) { lastComponentEntered = mouseEventTarget; Point cp = SwingUtilities.convertPoint(frame.getContentPane(), x, y, lastComponentEntered); MouseEvent entered = new MouseEvent(lastComponentEntered, MouseEvent.MOUSE_ENTERED, me.getWhen(), me.getModifiersEx(), cp.x, cp.y, me.getClickCount(), me.isPopupTrigger(), me.getButton()); lastComponentEntered.dispatchEvent(entered); } } if (me.getID() == MouseEvent.MOUSE_RELEASED || me.getID() == MouseEvent.MOUSE_PRESSED && pressCount > 0 || me.getID() == MouseEvent.MOUSE_DRAGGED) // If any of the following events occur while a button is held down, // they should be dispatched to the same component to which the // original MOUSE_PRESSED event was dispatched: // - MOUSE_RELEASED // - MOUSE_PRESSED: another button pressed while the first is held down // - MOUSE_DRAGGED mouseEventTarget = pressedComponent; else if (me.getID() == MouseEvent.MOUSE_CLICKED) { // Don't dispatch CLICKED events whose target is not the same as the // target for the original PRESSED event. if (candidate != pressedComponent) mouseEventTarget = null; else if (pressCount == 0) pressedComponent = null; } }
| 13,014
|
private void acquireComponentForMouseEvent(MouseEvent me) { int x = me.getX(); int y = me.getY(); // Find the candidate which should receive this event. Component parent = frame.getContentPane(); if (parent == null) return; Component candidate = null; Point p = me.getPoint(); while (candidate == null && parent != null) { candidate = SwingUtilities.getDeepestComponentAt(parent, p.x, p.y); if (candidate == null) { p = SwingUtilities.convertPoint(parent, p.x, p.y, parent.getParent()); parent = parent.getParent(); } } // If the only candidate we found was the native container itself, // don't dispatch any event at all. We only care about the lightweight // children here. if (candidate == frame.getContentPane()) candidate = null; // If our candidate is new, inform the old target we're leaving. if (lastComponentEntered != null && lastComponentEntered.isShowing() && lastComponentEntered != candidate) { Point tp = SwingUtilities.convertPoint(frame.getContentPane(), x, y, lastComponentEntered); MouseEvent exited = new MouseEvent(lastComponentEntered, MouseEvent.MOUSE_EXITED, me.getWhen(), me.getModifiersEx(), tp.x, tp.y, me.getClickCount(), me.isPopupTrigger(), me.getButton()); tempComponent = lastComponentEntered; lastComponentEntered = null; tempComponent.dispatchEvent(exited); } // If we have a candidate, maybe enter it. if (candidate != null) { mouseEventTarget = candidate; if (candidate.isLightweight() && candidate.isShowing() && candidate != frame.getContentPane() && candidate != lastComponentEntered) { lastComponentEntered = mouseEventTarget; Point cp = SwingUtilities.convertPoint(frame.getContentPane(), x, y, lastComponentEntered); MouseEvent entered = new MouseEvent(lastComponentEntered, MouseEvent.MOUSE_ENTERED, me.getWhen(), me.getModifiersEx(), cp.x, cp.y, me.getClickCount(), me.isPopupTrigger(), me.getButton()); lastComponentEntered.dispatchEvent(entered); } } if (me.getID() == MouseEvent.MOUSE_RELEASED || me.getID() == MouseEvent.MOUSE_PRESSED && pressCount > 0 || me.getID() == MouseEvent.MOUSE_DRAGGED) // If any of the following events occur while a button is held down, // they should be dispatched to the same component to which the // original MOUSE_PRESSED event was dispatched: // - MOUSE_RELEASED // - MOUSE_PRESSED: another button pressed while the first is held down // - MOUSE_DRAGGED mouseEventTarget = pressedComponent; else if (me.getID() == MouseEvent.MOUSE_CLICKED) { // Don't dispatch CLICKED events whose target is not the same as the // target for the original PRESSED event. if (candidate != pressedComponent) mouseEventTarget = null; else if (pressCount == 0) pressedComponent = null; } }
|
private void acquireComponentForMouseEvent(MouseEvent me) { int x = me.getX(); int y = me.getY(); // Find the candidate which should receive this event. Component parent = frame.getContentPane(); if (parent == null) return; Component candidate = null; Point p = me.getPoint(); while (candidate == null && parent != null) { candidate = SwingUtilities.getDeepestComponentAt(parent, p.x, p.y); if (candidate == null) { p = SwingUtilities.convertPoint(parent, p.x, p.y, parent.getParent()); parent = parent.getParent(); } } // If the only candidate we found was the native container itself, // don't dispatch any event at all. We only care about the lightweight // children here. if (candidate == frame.getContentPane()) candidate = null; // If our candidate is new, inform the old target we're leaving. if (lastComponentEntered != null && lastComponentEntered.isShowing() && lastComponentEntered != candidate) { Point tp = SwingUtilities.convertPoint(frame.getContentPane(), x, y, lastComponentEntered); MouseEvent exited = new MouseEvent(lastComponentEntered, MouseEvent.MOUSE_EXITED, me.getWhen(), me.getModifiersEx(), tp.x, tp.y, me.getClickCount(), me.isPopupTrigger(), me.getButton()); tempComponent = lastComponentEntered; lastComponentEntered = null; tempComponent.dispatchEvent(exited); } // If we have a candidate, maybe enter it. if (candidate != null) { mouseEventTarget = candidate; if (candidate.isLightweight() && candidate.isShowing() && candidate != frame.getContentPane() && candidate != lastComponentEntered) { lastComponentEntered = mouseEventTarget; Point cp = SwingUtilities.convertPoint(frame.getContentPane(), x, y, lastComponentEntered); MouseEvent entered = new MouseEvent(lastComponentEntered, MouseEvent.MOUSE_ENTERED, me.getWhen(), me.getModifiersEx(), cp.x, cp.y, me.getClickCount(), me.isPopupTrigger(), me.getButton()); lastComponentEntered.dispatchEvent(entered); } } if (me.getID() == MouseEvent.MOUSE_RELEASED || me.getID() == MouseEvent.MOUSE_PRESSED && pressCount > 0 || me.getID() == MouseEvent.MOUSE_DRAGGED) // If any of the following events occur while a button is held down, // they should be dispatched to the same component to which the // original MOUSE_PRESSED event was dispatched: // - MOUSE_RELEASED // - MOUSE_PRESSED: another button pressed while the first is held down // - MOUSE_DRAGGED mouseEventTarget = pressedComponent; else if (me.getID() == MouseEvent.MOUSE_CLICKED) { // Don't dispatch CLICKED events whose target is not the same as the // target for the original PRESSED event. if (candidate != pressedComponent) mouseEventTarget = null; else if (pressCount == 0) pressedComponent = null; } }
| 13,015
|
private void handleEvent(AWTEvent e) { if (e instanceof MouseEvent) { MouseEvent me = SwingUtilities.convertMouseEvent(frame.getRootPane() .getGlassPane(), (MouseEvent) e, frame.getRootPane() .getGlassPane()); acquireComponentForMouseEvent(me); // Avoid dispatching ENTERED and EXITED events twice. if (mouseEventTarget != null && mouseEventTarget.isShowing() && e.getID() != MouseEvent.MOUSE_ENTERED && e.getID() != MouseEvent.MOUSE_EXITED) { MouseEvent newEvt = SwingUtilities.convertMouseEvent(frame .getContentPane(), me, mouseEventTarget); mouseEventTarget.dispatchEvent(newEvt); switch (e.getID()) { case MouseEvent.MOUSE_PRESSED: if (pressCount++ == 0) pressedComponent = mouseEventTarget; break; case MouseEvent.MOUSE_RELEASED: // Clear our memory of the original PRESSED event, only if // we're not expecting a CLICKED event after this. If // there is a CLICKED event after this, it will do clean up. if (--pressCount == 0 && mouseEventTarget != pressedComponent) pressedComponent = null; break; } } } }
|
private void handleEvent(AWTEvent e) { if (e instanceof MouseEvent) { MouseEvent me = SwingUtilities.convertMouseEvent(frame.getRootPane() .getGlassPane(), (MouseEvent) e, frame.getRootPane() .getGlassPane()); acquireComponentForMouseEvent(me); // Avoid dispatching ENTERED and EXITED events twice. if (mouseEventTarget != null && mouseEventTarget.isShowing() && e.getID() != MouseEvent.MOUSE_ENTERED && e.getID() != MouseEvent.MOUSE_EXITED) { MouseEvent newEvt = SwingUtilities.convertMouseEvent(frame .getContentPane(), me, mouseEventTarget); mouseEventTarget.dispatchEvent(newEvt); switch (e.getID()) { case MouseEvent.MOUSE_PRESSED: if (pressCount++ == 0) pressedComponent = mouseEventTarget; break; case MouseEvent.MOUSE_RELEASED: // Clear our memory of the original PRESSED event, only if // we're not expecting a CLICKED event after this. If // there is a CLICKED event after this, it will do clean up. if (--pressCount == 0 && mouseEventTarget != pressedComponent) pressedComponent = null; break; } } } }
| 13,016
|
private void handleEvent(AWTEvent e) { if (e instanceof MouseEvent) { MouseEvent me = SwingUtilities.convertMouseEvent(frame.getRootPane() .getGlassPane(), (MouseEvent) e, frame.getRootPane() .getGlassPane()); acquireComponentForMouseEvent(me); // Avoid dispatching ENTERED and EXITED events twice. if (mouseEventTarget != null && mouseEventTarget.isShowing() && e.getID() != MouseEvent.MOUSE_ENTERED && e.getID() != MouseEvent.MOUSE_EXITED) { MouseEvent newEvt = SwingUtilities.convertMouseEvent(frame .getContentPane(), me, mouseEventTarget); mouseEventTarget.dispatchEvent(newEvt); switch (e.getID()) { case MouseEvent.MOUSE_PRESSED: if (pressCount++ == 0) pressedComponent = mouseEventTarget; break; case MouseEvent.MOUSE_RELEASED: // Clear our memory of the original PRESSED event, only if // we're not expecting a CLICKED event after this. If // there is a CLICKED event after this, it will do clean up. if (--pressCount == 0 && mouseEventTarget != pressedComponent) pressedComponent = null; break; } } } }
|
private void handleEvent(AWTEvent e) { if (e instanceof MouseEvent) { MouseEvent me = SwingUtilities.convertMouseEvent(frame.getRootPane() .getGlassPane(), (MouseEvent) e, frame.getRootPane() .getGlassPane()); acquireComponentForMouseEvent(me); // Avoid dispatching ENTERED and EXITED events twice. if (mouseEventTarget != null && mouseEventTarget.isShowing() && e.getID() != MouseEvent.MOUSE_ENTERED && e.getID() != MouseEvent.MOUSE_EXITED) { MouseEvent newEvt = SwingUtilities.convertMouseEvent(frame .getContentPane(), me, mouseEventTarget); mouseEventTarget.dispatchEvent(newEvt); switch (e.getID()) { case MouseEvent.MOUSE_PRESSED: if (pressCount++ == 0) pressedComponent = mouseEventTarget; break; case MouseEvent.MOUSE_RELEASED: // Clear our memory of the original PRESSED event, only if // we're not expecting a CLICKED event after this. If // there is a CLICKED event after this, it will do clean up. if (--pressCount == 0 && mouseEventTarget != pressedComponent) pressedComponent = null; break; } } } }
| 13,017
|
private void handleEvent(AWTEvent e) { if (e instanceof MouseEvent) { MouseEvent me = SwingUtilities.convertMouseEvent(frame.getRootPane() .getGlassPane(), (MouseEvent) e, frame.getRootPane() .getGlassPane()); acquireComponentForMouseEvent(me); // Avoid dispatching ENTERED and EXITED events twice. if (mouseEventTarget != null && mouseEventTarget.isShowing() && e.getID() != MouseEvent.MOUSE_ENTERED && e.getID() != MouseEvent.MOUSE_EXITED) { MouseEvent newEvt = SwingUtilities.convertMouseEvent(frame .getContentPane(), me, mouseEventTarget); mouseEventTarget.dispatchEvent(newEvt); switch (e.getID()) { case MouseEvent.MOUSE_PRESSED: if (pressCount++ == 0) pressedComponent = mouseEventTarget; break; case MouseEvent.MOUSE_RELEASED: // Clear our memory of the original PRESSED event, only if // we're not expecting a CLICKED event after this. If // there is a CLICKED event after this, it will do clean up. if (--pressCount == 0 && mouseEventTarget != pressedComponent) pressedComponent = null; break; } } } }
|
private void handleEvent(AWTEvent e) { if (e instanceof MouseEvent) { MouseEvent me = SwingUtilities.convertMouseEvent(frame.getRootPane() .getGlassPane(), (MouseEvent) e, frame.getRootPane() .getGlassPane()); acquireComponentForMouseEvent(me); // Avoid dispatching ENTERED and EXITED events twice. if (mouseEventTarget != null && mouseEventTarget.isShowing() && e.getID() != MouseEvent.MOUSE_ENTERED && e.getID() != MouseEvent.MOUSE_EXITED) { MouseEvent newEvt = SwingUtilities.convertMouseEvent(frame .getContentPane(), me, mouseEventTarget); mouseEventTarget.dispatchEvent(newEvt); switch (e.getID()) { case MouseEvent.MOUSE_PRESSED: if (pressCount++ == 0) pressedComponent = mouseEventTarget; break; case MouseEvent.MOUSE_RELEASED: // Clear our memory of the original PRESSED event, only if // we're not expecting a CLICKED event after this. If // there is a CLICKED event after this, it will do clean up. if (--pressCount == 0 && mouseEventTarget != pressedComponent) pressedComponent = null; break; } } } }
| 13,018
|
private void handleEvent(AWTEvent e) { if (e instanceof MouseEvent) { MouseEvent me = SwingUtilities.convertMouseEvent(frame.getRootPane() .getGlassPane(), (MouseEvent) e, frame.getRootPane() .getGlassPane()); acquireComponentForMouseEvent(me); // Avoid dispatching ENTERED and EXITED events twice. if (mouseEventTarget != null && mouseEventTarget.isShowing() && e.getID() != MouseEvent.MOUSE_ENTERED && e.getID() != MouseEvent.MOUSE_EXITED) { MouseEvent newEvt = SwingUtilities.convertMouseEvent(frame .getContentPane(), me, mouseEventTarget); mouseEventTarget.dispatchEvent(newEvt); switch (e.getID()) { case MouseEvent.MOUSE_PRESSED: if (pressCount++ == 0) pressedComponent = mouseEventTarget; break; case MouseEvent.MOUSE_RELEASED: // Clear our memory of the original PRESSED event, only if // we're not expecting a CLICKED event after this. If // there is a CLICKED event after this, it will do clean up. if (--pressCount == 0 && mouseEventTarget != pressedComponent) pressedComponent = null; break; } } } }
|
private void handleEvent(AWTEvent e) { if (e instanceof MouseEvent) { MouseEvent me = SwingUtilities.convertMouseEvent(frame.getRootPane() .getGlassPane(), (MouseEvent) e, frame.getRootPane() .getGlassPane()); acquireComponentForMouseEvent(me); // Avoid dispatching ENTERED and EXITED events twice. if (mouseEventTarget != null && mouseEventTarget.isShowing() && e.getID() != MouseEvent.MOUSE_ENTERED && e.getID() != MouseEvent.MOUSE_EXITED) { MouseEvent newEvt = SwingUtilities.convertMouseEvent(frame .getContentPane(), me, mouseEventTarget); mouseEventTarget.dispatchEvent(newEvt); switch (e.getID()) { case MouseEvent.MOUSE_PRESSED: if (pressCount++ == 0) pressedComponent = mouseEventTarget; break; case MouseEvent.MOUSE_RELEASED: // Clear our memory of the original PRESSED event, only if // we're not expecting a CLICKED event after this. If // there is a CLICKED event after this, it will do clean up. if (--pressCount == 0 && mouseEventTarget != pressedComponent) pressedComponent = null; break; } } } }
| 13,019
|
private Dimension getSize(Container c, boolean min) { Insets insets = frame.getInsets(); Dimension contentDims = frame.getContentPane().getPreferredSize(); if (min) contentDims.width = contentDims.height = 0; int nWidth = 0; int nHeight = 0; int sWidth = 0; int sHeight = 0; int eWidth = 0; int eHeight = 0; int wWidth = 0; int wHeight = 0; Dimension dims; if (northPane != null) { dims = northPane.getPreferredSize(); if (dims != null) { nWidth = dims.width; nHeight = dims.height; } } if (southPane != null) { dims = southPane.getPreferredSize(); if (dims != null) { sWidth = dims.width; sHeight = dims.height; } } if (eastPane != null) { dims = eastPane.getPreferredSize(); if (dims != null) { sWidth = dims.width; sHeight = dims.height; } } if (westPane != null) { dims = westPane.getPreferredSize(); if (dims != null) { wWidth = dims.width; wHeight = dims.height; } } int width = Math.max(sWidth, nWidth); width = Math.max(width, contentDims.width + eWidth + wWidth); int height = Math.max(eHeight, wHeight); height = Math.max(height, contentDims.height); height += nHeight + sHeight; width += insets.left + insets.right; height += insets.top + insets.bottom; return new Dimension(width, height); }
|
private Dimension getSize(Container c, boolean min) { Insets insets = frame.getInsets(); Dimension contentDims = frame.getContentPane().getPreferredSize(); if (min) contentDims.width = contentDims.height = 0; int nWidth = 0; int nHeight = 0; int sWidth = 0; int sHeight = 0; int eWidth = 0; int eHeight = 0; int wWidth = 0; int wHeight = 0; Dimension dims; if (northPane != null) { dims = northPane.getPreferredSize(); if (dims != null) { nWidth = dims.width; nHeight = dims.height; } } if (southPane != null) { dims = southPane.getPreferredSize(); if (dims != null) { sWidth = dims.width; sHeight = dims.height; } } if (eastPane != null) { dims = eastPane.getPreferredSize(); if (dims != null) { sWidth = dims.width; sHeight = dims.height; } } if (westPane != null) { dims = westPane.getPreferredSize(); if (dims != null) { wWidth = dims.width; wHeight = dims.height; } } int width = Math.max(sWidth, nWidth); width = Math.max(width, contentDims.width + eWidth + wWidth); int height = Math.max(eHeight, wHeight); height = Math.max(height, contentDims.height); height += nHeight + sHeight; width += insets.left + insets.right; height += insets.top + insets.bottom; return new Dimension(width, height); }
| 13,020
|
private Dimension getSize(Container c, boolean min) { Insets insets = frame.getInsets(); Dimension contentDims = frame.getContentPane().getPreferredSize(); if (min) contentDims.width = contentDims.height = 0; int nWidth = 0; int nHeight = 0; int sWidth = 0; int sHeight = 0; int eWidth = 0; int eHeight = 0; int wWidth = 0; int wHeight = 0; Dimension dims; if (northPane != null) { dims = northPane.getPreferredSize(); if (dims != null) { nWidth = dims.width; nHeight = dims.height; } } if (southPane != null) { dims = southPane.getPreferredSize(); if (dims != null) { sWidth = dims.width; sHeight = dims.height; } } if (eastPane != null) { dims = eastPane.getPreferredSize(); if (dims != null) { sWidth = dims.width; sHeight = dims.height; } } if (westPane != null) { dims = westPane.getPreferredSize(); if (dims != null) { wWidth = dims.width; wHeight = dims.height; } } int width = Math.max(sWidth, nWidth); width = Math.max(width, contentDims.width + eWidth + wWidth); int height = Math.max(eHeight, wHeight); height = Math.max(height, contentDims.height); height += nHeight + sHeight; width += insets.left + insets.right; height += insets.top + insets.bottom; return new Dimension(width, height); }
|
private Dimension getSize(Container c, boolean min) { Insets insets = frame.getInsets(); Dimension contentDims = frame.getContentPane().getPreferredSize(); if (min) contentDims.width = contentDims.height = 0; int nWidth = 0; int nHeight = 0; int sWidth = 0; int sHeight = 0; int eWidth = 0; int eHeight = 0; int wWidth = 0; int wHeight = 0; Dimension dims; if (northPane != null) { dims = northPane.getPreferredSize(); if (dims != null) { nWidth = dims.width; nHeight = dims.height; } } if (southPane != null) { dims = southPane.getPreferredSize(); if (dims != null) { sWidth = dims.width; sHeight = dims.height; } } if (eastPane != null) { dims = eastPane.getPreferredSize(); if (dims != null) { sWidth = dims.width; sHeight = dims.height; } } if (westPane != null) { dims = westPane.getPreferredSize(); if (dims != null) { wWidth = dims.width; wHeight = dims.height; } } int width = Math.max(sWidth, nWidth); width = Math.max(width, contentDims.width + eWidth + wWidth); int height = Math.max(eHeight, wHeight); height = Math.max(height, contentDims.height); height += nHeight + sHeight; width += insets.left + insets.right; height += insets.top + insets.bottom; return new Dimension(width, height); }
| 13,021
|
private Dimension getSize(Container c, boolean min) { Insets insets = frame.getInsets(); Dimension contentDims = frame.getContentPane().getPreferredSize(); if (min) contentDims.width = contentDims.height = 0; int nWidth = 0; int nHeight = 0; int sWidth = 0; int sHeight = 0; int eWidth = 0; int eHeight = 0; int wWidth = 0; int wHeight = 0; Dimension dims; if (northPane != null) { dims = northPane.getPreferredSize(); if (dims != null) { nWidth = dims.width; nHeight = dims.height; } } if (southPane != null) { dims = southPane.getPreferredSize(); if (dims != null) { sWidth = dims.width; sHeight = dims.height; } } if (eastPane != null) { dims = eastPane.getPreferredSize(); if (dims != null) { sWidth = dims.width; sHeight = dims.height; } } if (westPane != null) { dims = westPane.getPreferredSize(); if (dims != null) { wWidth = dims.width; wHeight = dims.height; } } int width = Math.max(sWidth, nWidth); width = Math.max(width, contentDims.width + eWidth + wWidth); int height = Math.max(eHeight, wHeight); height = Math.max(height, contentDims.height); height += nHeight + sHeight; width += insets.left + insets.right; height += insets.top + insets.bottom; return new Dimension(width, height); }
|
private Dimension getSize(Container c, boolean min) { Insets insets = frame.getInsets(); Dimension contentDims = frame.getContentPane().getPreferredSize(); if (min) contentDims.width = contentDims.height = 0; int nWidth = 0; int nHeight = 0; int sWidth = 0; int sHeight = 0; int eWidth = 0; int eHeight = 0; int wWidth = 0; int wHeight = 0; Dimension dims; if (northPane != null) { dims = northPane.getPreferredSize(); if (dims != null) { nWidth = dims.width; nHeight = dims.height; } } if (southPane != null) { dims = southPane.getPreferredSize(); if (dims != null) { sWidth = dims.width; sHeight = dims.height; } } if (eastPane != null) { dims = eastPane.getPreferredSize(); if (dims != null) { sWidth = dims.width; sHeight = dims.height; } } if (westPane != null) { dims = westPane.getPreferredSize(); if (dims != null) { wWidth = dims.width; wHeight = dims.height; } } int width = Math.max(sWidth, nWidth); width = Math.max(width, contentDims.width + eWidth + wWidth); int height = Math.max(eHeight, wHeight); height = Math.max(height, contentDims.height); height += nHeight + sHeight; width += insets.left + insets.right; height += insets.top + insets.bottom; return new Dimension(width, height); }
| 13,022
|
private Dimension getSize(Container c, boolean min) { Insets insets = frame.getInsets(); Dimension contentDims = frame.getContentPane().getPreferredSize(); if (min) contentDims.width = contentDims.height = 0; int nWidth = 0; int nHeight = 0; int sWidth = 0; int sHeight = 0; int eWidth = 0; int eHeight = 0; int wWidth = 0; int wHeight = 0; Dimension dims; if (northPane != null) { dims = northPane.getPreferredSize(); if (dims != null) { nWidth = dims.width; nHeight = dims.height; } } if (southPane != null) { dims = southPane.getPreferredSize(); if (dims != null) { sWidth = dims.width; sHeight = dims.height; } } if (eastPane != null) { dims = eastPane.getPreferredSize(); if (dims != null) { sWidth = dims.width; sHeight = dims.height; } } if (westPane != null) { dims = westPane.getPreferredSize(); if (dims != null) { wWidth = dims.width; wHeight = dims.height; } } int width = Math.max(sWidth, nWidth); width = Math.max(width, contentDims.width + eWidth + wWidth); int height = Math.max(eHeight, wHeight); height = Math.max(height, contentDims.height); height += nHeight + sHeight; width += insets.left + insets.right; height += insets.top + insets.bottom; return new Dimension(width, height); }
|
private Dimension getSize(Container c, boolean min) { Insets insets = frame.getInsets(); Dimension contentDims = frame.getContentPane().getPreferredSize(); if (min) contentDims.width = contentDims.height = 0; int nWidth = 0; int nHeight = 0; int sWidth = 0; int sHeight = 0; int eWidth = 0; int eHeight = 0; int wWidth = 0; int wHeight = 0; Dimension dims; if (northPane != null) { dims = northPane.getPreferredSize(); if (dims != null) { nWidth = dims.width; nHeight = dims.height; } } if (southPane != null) { dims = southPane.getPreferredSize(); if (dims != null) { sWidth = dims.width; sHeight = dims.height; } } if (eastPane != null) { dims = eastPane.getPreferredSize(); if (dims != null) { sWidth = dims.width; sHeight = dims.height; } } if (westPane != null) { dims = westPane.getPreferredSize(); if (dims != null) { wWidth = dims.width; wHeight = dims.height; } } int width = Math.max(sWidth, nWidth); width = Math.max(width, contentDims.width + eWidth + wWidth); int height = Math.max(eHeight, wHeight); height = Math.max(height, contentDims.height); height += nHeight + sHeight; width += insets.left + insets.right; height += insets.top + insets.bottom; return new Dimension(width, height); }
| 13,023
|
private Dimension getSize(Container c, boolean min) { Insets insets = frame.getInsets(); Dimension contentDims = frame.getContentPane().getPreferredSize(); if (min) contentDims.width = contentDims.height = 0; int nWidth = 0; int nHeight = 0; int sWidth = 0; int sHeight = 0; int eWidth = 0; int eHeight = 0; int wWidth = 0; int wHeight = 0; Dimension dims; if (northPane != null) { dims = northPane.getPreferredSize(); if (dims != null) { nWidth = dims.width; nHeight = dims.height; } } if (southPane != null) { dims = southPane.getPreferredSize(); if (dims != null) { sWidth = dims.width; sHeight = dims.height; } } if (eastPane != null) { dims = eastPane.getPreferredSize(); if (dims != null) { sWidth = dims.width; sHeight = dims.height; } } if (westPane != null) { dims = westPane.getPreferredSize(); if (dims != null) { wWidth = dims.width; wHeight = dims.height; } } int width = Math.max(sWidth, nWidth); width = Math.max(width, contentDims.width + eWidth + wWidth); int height = Math.max(eHeight, wHeight); height = Math.max(height, contentDims.height); height += nHeight + sHeight; width += insets.left + insets.right; height += insets.top + insets.bottom; return new Dimension(width, height); }
|
private Dimension getSize(Container c, boolean min) { Insets insets = frame.getInsets(); Dimension contentDims = frame.getContentPane().getPreferredSize(); if (min) contentDims.width = contentDims.height = 0; int nWidth = 0; int nHeight = 0; int sWidth = 0; int sHeight = 0; int eWidth = 0; int eHeight = 0; int wWidth = 0; int wHeight = 0; Dimension dims; if (northPane != null) { dims = northPane.getPreferredSize(); if (dims != null) { nWidth = dims.width; nHeight = dims.height; } } if (southPane != null) { dims = southPane.getPreferredSize(); if (dims != null) { sWidth = dims.width; sHeight = dims.height; } } if (eastPane != null) { dims = eastPane.getPreferredSize(); if (dims != null) { sWidth = dims.width; sHeight = dims.height; } } if (westPane != null) { dims = westPane.getPreferredSize(); if (dims != null) { wWidth = dims.width; wHeight = dims.height; } } int width = Math.max(sWidth, nWidth); width = Math.max(width, contentDims.width + eWidth + wWidth); int height = Math.max(eHeight, wHeight); height = Math.max(height, contentDims.height); height += nHeight + sHeight; width += insets.left + insets.right; height += insets.top + insets.bottom; return new Dimension(width, height); }
| 13,024
|
public void layoutContainer(Container c) { Dimension dims = frame.getSize(); Insets insets = frame.getInsets(); dims.width -= insets.left + insets.right; dims.height -= insets.top + insets.bottom; frame.getRootPane().getGlassPane().setBounds(0, 0, dims.width, dims.height); int nh = 0; int sh = 0; int ew = 0; int ww = 0; if (northPane != null) { Dimension nDims = northPane.getPreferredSize(); nh = Math.min(nDims.height, dims.height); northPane.setBounds(insets.left, insets.top, dims.width, nh); } if (southPane != null) { Dimension sDims = southPane.getPreferredSize(); sh = Math.min(sDims.height, dims.height - nh); southPane.setBounds(insets.left, insets.top + dims.height - sh, dims.width, sh); } int remHeight = dims.height - sh - nh; if (westPane != null) { Dimension wDims = westPane.getPreferredSize(); ww = Math.min(dims.width, wDims.width); westPane.setBounds(insets.left, insets.top + nh, ww, remHeight); } if (eastPane != null) { Dimension eDims = eastPane.getPreferredSize(); ew = Math.min(eDims.width, dims.width - ww); eastPane.setBounds(insets.left + dims.width - ew, insets.top + nh, ew, remHeight); } int remWidth = dims.width - ww - ew; frame.getRootPane().setBounds(insets.left + ww, insets.top + nh, remWidth, remHeight); }
|
public void layoutContainer(Container c) { Dimension dims = frame.getSize(); Insets insets = frame.getInsets(); dims.width -= insets.left + insets.right; dims.height -= insets.top + insets.bottom; frame.getRootPane().getGlassPane().setBounds(0, 0, dims.width, dims.height); int nh = 0; int sh = 0; int ew = 0; int ww = 0; if (northPane != null) { Dimension nDims = northPane.getPreferredSize(); nh = Math.min(nDims.height, dims.height); northPane.setBounds(insets.left, insets.top, dims.width, nh); } if (southPane != null) { Dimension sDims = southPane.getPreferredSize(); sh = Math.min(sDims.height, dims.height - nh); southPane.setBounds(insets.left, insets.top + dims.height - sh, dims.width, sh); } int remHeight = dims.height - sh - nh; if (westPane != null) { Dimension wDims = westPane.getPreferredSize(); ww = Math.min(dims.width, wDims.width); westPane.setBounds(insets.left, insets.top + nh, ww, remHeight); } if (eastPane != null) { Dimension eDims = eastPane.getPreferredSize(); ew = Math.min(eDims.width, dims.width - ww); eastPane.setBounds(insets.left + dims.width - ew, insets.top + nh, ew, remHeight); } int remWidth = dims.width - ww - ew; frame.getRootPane().setBounds(insets.left + ww, insets.top + nh, remWidth, remHeight); }
| 13,025
|
public void layoutContainer(Container c) { Dimension dims = frame.getSize(); Insets insets = frame.getInsets(); dims.width -= insets.left + insets.right; dims.height -= insets.top + insets.bottom; frame.getRootPane().getGlassPane().setBounds(0, 0, dims.width, dims.height); int nh = 0; int sh = 0; int ew = 0; int ww = 0; if (northPane != null) { Dimension nDims = northPane.getPreferredSize(); nh = Math.min(nDims.height, dims.height); northPane.setBounds(insets.left, insets.top, dims.width, nh); } if (southPane != null) { Dimension sDims = southPane.getPreferredSize(); sh = Math.min(sDims.height, dims.height - nh); southPane.setBounds(insets.left, insets.top + dims.height - sh, dims.width, sh); } int remHeight = dims.height - sh - nh; if (westPane != null) { Dimension wDims = westPane.getPreferredSize(); ww = Math.min(dims.width, wDims.width); westPane.setBounds(insets.left, insets.top + nh, ww, remHeight); } if (eastPane != null) { Dimension eDims = eastPane.getPreferredSize(); ew = Math.min(eDims.width, dims.width - ww); eastPane.setBounds(insets.left + dims.width - ew, insets.top + nh, ew, remHeight); } int remWidth = dims.width - ww - ew; frame.getRootPane().setBounds(insets.left + ww, insets.top + nh, remWidth, remHeight); }
|
public void layoutContainer(Container c) { Dimension dims = frame.getSize(); Insets insets = frame.getInsets(); dims.width -= insets.left + insets.right; dims.height -= insets.top + insets.bottom; frame.getRootPane().getGlassPane().setBounds(0, 0, dims.width, dims.height); int nh = 0; int sh = 0; int ew = 0; int ww = 0; if (northPane != null) { Dimension nDims = northPane.getPreferredSize(); nh = Math.min(nDims.height, dims.height); northPane.setBounds(insets.left, insets.top, dims.width, nh); } if (southPane != null) { Dimension sDims = southPane.getPreferredSize(); sh = Math.min(sDims.height, dims.height - nh); southPane.setBounds(insets.left, insets.top + dims.height - sh, dims.width, sh); } int remHeight = dims.height - sh - nh; if (westPane != null) { Dimension wDims = westPane.getPreferredSize(); ww = Math.min(dims.width, wDims.width); westPane.setBounds(insets.left, insets.top + nh, ww, remHeight); } if (eastPane != null) { Dimension eDims = eastPane.getPreferredSize(); ew = Math.min(eDims.width, dims.width - ww); eastPane.setBounds(insets.left + dims.width - ew, insets.top + nh, ew, remHeight); } int remWidth = dims.width - ww - ew; frame.getRootPane().setBounds(insets.left + ww, insets.top + nh, remWidth, remHeight); }
| 13,026
|
public void layoutContainer(Container c) { Dimension dims = frame.getSize(); Insets insets = frame.getInsets(); dims.width -= insets.left + insets.right; dims.height -= insets.top + insets.bottom; frame.getRootPane().getGlassPane().setBounds(0, 0, dims.width, dims.height); int nh = 0; int sh = 0; int ew = 0; int ww = 0; if (northPane != null) { Dimension nDims = northPane.getPreferredSize(); nh = Math.min(nDims.height, dims.height); northPane.setBounds(insets.left, insets.top, dims.width, nh); } if (southPane != null) { Dimension sDims = southPane.getPreferredSize(); sh = Math.min(sDims.height, dims.height - nh); southPane.setBounds(insets.left, insets.top + dims.height - sh, dims.width, sh); } int remHeight = dims.height - sh - nh; if (westPane != null) { Dimension wDims = westPane.getPreferredSize(); ww = Math.min(dims.width, wDims.width); westPane.setBounds(insets.left, insets.top + nh, ww, remHeight); } if (eastPane != null) { Dimension eDims = eastPane.getPreferredSize(); ew = Math.min(eDims.width, dims.width - ww); eastPane.setBounds(insets.left + dims.width - ew, insets.top + nh, ew, remHeight); } int remWidth = dims.width - ww - ew; frame.getRootPane().setBounds(insets.left + ww, insets.top + nh, remWidth, remHeight); }
|
public void layoutContainer(Container c) { Dimension dims = frame.getSize(); Insets insets = frame.getInsets(); dims.width -= insets.left + insets.right; dims.height -= insets.top + insets.bottom; frame.getRootPane().getGlassPane().setBounds(0, 0, dims.width, dims.height); int nh = 0; int sh = 0; int ew = 0; int ww = 0; if (northPane != null) { Dimension nDims = northPane.getPreferredSize(); nh = Math.min(nDims.height, dims.height); northPane.setBounds(insets.left, insets.top, dims.width, nh); } if (southPane != null) { Dimension sDims = southPane.getPreferredSize(); sh = Math.min(sDims.height, dims.height - nh); southPane.setBounds(insets.left, insets.top + dims.height - sh, dims.width, sh); } int remHeight = dims.height - sh - nh; if (westPane != null) { Dimension wDims = westPane.getPreferredSize(); ww = Math.min(dims.width, wDims.width); westPane.setBounds(insets.left, insets.top + nh, ww, remHeight); } if (eastPane != null) { Dimension eDims = eastPane.getPreferredSize(); ew = Math.min(eDims.width, dims.width - ww); eastPane.setBounds(insets.left + dims.width - ew, insets.top + nh, ew, remHeight); } int remWidth = dims.width - ww - ew; frame.getRootPane().setBounds(insets.left + ww, insets.top + nh, remWidth, remHeight); }
| 13,027
|
public void layoutContainer(Container c) { Dimension dims = frame.getSize(); Insets insets = frame.getInsets(); dims.width -= insets.left + insets.right; dims.height -= insets.top + insets.bottom; frame.getRootPane().getGlassPane().setBounds(0, 0, dims.width, dims.height); int nh = 0; int sh = 0; int ew = 0; int ww = 0; if (northPane != null) { Dimension nDims = northPane.getPreferredSize(); nh = Math.min(nDims.height, dims.height); northPane.setBounds(insets.left, insets.top, dims.width, nh); } if (southPane != null) { Dimension sDims = southPane.getPreferredSize(); sh = Math.min(sDims.height, dims.height - nh); southPane.setBounds(insets.left, insets.top + dims.height - sh, dims.width, sh); } int remHeight = dims.height - sh - nh; if (westPane != null) { Dimension wDims = westPane.getPreferredSize(); ww = Math.min(dims.width, wDims.width); westPane.setBounds(insets.left, insets.top + nh, ww, remHeight); } if (eastPane != null) { Dimension eDims = eastPane.getPreferredSize(); ew = Math.min(eDims.width, dims.width - ww); eastPane.setBounds(insets.left + dims.width - ew, insets.top + nh, ew, remHeight); } int remWidth = dims.width - ww - ew; frame.getRootPane().setBounds(insets.left + ww, insets.top + nh, remWidth, remHeight); }
|
public void layoutContainer(Container c) { Dimension dims = frame.getSize(); Insets insets = frame.getInsets(); dims.width -= insets.left + insets.right; dims.height -= insets.top + insets.bottom; frame.getRootPane().getGlassPane().setBounds(0, 0, dims.width, dims.height); int nh = 0; int sh = 0; int ew = 0; int ww = 0; if (northPane != null) { Dimension nDims = northPane.getPreferredSize(); nh = Math.min(nDims.height, dims.height); northPane.setBounds(insets.left, insets.top, dims.width, nh); } if (southPane != null) { Dimension sDims = southPane.getPreferredSize(); sh = Math.min(sDims.height, dims.height - nh); southPane.setBounds(insets.left, insets.top + dims.height - sh, dims.width, sh); } int remHeight = dims.height - sh - nh; if (westPane != null) { Dimension wDims = westPane.getPreferredSize(); ww = Math.min(dims.width, wDims.width); westPane.setBounds(insets.left, insets.top + nh, ww, remHeight); } if (eastPane != null) { Dimension eDims = eastPane.getPreferredSize(); ew = Math.min(eDims.width, dims.width - ww); eastPane.setBounds(insets.left + dims.width - ew, insets.top + nh, ew, remHeight); } int remWidth = dims.width - ww - ew; frame.getRootPane().setBounds(insets.left + ww, insets.top + nh, remWidth, remHeight); }
| 13,028
|
public void layoutContainer(Container c) { Dimension dims = frame.getSize(); Insets insets = frame.getInsets(); dims.width -= insets.left + insets.right; dims.height -= insets.top + insets.bottom; frame.getRootPane().getGlassPane().setBounds(0, 0, dims.width, dims.height); int nh = 0; int sh = 0; int ew = 0; int ww = 0; if (northPane != null) { Dimension nDims = northPane.getPreferredSize(); nh = Math.min(nDims.height, dims.height); northPane.setBounds(insets.left, insets.top, dims.width, nh); } if (southPane != null) { Dimension sDims = southPane.getPreferredSize(); sh = Math.min(sDims.height, dims.height - nh); southPane.setBounds(insets.left, insets.top + dims.height - sh, dims.width, sh); } int remHeight = dims.height - sh - nh; if (westPane != null) { Dimension wDims = westPane.getPreferredSize(); ww = Math.min(dims.width, wDims.width); westPane.setBounds(insets.left, insets.top + nh, ww, remHeight); } if (eastPane != null) { Dimension eDims = eastPane.getPreferredSize(); ew = Math.min(eDims.width, dims.width - ww); eastPane.setBounds(insets.left + dims.width - ew, insets.top + nh, ew, remHeight); } int remWidth = dims.width - ww - ew; frame.getRootPane().setBounds(insets.left + ww, insets.top + nh, remWidth, remHeight); }
|
public void layoutContainer(Container c) { Dimension dims = frame.getSize(); Insets insets = frame.getInsets(); dims.width -= insets.left + insets.right; dims.height -= insets.top + insets.bottom; frame.getRootPane().getGlassPane().setBounds(0, 0, dims.width, dims.height); int nh = 0; int sh = 0; int ew = 0; int ww = 0; if (northPane != null) { Dimension nDims = northPane.getPreferredSize(); nh = Math.min(nDims.height, dims.height); northPane.setBounds(insets.left, insets.top, dims.width, nh); } if (southPane != null) { Dimension sDims = southPane.getPreferredSize(); sh = Math.min(sDims.height, dims.height - nh); southPane.setBounds(insets.left, insets.top + dims.height - sh, dims.width, sh); } int remHeight = dims.height - sh - nh; if (westPane != null) { Dimension wDims = westPane.getPreferredSize(); ww = Math.min(dims.width, wDims.width); westPane.setBounds(insets.left, insets.top + nh, ww, remHeight); } if (eastPane != null) { Dimension eDims = eastPane.getPreferredSize(); ew = Math.min(eDims.width, dims.width - ww); eastPane.setBounds(insets.left + dims.width - ew, insets.top + nh, ew, remHeight); } int remWidth = dims.width - ww - ew; frame.getRootPane().setBounds(insets.left + ww, insets.top + nh, remWidth, remHeight); }
| 13,029
|
public void layoutContainer(Container c) { Dimension dims = frame.getSize(); Insets insets = frame.getInsets(); dims.width -= insets.left + insets.right; dims.height -= insets.top + insets.bottom; frame.getRootPane().getGlassPane().setBounds(0, 0, dims.width, dims.height); int nh = 0; int sh = 0; int ew = 0; int ww = 0; if (northPane != null) { Dimension nDims = northPane.getPreferredSize(); nh = Math.min(nDims.height, dims.height); northPane.setBounds(insets.left, insets.top, dims.width, nh); } if (southPane != null) { Dimension sDims = southPane.getPreferredSize(); sh = Math.min(sDims.height, dims.height - nh); southPane.setBounds(insets.left, insets.top + dims.height - sh, dims.width, sh); } int remHeight = dims.height - sh - nh; if (westPane != null) { Dimension wDims = westPane.getPreferredSize(); ww = Math.min(dims.width, wDims.width); westPane.setBounds(insets.left, insets.top + nh, ww, remHeight); } if (eastPane != null) { Dimension eDims = eastPane.getPreferredSize(); ew = Math.min(eDims.width, dims.width - ww); eastPane.setBounds(insets.left + dims.width - ew, insets.top + nh, ew, remHeight); } int remWidth = dims.width - ww - ew; frame.getRootPane().setBounds(insets.left + ww, insets.top + nh, remWidth, remHeight); }
|
public void layoutContainer(Container c) { Dimension dims = frame.getSize(); Insets insets = frame.getInsets(); dims.width -= insets.left + insets.right; dims.height -= insets.top + insets.bottom; frame.getRootPane().getGlassPane().setBounds(0, 0, dims.width, dims.height); int nh = 0; int sh = 0; int ew = 0; int ww = 0; if (northPane != null) { Dimension nDims = northPane.getPreferredSize(); nh = Math.min(nDims.height, dims.height); northPane.setBounds(insets.left, insets.top, dims.width, nh); } if (southPane != null) { Dimension sDims = southPane.getPreferredSize(); sh = Math.min(sDims.height, dims.height - nh); southPane.setBounds(insets.left, insets.top + dims.height - sh, dims.width, sh); } int remHeight = dims.height - sh - nh; if (westPane != null) { Dimension wDims = westPane.getPreferredSize(); ww = Math.min(dims.width, wDims.width); westPane.setBounds(insets.left, insets.top + nh, ww, remHeight); } if (eastPane != null) { Dimension eDims = eastPane.getPreferredSize(); ew = Math.min(eDims.width, dims.width - ww); eastPane.setBounds(insets.left + dims.width - ew, insets.top + nh, ew, remHeight); } int remWidth = dims.width - ww - ew; frame.getRootPane().setBounds(insets.left + ww, insets.top + nh, remWidth, remHeight); }
| 13,030
|
public void layoutContainer(Container c) { Dimension dims = frame.getSize(); Insets insets = frame.getInsets(); dims.width -= insets.left + insets.right; dims.height -= insets.top + insets.bottom; frame.getRootPane().getGlassPane().setBounds(0, 0, dims.width, dims.height); int nh = 0; int sh = 0; int ew = 0; int ww = 0; if (northPane != null) { Dimension nDims = northPane.getPreferredSize(); nh = Math.min(nDims.height, dims.height); northPane.setBounds(insets.left, insets.top, dims.width, nh); } if (southPane != null) { Dimension sDims = southPane.getPreferredSize(); sh = Math.min(sDims.height, dims.height - nh); southPane.setBounds(insets.left, insets.top + dims.height - sh, dims.width, sh); } int remHeight = dims.height - sh - nh; if (westPane != null) { Dimension wDims = westPane.getPreferredSize(); ww = Math.min(dims.width, wDims.width); westPane.setBounds(insets.left, insets.top + nh, ww, remHeight); } if (eastPane != null) { Dimension eDims = eastPane.getPreferredSize(); ew = Math.min(eDims.width, dims.width - ww); eastPane.setBounds(insets.left + dims.width - ew, insets.top + nh, ew, remHeight); } int remWidth = dims.width - ww - ew; frame.getRootPane().setBounds(insets.left + ww, insets.top + nh, remWidth, remHeight); }
|
public void layoutContainer(Container c) { Dimension dims = frame.getSize(); Insets insets = frame.getInsets(); dims.width -= insets.left + insets.right; dims.height -= insets.top + insets.bottom; frame.getRootPane().getGlassPane().setBounds(0, 0, dims.width, dims.height); int nh = 0; int sh = 0; int ew = 0; int ww = 0; if (northPane != null) { Dimension nDims = northPane.getPreferredSize(); nh = Math.min(nDims.height, dims.height); northPane.setBounds(insets.left, insets.top, dims.width, nh); } if (southPane != null) { Dimension sDims = southPane.getPreferredSize(); sh = Math.min(sDims.height, dims.height - nh); southPane.setBounds(insets.left, insets.top + dims.height - sh, dims.width, sh); } int remHeight = dims.height - sh - nh; if (westPane != null) { Dimension wDims = westPane.getPreferredSize(); ww = Math.min(dims.width, wDims.width); westPane.setBounds(insets.left, insets.top + nh, ww, remHeight); } if (eastPane != null) { Dimension eDims = eastPane.getPreferredSize(); ew = Math.min(eDims.width, dims.width - ww); eastPane.setBounds(insets.left + dims.width - ew, insets.top + nh, ew, remHeight); } int remWidth = dims.width - ww - ew; frame.getRootPane().setBounds(insets.left + ww, insets.top + nh, remWidth, remHeight); }
| 13,031
|
public void layoutContainer(Container c) { Dimension dims = frame.getSize(); Insets insets = frame.getInsets(); dims.width -= insets.left + insets.right; dims.height -= insets.top + insets.bottom; frame.getRootPane().getGlassPane().setBounds(0, 0, dims.width, dims.height); int nh = 0; int sh = 0; int ew = 0; int ww = 0; if (northPane != null) { Dimension nDims = northPane.getPreferredSize(); nh = Math.min(nDims.height, dims.height); northPane.setBounds(insets.left, insets.top, dims.width, nh); } if (southPane != null) { Dimension sDims = southPane.getPreferredSize(); sh = Math.min(sDims.height, dims.height - nh); southPane.setBounds(insets.left, insets.top + dims.height - sh, dims.width, sh); } int remHeight = dims.height - sh - nh; if (westPane != null) { Dimension wDims = westPane.getPreferredSize(); ww = Math.min(dims.width, wDims.width); westPane.setBounds(insets.left, insets.top + nh, ww, remHeight); } if (eastPane != null) { Dimension eDims = eastPane.getPreferredSize(); ew = Math.min(eDims.width, dims.width - ww); eastPane.setBounds(insets.left + dims.width - ew, insets.top + nh, ew, remHeight); } int remWidth = dims.width - ww - ew; frame.getRootPane().setBounds(insets.left + ww, insets.top + nh, remWidth, remHeight); }
|
public void layoutContainer(Container c) { Dimension dims = frame.getSize(); Insets insets = frame.getInsets(); dims.width -= insets.left + insets.right; dims.height -= insets.top + insets.bottom; frame.getRootPane().getGlassPane().setBounds(0, 0, dims.width, dims.height); int nh = 0; int sh = 0; int ew = 0; int ww = 0; if (northPane != null) { Dimension nDims = northPane.getPreferredSize(); nh = Math.min(nDims.height, dims.height); northPane.setBounds(insets.left, insets.top, dims.width, nh); } if (southPane != null) { Dimension sDims = southPane.getPreferredSize(); sh = Math.min(sDims.height, dims.height - nh); southPane.setBounds(insets.left, insets.top + dims.height - sh, dims.width, sh); } int remHeight = dims.height - sh - nh; if (westPane != null) { Dimension wDims = westPane.getPreferredSize(); ww = Math.min(dims.width, wDims.width); westPane.setBounds(insets.left, insets.top + nh, ww, remHeight); } if (eastPane != null) { Dimension eDims = eastPane.getPreferredSize(); ew = Math.min(eDims.width, dims.width - ww); eastPane.setBounds(insets.left + dims.width - ew, insets.top + nh, ew, remHeight); } int remWidth = dims.width - ww - ew; frame.getRootPane().setBounds(insets.left + ww, insets.top + nh, remWidth, remHeight); }
| 13,032
|
public void propertyChange(PropertyChangeEvent evt) { if (evt.getPropertyName().equals(JInternalFrame.IS_MAXIMUM_PROPERTY)) { if (frame.isMaximum()) maximizeFrame(frame); else minimizeFrame(frame); } else if (evt.getPropertyName().equals(JInternalFrame.IS_ICON_PROPERTY)) { if (frame.isIcon()) iconifyFrame(frame); else deiconifyFrame(frame); } else if (evt.getPropertyName().equals(JInternalFrame.IS_SELECTED_PROPERTY)) { if (frame.isSelected()) activateFrame(frame); else getDesktopManager().deactivateFrame(frame); } else if (evt.getPropertyName().equals(JInternalFrame.ROOT_PANE_PROPERTY) || evt.getPropertyName().equals(JInternalFrame.GLASS_PANE_PROPERTY)) { Component old = (Component) evt.getOldValue(); old.removeMouseListener(glassPaneDispatcher); old.removeMouseMotionListener(glassPaneDispatcher); Component newPane = (Component) evt.getNewValue(); newPane.addMouseListener(glassPaneDispatcher); newPane.addMouseMotionListener(glassPaneDispatcher); frame.revalidate(); } /* FIXME: need to add ancestor properties to JComponents. else if (evt.getPropertyName().equals(JComponent.ANCESTOR_PROPERTY)) { if (desktopPane != null) desktopPane.removeComponentListener(componentListener); desktopPane = frame.getDesktopPane(); if (desktopPane != null) desktopPane.addComponentListener(componentListener); } */ }
|
public void propertyChange(PropertyChangeEvent evt) { if (evt.getPropertyName().equals(JInternalFrame.IS_MAXIMUM_PROPERTY)) { if (frame.isMaximum()) maximizeFrame(frame); else minimizeFrame(frame); } else if (evt.getPropertyName().equals(JInternalFrame.IS_ICON_PROPERTY)) { if (frame.isIcon()) iconifyFrame(frame); else deiconifyFrame(frame); } else if (evt.getPropertyName().equals(JInternalFrame.IS_SELECTED_PROPERTY)) { if (frame.isSelected()) activateFrame(frame); else getDesktopManager().deactivateFrame(frame); } else if (evt.getPropertyName().equals(JInternalFrame.ROOT_PANE_PROPERTY) || evt.getPropertyName().equals(JInternalFrame.GLASS_PANE_PROPERTY)) { Component old = (Component) evt.getOldValue(); old.removeMouseListener(glassPaneDispatcher); old.removeMouseMotionListener(glassPaneDispatcher); Component newPane = (Component) evt.getNewValue(); newPane.addMouseListener(glassPaneDispatcher); newPane.addMouseMotionListener(glassPaneDispatcher); frame.revalidate(); } /* FIXME: need to add ancestor properties to JComponents. else if (evt.getPropertyName().equals(JComponent.ANCESTOR_PROPERTY)) { if (desktopPane != null) desktopPane.removeComponentListener(componentListener); desktopPane = frame.getDesktopPane(); if (desktopPane != null) desktopPane.addComponentListener(componentListener); } */ }
| 13,033
|
public void propertyChange(PropertyChangeEvent evt) { if (evt.getPropertyName().equals(JInternalFrame.IS_MAXIMUM_PROPERTY)) { if (frame.isMaximum()) maximizeFrame(frame); else minimizeFrame(frame); } else if (evt.getPropertyName().equals(JInternalFrame.IS_ICON_PROPERTY)) { if (frame.isIcon()) iconifyFrame(frame); else deiconifyFrame(frame); } else if (evt.getPropertyName().equals(JInternalFrame.IS_SELECTED_PROPERTY)) { if (frame.isSelected()) activateFrame(frame); else getDesktopManager().deactivateFrame(frame); } else if (evt.getPropertyName().equals(JInternalFrame.ROOT_PANE_PROPERTY) || evt.getPropertyName().equals(JInternalFrame.GLASS_PANE_PROPERTY)) { Component old = (Component) evt.getOldValue(); old.removeMouseListener(glassPaneDispatcher); old.removeMouseMotionListener(glassPaneDispatcher); Component newPane = (Component) evt.getNewValue(); newPane.addMouseListener(glassPaneDispatcher); newPane.addMouseMotionListener(glassPaneDispatcher); frame.revalidate(); } /* FIXME: need to add ancestor properties to JComponents. else if (evt.getPropertyName().equals(JComponent.ANCESTOR_PROPERTY)) { if (desktopPane != null) desktopPane.removeComponentListener(componentListener); desktopPane = frame.getDesktopPane(); if (desktopPane != null) desktopPane.addComponentListener(componentListener); } */ }
|
public void propertyChange(PropertyChangeEvent evt) { if (evt.getPropertyName().equals(JInternalFrame.IS_MAXIMUM_PROPERTY)) { if (frame.isMaximum()) maximizeFrame(frame); else minimizeFrame(frame); } else if (evt.getPropertyName().equals(JInternalFrame.IS_ICON_PROPERTY)) { if (frame.isIcon()) iconifyFrame(frame); else deiconifyFrame(frame); } else if (evt.getPropertyName().equals(JInternalFrame.IS_SELECTED_PROPERTY)) { if (frame.isSelected()) activateFrame(frame); else getDesktopManager().deactivateFrame(frame); } else if (evt.getPropertyName().equals(JInternalFrame.ROOT_PANE_PROPERTY) || evt.getPropertyName().equals(JInternalFrame.GLASS_PANE_PROPERTY)) { Component old = (Component) evt.getOldValue(); old.removeMouseListener(glassPaneDispatcher); old.removeMouseMotionListener(glassPaneDispatcher); Component newPane = (Component) evt.getNewValue(); newPane.addMouseListener(glassPaneDispatcher); newPane.addMouseMotionListener(glassPaneDispatcher); frame.revalidate(); } /* FIXME: need to add ancestor properties to JComponents. else if (evt.getPropertyName().equals(JComponent.ANCESTOR_PROPERTY)) { if (desktopPane != null) desktopPane.removeComponentListener(componentListener); desktopPane = frame.getDesktopPane(); if (desktopPane != null) desktopPane.addComponentListener(componentListener); } */ }
| 13,034
|
public void propertyChange(PropertyChangeEvent evt) { if (evt.getPropertyName().equals(JInternalFrame.IS_MAXIMUM_PROPERTY)) { if (frame.isMaximum()) maximizeFrame(frame); else minimizeFrame(frame); } else if (evt.getPropertyName().equals(JInternalFrame.IS_ICON_PROPERTY)) { if (frame.isIcon()) iconifyFrame(frame); else deiconifyFrame(frame); } else if (evt.getPropertyName().equals(JInternalFrame.IS_SELECTED_PROPERTY)) { if (frame.isSelected()) activateFrame(frame); else getDesktopManager().deactivateFrame(frame); } else if (evt.getPropertyName().equals(JInternalFrame.ROOT_PANE_PROPERTY) || evt.getPropertyName().equals(JInternalFrame.GLASS_PANE_PROPERTY)) { Component old = (Component) evt.getOldValue(); old.removeMouseListener(glassPaneDispatcher); old.removeMouseMotionListener(glassPaneDispatcher); Component newPane = (Component) evt.getNewValue(); newPane.addMouseListener(glassPaneDispatcher); newPane.addMouseMotionListener(glassPaneDispatcher); frame.revalidate(); } /* FIXME: need to add ancestor properties to JComponents. else if (evt.getPropertyName().equals(JComponent.ANCESTOR_PROPERTY)) { if (desktopPane != null) desktopPane.removeComponentListener(componentListener); desktopPane = frame.getDesktopPane(); if (desktopPane != null) desktopPane.addComponentListener(componentListener); } */ }
|
public void propertyChange(PropertyChangeEvent evt) { if (evt.getPropertyName().equals(JInternalFrame.IS_MAXIMUM_PROPERTY)) { if (frame.isMaximum()) maximizeFrame(frame); else minimizeFrame(frame); } else if (evt.getPropertyName().equals(JInternalFrame.IS_ICON_PROPERTY)) { if (frame.isIcon()) iconifyFrame(frame); else deiconifyFrame(frame); } else if (evt.getPropertyName().equals(JInternalFrame.IS_SELECTED_PROPERTY)) { if (frame.isSelected()) activateFrame(frame); else getDesktopManager().deactivateFrame(frame); } else if (evt.getPropertyName().equals(JInternalFrame.ROOT_PANE_PROPERTY) || evt.getPropertyName().equals(JInternalFrame.GLASS_PANE_PROPERTY)) { Component old = (Component) evt.getOldValue(); old.removeMouseListener(glassPaneDispatcher); old.removeMouseMotionListener(glassPaneDispatcher); Component newPane = (Component) evt.getNewValue(); newPane.addMouseListener(glassPaneDispatcher); newPane.addMouseMotionListener(glassPaneDispatcher); frame.revalidate(); } /* FIXME: need to add ancestor properties to JComponents. else if (evt.getPropertyName().equals(JComponent.ANCESTOR_PROPERTY)) { if (desktopPane != null) desktopPane.removeComponentListener(componentListener); desktopPane = frame.getDesktopPane(); if (desktopPane != null) desktopPane.addComponentListener(componentListener); } */ }
| 13,035
|
public void propertyChange(PropertyChangeEvent evt) { if (evt.getPropertyName().equals(JInternalFrame.IS_MAXIMUM_PROPERTY)) { if (frame.isMaximum()) maximizeFrame(frame); else minimizeFrame(frame); } else if (evt.getPropertyName().equals(JInternalFrame.IS_ICON_PROPERTY)) { if (frame.isIcon()) iconifyFrame(frame); else deiconifyFrame(frame); } else if (evt.getPropertyName().equals(JInternalFrame.IS_SELECTED_PROPERTY)) { if (frame.isSelected()) activateFrame(frame); else getDesktopManager().deactivateFrame(frame); } else if (evt.getPropertyName().equals(JInternalFrame.ROOT_PANE_PROPERTY) || evt.getPropertyName().equals(JInternalFrame.GLASS_PANE_PROPERTY)) { Component old = (Component) evt.getOldValue(); old.removeMouseListener(glassPaneDispatcher); old.removeMouseMotionListener(glassPaneDispatcher); Component newPane = (Component) evt.getNewValue(); newPane.addMouseListener(glassPaneDispatcher); newPane.addMouseMotionListener(glassPaneDispatcher); frame.revalidate(); } /* FIXME: need to add ancestor properties to JComponents. else if (evt.getPropertyName().equals(JComponent.ANCESTOR_PROPERTY)) { if (desktopPane != null) desktopPane.removeComponentListener(componentListener); desktopPane = frame.getDesktopPane(); if (desktopPane != null) desktopPane.addComponentListener(componentListener); } */ }
|
public void propertyChange(PropertyChangeEvent evt) { if (evt.getPropertyName().equals(JInternalFrame.IS_MAXIMUM_PROPERTY)) { if (frame.isMaximum()) maximizeFrame(frame); else minimizeFrame(frame); } else if (evt.getPropertyName().equals(JInternalFrame.IS_ICON_PROPERTY)) { if (frame.isIcon()) iconifyFrame(frame); else deiconifyFrame(frame); } else if (evt.getPropertyName().equals(JInternalFrame.IS_SELECTED_PROPERTY)) { if (frame.isSelected()) activateFrame(frame); else getDesktopManager().deactivateFrame(frame); } else if (evt.getPropertyName().equals(JInternalFrame.ROOT_PANE_PROPERTY) || evt.getPropertyName().equals( JInternalFrame.GLASS_PANE_PROPERTY)) { Component old = (Component) evt.getOldValue(); old.removeMouseListener(glassPaneDispatcher); old.removeMouseMotionListener(glassPaneDispatcher); Component newPane = (Component) evt.getNewValue(); newPane.addMouseListener(glassPaneDispatcher); newPane.addMouseMotionListener(glassPaneDispatcher); frame.revalidate(); } /* FIXME: need to add ancestor properties to JComponents. else if (evt.getPropertyName().equals(JComponent.ANCESTOR_PROPERTY)) { if (desktopPane != null) desktopPane.removeComponentListener(componentListener); desktopPane = frame.getDesktopPane(); if (desktopPane != null) desktopPane.addComponentListener(componentListener); } */ }
| 13,036
|
public void propertyChange(PropertyChangeEvent evt) { if (evt.getPropertyName().equals(JInternalFrame.IS_MAXIMUM_PROPERTY)) { if (frame.isMaximum()) maximizeFrame(frame); else minimizeFrame(frame); } else if (evt.getPropertyName().equals(JInternalFrame.IS_ICON_PROPERTY)) { if (frame.isIcon()) iconifyFrame(frame); else deiconifyFrame(frame); } else if (evt.getPropertyName().equals(JInternalFrame.IS_SELECTED_PROPERTY)) { if (frame.isSelected()) activateFrame(frame); else getDesktopManager().deactivateFrame(frame); } else if (evt.getPropertyName().equals(JInternalFrame.ROOT_PANE_PROPERTY) || evt.getPropertyName().equals(JInternalFrame.GLASS_PANE_PROPERTY)) { Component old = (Component) evt.getOldValue(); old.removeMouseListener(glassPaneDispatcher); old.removeMouseMotionListener(glassPaneDispatcher); Component newPane = (Component) evt.getNewValue(); newPane.addMouseListener(glassPaneDispatcher); newPane.addMouseMotionListener(glassPaneDispatcher); frame.revalidate(); } /* FIXME: need to add ancestor properties to JComponents. else if (evt.getPropertyName().equals(JComponent.ANCESTOR_PROPERTY)) { if (desktopPane != null) desktopPane.removeComponentListener(componentListener); desktopPane = frame.getDesktopPane(); if (desktopPane != null) desktopPane.addComponentListener(componentListener); } */ }
|
public void propertyChange(PropertyChangeEvent evt) { if (evt.getPropertyName().equals(JInternalFrame.IS_MAXIMUM_PROPERTY)) { if (frame.isMaximum()) maximizeFrame(frame); else minimizeFrame(frame); } else if (evt.getPropertyName().equals(JInternalFrame.IS_ICON_PROPERTY)) { if (frame.isIcon()) iconifyFrame(frame); else deiconifyFrame(frame); } else if (evt.getPropertyName().equals(JInternalFrame.IS_SELECTED_PROPERTY)) { if (frame.isSelected()) activateFrame(frame); else getDesktopManager().deactivateFrame(frame); } else if (evt.getPropertyName().equals(JInternalFrame.ROOT_PANE_PROPERTY) || evt.getPropertyName().equals(JInternalFrame.GLASS_PANE_PROPERTY)) { Component old = (Component) evt.getOldValue(); old.removeMouseListener(glassPaneDispatcher); old.removeMouseMotionListener(glassPaneDispatcher); Component newPane = (Component) evt.getNewValue(); newPane.addMouseListener(glassPaneDispatcher); newPane.addMouseMotionListener(glassPaneDispatcher); frame.revalidate(); } /* FIXME: need to add ancestor properties to JComponents. else if (evt.getPropertyName().equals(JComponent.ANCESTOR_PROPERTY)) { if (desktopPane != null) desktopPane.removeComponentListener(componentListener); desktopPane = frame.getDesktopPane(); if (desktopPane != null) desktopPane.addComponentListener(componentListener); } */ }
| 13,037
|
public void propertyChange(PropertyChangeEvent evt) { if (evt.getPropertyName().equals(JInternalFrame.IS_MAXIMUM_PROPERTY)) { if (frame.isMaximum()) maximizeFrame(frame); else minimizeFrame(frame); } else if (evt.getPropertyName().equals(JInternalFrame.IS_ICON_PROPERTY)) { if (frame.isIcon()) iconifyFrame(frame); else deiconifyFrame(frame); } else if (evt.getPropertyName().equals(JInternalFrame.IS_SELECTED_PROPERTY)) { if (frame.isSelected()) activateFrame(frame); else getDesktopManager().deactivateFrame(frame); } else if (evt.getPropertyName().equals(JInternalFrame.ROOT_PANE_PROPERTY) || evt.getPropertyName().equals(JInternalFrame.GLASS_PANE_PROPERTY)) { Component old = (Component) evt.getOldValue(); old.removeMouseListener(glassPaneDispatcher); old.removeMouseMotionListener(glassPaneDispatcher); Component newPane = (Component) evt.getNewValue(); newPane.addMouseListener(glassPaneDispatcher); newPane.addMouseMotionListener(glassPaneDispatcher); frame.revalidate(); } /* FIXME: need to add ancestor properties to JComponents. else if (evt.getPropertyName().equals(JComponent.ANCESTOR_PROPERTY)) { if (desktopPane != null) desktopPane.removeComponentListener(componentListener); desktopPane = frame.getDesktopPane(); if (desktopPane != null) desktopPane.addComponentListener(componentListener); } */ }
|
public void propertyChange(PropertyChangeEvent evt) { if (evt.getPropertyName().equals(JInternalFrame.IS_MAXIMUM_PROPERTY)) { if (frame.isMaximum()) maximizeFrame(frame); else minimizeFrame(frame); } else if (evt.getPropertyName().equals(JInternalFrame.IS_ICON_PROPERTY)) { if (frame.isIcon()) iconifyFrame(frame); else deiconifyFrame(frame); } else if (evt.getPropertyName().equals(JInternalFrame.IS_SELECTED_PROPERTY)) { if (frame.isSelected()) activateFrame(frame); else getDesktopManager().deactivateFrame(frame); } else if (evt.getPropertyName().equals(JInternalFrame.ROOT_PANE_PROPERTY) || evt.getPropertyName().equals(JInternalFrame.GLASS_PANE_PROPERTY)) { Component old = (Component) evt.getOldValue(); old.removeMouseListener(glassPaneDispatcher); old.removeMouseMotionListener(glassPaneDispatcher); Component newPane = (Component) evt.getNewValue(); newPane.addMouseListener(glassPaneDispatcher); newPane.addMouseMotionListener(glassPaneDispatcher); frame.revalidate(); } /* FIXME: need to add ancestor properties to JComponents. else if (evt.getPropertyName().equals(JComponent.ANCESTOR_PROPERTY)) { if (desktopPane != null) desktopPane.removeComponentListener(componentListener); desktopPane = frame.getDesktopPane(); if (desktopPane != null) desktopPane.addComponentListener(componentListener); } */ }
| 13,038
|
public void propertyChange(PropertyChangeEvent evt) { if (evt.getPropertyName().equals(JInternalFrame.IS_MAXIMUM_PROPERTY)) { if (frame.isMaximum()) maximizeFrame(frame); else minimizeFrame(frame); } else if (evt.getPropertyName().equals(JInternalFrame.IS_ICON_PROPERTY)) { if (frame.isIcon()) iconifyFrame(frame); else deiconifyFrame(frame); } else if (evt.getPropertyName().equals(JInternalFrame.IS_SELECTED_PROPERTY)) { if (frame.isSelected()) activateFrame(frame); else getDesktopManager().deactivateFrame(frame); } else if (evt.getPropertyName().equals(JInternalFrame.ROOT_PANE_PROPERTY) || evt.getPropertyName().equals(JInternalFrame.GLASS_PANE_PROPERTY)) { Component old = (Component) evt.getOldValue(); old.removeMouseListener(glassPaneDispatcher); old.removeMouseMotionListener(glassPaneDispatcher); Component newPane = (Component) evt.getNewValue(); newPane.addMouseListener(glassPaneDispatcher); newPane.addMouseMotionListener(glassPaneDispatcher); frame.revalidate(); } /* FIXME: need to add ancestor properties to JComponents. else if (evt.getPropertyName().equals(JComponent.ANCESTOR_PROPERTY)) { if (desktopPane != null) desktopPane.removeComponentListener(componentListener); desktopPane = frame.getDesktopPane(); if (desktopPane != null) desktopPane.addComponentListener(componentListener); } */ }
|
public void propertyChange(PropertyChangeEvent evt) { if (evt.getPropertyName().equals(JInternalFrame.IS_MAXIMUM_PROPERTY)) { if (frame.isMaximum()) maximizeFrame(frame); else minimizeFrame(frame); } else if (evt.getPropertyName().equals(JInternalFrame.IS_ICON_PROPERTY)) { if (frame.isIcon()) iconifyFrame(frame); else deiconifyFrame(frame); } else if (evt.getPropertyName().equals(JInternalFrame.IS_SELECTED_PROPERTY)) { if (frame.isSelected()) activateFrame(frame); else getDesktopManager().deactivateFrame(frame); } else if (evt.getPropertyName().equals(JInternalFrame.ROOT_PANE_PROPERTY) || evt.getPropertyName().equals(JInternalFrame.GLASS_PANE_PROPERTY)) { Component old = (Component) evt.getOldValue(); old.removeMouseListener(glassPaneDispatcher); old.removeMouseMotionListener(glassPaneDispatcher); Component newPane = (Component) evt.getNewValue(); newPane.addMouseListener(glassPaneDispatcher); newPane.addMouseMotionListener(glassPaneDispatcher); frame.revalidate(); } /* FIXME: need to add ancestor properties to JComponents. else if (evt.getPropertyName().equals(JComponent.ANCESTOR_PROPERTY)) { if (desktopPane != null) desktopPane.removeComponentListener(componentListener); desktopPane = frame.getDesktopPane(); if (desktopPane != null) desktopPane.addComponentListener(componentListener); } */ }
| 13,039
|
public void propertyChange(PropertyChangeEvent evt) { if (evt.getPropertyName().equals(JInternalFrame.IS_MAXIMUM_PROPERTY)) { if (frame.isMaximum()) maximizeFrame(frame); else minimizeFrame(frame); } else if (evt.getPropertyName().equals(JInternalFrame.IS_ICON_PROPERTY)) { if (frame.isIcon()) iconifyFrame(frame); else deiconifyFrame(frame); } else if (evt.getPropertyName().equals(JInternalFrame.IS_SELECTED_PROPERTY)) { if (frame.isSelected()) activateFrame(frame); else getDesktopManager().deactivateFrame(frame); } else if (evt.getPropertyName().equals(JInternalFrame.ROOT_PANE_PROPERTY) || evt.getPropertyName().equals(JInternalFrame.GLASS_PANE_PROPERTY)) { Component old = (Component) evt.getOldValue(); old.removeMouseListener(glassPaneDispatcher); old.removeMouseMotionListener(glassPaneDispatcher); Component newPane = (Component) evt.getNewValue(); newPane.addMouseListener(glassPaneDispatcher); newPane.addMouseMotionListener(glassPaneDispatcher); frame.revalidate(); } /* FIXME: need to add ancestor properties to JComponents. else if (evt.getPropertyName().equals(JComponent.ANCESTOR_PROPERTY)) { if (desktopPane != null) desktopPane.removeComponentListener(componentListener); desktopPane = frame.getDesktopPane(); if (desktopPane != null) desktopPane.addComponentListener(componentListener); } */ }
|
public void propertyChange(PropertyChangeEvent evt) { if (evt.getPropertyName().equals(JInternalFrame.IS_MAXIMUM_PROPERTY)) { if (frame.isMaximum()) maximizeFrame(frame); else minimizeFrame(frame); } else if (evt.getPropertyName().equals(JInternalFrame.IS_ICON_PROPERTY)) { if (frame.isIcon()) iconifyFrame(frame); else deiconifyFrame(frame); } else if (evt.getPropertyName().equals(JInternalFrame.IS_SELECTED_PROPERTY)) { if (frame.isSelected()) activateFrame(frame); else getDesktopManager().deactivateFrame(frame); } else if (evt.getPropertyName().equals(JInternalFrame.ROOT_PANE_PROPERTY) || evt.getPropertyName().equals(JInternalFrame.GLASS_PANE_PROPERTY)) { Component old = (Component) evt.getOldValue(); old.removeMouseListener(glassPaneDispatcher); old.removeMouseMotionListener(glassPaneDispatcher); Component newPane = (Component) evt.getNewValue(); newPane.addMouseListener(glassPaneDispatcher); newPane.addMouseMotionListener(glassPaneDispatcher); frame.revalidate(); } /* FIXME: need to add ancestor properties to JComponents. else if (evt.getPropertyName().equals(JComponent.ANCESTOR_PROPERTY)) { if (desktopPane != null) desktopPane.removeComponentListener(componentListener); desktopPane = frame.getDesktopPane(); if (desktopPane != null) desktopPane.addComponentListener(componentListener); } */ }
| 13,040
|
public void vetoableChange(PropertyChangeEvent e) throws PropertyVetoException { if (e.getPropertyName().equals(JInternalFrame.IS_CLOSED_PROPERTY)) { if (frame.getDefaultCloseOperation() == JInternalFrame.HIDE_ON_CLOSE) { frame.setVisible(false); frame.getDesktopPane().repaint(); throw new PropertyVetoException ("close operation is HIDE_ON_CLOSE\n", e); } else if (frame.getDefaultCloseOperation() == JInternalFrame.DISPOSE_ON_CLOSE) closeFrame(frame); else throw new PropertyVetoException ("close operation is DO_NOTHING_ON_CLOSE\n", e); } }
|
public void vetoableChange(PropertyChangeEvent e) throws PropertyVetoException { if (e.getPropertyName().equals(JInternalFrame.IS_CLOSED_PROPERTY)) { if (frame.getDefaultCloseOperation() == JInternalFrame.HIDE_ON_CLOSE) { frame.setVisible(false); frame.getDesktopPane().repaint(); throw new PropertyVetoException ("close operation is HIDE_ON_CLOSE\n", e); } else if (frame.getDefaultCloseOperation() == JInternalFrame.DISPOSE_ON_CLOSE) closeFrame(frame); else throw new PropertyVetoException ("close operation is DO_NOTHING_ON_CLOSE\n", e); } }
| 13,041
|
public void vetoableChange(PropertyChangeEvent e) throws PropertyVetoException { if (e.getPropertyName().equals(JInternalFrame.IS_CLOSED_PROPERTY)) { if (frame.getDefaultCloseOperation() == JInternalFrame.HIDE_ON_CLOSE) { frame.setVisible(false); frame.getDesktopPane().repaint(); throw new PropertyVetoException ("close operation is HIDE_ON_CLOSE\n", e); } else if (frame.getDefaultCloseOperation() == JInternalFrame.DISPOSE_ON_CLOSE) closeFrame(frame); else throw new PropertyVetoException ("close operation is DO_NOTHING_ON_CLOSE\n", e); } }
|
public void vetoableChange(PropertyChangeEvent e) throws PropertyVetoException { if (e.getPropertyName().equals(JInternalFrame.IS_CLOSED_PROPERTY)) { if (frame.getDefaultCloseOperation() == JInternalFrame.HIDE_ON_CLOSE) { frame.setVisible(false); frame.getDesktopPane().repaint(); throw new PropertyVetoException( "close operation is HIDE_ON_CLOSE\n", e); } else if (frame.getDefaultCloseOperation() == JInternalFrame.DISPOSE_ON_CLOSE) closeFrame(frame); else throw new PropertyVetoException ("close operation is DO_NOTHING_ON_CLOSE\n", e); } }
| 13,042
|
public void vetoableChange(PropertyChangeEvent e) throws PropertyVetoException { if (e.getPropertyName().equals(JInternalFrame.IS_CLOSED_PROPERTY)) { if (frame.getDefaultCloseOperation() == JInternalFrame.HIDE_ON_CLOSE) { frame.setVisible(false); frame.getDesktopPane().repaint(); throw new PropertyVetoException ("close operation is HIDE_ON_CLOSE\n", e); } else if (frame.getDefaultCloseOperation() == JInternalFrame.DISPOSE_ON_CLOSE) closeFrame(frame); else throw new PropertyVetoException ("close operation is DO_NOTHING_ON_CLOSE\n", e); } }
|
public void vetoableChange(PropertyChangeEvent e) throws PropertyVetoException { if (e.getPropertyName().equals(JInternalFrame.IS_CLOSED_PROPERTY)) { if (frame.getDefaultCloseOperation() == JInternalFrame.HIDE_ON_CLOSE) { frame.setVisible(false); frame.getDesktopPane().repaint(); throw new PropertyVetoException ("close operation is HIDE_ON_CLOSE\n", e); } else if (frame.getDefaultCloseOperation() == JInternalFrame.DISPOSE_ON_CLOSE) closeFrame(frame); else throw new PropertyVetoException( "close operation is DO_NOTHING_ON_CLOSE\n", e); } }
| 13,043
|
protected void installDefaults() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); Border border = defaults.getBorder("InternalFrame.border"); frame.setBorder(border); frame.setFrameIcon(defaults.getIcon("InternalFrame.icon")); // InternalFrames are invisible by default. frame.setVisible(false); }
|
protected void installDefaults() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); Border border = defaults.getBorder("InternalFrame.border"); frame.setBorder(border); frame.setFrameIcon(defaults.getIcon("InternalFrame.icon")); // InternalFrames are invisible by default. frame.setVisible(false); }
| 13,044
|
public void installUI(JComponent c) { if (c instanceof JInternalFrame) { frame = (JInternalFrame) c; internalFrameLayout = createLayoutManager(); frame.setLayout(internalFrameLayout); ((JComponent) frame.getRootPane().getGlassPane()).setOpaque(false); frame.getRootPane().getGlassPane().setVisible(true); installDefaults(); installListeners(); installComponents(); installKeyboardActions(); frame.setOpaque(true); frame.invalidate(); } }
|
public void installUI(JComponent c) { if (c instanceof JInternalFrame) { frame = (JInternalFrame) c; internalFrameLayout = createLayoutManager(); frame.setLayout(internalFrameLayout); ((JComponent) frame.getRootPane().getGlassPane()).setOpaque(false); frame.getRootPane().getGlassPane().setVisible(true); installDefaults(); installListeners(); installComponents(); installKeyboardActions(); frame.setOpaque(true); frame.invalidate(); } }
| 13,045
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.