Skip to content
Snippets Groups Projects
Commit 9e8b1372 authored by tjc's avatar tjc
Browse files

use paintComponent for plots

git-svn-id: svn+ssh://svn.internal.sanger.ac.uk/repos/svn/pathsoft/artemis/trunk@2069 ee4ac58c-ac51-4696-9907-e4b3aa274f04
parent cf80122b
No related branches found
No related tags found
No related merge requests found
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* *
* $Header: //tmp/pathsoft/artemis/uk/ac/sanger/artemis/components/BasePlot.java,v 1.1 2004-06-09 09:46:04 tjc Exp $ * $Header: //tmp/pathsoft/artemis/uk/ac/sanger/artemis/components/BasePlot.java,v 1.2 2004-11-24 09:38:20 tjc Exp $
**/ **/
package uk.ac.sanger.artemis.components; package uk.ac.sanger.artemis.components;
...@@ -40,7 +40,7 @@ import javax.swing.*; ...@@ -40,7 +40,7 @@ import javax.swing.*;
* scale is tied to a FeatureDisplay component. * scale is tied to a FeatureDisplay component.
* *
* @author Kim Rutherford * @author Kim Rutherford
* @version $Id: BasePlot.java,v 1.1 2004-06-09 09:46:04 tjc Exp $ * @version $Id: BasePlot.java,v 1.2 2004-11-24 09:38:20 tjc Exp $
**/ **/
public class BasePlot extends Plot public class BasePlot extends Plot
...@@ -181,7 +181,7 @@ public class BasePlot extends Plot ...@@ -181,7 +181,7 @@ public class BasePlot extends Plot
selection_end_marker = null; selection_end_marker = null;
} }
repaintCanvas (); repaint();
} }
/** /**
...@@ -191,7 +191,7 @@ public class BasePlot extends Plot ...@@ -191,7 +191,7 @@ public class BasePlot extends Plot
public void selectionChanged (SelectionChangeEvent event) { public void selectionChanged (SelectionChangeEvent event) {
selection_start_marker = null; selection_start_marker = null;
selection_end_marker = null; selection_end_marker = null;
repaintCanvas (); repaint();
} }
/** /**
...@@ -500,7 +500,7 @@ public class BasePlot extends Plot ...@@ -500,7 +500,7 @@ public class BasePlot extends Plot
* canvas (see drawCrossHair ()). * canvas (see drawCrossHair ()).
**/ **/
protected int getPointPosition (final int canvas_x_position) { protected int getPointPosition (final int canvas_x_position) {
return (int) ((1.0 * canvas_x_position / getCanvas ().getSize ().width) * return (int) ((1.0 * canvas_x_position / getSize ().width) *
getWidthInBases ()) + getStart (); getWidthInBases ()) + getStart ();
} }
...@@ -509,7 +509,7 @@ public class BasePlot extends Plot ...@@ -509,7 +509,7 @@ public class BasePlot extends Plot
**/ **/
private int getCanvasPosition (final int base) { private int getCanvasPosition (final int base) {
return (int) ((1.0 * base - getStart ()) / getWidthInBases () * return (int) ((1.0 * base - getStart ()) / getWidthInBases () *
getCanvas ().getSize ().width); getSize ().width);
} }
/** /**
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* *
* $Header: //tmp/pathsoft/artemis/uk/ac/sanger/artemis/components/BasePlotGroup.java,v 1.4 2004-11-17 13:19:43 tjc Exp $ * $Header: //tmp/pathsoft/artemis/uk/ac/sanger/artemis/components/BasePlotGroup.java,v 1.5 2004-11-24 09:38:20 tjc Exp $
*/ */
package uk.ac.sanger.artemis.components; package uk.ac.sanger.artemis.components;
...@@ -42,7 +42,7 @@ import javax.swing.*; ...@@ -42,7 +42,7 @@ import javax.swing.*;
* which can toggled off and on. * which can toggled off and on.
* *
* @author Kim Rutherford * @author Kim Rutherford
* @version $Id: BasePlotGroup.java,v 1.4 2004-11-17 13:19:43 tjc Exp $ * @version $Id: BasePlotGroup.java,v 1.5 2004-11-24 09:38:20 tjc Exp $
**/ **/
public class BasePlotGroup extends JPanel public class BasePlotGroup extends JPanel
...@@ -199,7 +199,7 @@ public class BasePlotGroup extends JPanel ...@@ -199,7 +199,7 @@ public class BasePlotGroup extends JPanel
BasePlot bp = (BasePlot)children[i]; BasePlot bp = (BasePlot)children[i];
if(!bp.isVisible()) if(!bp.isVisible())
continue; continue;
bp.paintCanvas(g); bp.paintComponent(g);
g.translate(0,bp.getHeight()); g.translate(0,bp.getHeight());
} }
} }
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* *
* $Header: //tmp/pathsoft/artemis/uk/ac/sanger/artemis/components/FeaturePlot.java,v 1.1 2004-06-09 09:46:42 tjc Exp $ * $Header: //tmp/pathsoft/artemis/uk/ac/sanger/artemis/components/FeaturePlot.java,v 1.2 2004-11-24 09:38:20 tjc Exp $
*/ */
package uk.ac.sanger.artemis.components; package uk.ac.sanger.artemis.components;
...@@ -36,7 +36,7 @@ import java.awt.event.*; ...@@ -36,7 +36,7 @@ import java.awt.event.*;
* particular feature. * particular feature.
* *
* @author Kim Rutherford * @author Kim Rutherford
* @version $Id: FeaturePlot.java,v 1.1 2004-06-09 09:46:42 tjc Exp $ * @version $Id: FeaturePlot.java,v 1.2 2004-11-24 09:38:20 tjc Exp $
**/ **/
public class FeaturePlot extends Plot public class FeaturePlot extends Plot
...@@ -104,7 +104,7 @@ public class FeaturePlot extends Plot ...@@ -104,7 +104,7 @@ public class FeaturePlot extends Plot
recalculate_flag = true; recalculate_flag = true;
repaintCanvas (); repaint();
} }
/** /**
...@@ -325,7 +325,7 @@ public class FeaturePlot extends Plot ...@@ -325,7 +325,7 @@ public class FeaturePlot extends Plot
} }
drawPoints (g, min_value, max_value, step_size, window_size, drawPoints (g, min_value, max_value, step_size, window_size,
getCanvas ().getSize ().width, getSize ().width,
0, // no offset. 0, // no offset.
value_array_array[value_index]); value_array_array[value_index]);
} }
......
This diff is collapsed.
...@@ -71,7 +71,7 @@ public class PrintACT extends ScrollPanel ...@@ -71,7 +71,7 @@ public class PrintACT extends ScrollPanel
{ {
if(c[j] instanceof BasePlot) if(c[j] instanceof BasePlot)
{ {
((BasePlot)c[j]).paintCanvas(g2d); ((BasePlot)c[j]).paintComponent(g2d);
g2d.translate(0,((BasePlot)c[j]).getHeight()); g2d.translate(0,((BasePlot)c[j]).getHeight());
} }
} }
...@@ -89,7 +89,7 @@ public class PrintACT extends ScrollPanel ...@@ -89,7 +89,7 @@ public class PrintACT extends ScrollPanel
{ {
if(c[j] instanceof BasePlot) if(c[j] instanceof BasePlot)
{ {
((BasePlot)c[j]).paintCanvas(g2d); ((BasePlot)c[j]).paintComponent(g2d);
g2d.translate(0,((BasePlot)c[j]).getHeight()); g2d.translate(0,((BasePlot)c[j]).getHeight());
} }
} }
...@@ -125,7 +125,7 @@ public class PrintACT extends ScrollPanel ...@@ -125,7 +125,7 @@ public class PrintACT extends ScrollPanel
height += ((BasePlot)c[j]).getHeight(); height += ((BasePlot)c[j]).getHeight();
if(((BasePlot)c[j]).getSize().width < width && if(((BasePlot)c[j]).getSize().width < width &&
((BasePlot)c[j]).getSize().width > 0) ((BasePlot)c[j]).getSize().width > 0)
width = ((BasePlot)c[j]).getCanvas().getSize().width; width = ((BasePlot)c[j]).getSize().width;
} }
} }
...@@ -143,7 +143,7 @@ public class PrintACT extends ScrollPanel ...@@ -143,7 +143,7 @@ public class PrintACT extends ScrollPanel
height += ((BasePlot)c[j]).getHeight(); height += ((BasePlot)c[j]).getHeight();
if(((BasePlot)c[j]).getSize().width < width && if(((BasePlot)c[j]).getSize().width < width &&
((BasePlot)c[j]).getSize().width > 0) ((BasePlot)c[j]).getSize().width > 0)
width = ((BasePlot)c[j]).getCanvas().getSize().width; width = ((BasePlot)c[j]).getSize().width;
} }
} }
...@@ -313,7 +313,7 @@ public class PrintACT extends ScrollPanel ...@@ -313,7 +313,7 @@ public class PrintACT extends ScrollPanel
height += ((BasePlot)c[j]).getHeight(); height += ((BasePlot)c[j]).getHeight();
if(((BasePlot)c[j]).getSize().width < width && if(((BasePlot)c[j]).getSize().width < width &&
((BasePlot)c[j]).getSize().width > 0) ((BasePlot)c[j]).getSize().width > 0)
width = ((BasePlot)c[j]).getCanvas().getSize().width; width = ((BasePlot)c[j]).getSize().width;
} }
} }
...@@ -331,7 +331,7 @@ public class PrintACT extends ScrollPanel ...@@ -331,7 +331,7 @@ public class PrintACT extends ScrollPanel
height += ((BasePlot)c[j]).getHeight(); height += ((BasePlot)c[j]).getHeight();
if(((BasePlot)c[j]).getSize().width < width && if(((BasePlot)c[j]).getSize().width < width &&
((BasePlot)c[j]).getSize().width > 0) ((BasePlot)c[j]).getSize().width > 0)
width = ((BasePlot)c[j]).getCanvas().getSize().width; width = ((BasePlot)c[j]).getSize().width;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment