Author: scooter
Date: 2012-06-02 09:38:34 -0700 (Sat, 02 Jun 2012)
New Revision: 29433
Modified:
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/cyannotator/listeners/CanvasKeyListener.java
Log:
Fix CanvasKeyListener resize option.
Modified:
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/cyannotator/listeners/CanvasKeyListener.java
===================================================================
---
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/cyannotator/listeners/CanvasKeyListener.java
2012-06-02 05:08:43 UTC (rev 29432)
+++
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/cyannotator/listeners/CanvasKeyListener.java
2012-06-02 16:38:34 UTC (rev 29433)
@@ -40,22 +40,18 @@
Component c = annotation.getComponent();
int x=c.getX(), y=c.getY();
int shiftMask = e.getModifiers() &
KeyEvent.SHIFT_DOWN_MASK;
- if (annotation instanceof ShapeAnnotation &&
- (shiftMask == KeyEvent.SHIFT_DOWN_MASK)) {
+ if (annotation instanceof ShapeAnnotation &&
e.isShiftDown()) {
ShapeAnnotation sa =
(ShapeAnnotation)annotation;
int width = c.getWidth(), height =
c.getHeight();
if (code == KeyEvent.VK_UP) {
- y-=move; height += move;
+ height -= move;
} else if (code == KeyEvent.VK_DOWN) {
height += move;
} else if (code == KeyEvent.VK_LEFT) {
- x-=move; width += move;
+ width -= move;
} else if (code == KeyEvent.VK_RIGHT) {
width += move;
}
-
- //Adjust the locations of the selected
annotations
- sa.getComponent().setLocation(x,y);
// Adjust the size of the selected
annotations
sa.setSize((double)width,
(double)height);
} else {
--
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.