Author: kono
Date: 2011-11-03 15:15:22 -0700 (Thu, 03 Nov 2011)
New Revision: 27398
Modified:
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/view/CytoscapeDesktop.java
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/view/NetworkViewManager.java
Log:
fixes #444 JInternalFrame will be moved to original position if title bar is
located outside of the desktop pane.
Modified:
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/view/CytoscapeDesktop.java
===================================================================
---
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/view/CytoscapeDesktop.java
2011-11-03 21:20:18 UTC (rev 27397)
+++
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/view/CytoscapeDesktop.java
2011-11-03 22:15:22 UTC (rev 27398)
@@ -87,11 +87,11 @@
* The CytoscapeDesktop is the central Window for working with Cytoscape
*/
public class CytoscapeDesktop extends JFrame implements CySwingApplication,
CytoscapeStartListener,
-
SessionLoadedListener, SessionAboutToBeSavedListener {
+ SessionLoadedListener, SessionAboutToBeSavedListener {
private final static long serialVersionUID = 1202339866271348L;
- private static final Dimension DEF_DESKTOP_SIZE = new Dimension(950,
720);
+ private static final Dimension DEF_DESKTOP_SIZE = new Dimension(1000,
720);
private static final String SMALL_ICON = "/images/c16.png";
private static final int DEVIDER_SIZE = 4;
private static final Map<String, CytoPanelName> CYTOPANEL_NAMES = new
LinkedHashMap<String, CytoPanelName>();
Modified:
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/view/NetworkViewManager.java
===================================================================
---
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/view/NetworkViewManager.java
2011-11-03 21:20:18 UTC (rev 27397)
+++
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/view/NetworkViewManager.java
2011-11-03 22:15:22 UTC (rev 27398)
@@ -38,6 +38,10 @@
import java.awt.Component;
import java.awt.Dimension;
+import java.awt.Point;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
import java.beans.PropertyVetoException;
import java.math.BigInteger;
import java.util.HashMap;
@@ -341,6 +345,17 @@
// it
final String title =
view.getModel().getCyRow().get(CyTableEntry.NAME, String.class);
final JInternalFrame iframe = new JInternalFrame(title, true,
true, true, true);
+
+ // This is for force move title bar to the desktop if it's out
of range.
+ iframe.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseReleased(MouseEvent e) {
+ final Point originalPoint =
iframe.getLocation();
+ if(originalPoint.y < 0)
+ iframe.setLocation(originalPoint.x, 0);
+ }
+ });
+
iframe.addInternalFrameListener(new InternalFrameAdapter() {
public void internalFrameClosing(InternalFrameEvent e) {
--
You received this message because you are subscribed to the Google Groups
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/cytoscape-cvs?hl=en.