diff --git a/src/org/hwo/ui/JDiagram.java b/src/org/hwo/ui/JDiagram.java index bfbfb5a..2d68776 100644 --- a/src/org/hwo/ui/JDiagram.java +++ b/src/org/hwo/ui/JDiagram.java @@ -486,8 +486,14 @@ public class JDiagram extends JComponent implements PlotProviderListener, Bounde Point2D pmin = mapDiagramToMouse(new Point2D.Double(0, bg.getMin())); Point2D pmax = mapDiagramToMouse(new Point2D.Double(0, bg.getMax())); + int x,y,width,height; + width = this.plotWidth; + height = (int)(pmin.getY() - pmax.getY()); + x = getWidth() - this.plotWidth - this.bRight; + y = (int)(pmax.getY()); + g.setColor(bg.getColor()); - g.fillRect(0, (int)pmax.getY(), getWidth(), (int)(pmax.getY() - pmin.getX())); + g.fillRect(0,y,getWidth(),height); } paintOrdinates ((Graphics2D) g); @@ -852,7 +858,7 @@ public class JDiagram extends JComponent implements PlotProviderListener, Bounde this.num = num; this.colDraw = Color.BLACK; - this.colGrid = Color.LIGHT_GRAY; + this.colGrid = Color.GRAY; this.scaler = new LinearScaler(); } @@ -942,4 +948,8 @@ public class JDiagram extends JComponent implements PlotProviderListener, Bounde public List getColoredBackgrounds() { return coloredBackgrounds; } + public void setColoredBackgrounds(List backgrounds){ + this.coloredBackgrounds.clear(); + this.coloredBackgrounds.addAll(backgrounds); + } }