Package java.awt

Examples of java.awt.Graphics2D.drawLine()


            Graphics2D g2D = (Graphics2D)g;
            Color oldColor = g2D.getColor();
            // Fill left and right border with a gradient
            for (int i = 0; i < 5; i++) {
              g2D.setColor(new Color(128, 128, 128, 200 - i * 45));
              g2D.drawLine(x + width - 5 + i, y + i, x + width - 5 + i, y + height - 5 + i);
              g2D.drawLine(x + i, y + height - 5 + i, x + width - 5 + i - 1, y + height - 5 + i);
            }
            g2D.setColor(oldColor);
          }
        },
View Full Code Here


            Color oldColor = g2D.getColor();
            // Fill left and right border with a gradient
            for (int i = 0; i < 5; i++) {
              g2D.setColor(new Color(128, 128, 128, 200 - i * 45));
              g2D.drawLine(x + width - 5 + i, y + i, x + width - 5 + i, y + height - 5 + i);
              g2D.drawLine(x + i, y + height - 5 + i, x + width - 5 + i - 1, y + height - 5 + i);
            }
            g2D.setColor(oldColor);
          }
        },
        BorderFactory.createLineBorder(Color.BLACK)));
View Full Code Here

        g.setColor(fill);
        g.fillRect(startPixel + 1, 0, endPixel - startPixel - 2, height);

        //Draw borders:
        g.setColor(border);
        g.drawLine(startPixel, 0, startPixel, height);
        g.drawLine(endPixel - 1, 0, endPixel - 1, height);

        return image;
    }
View Full Code Here

        g.fillRect(startPixel + 1, 0, endPixel - startPixel - 2, height);

        //Draw borders:
        g.setColor(border);
        g.drawLine(startPixel, 0, startPixel, height);
        g.drawLine(endPixel - 1, 0, endPixel - 1, height);

        return image;
    }

    public double getMax() {
View Full Code Here

                if (count[0] < 8) {
                    roiPts[count[0]++] = e.getX()/monitorWindowScale;
                    roiPts[count[0]++] = e.getY()/monitorWindowScale;
                    Graphics2D g = monitorWindow.createGraphics();
                    g.setColor(Color.RED);
                    g.drawLine(e.getX()-7, e.getY(), e.getX()+7, e.getY());
                    g.drawLine(e.getX(), e.getY()-7, e.getX(), e.getY()+7);
                    monitorWindow.releaseGraphics(g);
                }
                if (count[0] >= 8) {
                    synchronized (roiPts) {
View Full Code Here

                    roiPts[count[0]++] = e.getX()/monitorWindowScale;
                    roiPts[count[0]++] = e.getY()/monitorWindowScale;
                    Graphics2D g = monitorWindow.createGraphics();
                    g.setColor(Color.RED);
                    g.drawLine(e.getX()-7, e.getY(), e.getX()+7, e.getY());
                    g.drawLine(e.getX(), e.getY()-7, e.getX(), e.getY()+7);
                    monitorWindow.releaseGraphics(g);
                }
                if (count[0] >= 8) {
                    synchronized (roiPts) {
                        monitorWindow.getCanvas().removeMouseListener(this);
View Full Code Here

        }
        if (getModel().isRollover()) {
          g2.setColor(Color.MAGENTA);
        }
        int delta = 6;
        g2.drawLine(delta, delta, getWidth() - delta - 1, getHeight() - delta - 1);
        g2.drawLine(getWidth() - delta - 1, delta, delta, getHeight() - delta - 1);
        g2.dispose();
      }
    }
  }
View Full Code Here

        if (getModel().isRollover()) {
          g2.setColor(Color.MAGENTA);
        }
        int delta = 6;
        g2.drawLine(delta, delta, getWidth() - delta - 1, getHeight() - delta - 1);
        g2.drawLine(getWidth() - delta - 1, delta, delta, getHeight() - delta - 1);
        g2.dispose();
      }
    }
  }
View Full Code Here

            // draw the spline
            Point prev = null;
            for (Point next : spline.intervals) {
                if (prev != null)
                    g.drawLine(prev.x, prev.y, next.x, next.y);
                prev = next;
            }

            int i = 0;
            for (Point p : spline.points) {
View Full Code Here

            double tickSpace = (double) availableHeight / 10d;
            double x = w - rightIndent - tickLength;
            for (int tick = 0;
                    tick <=
                    10; tick++) {
                g2.drawLine((int) x, y, (int) (x + tickLength), y);
                y -= tickSpace;
            }
        }

        y = h;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.