private void paintTrack(int x, int y) { int w = this.getWidth(); int h = this.getHeight(); Graphics g = this.getGraphics(); g.setColor(Color.BLUE); g.setXORMode(this.getBackground()); if (this.isHorizontal()) { g.drawLine(x,-1,x,h); } else { g.drawLine(-1,y,w,y); } g.dispose(); }
protected void paintComponent(Graphics g) { super.paintComponent(g); endTracking(); paintToRect((Graphics2D)g,0,0,getWidth(),getHeight()); }
int h = getHeight(); if (w==0 || h==0) return false;
y = max(0,min(axis.getHeight()-1,y));