Author: kono
Date: 2012-01-12 15:43:10 -0800 (Thu, 12 Jan 2012)
New Revision: 28008
Modified:
core3/api/trunk/presentation-api/src/main/java/org/cytoscape/view/presentation/property/ArrowShapeVisualProperty.java
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DGraphView.java
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DingCanvas.java
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DingRenderingEngineFactory.java
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/InnerCanvas.java
Log:
Some cleanup had been done for tooltip bug. Still do not know why it's not
rendered in the JInternalFarame. It works when it's in regular JPanel.
Modified:
core3/api/trunk/presentation-api/src/main/java/org/cytoscape/view/presentation/property/ArrowShapeVisualProperty.java
===================================================================
---
core3/api/trunk/presentation-api/src/main/java/org/cytoscape/view/presentation/property/ArrowShapeVisualProperty.java
2012-01-12 23:38:31 UTC (rev 28007)
+++
core3/api/trunk/presentation-api/src/main/java/org/cytoscape/view/presentation/property/ArrowShapeVisualProperty.java
2012-01-12 23:43:10 UTC (rev 28008)
@@ -16,7 +16,7 @@
public final class ArrowShapeVisualProperty extends
AbstractVisualProperty<ArrowShape> {
// Preset arrow shapes
- public static final ArrowShape NONE = new ArrowShapeImpl("No Arrow",
"NONE");
+ public static final ArrowShape NONE = new ArrowShapeImpl("None",
"NONE");
public static final ArrowShape DIAMOND = new ArrowShapeImpl("Diamond",
"DIAMOND");
public static final ArrowShape DELTA = new ArrowShapeImpl("Delta",
"DELTA");
public static final ArrowShape ARROW = new ArrowShapeImpl("Arrow",
"ARROW");
Modified:
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DGraphView.java
===================================================================
---
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DGraphView.java
2012-01-12 23:38:31 UTC (rev 28007)
+++
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DGraphView.java
2012-01-12 23:43:10 UTC (rev 28008)
@@ -487,11 +487,9 @@
m_defaultNodeXMax = m_defaultNodeXMin + DNodeView.DEFAULT_WIDTH;
m_defaultNodeYMax = m_defaultNodeYMin +
DNodeView.DEFAULT_HEIGHT;
m_networkCanvas = new InnerCanvas(m_lock, this, undo);
- m_backgroundCanvas = new ArbitraryGraphicsCanvas(model, this,
- m_networkCanvas, Color.white, true, true);
+ m_backgroundCanvas = new ArbitraryGraphicsCanvas(model, this,
m_networkCanvas, Color.white, true, true);
addViewportChangeListener(m_backgroundCanvas);
- m_foregroundCanvas = new ArbitraryGraphicsCanvas(model, this,
- m_networkCanvas, Color.white, true, false);
+ m_foregroundCanvas = new ArbitraryGraphicsCanvas(model, this,
m_networkCanvas, Color.white, true, false);
addViewportChangeListener(m_foregroundCanvas);
m_selectedNodes = new IntBTree();
m_selectedEdges = new IntBTree();
Modified:
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DingCanvas.java
===================================================================
---
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DingCanvas.java
2012-01-12 23:38:31 UTC (rev 28007)
+++
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DingCanvas.java
2012-01-12 23:43:10 UTC (rev 28008)
@@ -52,6 +52,9 @@
* and org.cytoscape.ding.impl.ArbitraryGraphicsCanvas.
*/
public abstract class DingCanvas extends JComponent {
+
+ private static final long serialVersionUID = -789701521899087090L;
+
/**
* ref to image we maintain
*/
Modified:
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DingRenderingEngineFactory.java
===================================================================
---
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DingRenderingEngineFactory.java
2012-01-12 23:38:31 UTC (rev 28007)
+++
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DingRenderingEngineFactory.java
2012-01-12 23:43:10 UTC (rev 28008)
@@ -127,15 +127,8 @@
if (presentationContainer instanceof JInternalFrame) {
final JInternalFrame inFrame = (JInternalFrame)
presentationContainer;
-
- final InternalFrameComponent internalFrameComp
=
- new
InternalFrameComponent(inFrame.getLayeredPane(), dgv);
- inFrame.getContentPane().add(internalFrameComp);
-
-// // TODO - not sure this layered pane bit is
optimal
-// inFrame.setContentPane(dgv.getContainer(inFrame
-// .getLayeredPane()));
-// // dgv.addTransferComponent(desktopPane);
+ final InternalFrameComponent ifComp = new
InternalFrameComponent(inFrame.getLayeredPane(), dgv);
+ inFrame.getContentPane().add(ifComp);
} else {
final JComponent component = (JComponent)
presentationContainer;
component.setLayout(new BorderLayout());
Modified:
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/InnerCanvas.java
===================================================================
---
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/InnerCanvas.java
2012-01-12 23:38:31 UTC (rev 28007)
+++
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/InnerCanvas.java
2012-01-12 23:43:10 UTC (rev 28008)
@@ -83,12 +83,10 @@
import org.cytoscape.work.undo.UndoSupport;
/**
- *
+ * Canvas to be used for drawing actual network visualization
*/
-public class InnerCanvas extends DingCanvas implements MouseListener,
MouseMotionListener,
- DropTargetListener,
- KeyListener,
- MouseWheelListener {
+public class InnerCanvas extends DingCanvas implements MouseListener,
MouseMotionListener, DropTargetListener,
+ KeyListener, MouseWheelListener {
private final static long serialVersionUID = 1202416511420671L;
@@ -118,19 +116,10 @@
private boolean isPrinting = false;
private PopupMenuHelper popup;
- //final boolean[] m_printingTextAsShape = new boolean[1];
FontMetrics m_fontMetrics = null;
private boolean NodeMovement = true;
- /**
- * String used to compare against os.name System property -
- * to determine if we are running on Windows platform.
- */
- static final String MAC_OS_ID = "mac";
-
- private DropTarget dropTarget;
-
// for turning selection rectangle on and off
private boolean selecting = true;
@@ -166,7 +155,7 @@
addMouseWheelListener(this);
addKeyListener(this);
setFocusable(true);
- dropTarget = new DropTarget(this, DnDConstants.ACTION_COPY,
this);
+ new DropTarget(this, DnDConstants.ACTION_COPY, this);
popup = new PopupMenuHelper(m_view, this);
mousePressedDelegator = new MousePressedDelegator();
@@ -177,14 +166,7 @@
addEdgeMode = new AddEdgeStateMonitor(this,m_view);
}
- /**
- * DOCUMENT ME!
- *
- * @param x DOCUMENT ME!
- * @param y DOCUMENT ME!
- * @param width DOCUMENT ME!
- * @param height DOCUMENT ME!
- */
+ @Override
public void setBounds(int x, int y, int width, int height) {
super.setBounds(x, y, width, height);
@@ -200,8 +182,8 @@
}
}
-
-
+
+ @Override
public void update(Graphics g) {
if (m_grafx == null)
return;
@@ -255,20 +237,14 @@
}
}
- /**
- * DOCUMENT ME!
- *
- * @param g DOCUMENT ME!
- */
+
+ @Override
public void paint(Graphics g) {
update(g);
}
- /**
- * DOCUMENT ME!
- *
- * @param g Usually Graphics2D object for drawing network view as image.
- */
+
+ @Override
public void print(Graphics g) {
isPrinting = true;
renderGraph(new GraphGraphics(
@@ -277,11 +253,8 @@
isPrinting = false;
}
- /**
- * Print routine which corrects bug 1471/1495
- *
- * @param g DOCUMENT ME!
- */
+
+ @Override
public void printNoImposter(Graphics g) {
isPrinting = true;
final Image img = new BufferedImage(getWidth(), getHeight(),
BufferedImage.TYPE_INT_ARGB);
@@ -297,46 +270,43 @@
return isPrinting;
}
- /**
- * This method exposes the JComponent processMouseEvent so that
- * canvases on top of us can pass events they don't want down.
- *
- * @param e the MouseEvent to process
- */
- public void processMouseEvent(MouseEvent e) {
- super.processMouseEvent(e);
- }
-
/**
+ * This method exposes the JComponent processMouseEvent so that
canvases on
+ * top of us can pass events they don't want down.
*
+ * @param e
+ * the MouseEvent to process
*/
- public void mouseWheelMoved(MouseWheelEvent e) {
- adjustZoom(e.getWheelRotation());
+ @Override
+ public void processMouseEvent(MouseEvent e) {
+ super.processMouseEvent(e);
}
- //
- // MouseMotionListener
- //
+ @Override
+ public void mouseWheelMoved(MouseWheelEvent e) {
+ adjustZoom(e.getWheelRotation());
+ }
+
+
public void mouseDragged(MouseEvent e) {
mouseDraggedDelegator.delegateMouseDragEvent(e);
}
+ @Override
public void mouseMoved(MouseEvent e) {
- if ( addEdgeMode.addingEdge() )
+
+ if (addEdgeMode.addingEdge())
addEdgeMode.drawRubberBand(e);
- else
- setToolTipText( getToolTipText( e.getPoint() ) );
+ else {
+ final String tooltipText = getToolTipText(e.getPoint());
+ setToolTipText(tooltipText);
+ }
}
- //
- // MouseListener
- //
public void mouseClicked(MouseEvent e) { }
-
public void mouseEntered(MouseEvent e) { }
-
public void mouseExited(MouseEvent e) { }
public void mouseReleased(MouseEvent e) {
@@ -352,8 +322,6 @@
}
- // KeyListener
-
/**
* Handles key press events. Currently used with the up/down,
left/right arrow
* keys. Pressing any of the listed keys will move the selected nodes
one pixel
@@ -662,12 +630,13 @@
* Returns the tool tip text for the specified location if any exists
first
* checking nodes, then edges, and then returns null if it's empty
space.
*/
- private String getToolTipText(Point p) {
+ private String getToolTipText(final Point p) {
// display tips for nodes before edges
- NodeView nv = m_view.getPickedNodeView(p);
- if (nv != null)
- return ((DNodeView) nv).getToolTip();
-
+ final DNodeView nv = (DNodeView) m_view.getPickedNodeView(p);
+ if (nv != null) {
+ final String tooltip = nv.getToolTip();
+ return tooltip;
+ }
// only display edge tool tips if the LOD is sufficient
if ((m_lastRenderDetail & GraphRenderer.LOD_HIGH_DETAIL) != 0) {
EdgeView ev = m_view.getPickedEdgeView(p);
@@ -1448,5 +1417,4 @@
public double getScaleFactor(){
return m_scaleFactor;
}
-
}
--
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.