Package java.awt

Examples of java.awt.Graphics2D.drawLine()


    Graphics2D g2 = image.createGraphics();
    g2.setColor(new Color(255,0,0,0));
    g2.fillRect(0, 0, 22, 22);
   
    g2.setColor(getForeground());
    g2.drawLine(0, 11, 22, 11);
    setIcon(new ImageIcon(image));
  }
 
}
View Full Code Here


        m_oldX = m_startX;
        m_oldY = m_startY;

        Graphics2D gx = (Graphics2D)m_beanLayout.getGraphics();
        gx.setXORMode(java.awt.Color.white);
        gx.drawLine(m_startX, m_startY, m_startX, m_startY);
        gx.dispose();
        m_mode = CONNECTING;
      }
    }
  }
View Full Code Here

                //Rectangle oldBounds = getBounds();

                g2d.setColor(gridColor);
                // vertical lines
                for (int x = 1; x < visibleDays + 1; x++) {
                    g2d.drawLine(x * dayWidth, 0, x * dayWidth, getHoursPerDay() * hourWidth);
                }

                // horizontal lines
                int xEnd = visibleDays * dayWidth;
                for (int y = 1; y < getHoursPerDay() + 1; y++) {
View Full Code Here

                }

                // horizontal lines
                int xEnd = visibleDays * dayWidth;
                for (int y = 1; y < getHoursPerDay() + 1; y++) {
                    g2d.drawLine(0, y * hourWidth, xEnd, y * hourWidth);
                }

                RoundBox selectedBox = null;
                DateTime startDate = settings.getStartDate();
                // paint events
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

  {
    if (gfx instanceof Graphics2D)
    {
      Graphics2D graphics2D = (Graphics2D) gfx;
      graphics2D.setStroke(value);
      graphics2D.drawLine(box.x, box.height / 2 + box.y, box.x + box.width, box.height / 2 + box.y);
    }
  }

  /* (non-Javadoc)
   * @see java.beans.PropertyEditor#getJavaInitializationString()
View Full Code Here

        Color origColor = g2d.getColor();
        Shape origClip = g2d.getClip();

        g2d.setStroke(sampleValue);

        g2d.drawLine(getInsets().left + 1, (getHeight() / 2) + 1, getWidth() - (getInsets().right + 1), (getHeight() / 2) + 1);

        g2d.setClip(origClip);
        g2d.setStroke(origStroke);
        g2d.setColor(origColor);
      }
View Full Code Here

      g2d.translate(x, y);

      g2d.setColor(Color.BLACK);
      g2d.setStroke(basicStroke);

      g2d.drawLine(0, getIconHeight() / 2, getIconWidth(), getIconHeight() / 2);
      g2d.setColor(origColor);

      g2d.translate(-x, -y);
      g2d.setStroke(origStroke);
      g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, hint);
View Full Code Here

    public void draw(Graphics g, Point2D[] points, boolean complete) {
        Graphics2D g2D = (Graphics2D) g;
        setGraphics(g2D);
        // we just need to draw the poly line
        for (int i = 0; i < points.length - 1; i++)
            g2D.drawLine((int) points[i].getX(),
                    (int) points[i].getY(),
                    (int) points[i + 1].getX(),
                    (int) points[i + 1].getY());
        restoreGraphics(g2D);
    }
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.