1 7 package org.ejtools.graph.renderer; 8 9 import java.awt.Graphics ; 10 11 import javax.swing.JComponent ; 12 13 import org.ejtools.graph.GraphElement; 14 import org.ejtools.graph.GraphRenderer; 15 16 21 public abstract class AbstractGraphRenderer extends JComponent implements GraphRenderer 22 { 23 24 protected GraphElement element = null; 25 26 protected double horizontalScale = 1.0d; 27 28 protected int horizontalScaling = ALIGN_RIGHT; 29 30 protected double verticalScale = 1.0d; 31 32 protected int verticalScaling = BOUNDED; 33 34 35 36 public AbstractGraphRenderer() 37 { 38 super(); 39 } 40 41 42 45 public void setGraphElement(GraphElement element) 46 { 47 this.element = element; 48 } 49 50 51 54 public void setHorizontalScale(double multiplier) 55 { 56 this.horizontalScale = multiplier; 57 } 58 59 60 63 public void setHorizontalScaling(int type) 64 { 65 this.horizontalScaling = type; 66 } 67 68 69 72 public void setVerticalScale(double multiplier) 73 { 74 this.verticalScale = multiplier; 75 } 76 77 78 81 public void setVerticalScaling(int type) { } 82 83 84 87 protected abstract void paintComponent(Graphics graphics); 88 } 89 | Popular Tags |